Radix cross Linux

The main Radix cross Linux repository contains the build scripts of packages, which have the most complete and common functionality for desktop machines

383 Commits   1 Branch   1 Tag
Index: Makefile
===================================================================
--- Makefile	(nonexistent)
+++ Makefile	(revision 5)
@@ -0,0 +1,13 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+SOURCE_REQUIRES += ALL_DIRS
+
+
+include ../../build-system/core.mk
+
+
+download_clean:
+	@true
+
+.PHONY: download_clean
Index: app/Makefile
===================================================================
--- app/Makefile	(nonexistent)
+++ app/Makefile	(revision 5)
@@ -0,0 +1,13 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+SOURCE_REQUIRES += ALL_DIRS
+
+
+include ../../../build-system/core.mk
+
+
+download_clean:
+	@true
+
+.PHONY: download_clean
Index: app/appres/Makefile
===================================================================
--- app/appres/Makefile	(nonexistent)
+++ app/appres/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/appres
+
+versions    = 1.0.6
+pkgname     = appres
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/appres
===================================================================
--- app/appres	(nonexistent)
+++ app/appres	(revision 5)

Property changes on: app/appres
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/beforelight/Makefile
===================================================================
--- app/beforelight/Makefile	(nonexistent)
+++ app/beforelight/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/beforelight
+
+versions    = 1.0.5
+pkgname     = beforelight
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/beforelight
===================================================================
--- app/beforelight	(nonexistent)
+++ app/beforelight	(revision 5)

Property changes on: app/beforelight
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/bitmap/Makefile
===================================================================
--- app/bitmap/Makefile	(nonexistent)
+++ app/bitmap/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/bitmap
+
+versions    = 1.1.0
+pkgname     = bitmap
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/bitmap
===================================================================
--- app/bitmap	(nonexistent)
+++ app/bitmap	(revision 5)

Property changes on: app/bitmap
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/constype/Makefile
===================================================================
--- app/constype/Makefile	(nonexistent)
+++ app/constype/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/constype
+
+versions    = 1.0.4
+pkgname     = constype
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/constype
===================================================================
--- app/constype	(nonexistent)
+++ app/constype	(revision 5)

Property changes on: app/constype
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/editres/Makefile
===================================================================
--- app/editres/Makefile	(nonexistent)
+++ app/editres/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/editres
+
+versions    = 1.0.8
+pkgname     = editres
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/editres
===================================================================
--- app/editres	(nonexistent)
+++ app/editres	(revision 5)

Property changes on: app/editres
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/fonttosfnt/Makefile
===================================================================
--- app/fonttosfnt/Makefile	(nonexistent)
+++ app/fonttosfnt/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/fonttosfnt
+
+versions    = 1.2.2
+pkgname     = fonttosfnt
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/fonttosfnt
===================================================================
--- app/fonttosfnt	(nonexistent)
+++ app/fonttosfnt	(revision 5)

Property changes on: app/fonttosfnt
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/fslsfonts/Makefile
===================================================================
--- app/fslsfonts/Makefile	(nonexistent)
+++ app/fslsfonts/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/fslsfonts
+
+versions    = 1.0.6
+pkgname     = fslsfonts
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/fslsfonts
===================================================================
--- app/fslsfonts	(nonexistent)
+++ app/fslsfonts	(revision 5)

Property changes on: app/fslsfonts
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/fstobdf/Makefile
===================================================================
--- app/fstobdf/Makefile	(nonexistent)
+++ app/fstobdf/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/fstobdf
+
+versions    = 1.0.7
+pkgname     = fstobdf
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/fstobdf
===================================================================
--- app/fstobdf	(nonexistent)
+++ app/fstobdf	(revision 5)

Property changes on: app/fstobdf
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/iceauth/Makefile
===================================================================
--- app/iceauth/Makefile	(nonexistent)
+++ app/iceauth/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/iceauth
+
+versions    = 1.0.9
+pkgname     = iceauth
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/iceauth
===================================================================
--- app/iceauth	(nonexistent)
+++ app/iceauth	(revision 5)

Property changes on: app/iceauth
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/ico/Makefile
===================================================================
--- app/ico/Makefile	(nonexistent)
+++ app/ico/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/ico
+
+versions    = 1.0.6
+pkgname     = ico
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/ico
===================================================================
--- app/ico	(nonexistent)
+++ app/ico	(revision 5)

Property changes on: app/ico
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/intel-gpu-tools/Makefile
===================================================================
--- app/intel-gpu-tools/Makefile	(nonexistent)
+++ app/intel-gpu-tools/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/intel-gpu-tools
+
+versions    = 1.22
+pkgname     = intel-gpu-tools
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/intel-gpu-tools
===================================================================
--- app/intel-gpu-tools	(nonexistent)
+++ app/intel-gpu-tools	(revision 5)

Property changes on: app/intel-gpu-tools
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/lbxproxy/Makefile
===================================================================
--- app/lbxproxy/Makefile	(nonexistent)
+++ app/lbxproxy/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/lbxproxy
+
+versions    = 1.0.3
+pkgname     = lbxproxy
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/lbxproxy
===================================================================
--- app/lbxproxy	(nonexistent)
+++ app/lbxproxy	(revision 5)

Property changes on: app/lbxproxy
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/listres/Makefile
===================================================================
--- app/listres/Makefile	(nonexistent)
+++ app/listres/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/listres
+
+versions    = 1.0.5
+pkgname     = listres
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/listres
===================================================================
--- app/listres	(nonexistent)
+++ app/listres	(revision 5)

Property changes on: app/listres
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/luit/Makefile
===================================================================
--- app/luit/Makefile	(nonexistent)
+++ app/luit/Makefile	(revision 5)
@@ -0,0 +1,56 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/luit
+
+versions    = 1.1.1
+pkgname     = luit
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+patches     = $(CURDIR)/patches/luit-1.1.1-make.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-1.1.1-make-patch ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s) $(patches)
Index: app/luit/create-1.1.1-make-patch/create.patch.sh
===================================================================
--- app/luit/create-1.1.1-make-patch/create.patch.sh	(nonexistent)
+++ app/luit/create-1.1.1-make-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=1.1.1
+
+tar --files-from=file.list -xjvf ../luit-$VERSION.tar.bz2
+mv luit-$VERSION luit-$VERSION-orig
+
+cp -rf ./luit-$VERSION-new ./luit-$VERSION
+
+diff --unified -Nr  luit-$VERSION-orig  luit-$VERSION > luit-$VERSION-make.patch
+
+mv luit-$VERSION-make.patch ../patches
+
+rm -rf ./luit-$VERSION
+rm -rf ./luit-$VERSION-orig

Property changes on: app/luit/create-1.1.1-make-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: app/luit/create-1.1.1-make-patch/file.list
===================================================================
--- app/luit/create-1.1.1-make-patch/file.list	(nonexistent)
+++ app/luit/create-1.1.1-make-patch/file.list	(revision 5)
@@ -0,0 +1,4 @@
+luit-1.1.1/Makefile.am
+luit-1.1.1/configure.ac
+luit-1.1.1/luit.c
+luit-1.1.1/other.h
Index: app/luit/create-1.1.1-make-patch/luit-1.1.1-new/Makefile.am
===================================================================
--- app/luit/create-1.1.1-make-patch/luit-1.1.1-new/Makefile.am	(nonexistent)
+++ app/luit/create-1.1.1-make-patch/luit-1.1.1-new/Makefile.am	(revision 5)
@@ -0,0 +1,57 @@
+# 
+#  Copyright 2005  Red Hat, Inc.
+# 
+#  Permission to use, copy, modify, distribute, and sell this software and its
+#  documentation for any purpose is hereby granted without fee, provided that
+#  the above copyright notice appear in all copies and that both that
+#  copyright notice and this permission notice appear in supporting
+#  documentation, and that the name of Red Hat not be used in
+#  advertising or publicity pertaining to distribution of the software without
+#  specific, written prior permission.  Red Hat makes no
+#  representations about the suitability of this software for any purpose.  It
+#  is provided "as is" without express or implied warranty.
+# 
+#  RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+#  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+#  EVENT SHALL RED HAT 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.
+
+SUBDIRS=man
+bin_PROGRAMS = luit
+
+AM_CFLAGS =		\
+	$(CWARNFLAGS)	\
+	$(LUIT_CFLAGS)	\
+	-DLOCALE_ALIAS_FILE=\"$(LOCALEALIASFILE)\"
+
+luit_LDADD = $(LUIT_LIBS)
+
+luit_SOURCES =		\
+        charset.c	\
+        charset.h	\
+        iso2022.c	\
+        iso2022.h	\
+        locale.c	\
+        luit.c		\
+        luit.h		\
+        other.c		\
+        other.h		\
+        parser.c	\
+        parser.h	\
+        sys.c		\
+        sys.h
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+	$(INSTALL_CMD)
+
+ChangeLog:
+	$(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
Index: app/luit/create-1.1.1-make-patch/luit-1.1.1-new/configure.ac
===================================================================
--- app/luit/create-1.1.1-make-patch/luit-1.1.1-new/configure.ac	(nonexistent)
+++ app/luit/create-1.1.1-make-patch/luit-1.1.1-new/configure.ac	(revision 5)
@@ -0,0 +1,88 @@
+dnl  Copyright 2005 Red Hat, Inc.
+dnl 
+dnl  Permission to use, copy, modify, distribute, and sell this software and its
+dnl  documentation for any purpose is hereby granted without fee, provided that
+dnl  the above copyright notice appear in all copies and that both that
+dnl  copyright notice and this permission notice appear in supporting
+dnl  documentation, and that the name of Red Hat not be used in
+dnl  advertising or publicity pertaining to distribution of the software without
+dnl  specific, written prior permission.  Red Hat makes no
+dnl  representations about the suitability of this software for any purpose.  It
+dnl  is provided "as is" without express or implied warranty.
+dnl 
+dnl  RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+dnl  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+dnl  EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+dnl  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+dnl  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+dnl  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+dnl  PERFORMANCE OF THIS SOFTWARE.
+dnl
+dnl Process this file with autoconf to create configure.
+
+# Initialize Autoconf
+AC_PREREQ([2.60])
+AC_INIT([luit], [1.1.1],
+	[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [luit])
+AC_CONFIG_SRCDIR([Makefile.am])
+AC_CONFIG_HEADERS([config.h])
+AC_USE_SYSTEM_EXTENSIONS
+
+# Initialize Automake
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+          [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.8)
+XORG_DEFAULT_OPTIONS
+
+AC_ARG_WITH(localealiasfile,
+        AS_HELP_STRING([--with-localealiasfile=<path>],
+                       [The locale alias file (default: ${datadir}/X11/locale/locale.alias)]),
+        [LOCALEALIASFILE="$withval"],
+        [LOCALEALIASFILE=${datadir}/X11/locale/locale.alias])
+AC_SUBST([LOCALEALIASFILE])
+
+# Checks for pkg-config packages
+PKG_CHECK_MODULES(LUIT, fontenc)
+
+# We don't link against libX11, just use its locale.alias data file
+PKG_CHECK_EXISTS(x11, [],
+	[AC_MSG_WARN([libX11 not found.  luit may not be able to find locale aliases without it.])])
+
+AC_CANONICAL_HOST
+case $host_os in
+    # darwin has poll() but can't be used to poll character devices (atleast through SnowLeopard)
+    darwin*)
+        ;;
+    *)
+        AC_CHECK_HEADERS([poll.h])
+        AC_CHECK_FUNCS([poll])
+        ;;
+esac
+
+AC_CHECK_HEADERS([pty.h stropts.h sys/ioctl.h sys/param.h sys/poll.h sys/select.h sys/time.h termios.h]) 
+AC_CHECK_FUNCS([grantpt posix_openpt putenv select strdup])
+
+if test "x$ac_cv_func_grantpt" != "xyes" ; then
+        AC_CHECK_LIB(util, openpty, [cf_have_openpty=yes],[cf_have_openpty=no])
+        if test "$cf_have_openpty" = yes ; then
+                LIBS="-lutil $LIBS"
+                AC_DEFINE(HAVE_OPENPTY, 1, [Have openpty in libutil])
+                AC_CHECK_HEADERS( \
+                        util.h \
+                        libutil.h \
+                        pty.h \
+                )
+        fi
+fi
+
+CF_FUNC_POLL
+CF_SIGWINCH
+
+AC_CONFIG_FILES([Makefile
+                 man/Makefile])
+
+AC_OUTPUT
Index: app/luit/create-1.1.1-make-patch/luit-1.1.1-new/luit.c
===================================================================
--- app/luit/create-1.1.1-make-patch/luit-1.1.1-new/luit.c	(nonexistent)
+++ app/luit/create-1.1.1-make-patch/luit-1.1.1-new/luit.c	(revision 5)
@@ -0,0 +1,717 @@
+/*
+Copyright (c) 2001 by Juliusz Chroboczek
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <locale.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <assert.h>
+#include <stdarg.h>
+#include <sys/ioctl.h>
+#include <signal.h>
+
+#include "luit.h"
+#include "sys.h"
+#include "other.h"
+#include "parser.h"
+#include "iso2022.h"
+
+static int pipe_option = 0;
+static int p2c_waitpipe[2];
+static int c2p_waitpipe[2];
+
+static Iso2022Ptr inputState = NULL, outputState = NULL;
+
+static char *child_argv0 = NULL;
+static const char *locale_name = NULL;
+static int exitOnChild = 0;
+static int converter = 0;
+
+const char *locale_alias = LOCALE_ALIAS_FILE;
+
+int ilog = -1;
+int olog = -1;
+int verbose = 0;
+
+static volatile int sigwinch_queued = 0;
+static volatile int sigchld_queued = 0;
+
+static int convert(int, int);
+static int condom(int, char **);
+
+void
+ErrorF(const char *f,...)
+{
+    va_list args;
+    va_start(args, f);
+    vfprintf(stderr, f, args);
+    va_end(args);
+}
+
+void
+FatalError(const char *f,...)
+{
+    va_list args;
+    va_start(args, f);
+    vfprintf(stderr, f, args);
+    va_end(args);
+    ExitProgram(1);
+}
+
+static void
+help(void)
+{
+    fprintf(stderr,
+	    "luit\n"
+	    "  [ -V ] [ -h ] [ -list ] [ -v ] [ -argv0 name ]\n"
+	    "  [ -gl gn ] [-gr gk] "
+	    "[ -g0 set ] [ -g1 set ] "
+	    "[ -g2 set ] [ -g3 set ]\n"
+	    "  [ -encoding encoding ] "
+	    "[ +oss ] [ +ols ] [ +osl ] [ +ot ]\n"
+	    "  [ -kgl gn ] [-kgr gk] "
+	    "[ -kg0 set ] [ -kg1 set ] "
+	    "[ -kg2 set ] [ -kg3 set ]\n"
+	    "  [ -k7 ] [ +kss ] [ +kssgr ] [ -kls ]\n"
+	    "  [ -c ] "
+	    "[ -p ] "
+	    "[ -x ] "
+	    "[ -ilog filename ] "
+	    "[ -olog filename ] "
+	    "[ -alias filename ] "
+	    "[ -- ]\n"
+	    "  [ program [ args ] ]\n");
+}
+
+static int
+parseOptions(int argc, char **argv)
+{
+    int i = 1;
+    while (i < argc) {
+	if (argv[i][0] != '-' && argv[i][0] != '+') {
+	    break;
+	} else if (!strcmp(argv[i], "--")) {
+	    i++;
+	    break;
+	} else if (!strcmp(argv[i], "-v")) {
+	    verbose++;
+	    i++;
+	} else if (!strcmp(argv[i], "-V")) {
+	    printf("%s - %s\n", argv[0], VERSION);
+	    ExitProgram(0);
+	} else if (!strcmp(argv[i], "-h")) {
+	    help();
+	    ExitProgram(0);
+	} else if (!strcmp(argv[i], "-list")) {
+	    reportCharsets();
+	    ExitProgram(0);
+	} else if (!strcmp(argv[i], "+oss")) {
+	    outputState->outputFlags &= ~OF_SS;
+	    i++;
+	} else if (!strcmp(argv[i], "+ols")) {
+	    outputState->outputFlags &= ~OF_LS;
+	    i++;
+	} else if (!strcmp(argv[i], "+osl")) {
+	    outputState->outputFlags &= ~OF_SELECT;
+	    i++;
+	} else if (!strcmp(argv[i], "+ot")) {
+	    outputState->outputFlags = OF_PASSTHRU;
+	    i++;
+	} else if (!strcmp(argv[i], "-k7")) {
+	    inputState->inputFlags &= ~IF_EIGHTBIT;
+	    i++;
+	} else if (!strcmp(argv[i], "+kss")) {
+	    inputState->inputFlags &= ~IF_SS;
+	    i++;
+	} else if (!strcmp(argv[1], "+kssgr")) {
+	    inputState->inputFlags &= ~IF_SSGR;
+	    i++;
+	} else if (!strcmp(argv[i], "-kls")) {
+	    inputState->inputFlags |= IF_LS;
+	    i++;
+	} else if (!strcmp(argv[i], "-g0")) {
+	    if (i + 1 >= argc)
+		FatalError("-g0 requires an argument\n");
+	    G0(outputState) = getCharsetByName(argv[i + 1]);
+	    i += 2;
+	} else if (!strcmp(argv[i], "-g1")) {
+	    if (i + 1 >= argc)
+		FatalError("-g1 requires an argument\n");
+	    G1(outputState) = getCharsetByName(argv[i + 1]);
+	    i += 2;
+	} else if (!strcmp(argv[i], "-g2")) {
+	    if (i + 1 >= argc)
+		FatalError("-g2 requires an argument\n");
+	    G2(outputState) = getCharsetByName(argv[i + 1]);
+	    i += 2;
+	} else if (!strcmp(argv[i], "-g3")) {
+	    if (i + 1 >= argc)
+		FatalError("-g3 requires an argument\n");
+	    G3(outputState) = getCharsetByName(argv[i + 1]);
+
+	    i += 2;
+	} else if (!strcmp(argv[i], "-gl")) {
+	    int j;
+	    if (i + 1 >= argc)
+		FatalError("-gl requires an argument\n");
+	    if (strlen(argv[i + 1]) != 2 ||
+		argv[i + 1][0] != 'g')
+		j = -1;
+	    else
+		j = argv[i + 1][1] - '0';
+	    if (j < 0 || j > 3)
+		FatalError("The argument of -gl "
+			   "should be one of g0 through g3,\n"
+			   "not %s\n", argv[i + 1]);
+	    else
+		outputState->glp = &outputState->g[j];
+	    i += 2;
+	} else if (!strcmp(argv[i], "-gr")) {
+	    int j;
+	    if (i + 1 >= argc)
+		FatalError("-gr requires an argument\n");
+	    if (strlen(argv[i + 1]) != 2 ||
+		argv[i + 1][0] != 'g')
+		j = -1;
+	    else
+		j = argv[i + 1][1] - '0';
+	    if (j < 0 || j > 3)
+		FatalError("The argument of -gl "
+			   "should be one of g0 through g3,\n"
+			   "not %s\n", argv[i + 1]);
+	    else
+		outputState->grp = &outputState->g[j];
+	    i += 2;
+	} else if (!strcmp(argv[i], "-kg0")) {
+	    if (i + 1 >= argc)
+		FatalError("-kg0 requires an argument\n");
+	    G0(inputState) = getCharsetByName(argv[i + 1]);
+	    i += 2;
+	} else if (!strcmp(argv[i], "-kg1")) {
+	    if (i + 1 >= argc)
+		FatalError("-kg1 requires an argument\n");
+	    G1(inputState) = getCharsetByName(argv[i + 1]);
+	    i += 2;
+	} else if (!strcmp(argv[i], "-kg2")) {
+	    if (i + 1 >= argc)
+		FatalError("-kg2 requires an argument\n");
+	    G2(inputState) = getCharsetByName(argv[i + 1]);
+	    i += 2;
+	} else if (!strcmp(argv[i], "-kg3")) {
+	    if (i + 1 >= argc)
+		FatalError("-kg3 requires an argument\n");
+	    G3(inputState) = getCharsetByName(argv[i + 1]);
+
+	    i += 2;
+	} else if (!strcmp(argv[i], "-kgl")) {
+	    int j;
+	    if (i + 1 >= argc)
+		FatalError("-kgl requires an argument\n");
+	    if (strlen(argv[i + 1]) != 2 ||
+		argv[i + 1][0] != 'g')
+		j = -1;
+	    else
+		j = argv[i + 1][1] - '0';
+	    if (j < 0 || j > 3)
+		FatalError("The argument of -kgl "
+			   "should be one of g0 through g3,\n"
+			   "not %s\n", argv[i + 1]);
+	    else
+		inputState->glp = &inputState->g[j];
+	    i += 2;
+	} else if (!strcmp(argv[i], "-kgr")) {
+	    int j;
+	    if (i + 1 >= argc)
+		FatalError("-kgl requires an argument\n");
+	    if (strlen(argv[i + 1]) != 2 ||
+		argv[i + 1][0] != 'g')
+		j = -1;
+	    else
+		j = argv[i + 1][1] - '0';
+	    if (j < 0 || j > 3)
+		FatalError("The argument of -kgl "
+			   "should be one of g0 through g3,\n"
+			   "not %s\n", argv[i + 1]);
+	    else
+		inputState->grp = &inputState->g[j];
+	    i += 2;
+	} else if (!strcmp(argv[i], "-argv0")) {
+	    if (i + 1 >= argc)
+		FatalError("-argv0 requires an argument\n");
+	    child_argv0 = argv[i + 1];
+	    i += 2;
+	} else if (!strcmp(argv[i], "-x")) {
+	    exitOnChild = 1;
+	    i++;
+	} else if (!strcmp(argv[i], "-c")) {
+	    converter = 1;
+	    i++;
+	} else if (!strcmp(argv[i], "-ilog")) {
+	    if (i + 1 >= argc)
+		FatalError("-ilog requires an argument\n");
+	    ilog = open(argv[i + 1], O_WRONLY | O_CREAT | O_TRUNC, 0777);
+	    if (ilog < 0) {
+		perror("Couldn't open input log");
+		ExitProgram(1);
+	    }
+	    i += 2;
+	} else if (!strcmp(argv[i], "-olog")) {
+	    if (i + 1 >= argc)
+		FatalError("-olog requires an argument\n");
+	    olog = open(argv[i + 1], O_WRONLY | O_CREAT | O_TRUNC, 0777);
+	    if (olog < 0) {
+		perror("Couldn't open output log");
+		ExitProgram(1);
+	    }
+	    i += 2;
+	} else if (!strcmp(argv[i], "-alias")) {
+	    if (i + 1 >= argc)
+		FatalError("-alias requires an argument\n");
+	    locale_alias = argv[i + 1];
+	    i += 2;
+	} else if (!strcmp(argv[i], "-encoding")) {
+	    if (i + 1 >= argc)
+		FatalError("-encoding requires an argument\n");
+	    locale_name = argv[i + 1];
+	    i += 2;
+	} else if (!strcmp(argv[i], "-p")) {
+	    pipe_option = 1;
+	    i += 1;
+	} else {
+	    FatalError("Unknown option %s\n", argv[i]);
+	}
+    }
+    return i;
+}
+
+static int
+parseArgs(int argc, char **argv,
+	  char *argv0,
+	  char **path_return,
+	  char ***argv_return)
+{
+    char *path = NULL;
+    char **child_argv = NULL;
+
+    if (argc <= 0) {
+	char *shell;
+	shell = getenv("SHELL");
+	if (shell) {
+	    path = strmalloc(shell);
+	    if (!path)
+		goto bail;
+	} else {
+	    path = strmalloc("/bin/sh");
+	    if (!path)
+		goto bail;
+	}
+	child_argv = malloc(2 * sizeof(char *));
+	if (!child_argv)
+	    goto bail;
+	if (argv0)
+	    child_argv[0] = argv0;
+	else
+	    child_argv[0] = my_basename(path);
+	child_argv[1] = NULL;
+    } else {
+	path = strmalloc(argv[0]);
+	if (!path)
+	    goto bail;
+	child_argv = malloc((unsigned) (argc + 1) * sizeof(char *));
+	if (!child_argv) {
+	    goto bail;
+	}
+	if (child_argv0)
+	    child_argv[0] = argv0;
+	else
+	    child_argv[0] = my_basename(argv[0]);
+	memcpy(child_argv + 1, argv + 1, (unsigned) (argc - 1) * sizeof(char *));
+	child_argv[argc] = NULL;
+    }
+
+    *path_return = path;
+    *argv_return = child_argv;
+    return 0;
+
+  bail:
+    if (path)
+	free(path);
+    if (argv)
+	free(argv);
+    return -1;
+}
+
+int
+main(int argc, char **argv)
+{
+    int rc;
+    int i;
+    char *l;
+
+#ifdef HAVE_PUTENV
+    if ((l = strmalloc("NCURSES_NO_UTF8_ACS=1")) != 0)
+	putenv(l);
+#endif
+
+    l = setlocale(LC_ALL, "");
+    if (!l)
+	ErrorF("Warning: couldn't set locale.\n");
+
+    inputState = allocIso2022();
+    if (!inputState)
+	FatalError("Couldn't create input state\n");
+
+    outputState = allocIso2022();
+    if (!outputState)
+	FatalError("Couldn't create output state\n");
+
+    if (l) {
+	locale_name = setlocale(LC_CTYPE, NULL);
+    } else {
+	locale_name = getenv("LC_ALL");
+	if (locale_name == NULL) {
+	    locale_name = getenv("LC_CTYPE");
+	    if (locale_name == NULL) {
+		locale_name = getenv("LANG");
+	    }
+	}
+    }
+
+    if (locale_name == NULL) {
+	ErrorF("Couldn't get locale name -- using C\n");
+	locale_name = "C";
+    }
+
+    i = parseOptions(argc, argv);
+    if (i < 0)
+	FatalError("Couldn't parse options\n");
+
+    rc = initIso2022(locale_name, NULL, outputState);
+    if (rc < 0)
+	FatalError("Couldn't init output state\n");
+
+    rc = mergeIso2022(inputState, outputState);
+    if (rc < 0)
+	FatalError("Couldn't init input state\n");
+
+    if (converter)
+	rc = convert(0, 1);
+    else
+	rc = condom(argc - i, argv + i);
+
+#ifdef NO_LEAKS
+    ExitProgram(rc);
+#endif
+    return rc;
+}
+
+static int
+convert(int ifd, int ofd)
+{
+    int rc, i;
+    unsigned char buf[BUFFER_SIZE];
+
+    rc = droppriv();
+    if (rc < 0) {
+	perror("Couldn't drop privileges");
+	ExitProgram(1);
+    }
+
+    while (1) {
+	i = (int) read(ifd, buf, (size_t) BUFFER_SIZE);
+	if (i <= 0) {
+	    if (i < 0) {
+		perror("Read error");
+		ExitProgram(1);
+	    }
+	    break;
+	}
+	copyOut(outputState, ofd, buf, (unsigned) i);
+    }
+    return 0;
+}
+
+#ifdef SIGWINCH
+static void
+sigwinchHandler(int sig GCC_UNUSED)
+{
+    sigwinch_queued = 1;
+}
+#endif
+
+static void
+sigchldHandler(int sig GCC_UNUSED)
+{
+    sigchld_queued = 1;
+}
+
+static int
+setup_io(int pty)
+{
+    int rc;
+    int val;
+
+#ifdef SIGWINCH
+    installHandler(SIGWINCH, sigwinchHandler);
+#endif
+    installHandler(SIGCHLD, sigchldHandler);
+
+    rc = copyTermios(0, pty);
+    if (rc < 0)
+	FatalError("Couldn't copy terminal settings\n");
+
+    rc = setRawTermios();
+    if (rc < 0)
+	FatalError("Couldn't set terminal to raw\n");
+
+    val = fcntl(0, F_GETFL, 0);
+    if (val >= 0) {
+	fcntl(0, F_SETFL, val | O_NONBLOCK);
+    }
+    val = fcntl(pty, F_GETFL, 0);
+    if (val >= 0) {
+	fcntl(pty, F_SETFL, val | O_NONBLOCK);
+    }
+
+    setWindowSize(0, pty);
+
+    return rc;
+}
+
+static void
+cleanup_io(int pty)
+{
+    int val;
+
+#ifdef SIGWINCH
+    installHandler(SIGWINCH, SIG_DFL);
+#endif
+    installHandler(SIGCHLD, SIG_DFL);
+
+    val = fcntl(0, F_GETFL, 0);
+    if (val >= 0) {
+	fcntl(0, F_SETFL, val & ~O_NONBLOCK);
+    }
+    val = fcntl(pty, F_GETFL, 0);
+    if (val >= 0) {
+	fcntl(pty, F_SETFL, val & ~O_NONBLOCK);
+    }
+}
+
+static void
+close_waitpipe(int which)
+{
+    close(p2c_waitpipe[which]);
+    close(c2p_waitpipe[!which]);
+}
+
+static void
+write_waitpipe(int fds[2])
+{
+    IGNORE_RC(write(fds[1], "1", (size_t) 1));
+}
+
+static void
+read_waitpipe(int fds[2])
+{
+    char tmp[10];
+    IGNORE_RC(read(fds[0], tmp, (size_t) 1));
+}
+
+static int
+condom(int argc, char **argv)
+{
+    int pty;
+    int pid;
+    char *line;
+    char *path = 0;
+    char **child_argv = 0;
+    int rc;
+
+    rc = parseArgs(argc, argv, child_argv0,
+		   &path, &child_argv);
+    if (rc < 0)
+	FatalError("Couldn't parse arguments\n");
+
+    rc = allocatePty(&pty, &line);
+    if (rc < 0) {
+	perror("Couldn't allocate pty");
+	ExitProgram(1);
+    }
+
+    rc = droppriv();
+    if (rc < 0) {
+	perror("Couldn't drop privileges");
+	ExitProgram(1);
+    }
+
+    if (pipe_option) {
+	IGNORE_RC(pipe(p2c_waitpipe));
+	IGNORE_RC(pipe(c2p_waitpipe));
+    }
+
+    setup_io(pty);
+
+    pid = fork();
+    if (pid < 0) {
+	perror("Couldn't fork");
+	ExitProgram(1);
+    }
+
+    if (pid == 0) {
+#ifdef SIGWINCH
+	installHandler(SIGWINCH, SIG_DFL);
+#endif
+	installHandler(SIGCHLD, SIG_DFL);
+	close(pty);
+	if (pipe_option) {
+	    close_waitpipe(1);
+	}
+	child(line, path, child_argv);
+    } else {
+	if (pipe_option) {
+	    close_waitpipe(0);
+	}
+	free(child_argv);
+	free(path);
+	free(line);
+	parent(pid, pty);
+    }
+
+    return 0;
+}
+
+void
+child(char *line, char *path, char *const argv[])
+{
+    int tty;
+    int pgrp;
+
+    close(0);
+    close(1);
+    close(2);
+
+    pgrp = setsid();
+    if (pgrp < 0) {
+	kill(getppid(), SIGABRT);
+	ExitProgram(1);
+    }
+
+    tty = openTty(line);
+    if (tty < 0) {
+	kill(getppid(), SIGABRT);
+	ExitProgram(1);
+    }
+    if (pipe_option) {
+	write_waitpipe(c2p_waitpipe);
+    }
+
+    if (tty != 0)
+	dup2(tty, 0);
+    if (tty != 1)
+	dup2(tty, 1);
+    if (tty != 2)
+	dup2(tty, 2);
+
+    if (tty > 2)
+	close(tty);
+
+    if (pipe_option) {
+	read_waitpipe(p2c_waitpipe);
+	close_waitpipe(0);
+    }
+
+    execvp(path, argv);
+    perror("Couldn't exec");
+    ExitProgram(1);
+}
+
+void
+parent(int pid GCC_UNUSED, int pty)
+{
+    unsigned char buf[BUFFER_SIZE];
+    int i;
+    int rc;
+
+    if (pipe_option) {
+	read_waitpipe(c2p_waitpipe);
+    }
+
+    if (verbose) {
+	reportIso2022(outputState);
+    }
+    setup_io(pty);
+
+    if (pipe_option) {
+	write_waitpipe(p2c_waitpipe);
+	close_waitpipe(1);
+    }
+
+    for (;;) {
+	rc = waitForInput(0, pty);
+
+	if (sigwinch_queued) {
+	    sigwinch_queued = 0;
+	    setWindowSize(0, pty);
+	}
+
+	if (sigchld_queued && exitOnChild)
+	    break;
+
+	if (rc > 0) {
+	    if (rc & 2) {
+		i = (int) read(pty, buf, (size_t) BUFFER_SIZE);
+		if ((i == 0) || ((i < 0) && (errno != EAGAIN)))
+		    break;
+		if (i > 0)
+		    copyOut(outputState, 0, buf, (unsigned) i);
+	    }
+	    if (rc & 1) {
+		i = (int) read(0, buf, (size_t) BUFFER_SIZE);
+		if ((i == 0) || ((i < 0) && (errno != EAGAIN)))
+		    break;
+		if (i > 0)
+		    copyIn(inputState, pty, buf, i);
+	    }
+	}
+    }
+
+    restoreTermios();
+    cleanup_io(pty);
+}
+
+#ifdef NO_LEAKS
+void
+luit_leaks(void)
+{
+    destroyIso2022(inputState);
+    destroyIso2022(outputState);
+}
+#endif
Index: app/luit/create-1.1.1-make-patch/luit-1.1.1-new/other.h
===================================================================
--- app/luit/create-1.1.1-make-patch/luit-1.1.1-new/other.h	(nonexistent)
+++ app/luit/create-1.1.1-make-patch/luit-1.1.1-new/other.h	(revision 5)
@@ -0,0 +1,110 @@
+/*
+Copyright (c) 2002 by Tomohiro KUBOTA
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
+#ifndef LUIT_OTHER_H
+#define LUIT_OTHER_H 1
+
+#include "config.h"		/* include this, for self-contained headers */
+
+#ifndef GCC_UNUSED
+# if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)
+#  define GCC_UNUSED __attribute__((__unused__))
+# else
+#  define GCC_UNUSED /* ARGSUSED */
+# endif
+#endif
+
+#include <X11/fonts/fontenc.h>
+
+#define UChar(n) ((unsigned char)(n))
+
+typedef struct {
+    FontMapPtr mapping;
+    FontMapReversePtr reverse;
+    int buf;
+} aux_gbk;
+
+typedef struct {
+    unsigned char buf[4];
+    int buf_ptr, len;
+} aux_utf8;
+
+typedef struct {
+    FontMapPtr x0208mapping;
+    FontMapPtr x0201mapping;
+    FontMapReversePtr x0208reverse;
+    FontMapReversePtr x0201reverse;
+    int buf;
+} aux_sjis;
+
+typedef struct {
+    FontMapPtr mapping;
+    FontMapReversePtr reverse;
+    int buf;
+} aux_hkscs;
+
+typedef struct {
+    FontMapPtr cs0_mapping;	/* gb18030.2000-0 */
+    FontMapReversePtr cs0_reverse;
+
+    FontMapPtr cs1_mapping;	/* gb18030.2000-1 */
+    FontMapReversePtr cs1_reverse;
+
+    int linear;			/* set to '1' if stack_gb18030 linearized a 4bytes seq */
+    int buf[3];
+    int buf_ptr;
+} aux_gb18030;
+
+typedef union {
+    aux_gbk gbk;
+    aux_utf8 utf8;
+    aux_sjis sjis;
+    aux_hkscs hkscs;
+    aux_gb18030 gb18030;
+} OtherState, *OtherStatePtr;
+
+int init_gbk(OtherStatePtr);
+unsigned int mapping_gbk(unsigned int, OtherStatePtr);
+unsigned int reverse_gbk(unsigned int, OtherStatePtr);
+int stack_gbk(unsigned, OtherStatePtr);
+
+int init_utf8(OtherStatePtr);
+unsigned int mapping_utf8(unsigned int, OtherStatePtr);
+unsigned int reverse_utf8(unsigned int, OtherStatePtr);
+int stack_utf8(unsigned, OtherStatePtr);
+
+int init_sjis(OtherStatePtr);
+unsigned int mapping_sjis(unsigned int, OtherStatePtr);
+unsigned int reverse_sjis(unsigned int, OtherStatePtr);
+int stack_sjis(unsigned, OtherStatePtr);
+
+int init_hkscs(OtherStatePtr);
+unsigned int mapping_hkscs(unsigned int, OtherStatePtr);
+unsigned int reverse_hkscs(unsigned int, OtherStatePtr);
+int stack_hkscs(unsigned, OtherStatePtr);
+
+int init_gb18030(OtherStatePtr);
+unsigned int mapping_gb18030(unsigned int, OtherStatePtr);
+unsigned int reverse_gb18030(unsigned int, OtherStatePtr);
+int stack_gb18030(unsigned, OtherStatePtr);
+
+#endif /* LUIT_OTHER_H */
Index: app/luit/create-1.1.1-make-patch/luit-1.1.1-new
===================================================================
--- app/luit/create-1.1.1-make-patch/luit-1.1.1-new	(nonexistent)
+++ app/luit/create-1.1.1-make-patch/luit-1.1.1-new	(revision 5)

Property changes on: app/luit/create-1.1.1-make-patch/luit-1.1.1-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/luit/create-1.1.1-make-patch
===================================================================
--- app/luit/create-1.1.1-make-patch	(nonexistent)
+++ app/luit/create-1.1.1-make-patch	(revision 5)

Property changes on: app/luit/create-1.1.1-make-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/luit/patches/README
===================================================================
--- app/luit/patches/README	(nonexistent)
+++ app/luit/patches/README	(revision 5)
@@ -0,0 +1,6 @@
+
+/* begin *
+
+   TODO: Leave some comment here.
+
+ * end */
Index: app/luit/patches
===================================================================
--- app/luit/patches	(nonexistent)
+++ app/luit/patches	(revision 5)

Property changes on: app/luit/patches
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/luit
===================================================================
--- app/luit	(nonexistent)
+++ app/luit	(revision 5)

Property changes on: app/luit
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/mkcomposecache/Makefile
===================================================================
--- app/mkcomposecache/Makefile	(nonexistent)
+++ app/mkcomposecache/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/mkcomposecache
+
+versions    = 1.2.2
+pkgname     = mkcomposecache
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/mkcomposecache
===================================================================
--- app/mkcomposecache	(nonexistent)
+++ app/mkcomposecache	(revision 5)

Property changes on: app/mkcomposecache
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/mkfontscale/Makefile
===================================================================
--- app/mkfontscale/Makefile	(nonexistent)
+++ app/mkfontscale/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/mkfontscale
+
+versions    = 1.2.2
+pkgname     = mkfontscale
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/mkfontscale
===================================================================
--- app/mkfontscale	(nonexistent)
+++ app/mkfontscale	(revision 5)

Property changes on: app/mkfontscale
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/oclock/Makefile
===================================================================
--- app/oclock/Makefile	(nonexistent)
+++ app/oclock/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/oclock
+
+versions    = 1.0.5
+pkgname     = oclock
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/oclock
===================================================================
--- app/oclock	(nonexistent)
+++ app/oclock	(revision 5)

Property changes on: app/oclock
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/proxymngr/Makefile
===================================================================
--- app/proxymngr/Makefile	(nonexistent)
+++ app/proxymngr/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/proxymngr
+
+versions    = 1.0.4
+pkgname     = proxymngr
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/proxymngr
===================================================================
--- app/proxymngr	(nonexistent)
+++ app/proxymngr	(revision 5)

Property changes on: app/proxymngr
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/rendercheck/Makefile
===================================================================
--- app/rendercheck/Makefile	(nonexistent)
+++ app/rendercheck/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/rendercheck
+
+versions    = 1.5
+pkgname     = rendercheck
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/rendercheck
===================================================================
--- app/rendercheck	(nonexistent)
+++ app/rendercheck	(revision 5)

Property changes on: app/rendercheck
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/rgb/Makefile
===================================================================
--- app/rgb/Makefile	(nonexistent)
+++ app/rgb/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/rgb
+
+versions    = 1.1.0
+pkgname     = rgb
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/rgb
===================================================================
--- app/rgb	(nonexistent)
+++ app/rgb	(revision 5)

Property changes on: app/rgb
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/rstart/Makefile
===================================================================
--- app/rstart/Makefile	(nonexistent)
+++ app/rstart/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/rstart
+
+versions    = 1.0.6
+pkgname     = rstart
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/rstart
===================================================================
--- app/rstart	(nonexistent)
+++ app/rstart	(revision 5)

Property changes on: app/rstart
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/sessreg/Makefile
===================================================================
--- app/sessreg/Makefile	(nonexistent)
+++ app/sessreg/Makefile	(revision 5)
@@ -0,0 +1,56 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/sessreg
+
+versions    = 1.1.3
+pkgname     = sessreg
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+patches     = $(CURDIR)/patches/sessreg-1.1.3-man.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-1.1.3-man-patch ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s) $(patches)
Index: app/sessreg/create-1.1.3-man-patch/create.patch.sh
===================================================================
--- app/sessreg/create-1.1.3-man-patch/create.patch.sh	(nonexistent)
+++ app/sessreg/create-1.1.3-man-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=1.1.3
+
+tar --files-from=file.list -xJvf ../sessreg-$VERSION.tar.xz
+mv sessreg-$VERSION sessreg-$VERSION-orig
+
+cp -rf ./sessreg-$VERSION-new ./sessreg-$VERSION
+
+diff --unified -Nr  sessreg-$VERSION-orig  sessreg-$VERSION > sessreg-$VERSION-man.patch
+
+mv sessreg-$VERSION-man.patch ../patches
+
+rm -rf ./sessreg-$VERSION
+rm -rf ./sessreg-$VERSION-orig

Property changes on: app/sessreg/create-1.1.3-man-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: app/sessreg/create-1.1.3-man-patch/file.list
===================================================================
--- app/sessreg/create-1.1.3-man-patch/file.list	(nonexistent)
+++ app/sessreg/create-1.1.3-man-patch/file.list	(revision 5)
@@ -0,0 +1,2 @@
+sessreg-1.1.3/man/Makefile.am
+sessreg-1.1.3/man/Makefile.in
Index: app/sessreg/create-1.1.3-man-patch/sessreg-1.1.3-new/man/Makefile.am
===================================================================
--- app/sessreg/create-1.1.3-man-patch/sessreg-1.1.3-new/man/Makefile.am	(nonexistent)
+++ app/sessreg/create-1.1.3-man-patch/sessreg-1.1.3-new/man/Makefile.am	(revision 5)
@@ -0,0 +1,22 @@
+
+appmandir = $(APP_MAN_DIR)
+appman_PRE = sessreg.man
+appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX))
+
+EXTRA_DIST = $(appman_PRE) filenames.sed.c
+CLEANFILES = $(appman_DATA) filenames.sed
+SUFFIXES = .$(APP_MAN_SUFFIX) .man
+
+AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)
+filenames.sed: filenames.sed.c
+	$(AM_V_GEN)$(CPP) -P $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(SESSREG_CFLAGS) \
+	    $(AM_CPPFLAGS) $(CPPFLAGS) $(srcdir)/filenames.sed.c | \
+	    $(SED) -n -e '/s|__/ p' -e '/^\/__/ p' > $@
+
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
+MAN_SUBSTS += -f filenames.sed
+
+sessreg.$(APP_MAN_SUFFIX): filenames.sed
+
+.man.$(APP_MAN_SUFFIX):
+	$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
Index: app/sessreg/create-1.1.3-man-patch/sessreg-1.1.3-new/man/Makefile.in
===================================================================
--- app/sessreg/create-1.1.3-man-patch/sessreg-1.1.3-new/man/Makefile.in	(nonexistent)
+++ app/sessreg/create-1.1.3-man-patch/sessreg-1.1.3-new/man/Makefile.in	(revision 5)
@@ -0,0 +1,509 @@
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = man
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(appmandir)"
+DATA = $(appman_DATA)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
+ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APP_MAN_DIR = @APP_MAN_DIR@
+APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASE_CFLAGS = @BASE_CFLAGS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHANGELOG_CMD = @CHANGELOG_CMD@
+CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
+CWARNFLAGS = @CWARNFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
+DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+ETAGS = @ETAGS@
+EXEEXT = @EXEEXT@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+INSTALL = @INSTALL@
+INSTALL_CMD = @INSTALL_CMD@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIB_MAN_DIR = @LIB_MAN_DIR@
+LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
+LINT = @LINT@
+LINT_FLAGS = @LINT_FLAGS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
+MAN_SUBSTS = @MAN_SUBSTS@ -f filenames.sed
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+SED = @SED@
+SESSREG_CFLAGS = @SESSREG_CFLAGS@
+SESSREG_LIBS = @SESSREG_LIBS@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRICT_CFLAGS = @STRICT_CFLAGS@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XORG_MAN_PAGE = @XORG_MAN_PAGE@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+appmandir = $(APP_MAN_DIR)
+appman_PRE = sessreg.man
+appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX))
+EXTRA_DIST = $(appman_PRE) filenames.sed.c
+CLEANFILES = $(appman_DATA) filenames.sed
+SUFFIXES = .$(APP_MAN_SUFFIX) .man
+AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .$(APP_MAN_SUFFIX) .man
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign man/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-appmanDATA: $(appman_DATA)
+	@$(NORMAL_INSTALL)
+	@list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(appmandir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(appmandir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appmandir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \
+	done
+
+uninstall-appmanDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(appmandir)'; $(am__uninstall_files_from_dir)
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+distdir: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+	for dir in "$(DESTDIR)$(appmandir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-appmanDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-appmanDATA
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic cscopelist-am \
+	ctags-am distclean distclean-generic distdir dvi dvi-am html \
+	html-am info info-am install install-am install-appmanDATA \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+	pdf-am ps ps-am tags-am uninstall uninstall-am \
+	uninstall-appmanDATA
+
+.PRECIOUS: Makefile
+
+filenames.sed: filenames.sed.c
+	$(AM_V_GEN)$(CPP) -P $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(SESSREG_CFLAGS) \
+	    $(AM_CPPFLAGS) $(CPPFLAGS) $(srcdir)/filenames.sed.c | \
+	    $(SED) -n -e '/s|__/ p' -e '/^\/__/ p' > $@
+
+sessreg.$(APP_MAN_SUFFIX): filenames.sed
+
+.man.$(APP_MAN_SUFFIX):
+	$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: app/sessreg/create-1.1.3-man-patch/sessreg-1.1.3-new/man
===================================================================
--- app/sessreg/create-1.1.3-man-patch/sessreg-1.1.3-new/man	(nonexistent)
+++ app/sessreg/create-1.1.3-man-patch/sessreg-1.1.3-new/man	(revision 5)

Property changes on: app/sessreg/create-1.1.3-man-patch/sessreg-1.1.3-new/man
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/sessreg/create-1.1.3-man-patch/sessreg-1.1.3-new
===================================================================
--- app/sessreg/create-1.1.3-man-patch/sessreg-1.1.3-new	(nonexistent)
+++ app/sessreg/create-1.1.3-man-patch/sessreg-1.1.3-new	(revision 5)

Property changes on: app/sessreg/create-1.1.3-man-patch/sessreg-1.1.3-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/sessreg/create-1.1.3-man-patch
===================================================================
--- app/sessreg/create-1.1.3-man-patch	(nonexistent)
+++ app/sessreg/create-1.1.3-man-patch	(revision 5)

Property changes on: app/sessreg/create-1.1.3-man-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/sessreg/patches/README
===================================================================
--- app/sessreg/patches/README	(nonexistent)
+++ app/sessreg/patches/README	(revision 5)
@@ -0,0 +1,6 @@
+
+/* begin *
+
+   TODO: Leave some comment here.
+
+ * end */
Index: app/sessreg/patches
===================================================================
--- app/sessreg/patches	(nonexistent)
+++ app/sessreg/patches	(revision 5)

Property changes on: app/sessreg/patches
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/sessreg
===================================================================
--- app/sessreg	(nonexistent)
+++ app/sessreg	(revision 5)

Property changes on: app/sessreg
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/setxkbmap/Makefile
===================================================================
--- app/setxkbmap/Makefile	(nonexistent)
+++ app/setxkbmap/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/setxkbmap
+
+versions    = 1.3.3
+pkgname     = setxkbmap
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/setxkbmap
===================================================================
--- app/setxkbmap	(nonexistent)
+++ app/setxkbmap	(revision 5)

Property changes on: app/setxkbmap
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/showfont/Makefile
===================================================================
--- app/showfont/Makefile	(nonexistent)
+++ app/showfont/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/showfont
+
+versions    = 1.0.6
+pkgname     = showfont
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/showfont
===================================================================
--- app/showfont	(nonexistent)
+++ app/showfont	(revision 5)

Property changes on: app/showfont
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/smproxy/Makefile
===================================================================
--- app/smproxy/Makefile	(nonexistent)
+++ app/smproxy/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/smproxy
+
+versions    = 1.0.7
+pkgname     = smproxy
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/smproxy
===================================================================
--- app/smproxy	(nonexistent)
+++ app/smproxy	(revision 5)

Property changes on: app/smproxy
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/transset/Makefile
===================================================================
--- app/transset/Makefile	(nonexistent)
+++ app/transset/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/transset
+
+versions    = 1.0.3
+pkgname     = transset
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/transset
===================================================================
--- app/transset	(nonexistent)
+++ app/transset	(revision 5)

Property changes on: app/transset
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/twm/Makefile
===================================================================
--- app/twm/Makefile	(nonexistent)
+++ app/twm/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/twm
+
+versions    = 1.0.12
+pkgname     = twm
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/twm
===================================================================
--- app/twm	(nonexistent)
+++ app/twm	(revision 5)

Property changes on: app/twm
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/viewres/Makefile
===================================================================
--- app/viewres/Makefile	(nonexistent)
+++ app/viewres/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/viewres
+
+versions    = 1.0.7
+pkgname     = viewres
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/viewres
===================================================================
--- app/viewres	(nonexistent)
+++ app/viewres	(revision 5)

Property changes on: app/viewres
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xauth/Makefile
===================================================================
--- app/xauth/Makefile	(nonexistent)
+++ app/xauth/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xauth
+
+versions    = 1.1.2
+pkgname     = xauth
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xauth
===================================================================
--- app/xauth	(nonexistent)
+++ app/xauth	(revision 5)

Property changes on: app/xauth
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xbacklight/Makefile
===================================================================
--- app/xbacklight/Makefile	(nonexistent)
+++ app/xbacklight/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xbacklight
+
+versions    = 1.2.3
+pkgname     = xbacklight
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xbacklight
===================================================================
--- app/xbacklight	(nonexistent)
+++ app/xbacklight	(revision 5)

Property changes on: app/xbacklight
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xbiff/Makefile
===================================================================
--- app/xbiff/Makefile	(nonexistent)
+++ app/xbiff/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xbiff
+
+versions    = 1.0.4
+pkgname     = xbiff
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xbiff
===================================================================
--- app/xbiff	(nonexistent)
+++ app/xbiff	(revision 5)

Property changes on: app/xbiff
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xcalc/Makefile
===================================================================
--- app/xcalc/Makefile	(nonexistent)
+++ app/xcalc/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xcalc
+
+versions    = 1.1.1
+pkgname     = xcalc
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xcalc
===================================================================
--- app/xcalc	(nonexistent)
+++ app/xcalc	(revision 5)

Property changes on: app/xcalc
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xclipboard/Makefile
===================================================================
--- app/xclipboard/Makefile	(nonexistent)
+++ app/xclipboard/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xclipboard
+
+versions    = 1.1.4
+pkgname     = xclipboard
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xclipboard
===================================================================
--- app/xclipboard	(nonexistent)
+++ app/xclipboard	(revision 5)

Property changes on: app/xclipboard
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xclock/Makefile
===================================================================
--- app/xclock/Makefile	(nonexistent)
+++ app/xclock/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xclock
+
+versions    = 1.1.1
+pkgname     = xclock
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xclock
===================================================================
--- app/xclock	(nonexistent)
+++ app/xclock	(revision 5)

Property changes on: app/xclock
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xcm/Makefile
===================================================================
--- app/xcm/Makefile	(nonexistent)
+++ app/xcm/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xcm
+
+versions    = 0.5.4
+pkgname     = xcm
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xcm
===================================================================
--- app/xcm	(nonexistent)
+++ app/xcm	(revision 5)

Property changes on: app/xcm
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xcmsdb/Makefile
===================================================================
--- app/xcmsdb/Makefile	(nonexistent)
+++ app/xcmsdb/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xcmsdb
+
+versions    = 1.0.6
+pkgname     = xcmsdb
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xcmsdb
===================================================================
--- app/xcmsdb	(nonexistent)
+++ app/xcmsdb	(revision 5)

Property changes on: app/xcmsdb
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xcompmgr/Makefile
===================================================================
--- app/xcompmgr/Makefile	(nonexistent)
+++ app/xcompmgr/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xcompmgr
+
+versions    = 1.1.9
+pkgname     = xcompmgr
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xcompmgr
===================================================================
--- app/xcompmgr	(nonexistent)
+++ app/xcompmgr	(revision 5)

Property changes on: app/xcompmgr
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xconsole/Makefile
===================================================================
--- app/xconsole/Makefile	(nonexistent)
+++ app/xconsole/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xconsole
+
+versions    = 1.0.8
+pkgname     = xconsole
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xconsole
===================================================================
--- app/xconsole	(nonexistent)
+++ app/xconsole	(revision 5)

Property changes on: app/xconsole
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xcursorgen/Makefile
===================================================================
--- app/xcursorgen/Makefile	(nonexistent)
+++ app/xcursorgen/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xcursorgen
+
+versions    = 1.0.8
+pkgname     = xcursorgen
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xcursorgen
===================================================================
--- app/xcursorgen	(nonexistent)
+++ app/xcursorgen	(revision 5)

Property changes on: app/xcursorgen
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xdbedizzy/Makefile
===================================================================
--- app/xdbedizzy/Makefile	(nonexistent)
+++ app/xdbedizzy/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xdbedizzy
+
+versions    = 1.1.0
+pkgname     = xdbedizzy
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xdbedizzy
===================================================================
--- app/xdbedizzy	(nonexistent)
+++ app/xdbedizzy	(revision 5)

Property changes on: app/xdbedizzy
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xditview/Makefile
===================================================================
--- app/xditview/Makefile	(nonexistent)
+++ app/xditview/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xditview
+
+versions    = 1.0.6
+pkgname     = xditview
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xditview
===================================================================
--- app/xditview	(nonexistent)
+++ app/xditview	(revision 5)

Property changes on: app/xditview
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xdm/Makefile
===================================================================
--- app/xdm/Makefile	(nonexistent)
+++ app/xdm/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xdm
+
+versions    = 1.1.14
+pkgname     = xdm
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xdm
===================================================================
--- app/xdm	(nonexistent)
+++ app/xdm	(revision 5)

Property changes on: app/xdm
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xdpyinfo/Makefile
===================================================================
--- app/xdpyinfo/Makefile	(nonexistent)
+++ app/xdpyinfo/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xdpyinfo
+
+versions    = 1.3.3
+pkgname     = xdpyinfo
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xdpyinfo
===================================================================
--- app/xdpyinfo	(nonexistent)
+++ app/xdpyinfo	(revision 5)

Property changes on: app/xdpyinfo
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xdriinfo/Makefile
===================================================================
--- app/xdriinfo/Makefile	(nonexistent)
+++ app/xdriinfo/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xdriinfo
+
+versions    = 1.0.7
+pkgname     = xdriinfo
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xdriinfo
===================================================================
--- app/xdriinfo	(nonexistent)
+++ app/xdriinfo	(revision 5)

Property changes on: app/xdriinfo
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xedit/Makefile
===================================================================
--- app/xedit/Makefile	(nonexistent)
+++ app/xedit/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xedit
+
+versions    = 1.2.3
+pkgname     = xedit
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xedit
===================================================================
--- app/xedit	(nonexistent)
+++ app/xedit	(revision 5)

Property changes on: app/xedit
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xev/Makefile
===================================================================
--- app/xev/Makefile	(nonexistent)
+++ app/xev/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xev
+
+versions    = 1.2.5
+pkgname     = xev
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xev
===================================================================
--- app/xev	(nonexistent)
+++ app/xev	(revision 5)

Property changes on: app/xev
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xeyes/Makefile
===================================================================
--- app/xeyes/Makefile	(nonexistent)
+++ app/xeyes/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xeyes
+
+versions    = 1.2.0
+pkgname     = xeyes
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xeyes
===================================================================
--- app/xeyes	(nonexistent)
+++ app/xeyes	(revision 5)

Property changes on: app/xeyes
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xf86dga/Makefile
===================================================================
--- app/xf86dga/Makefile	(nonexistent)
+++ app/xf86dga/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xf86dga
+
+versions    = 1.0.3
+pkgname     = xf86dga
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xf86dga
===================================================================
--- app/xf86dga	(nonexistent)
+++ app/xf86dga	(revision 5)

Property changes on: app/xf86dga
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xfd/Makefile
===================================================================
--- app/xfd/Makefile	(nonexistent)
+++ app/xfd/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xfd
+
+versions    = 1.1.4
+pkgname     = xfd
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xfd
===================================================================
--- app/xfd	(nonexistent)
+++ app/xfd	(revision 5)

Property changes on: app/xfd
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xfindproxy/Makefile
===================================================================
--- app/xfindproxy/Makefile	(nonexistent)
+++ app/xfindproxy/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xfindproxy
+
+versions    = 1.0.4
+pkgname     = xfindproxy
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xfindproxy
===================================================================
--- app/xfindproxy	(nonexistent)
+++ app/xfindproxy	(revision 5)

Property changes on: app/xfindproxy
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xfontsel/Makefile
===================================================================
--- app/xfontsel/Makefile	(nonexistent)
+++ app/xfontsel/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xfontsel
+
+versions    = 1.1.0
+pkgname     = xfontsel
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xfontsel
===================================================================
--- app/xfontsel	(nonexistent)
+++ app/xfontsel	(revision 5)

Property changes on: app/xfontsel
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xfs/Makefile
===================================================================
--- app/xfs/Makefile	(nonexistent)
+++ app/xfs/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xfs
+
+versions    = 1.2.1
+pkgname     = xfs
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xfs
===================================================================
--- app/xfs	(nonexistent)
+++ app/xfs	(revision 5)

Property changes on: app/xfs
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xfsinfo/Makefile
===================================================================
--- app/xfsinfo/Makefile	(nonexistent)
+++ app/xfsinfo/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xfsinfo
+
+versions    = 1.0.7
+pkgname     = xfsinfo
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xfsinfo
===================================================================
--- app/xfsinfo	(nonexistent)
+++ app/xfsinfo	(revision 5)

Property changes on: app/xfsinfo
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xfwp/Makefile
===================================================================
--- app/xfwp/Makefile	(nonexistent)
+++ app/xfwp/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xfwp
+
+versions    = 1.0.3
+pkgname     = xfwp
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xfwp
===================================================================
--- app/xfwp	(nonexistent)
+++ app/xfwp	(revision 5)

Property changes on: app/xfwp
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xgamma/Makefile
===================================================================
--- app/xgamma/Makefile	(nonexistent)
+++ app/xgamma/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xgamma
+
+versions    = 1.0.7
+pkgname     = xgamma
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xgamma
===================================================================
--- app/xgamma	(nonexistent)
+++ app/xgamma	(revision 5)

Property changes on: app/xgamma
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xgc/Makefile
===================================================================
--- app/xgc/Makefile	(nonexistent)
+++ app/xgc/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xgc
+
+versions    = 1.0.6
+pkgname     = xgc
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xgc
===================================================================
--- app/xgc	(nonexistent)
+++ app/xgc	(revision 5)

Property changes on: app/xgc
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xhost/Makefile
===================================================================
--- app/xhost/Makefile	(nonexistent)
+++ app/xhost/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xhost
+
+versions    = 1.0.9
+pkgname     = xhost
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xhost
===================================================================
--- app/xhost	(nonexistent)
+++ app/xhost	(revision 5)

Property changes on: app/xhost
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xinit/Makefile
===================================================================
--- app/xinit/Makefile	(nonexistent)
+++ app/xinit/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xinit
+
+versions    = 1.4.2
+pkgname     = xinit
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xinit
===================================================================
--- app/xinit	(nonexistent)
+++ app/xinit	(revision 5)

Property changes on: app/xinit
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xinput/Makefile
===================================================================
--- app/xinput/Makefile	(nonexistent)
+++ app/xinput/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xinput
+
+versions    = 1.6.3
+pkgname     = xinput
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xinput
===================================================================
--- app/xinput	(nonexistent)
+++ app/xinput	(revision 5)

Property changes on: app/xinput
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xisxwayland/Makefile
===================================================================
--- app/xisxwayland/Makefile	(nonexistent)
+++ app/xisxwayland/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xisxwayland
+
+versions    = 2
+pkgname     = xisxwayland
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xisxwayland
===================================================================
--- app/xisxwayland	(nonexistent)
+++ app/xisxwayland	(revision 5)

Property changes on: app/xisxwayland
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xkbcomp/Makefile
===================================================================
--- app/xkbcomp/Makefile	(nonexistent)
+++ app/xkbcomp/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xkbcomp
+
+versions    = 1.4.6
+pkgname     = xkbcomp
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xkbcomp
===================================================================
--- app/xkbcomp	(nonexistent)
+++ app/xkbcomp	(revision 5)

Property changes on: app/xkbcomp
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xkbevd/Makefile
===================================================================
--- app/xkbevd/Makefile	(nonexistent)
+++ app/xkbevd/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xkbevd
+
+versions    = 1.1.5
+pkgname     = xkbevd
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xkbevd
===================================================================
--- app/xkbevd	(nonexistent)
+++ app/xkbevd	(revision 5)

Property changes on: app/xkbevd
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xkbprint/Makefile
===================================================================
--- app/xkbprint/Makefile	(nonexistent)
+++ app/xkbprint/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xkbprint
+
+versions    = 1.0.6
+pkgname     = xkbprint
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xkbprint
===================================================================
--- app/xkbprint	(nonexistent)
+++ app/xkbprint	(revision 5)

Property changes on: app/xkbprint
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xkbutils/Makefile
===================================================================
--- app/xkbutils/Makefile	(nonexistent)
+++ app/xkbutils/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xkbutils
+
+versions    = 1.0.5
+pkgname     = xkbutils
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xkbutils
===================================================================
--- app/xkbutils	(nonexistent)
+++ app/xkbutils	(revision 5)

Property changes on: app/xkbutils
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xkill/Makefile
===================================================================
--- app/xkill/Makefile	(nonexistent)
+++ app/xkill/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xkill
+
+versions    = 1.0.6
+pkgname     = xkill
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xkill
===================================================================
--- app/xkill	(nonexistent)
+++ app/xkill	(revision 5)

Property changes on: app/xkill
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xload/Makefile
===================================================================
--- app/xload/Makefile	(nonexistent)
+++ app/xload/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xload
+
+versions    = 1.1.4
+pkgname     = xload
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xload
===================================================================
--- app/xload	(nonexistent)
+++ app/xload	(revision 5)

Property changes on: app/xload
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xlogo/Makefile
===================================================================
--- app/xlogo/Makefile	(nonexistent)
+++ app/xlogo/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xlogo
+
+versions    = 1.0.6
+pkgname     = xlogo
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xlogo
===================================================================
--- app/xlogo	(nonexistent)
+++ app/xlogo	(revision 5)

Property changes on: app/xlogo
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xlsatoms/Makefile
===================================================================
--- app/xlsatoms/Makefile	(nonexistent)
+++ app/xlsatoms/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xlsatoms
+
+versions    = 1.1.4
+pkgname     = xlsatoms
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xlsatoms
===================================================================
--- app/xlsatoms	(nonexistent)
+++ app/xlsatoms	(revision 5)

Property changes on: app/xlsatoms
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xlsclients/Makefile
===================================================================
--- app/xlsclients/Makefile	(nonexistent)
+++ app/xlsclients/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xlsclients
+
+versions    = 1.1.5
+pkgname     = xlsclients
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xlsclients
===================================================================
--- app/xlsclients	(nonexistent)
+++ app/xlsclients	(revision 5)

Property changes on: app/xlsclients
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xlsfonts/Makefile
===================================================================
--- app/xlsfonts/Makefile	(nonexistent)
+++ app/xlsfonts/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xlsfonts
+
+versions    = 1.0.7
+pkgname     = xlsfonts
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xlsfonts
===================================================================
--- app/xlsfonts	(nonexistent)
+++ app/xlsfonts	(revision 5)

Property changes on: app/xlsfonts
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xmag/Makefile
===================================================================
--- app/xmag/Makefile	(nonexistent)
+++ app/xmag/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xmag
+
+versions    = 1.0.7
+pkgname     = xmag
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xmag
===================================================================
--- app/xmag	(nonexistent)
+++ app/xmag	(revision 5)

Property changes on: app/xmag
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xman/Makefile
===================================================================
--- app/xman/Makefile	(nonexistent)
+++ app/xman/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xman
+
+versions    = 1.1.5
+pkgname     = xman
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xman
===================================================================
--- app/xman	(nonexistent)
+++ app/xman	(revision 5)

Property changes on: app/xman
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xmessage/Makefile
===================================================================
--- app/xmessage/Makefile	(nonexistent)
+++ app/xmessage/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xmessage
+
+versions    = 1.0.6
+pkgname     = xmessage
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xmessage
===================================================================
--- app/xmessage	(nonexistent)
+++ app/xmessage	(revision 5)

Property changes on: app/xmessage
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xmh/Makefile
===================================================================
--- app/xmh/Makefile	(nonexistent)
+++ app/xmh/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xmh
+
+versions    = 1.0.4
+pkgname     = xmh
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xmh
===================================================================
--- app/xmh	(nonexistent)
+++ app/xmh	(revision 5)

Property changes on: app/xmh
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xmodmap/Makefile
===================================================================
--- app/xmodmap/Makefile	(nonexistent)
+++ app/xmodmap/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xmodmap
+
+versions    = 1.0.11
+pkgname     = xmodmap
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xmodmap
===================================================================
--- app/xmodmap	(nonexistent)
+++ app/xmodmap	(revision 5)

Property changes on: app/xmodmap
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xmore/Makefile
===================================================================
--- app/xmore/Makefile	(nonexistent)
+++ app/xmore/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xmore
+
+versions    = 1.0.3
+pkgname     = xmore
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xmore
===================================================================
--- app/xmore	(nonexistent)
+++ app/xmore	(revision 5)

Property changes on: app/xmore
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xpr/Makefile
===================================================================
--- app/xpr/Makefile	(nonexistent)
+++ app/xpr/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xpr
+
+versions    = 1.1.0
+pkgname     = xpr
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xpr
===================================================================
--- app/xpr	(nonexistent)
+++ app/xpr	(revision 5)

Property changes on: app/xpr
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xprop/Makefile
===================================================================
--- app/xprop/Makefile	(nonexistent)
+++ app/xprop/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xprop
+
+versions    = 1.2.6
+pkgname     = xprop
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xprop
===================================================================
--- app/xprop	(nonexistent)
+++ app/xprop	(revision 5)

Property changes on: app/xprop
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xrandr/Makefile
===================================================================
--- app/xrandr/Makefile	(nonexistent)
+++ app/xrandr/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xrandr
+
+versions    = 1.5.2
+pkgname     = xrandr
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xrandr
===================================================================
--- app/xrandr	(nonexistent)
+++ app/xrandr	(revision 5)

Property changes on: app/xrandr
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xrdb/Makefile
===================================================================
--- app/xrdb/Makefile	(nonexistent)
+++ app/xrdb/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xrdb
+
+versions    = 1.2.1
+pkgname     = xrdb
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xrdb
===================================================================
--- app/xrdb	(nonexistent)
+++ app/xrdb	(revision 5)

Property changes on: app/xrdb
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xrefresh/Makefile
===================================================================
--- app/xrefresh/Makefile	(nonexistent)
+++ app/xrefresh/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xrefresh
+
+versions    = 1.0.7
+pkgname     = xrefresh
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xrefresh
===================================================================
--- app/xrefresh	(nonexistent)
+++ app/xrefresh	(revision 5)

Property changes on: app/xrefresh
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xscope/Makefile
===================================================================
--- app/xscope/Makefile	(nonexistent)
+++ app/xscope/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xscope
+
+versions    = 1.4.3
+pkgname     = xscope
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xscope
===================================================================
--- app/xscope	(nonexistent)
+++ app/xscope	(revision 5)

Property changes on: app/xscope
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xset/Makefile
===================================================================
--- app/xset/Makefile	(nonexistent)
+++ app/xset/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xset
+
+versions    = 1.2.5
+pkgname     = xset
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xset
===================================================================
--- app/xset	(nonexistent)
+++ app/xset	(revision 5)

Property changes on: app/xset
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xsetroot/Makefile
===================================================================
--- app/xsetroot/Makefile	(nonexistent)
+++ app/xsetroot/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xsetroot
+
+versions    = 1.1.3
+pkgname     = xsetroot
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xsetroot
===================================================================
--- app/xsetroot	(nonexistent)
+++ app/xsetroot	(revision 5)

Property changes on: app/xsetroot
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xsm/Makefile
===================================================================
--- app/xsm/Makefile	(nonexistent)
+++ app/xsm/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xsm
+
+versions    = 1.0.5
+pkgname     = xsm
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xsm
===================================================================
--- app/xsm	(nonexistent)
+++ app/xsm	(revision 5)

Property changes on: app/xsm
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xstdcmap/Makefile
===================================================================
--- app/xstdcmap/Makefile	(nonexistent)
+++ app/xstdcmap/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xstdcmap
+
+versions    = 1.0.5
+pkgname     = xstdcmap
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xstdcmap
===================================================================
--- app/xstdcmap	(nonexistent)
+++ app/xstdcmap	(revision 5)

Property changes on: app/xstdcmap
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xvidtune/Makefile
===================================================================
--- app/xvidtune/Makefile	(nonexistent)
+++ app/xvidtune/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xvidtune
+
+versions    = 1.0.3
+pkgname     = xvidtune
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xvidtune
===================================================================
--- app/xvidtune	(nonexistent)
+++ app/xvidtune	(revision 5)

Property changes on: app/xvidtune
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xvinfo/Makefile
===================================================================
--- app/xvinfo/Makefile	(nonexistent)
+++ app/xvinfo/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xvinfo
+
+versions    = 1.1.5
+pkgname     = xvinfo
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xvinfo
===================================================================
--- app/xvinfo	(nonexistent)
+++ app/xvinfo	(revision 5)

Property changes on: app/xvinfo
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xwd/Makefile
===================================================================
--- app/xwd/Makefile	(nonexistent)
+++ app/xwd/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xwd
+
+versions    = 1.0.8
+pkgname     = xwd
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xwd
===================================================================
--- app/xwd	(nonexistent)
+++ app/xwd	(revision 5)

Property changes on: app/xwd
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xwininfo/Makefile
===================================================================
--- app/xwininfo/Makefile	(nonexistent)
+++ app/xwininfo/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xwininfo
+
+versions    = 1.1.5
+pkgname     = xwininfo
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xwininfo
===================================================================
--- app/xwininfo	(nonexistent)
+++ app/xwininfo	(revision 5)

Property changes on: app/xwininfo
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app/xwud/Makefile
===================================================================
--- app/xwud/Makefile	(nonexistent)
+++ app/xwud/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/app/xwud
+
+versions    = 1.0.6
+pkgname     = xwud
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: app/xwud
===================================================================
--- app/xwud	(nonexistent)
+++ app/xwud	(revision 5)

Property changes on: app/xwud
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: app
===================================================================
--- app	(nonexistent)
+++ app	(revision 5)

Property changes on: app
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: data/Makefile
===================================================================
--- data/Makefile	(nonexistent)
+++ data/Makefile	(revision 5)
@@ -0,0 +1,13 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+SOURCE_REQUIRES += ALL_DIRS
+
+
+include ../../../build-system/core.mk
+
+
+download_clean:
+	@true
+
+.PHONY: download_clean
Index: data/xbitmaps/Makefile
===================================================================
--- data/xbitmaps/Makefile	(nonexistent)
+++ data/xbitmaps/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/data/xbitmaps
+
+versions    = 1.1.2
+pkgname     = xbitmaps
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: data/xbitmaps
===================================================================
--- data/xbitmaps	(nonexistent)
+++ data/xbitmaps	(revision 5)

Property changes on: data/xbitmaps
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: data/xcursor-themes/Makefile
===================================================================
--- data/xcursor-themes/Makefile	(nonexistent)
+++ data/xcursor-themes/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/data/xcursor-themes
+
+versions    = 1.0.6
+pkgname     = xcursor-themes
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: data/xcursor-themes
===================================================================
--- data/xcursor-themes	(nonexistent)
+++ data/xcursor-themes	(revision 5)

Property changes on: data/xcursor-themes
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: data/xkeyboard-config/Makefile
===================================================================
--- data/xkeyboard-config/Makefile	(nonexistent)
+++ data/xkeyboard-config/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/data/xkeyboard-config
+
+versions    = 2.38
+pkgname     = xkeyboard-config
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: data/xkeyboard-config
===================================================================
--- data/xkeyboard-config	(nonexistent)
+++ data/xkeyboard-config	(revision 5)

Property changes on: data/xkeyboard-config
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: data
===================================================================
--- data	(nonexistent)
+++ data	(revision 5)

Property changes on: data
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: doc/Makefile
===================================================================
--- doc/Makefile	(nonexistent)
+++ doc/Makefile	(revision 5)
@@ -0,0 +1,13 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+SOURCE_REQUIRES += ALL_DIRS
+
+
+include ../../../build-system/core.mk
+
+
+download_clean:
+	@true
+
+.PHONY: download_clean
Index: doc/xorg-docs/Makefile
===================================================================
--- doc/xorg-docs/Makefile	(nonexistent)
+++ doc/xorg-docs/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/doc/xorg-docs
+
+versions    = 1.7.2
+pkgname     = xorg-docs
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: doc/xorg-docs
===================================================================
--- doc/xorg-docs	(nonexistent)
+++ doc/xorg-docs	(revision 5)

Property changes on: doc/xorg-docs
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: doc/xorg-sgml-doctools/Makefile
===================================================================
--- doc/xorg-sgml-doctools/Makefile	(nonexistent)
+++ doc/xorg-sgml-doctools/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/doc/xorg-sgml-doctools
+
+versions    = 1.12
+pkgname     = xorg-sgml-doctools
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: doc/xorg-sgml-doctools
===================================================================
--- doc/xorg-sgml-doctools	(nonexistent)
+++ doc/xorg-sgml-doctools	(revision 5)

Property changes on: doc/xorg-sgml-doctools
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: doc
===================================================================
--- doc	(nonexistent)
+++ doc	(revision 5)

Property changes on: doc
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/Makefile
===================================================================
--- driver/Makefile	(nonexistent)
+++ driver/Makefile	(revision 5)
@@ -0,0 +1,13 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+SOURCE_REQUIRES += ALL_DIRS
+
+
+include ../../../build-system/core.mk
+
+
+download_clean:
+	@true
+
+.PHONY: download_clean
Index: driver/xf86-input-acecad/Makefile
===================================================================
--- driver/xf86-input-acecad/Makefile	(nonexistent)
+++ driver/xf86-input-acecad/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-input-acecad
+
+versions    = 1.5.0
+pkgname     = xf86-input-acecad
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-input-acecad
===================================================================
--- driver/xf86-input-acecad	(nonexistent)
+++ driver/xf86-input-acecad	(revision 5)

Property changes on: driver/xf86-input-acecad
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-input-aiptek/Makefile
===================================================================
--- driver/xf86-input-aiptek/Makefile	(nonexistent)
+++ driver/xf86-input-aiptek/Makefile	(revision 5)
@@ -0,0 +1,56 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-input-aiptek
+
+versions    = 1.4.1
+pkgname     = xf86-input-aiptek
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+patches     = $(CURDIR)/patches/xf86-input-aiptek-1.4.1-abi.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-1.4.1-abi-patch      ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s) $(patches)
Index: driver/xf86-input-aiptek/create-1.4.1-abi-patch/create.patch.sh
===================================================================
--- driver/xf86-input-aiptek/create-1.4.1-abi-patch/create.patch.sh	(nonexistent)
+++ driver/xf86-input-aiptek/create-1.4.1-abi-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=1.4.1
+
+tar --files-from=file.list -xjvf ../xf86-input-aiptek-$VERSION.tar.bz2
+mv xf86-input-aiptek-$VERSION xf86-input-aiptek-$VERSION-orig
+
+cp -rf ./xf86-input-aiptek-$VERSION-new ./xf86-input-aiptek-$VERSION
+
+diff -b --unified -Nr  xf86-input-aiptek-$VERSION-orig  xf86-input-aiptek-$VERSION > xf86-input-aiptek-$VERSION-abi.patch
+
+mv xf86-input-aiptek-$VERSION-abi.patch ../patches
+
+rm -rf ./xf86-input-aiptek-$VERSION
+rm -rf ./xf86-input-aiptek-$VERSION-orig

Property changes on: driver/xf86-input-aiptek/create-1.4.1-abi-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: driver/xf86-input-aiptek/create-1.4.1-abi-patch/file.list
===================================================================
--- driver/xf86-input-aiptek/create-1.4.1-abi-patch/file.list	(nonexistent)
+++ driver/xf86-input-aiptek/create-1.4.1-abi-patch/file.list	(revision 5)
@@ -0,0 +1 @@
+xf86-input-aiptek-1.4.1/src/xf86Aiptek.c
Index: driver/xf86-input-aiptek/create-1.4.1-abi-patch/xf86-input-aiptek-1.4.1-new/src/xf86Aiptek.c
===================================================================
--- driver/xf86-input-aiptek/create-1.4.1-abi-patch/xf86-input-aiptek-1.4.1-new/src/xf86Aiptek.c	(nonexistent)
+++ driver/xf86-input-aiptek/create-1.4.1-abi-patch/xf86-input-aiptek-1.4.1-new/src/xf86Aiptek.c	(revision 5)
@@ -0,0 +1,2296 @@
+/*
+ * xf86Aiptek
+ *
+ * This driver assumes Linux USB/HID support, available for USB devices.
+ * 
+ * Version 0.0, 1-Jan-2003, Bryan W. Headley
+ *
+ * Version 1.0 10-jan-2008, Rene van Paassen
+ *  * This version is based on the Xorg driver 1.0.1 version, with 
+ *    fixes based on the version developed at aiptektablet.sourceforge.net
+ *    fixes include - correction of the button status calculation
+ *                    (buttons were never released) 
+ *                  - use stylus as default, because reading the
+ *                    tablet before X start gives no hint as to what device
+ *                    it is producing
+ *                  - correction of the proximity bit detection
+ *                  - although tablet may produce relative (x, y), the z and 
+ *                    tilt values are always absolute, corrected that
+ *                  - relative x and y may be negative sometimes! removed 
+ *                    clipping there
+ *                  - filtering out events only if ALL values are equal to 
+ *                    the, previous not when only one or more is equal + 
+ *                    combined filtering with threshold.
+ *                  
+ * 
+ * Copyright 2003 by Bryan W. Headley. <bwheadley@earthlink.net>
+ *
+ * Lineage: This driver is based on both the xf86HyperPen and xf86Wacom tablet
+ *          drivers.
+ *
+ *      xf86HyperPen -- modified from xf86Summa (c) 1996 Steven Lang
+ *          (c) 2000 Roland Jansen
+ *          (c) 2000 Christian Herzog (button & 19200 baud support)
+ *
+ *      xf86Wacom -- (c) 1995-2001 Frederic Lepied
+ *
+ *
+ * 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 Bryan W. Headley not be used in 
+ * advertising or publicity pertaining to distribution of the software 
+ * without specific, written prior permission.  Bryan W. Headley makes no 
+ * representations about the suitability of this software for any purpose.  
+ * It is provided "as is" without express or implied warranty.
+ *
+ * BRYAN W. HEADLEY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL BRYAN W. HEADLEY 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 ACTIONS, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ *
+ * Section "InputDevice"
+ *      Identifier  "stylus"
+ *      Driver      "aiptek"
+ *      Option      "Device"        "pathname" {/dev/input/event0}
+ *      Option      "Type"          "string" {stylus|cursor|eraser}
+ *      Option      "Mode"          "string" {absolute|relative}
+ *      Option      "Cursor"        "string" {stylus|puck}
+ *      Option      "USB"           "bool"   {on|off}
+ *      Option      "ScreenNo"      "int"
+ *      Option      "KeepShape"     "bool"   {on|off}
+ *
+ *      # The tablet reports top-right as 0 for the given coordinate
+ *      # to bottom-left as num (value dependent on tablet.)
+ *      # If you choose to invert X, Y or both, the bottom-left coordinate
+ *      # is reported as 0.
+ *      Option      "InvX"          "bool"   {on|off}
+ *      Option      "InvY"          "bool"   {on|off}
+ *
+ *      # XSize/YSize/XOffset/YOffset allow you to specify an active
+ *      # area within yout tablet.
+ *
+ *      Option      "XSize"         "int"
+ *      Option      "YSize"         "int"
+ *      
+ *      Option      "XTop"          "int"
+ *      Option      "YTop"          "int"
+ *      Option      "XBottom"       "int"
+ *      Option      "YBottom"       "int"
+ *      Option      "XOffset"       "int"
+ *      Option      "YOffset"       "int"
+ *
+ *      Option      "XMax"          "int"
+ *      Option      "YMax"          "int"
+ *      Option      "ZMax"          "int"
+ *      Option      "ZMin"          "int"
+ *
+ *      Option      "XThreshold"  "int"
+ *      Option      "YThreshold"  "int"
+ *      Option      "ZThreshold"  "int"
+ *
+ *      Option      "Pressure"      "Soft|Hard|Linear"  defaults to Linear
+ *
+ *      Option      "alwayscore"  "bool"   {on|off}
+ *      Option      "debuglevel"  "int"
+ *      Option      "HistorySize" "int"
+ * EndSection
+ *
+ *  Commentary:
+ *  1.  Identifier: what you name your input device is not too
+ *      significant. 
+ *      but what it infers is that you can have a driver with
+ *      a name of "stylus" (whose type would be 'stylus') and
+ *      another one with identifier "cursor" (whose type would be
+ *      'cursor') that both would be driver by the same aiptek
+ *      driver. Note though that the identifier keyword has
+ *      no devicetype connotations: you can identify your input
+ *      device as "zzz", 
+ *
+ */
+
+#include "xf86Aiptek.h"
+#include <errno.h>
+#include <string.h>
+#include <math.h>
+
+#include <X11/Xatom.h>
+#include <xserver-properties.h>
+
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
+#error "Need a server with input ABI 12"
+#endif
+
+static InputDriverPtr aiptekDrv;
+static int debug_level = INI_DEBUG_LEVEL;
+
+static char *default_options[] =
+{
+    "BaudRate",     "9600",
+    "StopBits",     "1",
+    "DataBits",     "8",
+    "Parity",       "None",
+    "VMin",         "1",
+    "Vtime",        "10",
+    "FlowControl",  "Xoff",
+    NULL
+};
+
+_X_EXPORT InputDriverRec AIPTEK =
+{
+    1,                  /* driver version */
+    "aiptek",           /* driver name */
+    NULL,               /* identify */
+    xf86AiptekInit,     /* pre-init */
+    xf86AiptekUninit,   /* un-init */
+    NULL,               /* module */
+    default_options
+};
+
+/*
+ * This is the map of Linux Event Input system keystrokes sent for
+ * the macro keys. There are discrepancies in the mappings, so for example,
+ * if we wanted to implement full macro key-to-string conversion in the
+ * Linux driver, we'd have to accept 1-to-many keyboard events, several of
+ * whom would not have the same encoding. For this reason, we're biting
+ * the bullet now & implementing a simple lookup/translation scheme.
+ * A simple 'KEY_F1 = XK_F1' layout wouldn't work, because X wants an
+ * offset into the KeySym array above, and it'll look up that this means 
+ * XK_whatever...
+ */
+
+static int linux_inputDevice_keyMap[] =
+{
+    KEY_F1,  KEY_F2,  KEY_F3,  KEY_F4,  KEY_F5,  KEY_F6,  KEY_F7,  KEY_F8,
+    KEY_F9,  KEY_F10, KEY_F11, KEY_F12, KEY_F13, KEY_F14, KEY_F15, KEY_F16,
+    KEY_F17, KEY_F18, KEY_F19, KEY_F20, KEY_F21, KEY_F22, KEY_F23, KEY_F24, 
+    KEY_STOP, KEY_AGAIN, KEY_PROPS, KEY_UNDO, KEY_FRONT, KEY_COPY,
+    KEY_OPEN, KEY_PASTE
+};
+
+/**********************************************************************
+ * xf86AiptekSendEvents
+ *  Send events according to the device state.
+ */
+static void
+xf86AiptekSendEvents(InputInfoPtr pInfo, int r_z)
+{
+    AiptekDevicePtr device = (AiptekDevicePtr) pInfo->private;
+    AiptekCommonPtr common = device->common;
+
+    int bAbsolute;
+    int x, y, z, xTilt, yTilt;
+
+    if ((DEVICE_ID(device->flags) != common->currentValues.eventType))
+    {
+        DBG(7,"xf86AiptekSendEvents: not the same device type (%u,%u)\n",
+           DEVICE_ID(device->flags), common->currentValues.eventType);
+        return;
+    }
+
+    bAbsolute    = (device->flags & ABSOLUTE_FLAG);
+
+    /*
+     * Normalize X and Y coordinates. This includes dealing
+     * with absolute/relative coordinate mode.
+     */
+    if (bAbsolute)
+    {
+        x = common->currentValues.x;
+        y = common->currentValues.y;
+
+        /* Translate coordinates according to Top and Bottom points.
+         */
+        if (x > device->xBottom) {
+            x = device->xBottom;
+        }
+
+        if (y > device->yBottom) {
+            y = device->yBottom;
+        }
+
+	if (device->xTop > 0) {
+	    DBG(10, "Adjusting x, with xTop=%d\n", device->xTop);
+	    x -= device->xTop;
+	}
+
+	if (device->yTop > 0) {
+	    DBG(10, "Adjusting y, with yTop=%d\n", device->yTop);
+	    y -= device->yTop;
+	}
+
+	if (x < 0) {
+	    x = 0;
+	}
+	if (y < 0) {
+	    y = 0;
+	}
+
+    }
+    else
+    {
+        if (common->previousValues.proximity != 0)
+        {
+            x = common->currentValues.x - common->previousValues.x;
+            y = common->currentValues.y - common->previousValues.y;
+        }
+        else
+        {
+            x = 0;
+            y = 0;
+        }
+    }
+
+    z = r_z;
+    xTilt = common->currentValues.xTilt;
+    yTilt = common->currentValues.yTilt;
+
+    
+    /* Deal with pressure min..max, which differs from threshold. */
+    if (z < device->zMin) {
+        z = 0;
+    }
+
+    if (z > device->zMax) {
+        z = device->zMax;
+    }
+
+    /*
+     * First, handle the macro keys.
+     */
+    if (common->currentValues.macroKey != VALUE_NA)
+    {
+        int i;
+
+        /* This is a little silly, but: The Linux Event Input
+         * system uses a slightly different keymap than does X 
+         * (it also has more keys defined). So, we have to go
+         * through a translation process. It's made sillier than
+         * required because X wants an offset to it's KeySym table,
+         * rather than an event key -- it'll do it's own lookup.
+         * It DOES support arbitrary ordering of key events, and
+         * partial keyboard matrices, so that speaks in favor of this
+         * scheme.
+         */
+        for (i = 0; 
+             i < sizeof(linux_inputDevice_keyMap)/
+                 sizeof(linux_inputDevice_keyMap[0]);
+             ++i)
+        {
+            if (linux_inputDevice_keyMap[i]==common->currentValues.macroKey)
+            {
+                /* First available Keycode begins at 8 => macro+8.
+                 * It's pervasive throughout the Xinput drivers, and
+                 * no, I don't know why they purposively waste the first 8
+                 * positions of the KeySym map...
+                 */
+
+                /* Keyboard 'make' (press) event */
+                xf86PostKeyEvent(pInfo->dev, i+8, TRUE
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 22
+                                 , bAbsolute, 0, 5,
+                                 x, y, common->currentValues.button, xTilt, yTilt
+#endif
+                );
+                /* Keyboard 'break' (depress) event */
+                xf86PostKeyEvent(pInfo->dev, i+8, FALSE
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 22
+                                 , bAbsolute, 0, 5,
+                                 x, y, common->currentValues.button, xTilt, yTilt
+#endif
+                );
+                break;
+            }
+        }
+
+    }
+
+    /* As the coordinates are ready, we can send events to X */
+    if (common->currentValues.proximity)
+    {
+        if (!common->previousValues.proximity)
+                xf86PostProximityEvent(pInfo->dev, 1, 0, 5,
+                    x, y, z, xTilt, yTilt);
+
+        if ((bAbsolute &&
+             (common->previousValues.x != common->currentValues.x ||
+              common->previousValues.y != common->currentValues.y ||
+              common->previousValues.z != common->currentValues.z)) ||
+            (!bAbsolute && 
+             (common->currentValues.x || common->currentValues.y)))
+        {
+            if (bAbsolute || common->previousValues.proximity)
+            {
+                xf86PostMotionEvent(pInfo->dev, bAbsolute, 0, 5,
+                        x, y, z, xTilt, yTilt);
+            }
+        }
+       
+        if (common->previousValues.button != common->currentValues.button)
+        {
+            int delta;
+            delta = common->currentValues.button ^ common->previousValues.button;
+            while(delta)
+            {
+                int id;
+                id = ffs(delta);
+                delta &= ~(1 << (id-1));
+                xf86PostButtonEvent(pInfo->dev, bAbsolute, id,
+                        (common->currentValues.button & (1<<(id-1))), 0, 5,
+                        x, y, z, xTilt, yTilt);
+            }
+        }
+    }
+    else
+    {
+        if (common->previousValues.proximity)
+            xf86PostProximityEvent(pInfo->dev, 0, 0, 5, x, y, z,
+                    xTilt, yTilt);
+        common->previousValues.proximity = 0;
+    }
+}
+
+/*
+ ***************************************************************************
+ * xf86AiptekHIDReadInput --
+ *    Read the new events from the device, and enqueue them.
+ */
+static void
+xf86AiptekHIDReadInput(InputInfoPtr pInfo)
+{
+    AiptekDevicePtr     device = (AiptekDevicePtr) pInfo->private;
+    AiptekCommonPtr     common = device->common;
+
+    ssize_t             len;
+    int                 i;
+    struct input_event* event;
+    char                eventbuf[sizeof(struct input_event) * MAX_EVENTS];
+    int                 eventsInMessage;
+    double              d_z;
+    double              d_zCapacity;
+
+    SYSCALL(len = read(pInfo->fd, eventbuf, sizeof(eventbuf)));
+
+    if (len <= 0)
+    {
+        xf86Msg(X_ERROR, "Error reading Aiptek tablet: %s\n", strerror(errno));
+        return;
+    }
+
+    eventsInMessage = 0;
+    for (event=(struct input_event *)(eventbuf);
+         event<(struct input_event *)(eventbuf+len);
+         ++event)
+    {
+        /*
+         * Unprocessed events:
+         * ABS_RZ - rotate stylus
+         * ABS_DISTANCE - unknown
+         * ABS_THROTTLE - unknown
+         * ABS_WHEEL - we have no wheel
+         * REL_WHEEL - we have no wheel
+         *
+         * Synthesized events
+         * ABS_X_TILT - The aiptek tablet does not report these,
+         * ABS_Y_TILT - but the Linux kernel driver sends synthetic values.
+         */
+        switch (event->type)
+        {
+            case EV_ABS:
+            {
+                switch (event->code)
+                {
+                    case ABS_X:
+                    {
+                        ++eventsInMessage;
+                        common->currentValues.x = event->value;
+                    }
+                    break;
+
+                    case ABS_Y:
+                    {
+                        ++eventsInMessage;
+                        common->currentValues.y = event->value;
+                    }
+                    break;
+
+                    case ABS_PRESSURE:
+                    {
+                        ++eventsInMessage;
+                        common->currentValues.z = event->value;
+                    }
+                    break;
+
+                    case ABS_TILT_X:
+                    case ABS_RZ:
+                    {
+                        ++eventsInMessage;
+                        common->currentValues.xTilt = event->value;
+                    }
+                    break;
+
+                    case ABS_TILT_Y:
+                    {
+                        ++eventsInMessage;
+                        common->currentValues.yTilt = event->value;
+                    }
+                    break;
+
+                    case ABS_DISTANCE:
+                    {
+                        ++eventsInMessage;
+                        common->currentValues.distance = event->value;
+                    }
+                    break;
+
+                    case ABS_WHEEL:
+                    case ABS_THROTTLE:
+                    {
+                        ++eventsInMessage;
+                        common->currentValues.wheel = event->value;
+                    }
+                    break;
+
+                    case ABS_MISC:
+                    {
+                        /* We have an agreement with the
+                         * Linux Aiptek HID driver to send
+                         * the proximity bit through ABS_MISC.
+                         * We do this solely if proximity is
+                         * being reported through the Stylus tool;
+                         * else, if mouse, we'll get proximity through
+                         * REL_MISC.
+                         */
+                        ++eventsInMessage;
+                        common->currentValues.proximity = 
+                            PROXIMITY(event->value) ? 1 : 0;
+                    }
+                    break;
+                }
+            }
+            break; /* EV_ABS */
+
+            case EV_REL:
+            {
+                switch (event->code)
+                {
+                    case REL_X:
+                    {
+                        /* Normalize all relative events into absolute
+                         * coordinates.
+                         */
+                        ++eventsInMessage;
+                        common->currentValues.x = 
+                            common->previousValues.x + event->value;
+                    }
+                    break;
+
+                    case REL_Y:
+                    {
+                        /* Normalize all relative events into absolute
+                         * coordinates.
+                         */
+                        ++eventsInMessage;
+                        common->currentValues.y =
+                            common->previousValues.y + event->value;
+                    }
+                    break;
+
+                    case REL_WHEEL:
+                    {
+                        /* Normalize all relative events into absolute
+                         * coordinates.
+                         */
+                        ++eventsInMessage;
+                        common->currentValues.wheel =
+                            common->previousValues.wheel + event->value;
+                    }
+
+                    case REL_MISC:
+                    {
+                        /* We have an agreement with the
+                         * Linux Aiptek HID driver to send
+                         * the proximity bit through REL_MISC.
+                         * We do this solely if proximity is
+                         * being reported through the Mouse tool;
+                         * else, if stylus, we'll get proximity through
+                         * ABS_MISC.
+                         */
+                        ++eventsInMessage;
+                        common->currentValues.proximity = 
+                            PROXIMITY (event->value) ? 1 : 0;
+                    }
+                    break;
+                }
+            }
+            break; /* EV_REL */
+
+            case EV_KEY:
+            {
+                switch (event->code)
+                {
+                    /*
+                     * Events begun with a BTN_TOOL_PEN, PENCIL,
+                     * BRUSH or AIRBRUSH indicate that they are
+                     * destined for the STYLUS device.
+                     *
+                     * This should probably change, and we should
+                     * have devices for each type. We'll address that
+                     * later.
+                     */
+                    case BTN_TOOL_PEN:
+                    case BTN_TOOL_PENCIL:
+                    case BTN_TOOL_BRUSH:
+                    case BTN_TOOL_AIRBRUSH:
+                    {
+                        ++eventsInMessage;
+                        common->currentValues.eventType = STYLUS_ID;
+                    }
+                    break;
+
+                    /*
+                     * Events begun with a BTN_TOOL_RUBBER indicate
+                     * that they are destined for the ERASER device.
+                     */
+                    case BTN_TOOL_RUBBER:
+                    {
+                        ++eventsInMessage;
+                        common->currentValues.eventType = ERASER_ID;
+                    }
+                    break;
+
+                    /*
+                     * A TOOL_LENS would be for a true PUCK/CURSOR.
+                     * Aiptek instead gives us a mouse, that we can pretend
+                     * is a puck.
+                     */
+                    case BTN_TOOL_MOUSE:
+                    case BTN_TOOL_LENS:
+                    {
+                        ++eventsInMessage;
+                        common->currentValues.eventType = CURSOR_ID;
+                    }
+                    break;
+
+                    /*
+                     * Normal button handling: TOUCH, STYLUS and
+                     * STYLUS2 all buttons that we'll report to X
+                     * as normal buttons.
+                     */
+                    case BTN_TOUCH:
+                    {
+                        ++eventsInMessage;
+                        if (event->value)
+                            common->currentValues.button |= 
+			        BUTTONS_EVENT_TOUCH;
+			else
+			    common->currentValues.button &= 
+			        ~BUTTONS_EVENT_TOUCH;
+                    }
+                    break;
+
+                    case BTN_STYLUS:
+                    {
+                        ++eventsInMessage;
+                        if (event->value)
+                            common->currentValues.button |= 
+			        BUTTONS_EVENT_STYLUS;
+			else
+			    common->currentValues.button &= 
+			        ~BUTTONS_EVENT_STYLUS;
+                    }
+                    break;
+
+                    case BTN_STYLUS2:
+                    {
+                        ++eventsInMessage;
+                        if (event->value)
+                            common->currentValues.button |= 
+			        BUTTONS_EVENT_STYLUS2;
+			else
+			    common->currentValues.button &= 
+			        ~BUTTONS_EVENT_STYLUS2;
+                    }
+                    break;
+
+                    /*
+                     * Normal Mouse button handling: LEFT, RIGHT and
+                     * MIDDLE all buttons that we'll report to X
+                     * as normal buttons. Note that the damned things
+                     * re-use the same bitmasks as the Stylus buttons,
+                     * above.
+                     */
+                    case BTN_LEFT:
+                    {
+                        ++eventsInMessage;
+                        if (event->value)
+                            common->currentValues.button |= 
+			        BUTTONS_EVENT_MOUSE_LEFT;
+			else
+			    common->currentValues.button &= 
+			        ~BUTTONS_EVENT_MOUSE_LEFT;
+                    }
+                    break;
+
+                    case BTN_MIDDLE:
+                    {
+                        ++eventsInMessage;
+                        if (event->value)
+                            common->currentValues.button |= 
+			        BUTTONS_EVENT_MOUSE_MIDDLE;
+			else
+			    common->currentValues.button &= 
+			        ~BUTTONS_EVENT_MOUSE_MIDDLE;
+                    }
+                    break;
+
+                    case BTN_RIGHT:
+                    {
+                        ++eventsInMessage;
+                        if (event->value)
+                            common->currentValues.button |= 
+			        BUTTONS_EVENT_MOUSE_RIGHT;
+			else
+			    common->currentValues.button &= 
+			        ~BUTTONS_EVENT_MOUSE_RIGHT;
+                    }
+                    break;
+
+                    case BTN_SIDE:
+                    {
+                        ++eventsInMessage;
+                        if (event->value)
+                            common->currentValues.button |= 
+			        BUTTONS_EVENT_SIDE_BTN;
+			else
+			    common->currentValues.button &= 
+			        ~BUTTONS_EVENT_SIDE_BTN;
+                    }
+                    break;
+
+                    case BTN_EXTRA:
+                    {
+                        ++eventsInMessage;
+                        if (event->value)
+                            common->currentValues.button |= 
+			        BUTTONS_EVENT_EXTRA_BTN;
+			else
+			    common->currentValues.button &= 
+			        ~BUTTONS_EVENT_EXTRA_BTN;
+                    }
+                    break;
+
+                    /*
+                     * Any other EV_KEY event is assumed to be
+                     * the pressing of a macro key from the tablet.
+                     */
+                    default:
+                    {
+                        ++eventsInMessage;
+                        common->currentValues.macroKey = event->code;
+                    }
+                    break;
+                }
+            }
+            break; /* EV_KEY */
+
+        } /* switch event->type */
+
+        /* We have two potential event terminators. EV_MSC was used
+         * by (unwritten) convention to indicate the end-of-report.
+         * Problem is, EV_MSC is supposed to actually report data,
+         * so a new event type, EV_SYN, was created in Linux 2.5.x
+         * expressively for this purpose.
+         *
+         * Theoretically, if EV_SYN is defined, I should only terminate
+         * the population of device->currentValues struct IFF I receive
+         * that event. The fact of the matter is, the EV_MSC is assumed
+         * to be an ugliness that will take some time to be deprecated.
+         * For the nonce, we'll support both. But, if you have a tablet
+         * that's actually supplying something interesting with EV_MSC,
+         * this is obviously some code that requires modifications.
+         */
+#ifndef EV_SYN
+        if (event->type != EV_MSC)
+#else
+        if (event->type != EV_MSC && event->type != EV_SYN)
+#endif
+        {
+            continue;
+        }
+
+        /*
+         * We've seen EV_MSCs in the incoming data trail with no
+         * other message types in-between. We use 'eventsInMessage'
+         * to count all 'real' messages in-between. If there were none,
+         * do NOT copy common->currentValues to common->previousValues
+         * (as this will make the jitter filter useless). Just go and
+         * read the subsequent events.
+         */
+        if (eventsInMessage == 0)
+        {
+            continue;
+        }
+        eventsInMessage = 0;
+
+        /* 
+         * This filter throws out reports that do not meet minimum threshold
+         * requirements for movement along that axis.
+         *
+         * Presently, we discard the entire report if any dimension of the
+         * currentValues struct does not meet it's minimum threshold.
+         *
+         * Also, we only do the comparison IFF a threshold has been set
+         * for that given dimension.
+         */
+        if (ABS(common->currentValues.x - common->previousValues.x)
+                    <= device->xThreshold &&
+            ABS(common->currentValues.y - common->previousValues.y)
+                    <= device->yThreshold &&
+            ABS(common->currentValues.z - common->previousValues.z)
+                    <= device->zThreshold &&
+            ABS(common->currentValues.xTilt - common->previousValues.xTilt)
+                    <= device->xTiltThreshold &&
+            ABS(common->currentValues.yTilt - common->previousValues.yTilt)
+                    <= device->yTiltThreshold &&
+	    common->currentValues.proximity == 
+                    common->previousValues.proximity &&
+            common->currentValues.button ==
+                    common->previousValues.button &&
+            common->currentValues.macroKey ==
+                    common->previousValues.macroKey)
+        {
+            DBG(10, "Event Filtered Out by Thresholds\n");
+            continue;
+        }
+
+        /*
+         * We have three different methods by which we report pressure, Z.
+         * One is to use linear values from 0 to common->zCapacity. The
+         * other two, SOFT_SMOOTH and HARD_SMOOTH, use different
+         * algorithms to 'smooth out' the values.
+         */
+        d_z         = (double)common->currentValues.z;
+        d_zCapacity = (double)common->zCapacity;
+
+        switch (device->zMode)
+        {
+            case VALUE_NA:
+            case PRESSURE_MODE_LINEAR:
+            {
+                /* Leave Z alone. */
+            }
+            break;
+
+            case PRESSURE_MODE_SOFT_SMOOTH:
+            {
+                d_z = (d_z * d_z / d_zCapacity)+ 0.5;
+            }
+            break;
+
+            case PRESSURE_MODE_HARD_SMOOTH:
+            {
+                d_z = (d_zCapacity * sqrt( d_z / d_zCapacity)) + 0.5;
+            }
+            break;
+        }
+
+        /* Dispatch events to all of our configured devices. */
+        for (i=0; i < common->numDevices; ++i)
+        {
+            AiptekDevicePtr dev = common->deviceArray[i]->private;
+            int             id;
+
+            id  = DEVICE_ID (dev->flags);
+
+            /* Find the device the current events are meant for */
+            if (id == common->currentValues.eventType)
+            {
+                /* We left 'z' alone during smoothing, so send up
+                 * perturbed value outside of the struct
+                 */
+                xf86AiptekSendEvents(common->deviceArray[i], (int) d_z);
+            }
+        }
+
+        /*
+         * Copy the values just processed into the previousValues struct,
+         * so we can check for 'jittering' in the subsequent report.
+         */
+        common->previousValues.eventType = common->currentValues.eventType;
+        common->previousValues.x         = common->currentValues.x;
+        common->previousValues.y         = common->currentValues.y;
+        common->previousValues.z         = common->currentValues.z;
+        common->previousValues.proximity = common->currentValues.proximity;
+        common->previousValues.button    = common->currentValues.button;
+        common->previousValues.macroKey  = common->currentValues.macroKey;
+        common->previousValues.xTilt     = common->currentValues.xTilt;
+        common->previousValues.yTilt     = common->currentValues.yTilt;
+        common->previousValues.distance  = common->currentValues.distance;
+        common->previousValues.wheel     = common->currentValues.wheel;
+
+        common->currentValues.macroKey   = VALUE_NA;
+    }
+}
+
+/*
+ ***************************************************************************
+ *
+ * xf86AiptekHIDOpen --
+ *
+ ***************************************************************************
+ */
+static Bool
+xf86AiptekHIDOpen(InputInfoPtr pInfo)
+{
+    AiptekDevicePtr device = (AiptekDevicePtr)pInfo->private;
+    AiptekCommonPtr common = device->common;
+    char            name[256] = "Unknown";
+    int             abs[5];
+    unsigned long   bit[EV_MAX][NBITS(KEY_MAX)];
+    int             i, j;
+    int             err = 0;
+    int             version;
+
+    pInfo->fd = xf86OpenSerial(pInfo->options);
+    if (pInfo->fd == -1)
+    {
+        xf86Msg(X_ERROR, "xf86AiptekHIDOpen Error opening %s : %s\n", common->deviceName, strerror(errno));
+        return !Success;
+    }
+
+    ioctl(pInfo->fd, EVIOCGNAME(sizeof(name)), name);
+    xf86Msg(X_PROBED, "HID Device name: \"%s\"\n", name);
+
+    ioctl(pInfo->fd, EVIOCGVERSION, &version);
+    xf86Msg(X_PROBED, "HID Driver Version: %d.%d.%d\n",
+            version>>16, (version>>8) & 0xff, version & 0xff);
+
+    xf86Msg(X_PROBED, "HID Driver knows it has %d devices configured\n",
+            common->numDevices);
+    xf86Msg(X_PROBED, "HID Driver is using %d as the fd\n", pInfo->fd);
+
+    for (i = 0; i < common->numDevices; ++i)
+    {
+        common->deviceArray[i]->read_input = xf86AiptekHIDReadInput;
+        common->deviceArray[i]->fd = pInfo->fd;
+    }
+    common->open = xf86AiptekHIDOpen;
+
+    memset(bit, 0, sizeof(bit));
+    ioctl(pInfo->fd, EVIOCGBIT(0, EV_MAX), bit[0]);
+
+    for (i = 0; i < EV_MAX; ++i)
+    {
+        if (TEST_BIT(i, bit[0]))
+        {
+            ioctl(pInfo->fd, EVIOCGBIT(i, KEY_MAX), bit[i]);
+            for (j = 0; j < KEY_MAX; ++j)
+            {
+                if (TEST_BIT(j, bit[i]))
+                {
+                    if (i == EV_ABS)
+                    {
+                        ioctl(pInfo->fd, EVIOCGABS(j), abs);
+                        switch (j) 
+                        {
+                            case ABS_X:
+                            {
+                                xf86Msg(X_ERROR, "From ioctl() xCapacity=%d\n", abs[2]);
+                                common->xCapacity = abs[2];
+                            }
+                            break;
+
+                            case ABS_Y:
+                            {
+                                xf86Msg(X_ERROR, "From ioctl() yCapacity=%d\n", abs[2]);
+                                common->yCapacity = abs[2];
+                            }
+                            break;
+
+                            case ABS_Z:
+                            {
+                                xf86Msg(X_ERROR, "From ioctl() zCapacity=%d\n", abs[2]);
+                                common->zCapacity = abs[2];
+                            }
+                            break;
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    if (err < 0)
+    {
+        xf86Msg(X_ERROR, "xf86AiptekHIDOpen ERROR: %d\n", err);
+        SYSCALL(close(pInfo->fd));
+        return !Success;
+    }
+
+    return Success;
+}
+
+/*
+ * xf86AiptekControlProc
+ */
+static void
+xf86AiptekControlProc(DeviceIntPtr device, PtrCtrl *ctrl)
+{
+    DBG(2, "xf86AiptekControlProc\n");
+}
+
+/*
+** xf86AiptekOpen
+ * Open and initialize the tablet, as well as probe for any needed data.
+ * (This is TTY style open)
+ */
+
+static Bool
+xf86AiptekOpen(InputInfoPtr pInfo)
+{
+    AiptekDevicePtr device = (AiptekDevicePtr)pInfo->private;
+    AiptekCommonPtr common = device->common;
+    int err, version;
+
+    DBG(1, "Opening %s\n", common->deviceName);
+
+    pInfo->fd = xf86OpenSerial(pInfo->options);
+    if (pInfo->fd < 0)
+    {
+        xf86Msg(X_ERROR, "Error opening %s: %s\n", common->deviceName, strerror(errno));
+        return !Success;
+    }
+
+    DBG(1, "Testing USB\n");
+
+    SYSCALL(err = ioctl(pInfo->fd, EVIOCGVERSION, &version));
+    if (!err)
+    {
+        int j;
+
+        SYSCALL(close(pInfo->fd));
+
+        for(j=0; j<common->numDevices; ++j)
+        {
+            common->deviceArray[j]->read_input=xf86AiptekHIDReadInput;
+        }
+        common->open=xf86AiptekHIDOpen;
+
+        return xf86AiptekHIDOpen(pInfo);
+    }
+
+    /* We do not support TTY mode, so just exit angry. */
+    return !Success;
+}
+
+/*
+ * xf86AiptekOpenDevice
+ * Opens and initializes the device driver.
+ */
+static int
+xf86AiptekOpenDevice(DeviceIntPtr pDriver)
+{
+    InputInfoPtr    pInfo  = (InputInfoPtr)pDriver->public.devicePrivate;
+    AiptekDevicePtr   device = pInfo->private;
+    AiptekCommonPtr   common = device->common;
+    double            tabletRatio, screenRatio;
+    double            xFactor, yFactor;
+    int               gap, loop;
+
+    DBG(2, "In xf86AiptekOpenDevice, with fd=%d\n", pInfo->fd);
+
+    if (pInfo->fd < 0)
+    {
+        if (common->initNumber > 2 ||
+            device->initNumber == common->initNumber)
+        {
+            if (common->open(pInfo) != Success)
+            {
+                if (pInfo->fd >= 0)
+                {
+                    SYSCALL(close(pInfo->fd));
+                }
+                pInfo->fd = -1;
+                return !Success;
+            }
+            else
+            {
+                /* Report the file descriptor to all devices */
+                for (loop=0; loop < common->numDevices; ++loop)
+                {
+                    common->deviceArray[loop]->fd = pInfo->fd;
+                }
+            }
+            common->initNumber++;
+        }
+        device->initNumber = common->initNumber;
+    }
+
+    /*
+     * Check our active area parameters. We support the following
+     * three sets of mutually exclusive parameter sets:
+     * 1) xMax/yMax. The origin (0,0) of the active area is the origin
+     *    of the physical tablet. You therefore are describing the
+     *    width and height of that active area.
+     * 2) xOffset/xSize,yOffset/ySize. The origin (0,0) of the active
+     *    area is defined as (xOffset,yOffset) (which we'll report as
+     *    (0,0)). The size of the active area in width and height are
+     *    expressed in coordinates as xSize/ySize. That is to say,
+     *    if xOffset=5; yOffset=5, and xSize=10; ySize=10, then we will 
+     *    have an active area beginning at (5,5) and ending at (15,15).
+     *    Physical coordinate (5,5) is reported as (0,0); (15,15) is 
+     *    reported as (10,10). The rest of the tablet is inert, as far as
+     *    drawing area goes,
+     * 3) xTop/xBottom,yTop/yBottom. The difference between this and
+     *    #2 above is that all four parameters are physical coordinates
+     *    on the tablet. Using the example above, xTop=5; yTop=5, and
+     *    xBottom=15; yBottom=15. It is inferred mathematically that
+     *    the overall active area is 10x10 coordinates.
+     *
+     * NOTE: Mutually exclusive means just that: choose the set of
+     * parameters you like, and use them throughout. If you user xSize,
+     * yOffset and xBottom, we'll have NO idea what you want, and quite
+     * frankly you'll have tempted Fate enough that Bad Things(tm) will
+     * happen to you. Do not complain to us!
+     */
+    if (device->xMax != VALUE_NA ||
+        device->yMax != VALUE_NA)
+    {
+        /* Deal with larger-than-tablet and NA values.
+         */
+        if (device->xMax >  common->xCapacity ||
+            device->xMax == VALUE_NA)
+        {
+            device->xMax = common->xCapacity;
+            xf86Msg(X_CONFIG, "xMax value invalid; adjusting to %d\n",
+                    device->xMax);
+        }
+        if (device->yMax > common->yCapacity ||
+            device->yMax == VALUE_NA)
+        {
+            device->yMax = common->yCapacity;
+            xf86Msg(X_CONFIG,"yMax value invalid; adjusting to %d\n",
+                    device->yMax);
+        }
+
+        /*
+         * Internally we use xTop/yTop/xBottom/yBottom
+         * for everything. It's the easiest for us to work
+         * with, vis-a-vis filtering.
+         */
+
+        device->xTop = 0;
+        device->yTop = 0;
+        device->xBottom = device->xMax;
+        device->yBottom = device->yMax;
+    }
+
+    /*
+     * Deal with xOffset/yOffset;xSize/ySize parameters
+     */
+    if (device->xSize   != VALUE_NA ||
+        device->ySize   != VALUE_NA ||
+        device->xOffset != VALUE_NA ||
+        device->yOffset != VALUE_NA)
+    {
+        int message = 0;
+        /* Simple sanity tests: nothing larger than the
+         * tablet; nothing negative, except for an NA value.
+         */
+        if (device->xOffset  != VALUE_NA &&
+            (device->xOffset >  common->xCapacity ||
+             device->xOffset <  0))
+        {
+            message = 1;
+            device->xOffset = 0;
+        }
+        if (device->yOffset  != VALUE_NA &&
+            (device->yOffset >  common->yCapacity ||
+             device->yOffset <  0))
+        {
+            message = 1;
+            device->yOffset = 0;
+        }
+        if (device->xSize  != VALUE_NA &&
+            (device->xSize >  common->xCapacity ||
+             device->xSize <  0))
+        {
+            message = 1;
+            device->xSize = common->xCapacity;
+        }
+        if (device->ySize  != VALUE_NA &&
+            (device->ySize >  common->yCapacity ||
+             device->ySize <  0))
+        {
+            message = 1;
+            device->ySize = common->yCapacity;
+        }
+
+        /*
+         * If one parameter is set but not the other, we'll
+         * guess at something reasonable for the missing one.
+         */
+        if (device->xOffset == VALUE_NA ||
+            device->xSize   == VALUE_NA)
+        {
+            if (device->xOffset == VALUE_NA)
+            {
+                message = 1;
+                device->xOffset = 0;
+            }
+            else
+            {
+                message = 1;
+                device->xSize = common->xCapacity - device->xOffset;
+            }
+        }
+        if (device->yOffset == VALUE_NA ||
+            device->ySize   == VALUE_NA)
+        {
+            if (device->yOffset == VALUE_NA)
+            {
+                message = 1;
+                device->yOffset = 0;
+            }
+            else
+            {
+                message = 1;
+                device->ySize = common->yCapacity - device->yOffset;
+            }
+        }
+
+        /*
+         * Do not allow the active area to exceed the size of the
+         * tablet. To do this, we have to consider both parameters.
+         * Assumption: xOffset/yOffset is always correct; deliver less
+         * of the tablet than they asked for, if they asked for too much.
+         */
+        if (device->xOffset + device->xSize > common->xCapacity)
+        {
+            message = 1;
+            device->xSize = common->xCapacity - device->xOffset;
+        }
+        if (device->yOffset + device->ySize > common->yCapacity)
+        {
+            message = 1;
+            device->ySize = common->yCapacity - device->yOffset;
+        }
+
+        /*
+         * 'message' is used to indicate that we've changed some parameter
+         * during our filtration process. It's conceivable that we may
+         * have changed parameters several times, so we without commentary
+         * to the very end.
+         */
+        if (message == 1)
+        {
+            xf86Msg(X_CONFIG,"xOffset/yOffset;xSize/ySize values wrong.\n");
+            xf86Msg(X_CONFIG,"xOffset adjusted to %d\n", device->xOffset);
+            xf86Msg(X_CONFIG,"yOffset adjusted to %d\n", device->yOffset);
+            xf86Msg(X_CONFIG,"xSize adjusted to %d\n", device->xSize);
+            xf86Msg(X_CONFIG,"ySize adjusted to %d\n", device->ySize);
+        }
+
+        /*
+         * Internally we use xTop/yTop/xBottom/yBottom
+         * for everything. It's the easiest for us to work
+         * with, vis-a-vis filtering.
+         */
+        device->xTop    = device->xOffset;
+        device->yTop    = device->yOffset;
+        device->xBottom = device->xOffset + device->xSize;
+        device->yBottom = device->yOffset + device->ySize;
+    }
+
+    /*
+     * Third set of parameters. Because everything internally
+     * is expressed as xTop/yTop, etc., I'll do tests on transformed
+     * values from the other parameters as need. My last chance to do
+     * so.
+     */
+    if (device->xTop == VALUE_NA ||
+        device->xTop <  0 ||
+        device->xTop >  common->xCapacity)
+    {
+        device->xTop = 0;
+        xf86Msg(X_CONFIG,"xTop invalid; adjusted to %d\n", device->xTop);
+    }
+    if (device->yTop == VALUE_NA ||
+        device->yTop <  0 ||
+        device->yTop >  common->yCapacity)
+    {
+        device->yTop = 0;
+        xf86Msg(X_CONFIG,"yTop invalid; adjusted to %d\n", device->yTop);
+    }
+    if (device->xBottom == VALUE_NA ||
+        device->xBottom <  0 ||
+        device->xBottom >  common->xCapacity)
+    {
+        device->xBottom = common->xCapacity;
+        xf86Msg(X_CONFIG,"xBottom invalid; adjusted to %d\n", 
+                device->xBottom);
+    }
+    if (device->yBottom == VALUE_NA ||
+        device->yBottom <  0 ||
+        device->yBottom >  common->yCapacity)
+    {
+        device->yBottom = common->yCapacity;
+        xf86Msg(X_CONFIG,"yBottom invalid; adjusted to %d\n", 
+                    device->yBottom);
+    }
+
+    /*
+     * Determine the X screen we're going to be using.
+     * If NA, or larger than the number of screens we
+     * have, or negative, we've going for screen 0, e.g.,
+     * 'default' screen.
+     */
+    if ( device->screenNo >= screenInfo.numScreens ||
+         device->screenNo == VALUE_NA ||
+         device->screenNo < 0) 
+    {
+        device->screenNo = 0;
+        xf86Msg(X_CONFIG,"ScreenNo invalid; adjusted to %d\n", 
+                device->screenNo);
+    }
+
+    /* Calculate the ratio according to KeepShape, TopX and TopY */
+
+    if (device->flags & KEEP_SHAPE_FLAG)
+    {
+        int xDiff, yDiff;
+
+        xDiff = common->xCapacity - device->xTop;
+        yDiff = common->yCapacity - device->yTop;
+
+        tabletRatio = (double) xDiff / (double) yDiff;
+        screenRatio = (double) screenInfo.screens[device->screenNo]->width /
+                      (double) screenInfo.screens[device->screenNo]->height;
+
+        DBG(2, "Screen %d: screenRatio = %.3g, tabletRatio = %.3g\n",
+                  device->screenNo, screenRatio, tabletRatio);
+
+        if (screenRatio > tabletRatio)
+        {
+            gap = (int)((double)common->yCapacity *
+                       (1.0 - tabletRatio/screenRatio));
+            device->xBottom = common->xCapacity;
+            device->yBottom = common->yCapacity - gap;
+            DBG(2, "Screen %d: 'Y' Gap of %d computed\n",
+                  device->screenNo, gap);
+        }
+        else
+        {
+            gap = (int)((double)common->xCapacity *
+                       (1.0 - screenRatio/tabletRatio));
+            device->xBottom = common->xCapacity - gap;
+            device->yBottom = common->yCapacity;
+            DBG(2, "Screen %d: 'X' Gap of %d computed\n",
+                  device->screenNo, gap);
+        }
+    }
+
+    xFactor = (double)screenInfo.screens[device->screenNo]->width/
+        (double)(device->xBottom - device->xTop);
+    yFactor = (double)screenInfo.screens[device->screenNo]->height/
+        (double)(device->yBottom - device->yTop);
+
+    /* 
+     * Check threshold correctness
+     */
+    if (device->xThreshold > common->xCapacity ||
+        device->xThreshold == VALUE_NA ||
+        device->xThreshold <  0)
+    {
+        device->xThreshold = 0;
+    }
+
+    if (device->yThreshold > common->yCapacity ||
+        device->yThreshold == VALUE_NA ||
+        device->yThreshold < 0)
+    {
+        device->yThreshold = 0;
+    }
+
+    if (device->zThreshold > common->zCapacity ||
+        device->zThreshold == VALUE_NA ||
+        device->zThreshold < 0) 
+    {
+        device->zThreshold = 0;
+    }
+
+    /* Create axisStructs for every axis we support.
+     * NOTE: min_resolution and max_resolution infers to
+     * me a programmability to increase/decrease resolution.
+     * We don't support that, so min & max = current_resolution.
+     */
+    InitValuatorAxisStruct(pDriver,                 /* X resolution */
+               0,                                   /* axis_id */
+               XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X),
+               0,                                   /* min value */
+               device->xBottom - device->xTop,      /* max value */
+               LPI2CPM(375),                        /* resolution */
+               LPI2CPM(375),                        /* min_resolution */
+               LPI2CPM(375),                        /* max_resolution */
+               Absolute);
+
+    InitValuatorAxisStruct(pDriver,                 /* Y Resolution */
+               1,                                   /* axis_id */
+               XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y),
+               0,                                   /* min value */
+               device->yBottom - device->yTop,      /* max value */
+               LPI2CPM(375),                        /* resolution */
+               LPI2CPM(375),                        /* min_resolution */
+               LPI2CPM(375),                        /* max_resolution */
+               Absolute);
+
+    InitValuatorAxisStruct(pDriver,                 /* Pressure */
+               2,                                   /* axis_id */
+               XIGetKnownProperty(AXIS_LABEL_PROP_ABS_PRESSURE),
+               0,                                   /* min value */
+               511,                                 /* max value */
+               512,                                 /* resolution */
+               512,                                 /* min_resolution */
+               512,                                 /* max_resolution */
+               Absolute);
+
+    InitValuatorAxisStruct(pDriver,                 /* xTilt */
+               3,                                   /* axis id */
+               XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_X),
+               -128,                                /* min value */
+               127,                                 /* max value */
+               256,                                 /* resolution */
+               256,                                 /* min_resolution */
+               256,                                 /* max_resolution */
+               Absolute);
+
+    InitValuatorAxisStruct(pDriver,                 /* yTilt */
+               4,                                   /* axis_id */
+               XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_Y),
+               -128,                                /* min value */
+               127,                                 /* max value */
+               256,                                 /* resolution */
+               256,                                 /* min_resolution */
+               256,                                 /* max_resolution */
+               Absolute);
+
+    /*
+     * The sixth axis would be for wheel support. We do not have
+     * any wheel devices. But if we did, it would be allocated
+     * here.
+     */
+    return (pInfo->fd != -1);
+}
+
+/*
+ * xf86AiptekProc
+ *
+ *  Call dispatcher for this driver.
+ */
+static int
+xf86AiptekProc(DeviceIntPtr pAiptek, int requestCode)
+{
+    CARD8           map[512+1];
+    int             numAxes = 5; /* X, Y, Z, xTilt, yTilt */
+    int             numButtons = 5;
+    int             loop;
+    InputInfoPtr  pInfo  = (InputInfoPtr)pAiptek->public.devicePrivate;
+    AiptekDevicePtr device = pInfo->private;
+    Atom            btn_labels[numAxes];
+    Atom            axes_labels[numButtons];
+
+    DBG(2, "xf86AiptekProc() type=%s flags=%d request=%d\n",
+              (DEVICE_ID(device->flags) == STYLUS_ID) ? "stylus" :
+              (DEVICE_ID(device->flags) == CURSOR_ID) ? "cursor" : "eraser",
+              device->flags, requestCode);
+
+    switch (requestCode)
+    {
+        case DEVICE_INIT:
+        {
+            DBG(1, "xf86AiptekProc request=INIT\n");
+
+            for(loop=1; loop<=numButtons; ++loop)
+            {
+                map[loop] = loop;
+            }
+
+            btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
+            btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE);
+            btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT);
+            btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP);
+            btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN);
+
+            memset(axes_labels, 0, sizeof(axes_labels));
+
+            if (InitButtonClassDeviceStruct(pAiptek,numButtons,
+                                            btn_labels, map) == FALSE)
+            {
+                xf86Msg(X_ERROR, "Unable to init Button Class Device\n");
+                return !Success;
+            }
+
+            if (InitFocusClassDeviceStruct(pAiptek) == FALSE) 
+            {
+                xf86Msg(X_ERROR, "Unable to init Focus Class Device\n");
+                return !Success;
+            }
+
+            if (InitPtrFeedbackClassDeviceStruct(pAiptek,
+                        xf86AiptekControlProc) == FALSE)
+            {
+                xf86Msg(X_ERROR, "Unable to init Pointer Feedback Class Device\n");
+                return !Success;
+            }
+
+            if (InitProximityClassDeviceStruct(pAiptek) == FALSE)
+            {
+                xf86Msg(X_ERROR, "Unable to init Proximity Class Device\n");
+                return !Success;
+            }
+
+            /* we don't label the axes here, done later in
+             * xf86AiptedOpenDevice */
+            if (InitValuatorClassDeviceStruct(pAiptek, numAxes,
+                                              axes_labels, GetMotionHistorySize(),
+                                              ((device->flags & ABSOLUTE_FLAG) ? Absolute : Relative) | OutOfProximity ) == FALSE)
+            {
+                xf86Msg(X_ERROR, "Unable to allocate Valuator Class Device\n");
+                return !Success;
+            }
+
+            /* Allocate the motion history buffer if needed */
+            xf86MotionHistoryAllocate(pInfo);
+
+            /* Open the device to gather information */
+            xf86AiptekOpenDevice(pAiptek);
+        }
+        break;
+
+        case DEVICE_ON:
+        {
+            DBG(1, "xf86AiptekProc request=ON\n");
+
+            if ((pInfo->fd < 0) &&
+                (!xf86AiptekOpenDevice(pAiptek)))
+            {
+                xf86Msg(X_ERROR, "Unable to open aiptek device\n");
+                return !Success;
+            }
+            xf86Msg(X_INFO, "Able to open aiptek device\n");
+            xf86AddEnabledDevice(pInfo);
+            pAiptek->public.on = TRUE;
+        }
+        break;
+
+        case DEVICE_OFF:
+        {
+	    DBG(1, "xf86AiptekProc request=OFF\n");
+            if (pInfo->fd >= 0)
+            {
+                xf86RemoveEnabledDevice(pInfo);
+                xf86AiptekClose(pInfo);
+            }
+            pAiptek->public.on = FALSE;
+        }
+        break;
+
+        case DEVICE_CLOSE:
+        {
+	    DBG(1, "xf86AiptekProc request=CLOSE\n");
+            xf86AiptekClose(pInfo);
+        }
+        break;
+
+        default:
+        {
+            xf86Msg(X_ERROR, "xf86AiptekProc - Unsupported mode=%d\n", requestCode);
+            return !Success;
+        }
+        break;
+    }
+    DBG(2, "xf86AiptekProc Success request=%d\n", requestCode );
+    return Success;
+}
+
+/*
+ * xf86AiptekClose
+ * Perhaps this will close the device
+ */
+static void
+xf86AiptekClose(InputInfoPtr pInfo)
+{
+    if (pInfo->fd >= 0)
+    {
+        SYSCALL(close(pInfo->fd));
+    }
+    pInfo->fd = -1;
+}
+
+/*
+ * xf86AiptekChangeControl
+ * Allow the user to change the tablet resolution -- we have an issue
+ * insofar as we don't know how to write to the tablet. And furthermore,
+ * even if we DID know how to write to the tablet, it doesn't support
+ * a "change resolution" call. We tried to avoid this by claiming when
+ * creating axisStructs that minRes = curRes = maxRes. So, we should never
+ * get dispatched.
+ */
+static int
+xf86AiptekChangeControl(InputInfoPtr pInfo, xDeviceCtl *control)
+{
+    xDeviceResolutionCtl    *res;
+    int                     *resolutions;
+
+    DBG(3, "xf86AiptekChangeControl() entered\n");
+
+    res = (xDeviceResolutionCtl *)control;
+    
+    if ((control->control != DEVICE_RESOLUTION) ||
+        (res->num_valuators < 1))
+    {
+        DBG(3, "xf86AiptekChangeControl abends\n");
+        return (BadMatch);
+    }
+
+    resolutions = (int *)(res +1);
+    
+    DBG(3, "xf86AiptekChangeControl changing to res %d\n",
+              resolutions[0]);
+
+    /* We don't know how to write, yet
+     *
+     * sprintf(str, "SU%d\r", resolutions[0]);
+     * SYSCALL(write(pInfo->fd, str, strlen(str)));
+     */
+
+    return(Success);
+}
+
+/*
+ * xf86AiptekSwitchMode
+ * Switches the mode. For now just absolute or relative, hopefully
+ * more on the way.
+ */
+static int
+xf86AiptekSwitchMode(ClientPtr client, DeviceIntPtr dev, int mode)
+{
+    InputInfoPtr  pInfo  = (InputInfoPtr)dev->public.devicePrivate;
+    AiptekDevicePtr device = (AiptekDevicePtr)(pInfo->private);
+
+    DBG(3, "xf86AiptekSwitchMode() dev=%p mode=%d\n", dev, mode);
+
+    switch(mode)
+    {
+        case Absolute:
+        {
+            device->flags |= ABSOLUTE_FLAG;
+        }
+        break;
+
+        case Relative:
+        {
+            device->flags &= ~ABSOLUTE_FLAG;
+        }
+        break;
+
+        default:
+        {
+            DBG(1, "xf86AiptekSwitchMode dev=%p invalid mode=%d\n",
+                   dev, mode);
+            return BadMatch;
+        }
+        break;
+    }
+
+    return Success;
+}
+
+/*
+ * xf86AiptekInitialize
+ * Initializes the device structures for the Aiptek.
+ */
+static int
+xf86AiptekAllocate(InputInfoPtr pInfo,
+                   char* name,
+                   int   flag)
+{
+    InputInfoPtr*   deviceArray;
+    AiptekDevicePtr   device;
+    AiptekCommonPtr   common;
+
+    DBG(3, "xf86AiptekAllocate, with %s and %d\n", name, flag);
+
+    device = (AiptekDevicePtr) malloc(sizeof(AiptekDeviceRec));
+    if (!device)
+    {
+        DBG(3, "xf86AiptekAllocate failed to allocate 'device'\n");
+        return BadAlloc;
+    }
+
+    common = (AiptekCommonPtr) malloc(sizeof(AiptekCommonRec));
+    if (!common)
+    {
+        DBG(3, "xf86AiptekAllocate failed to allocate 'common'\n");
+        free(device);
+        return BadAlloc;
+    }
+
+    deviceArray = (InputInfoPtr*) malloc(sizeof(InputInfoPtr));
+    if (!deviceArray)
+    {
+        DBG(3, "xf86AiptekAllocate failed to allocate 'deviceArray'\n");
+        free(device);
+        free(common);
+        return BadAlloc;
+    }
+
+    pInfo->type_name =                  "Aiptek";
+    pInfo->device_control =             xf86AiptekProc;
+    pInfo->read_input =                 xf86AiptekHIDReadInput;
+    pInfo->control_proc =               xf86AiptekChangeControl;
+    pInfo->switch_mode =                xf86AiptekSwitchMode;
+
+    pInfo->fd =             VALUE_NA;
+    pInfo->private =        device;
+
+    device->flags =         flag;       /* various flags (device type, 
+                                         * coordinate type */
+    device->xSize =         VALUE_NA; /* Active Area X */
+    device->ySize =         VALUE_NA; /* Active Area Y */
+    device->xOffset =       VALUE_NA; /* Active area offset X */
+    device->yOffset =       VALUE_NA; /* Active area offset Y */
+    device->xMax =          VALUE_NA; /* Max allowed X value */
+    device->yMax =          VALUE_NA; /* Max allowed Y value */
+    device->zMin =          VALUE_NA; /* Min allowed Z value */
+    device->zMax =          VALUE_NA; /* Max allowed Z value */
+    device->xTop =          VALUE_NA; /* Upper Left X coordinate */
+    device->yTop =          VALUE_NA; /* Upper Left Y coordinate */
+    device->xBottom =       VALUE_NA; /* Lower Right X coordinate */
+    device->yBottom =       VALUE_NA; /* Lower Right Y coordinate */
+    device->xThreshold =    VALUE_NA; /* X delta must be greater than */
+    device->yThreshold =    VALUE_NA; /* Y delta must be greater than */
+    device->zThreshold =    VALUE_NA; /* Z delta must be greater than */
+    device->xTiltThreshold =VALUE_NA;
+    device->yTiltThreshold =VALUE_NA;
+    device->zMode =         VALUE_NA; /* Z: linear, soft, hard log */
+
+    device->initNumber =    VALUE_NA; /* avoid re-init devices */
+    device->screenNo =      VALUE_NA; /* Attached to X screen */
+
+    device->common =        common;   /* Common info pointer */
+
+    /* Record of the event currently being read of the queue */
+    common->currentValues.eventType = STYLUS_ID;   
+                                      /* Device event is for, e.g., */
+                                      /* STYLUS, RUBBER, CURSOR */
+                                      /* Starting with stylus as default */
+    common->currentValues.x         = 0;   /* X coordinate */
+    common->currentValues.y         = 0;   /* Y coordinate */
+    common->currentValues.z         = 0;   /* Z (pressure) */
+    common->currentValues.xTilt     = 0;   /* XTilt */
+    common->currentValues.yTilt     = 0;   /* YTilt */
+    common->currentValues.proximity = 0;   /* proximity bit */
+    common->currentValues.macroKey  = VALUE_NA;   /* tablet macro key code */
+    common->currentValues.button    = 0;   /* bitmask of buttons pressed */
+    common->currentValues.distance  = 0;   /* currently unsupported */
+    common->currentValues.wheel     = 0;   /* likewise */
+
+    /* Record of the event previously read off of the queue */
+    common->previousValues.eventType = 0;  /* Same comments as above */
+    common->previousValues.x         = 0;
+    common->previousValues.y         = 0;
+    common->previousValues.z         = 0;
+    common->previousValues.xTilt     = 0;
+    common->previousValues.yTilt     = 0;
+    common->previousValues.proximity = 0;
+    common->previousValues.macroKey  = VALUE_NA;
+    common->previousValues.button    = 0;
+    common->previousValues.distance  = 0;
+    common->previousValues.wheel     = 0;
+
+    common->deviceName =    "";             /* device file name */
+    common->flags =         0;              /* various flags */
+    common->deviceArray =   deviceArray;    /* Array of tablets */
+    common->deviceArray[0]= pInfo;          /* with pInfo as element */
+    common->numDevices =    1;              /* number of devices */
+
+    common->xCapacity =     0;              /* tablet's max X value */
+    common->yCapacity =     0;              /* tablet's max Y value */
+    common->zCapacity =     0;              /* tablet's max Z value */
+    common->open =          xf86AiptekOpen; /* Open function */
+
+    return Success;
+}
+
+/*
+ * xf86AiptekAllocateStylus
+ */
+static int
+xf86AiptekAllocateStylus(InputInfoPtr pInfo)
+{
+    int rc;
+
+    rc = xf86AiptekAllocate(pInfo, XI_STYLUS, STYLUS_ID);
+    pInfo->type_name = "Stylus";
+
+    return rc;
+}
+
+/*
+ * xf86AiptekAllocateCursor
+ */
+static int
+xf86AiptekAllocateCursor(InputInfoPtr pInfo)
+{
+    int rc;
+
+    rc = xf86AiptekAllocate(pInfo, XI_CURSOR, CURSOR_ID);
+    pInfo->type_name = "Cursor";
+
+    return rc;
+}
+
+/*
+ * xf86AiptekAllocateEraser
+ */
+static int
+xf86AiptekAllocateEraser(InputInfoPtr pInfo)
+{
+    int rc;
+
+    rc = xf86AiptekAllocate(pInfo, XI_ERASER, ABSOLUTE_FLAG|ERASER_ID);
+    pInfo->type_name = "Eraser";
+
+    return rc;
+}
+
+/*
+ * xf86AiptekUninit --
+ *
+ * called when the driver is unloaded.
+ */
+static void
+xf86AiptekUninit(InputDriverPtr    drv,
+                 InputInfoPtr    pInfo,
+                 int               flags)
+{
+    AiptekDevicePtr device = (AiptekDevicePtr) pInfo->private;
+
+    DBG(1, "xf86AiptekUninit\n");
+
+    if (device)
+    {
+        if (device->common)
+        {
+            AiptekCommonPtr common = device->common;
+            int i;
+
+            common->numDevices--;
+
+            for (i = 0; i < common->numDevices; i++)
+            {
+                if (common->deviceArray[i] == pInfo)
+                    memmove(&common->deviceArray[i],
+                            &common->deviceArray[i+1],
+                            (common->numDevices - i) * sizeof(InputInfoPtr));
+            }
+
+            if (common->numDevices == 0)
+                free(common);
+        }
+        device->common = NULL;
+    }
+    pInfo->private = NULL;
+    xf86DeleteInput(pInfo, 0);
+}
+
+/*
+ * xf86AiptekInit --
+ *
+ * Called when the module subsection is found in XF86Config
+ */
+static int
+xf86AiptekInit(InputDriverPtr    drv,
+               InputInfoPtr      pInfo,
+               int               flags)
+{
+    AiptekDevicePtr   device    = NULL;
+    AiptekCommonPtr   common    = NULL;
+    InputInfoPtr    pInfos;
+    char*             s;
+    int               shared;
+    int               rc = BadValue;
+
+    aiptekDrv = drv;
+
+    xf86Msg(X_INFO, "xf86AiptekInit(): begins\n");
+
+/* Type */
+    s = xf86FindOptionValue(pInfo->options, "Type");
+    if (s && (xf86NameCmp(s, "stylus") == 0))
+    {
+        rc = xf86AiptekAllocateStylus(pInfo);
+    }
+    else if (s && (xf86NameCmp(s, "cursor") == 0))
+    {
+        rc = xf86AiptekAllocateCursor(pInfo);
+    }
+    else if (s && (xf86NameCmp(s, "eraser") == 0))
+    {
+        rc = xf86AiptekAllocateEraser(pInfo);
+    }
+    else
+    {
+        xf86Msg(X_ERROR, "%s: No type or invalid type specified.\n"
+                  "Must be one of 'stylus', 'cursor', or 'eraser'\n",
+                  pInfo->name);
+    }
+
+    if(rc != Success)
+        return rc;
+
+    device = (AiptekDevicePtr) pInfo->private;
+
+    common              = device->common;
+
+/* Device */
+/* (mandatory) */
+    common->deviceName = xf86FindOptionValue(pInfo->options, "Device");
+    if(!common->deviceName)
+    {
+        xf86Msg(X_ERROR, "%s: No Device specified.\n", pInfo->name);
+        goto SetupProc_fail;
+    }
+
+    /*
+     * Lookup to see if there is another aiptek device sharing the
+     * same device.
+     */
+
+    shared = 0;
+    for (pInfos = xf86FirstLocalDevice();
+         pInfos != NULL;
+         pInfos = pInfos->next)
+    {
+        if((pInfo != pInfos) &&
+           (pInfos->device_control == xf86AiptekProc) &&
+           (strcmp(((AiptekDevicePtr)pInfos->private)->common->deviceName,
+                    common->deviceName) == 0))
+        {
+            xf86Msg(X_CONFIG,
+                    "xf86AiptekConfig: device shared between %s and %s\n",
+                    pInfo->name,
+                    pInfos->name);
+
+            shared = 1;
+
+            free(common->deviceArray);
+            free(common);
+
+            common = device->common =
+                ((AiptekDevicePtr) pInfos->private)->common;
+            common->numDevices++;
+            common->deviceArray = (InputInfoPtr*)realloc(common->deviceArray,
+                    sizeof(InputInfoPtr)*common->numDevices);
+            common->deviceArray[common->numDevices-1] = pInfo;
+            break;
+        }
+        else
+        {
+            xf86Msg(X_CONFIG, 
+                    "xf86AiptekConfig: device not shared btw %s and %s\n",
+                    pInfo->name, pInfos->name);
+        }
+    }
+
+    /* Process the common options */
+    xf86ProcessCommonOptions(pInfo, pInfo->options);
+
+    /* If this is the first device using the aiptek driver, let's open
+     * the interface so as to obtain legit values for xCapacity and yCapacity
+     * (and then quickly close it). Yes, the word for this is "kludge".
+     * I am sufficiently ashamed :-) TODO kludge alert!
+     */
+    if ( shared == 0)
+    {
+        xf86AiptekHIDOpen(pInfo);
+        close(pInfo->fd);
+        pInfo->fd=-1;
+    }
+
+    /* Optional configuration */
+    xf86Msg(X_CONFIG, "%s device is %s\n", pInfo->name,
+            common->deviceName);
+
+/* DebugLevel */
+    debug_level = xf86SetIntOption(pInfo->options, "DebugLevel", debug_level);
+    if ( debug_level > 0)
+    {
+        xf86Msg(X_CONFIG, "Debug level set to %d\n", debug_level);
+    }
+
+/* zMode */
+    s = xf86FindOptionValue(pInfo->options, "Pressure");
+    if ( s && (xf86NameCmp(s, "hard") == 0))
+    {
+        device->zMode = PRESSURE_MODE_HARD_SMOOTH;
+    }
+    else if ( s && (xf86NameCmp(s, "soft") == 0))
+    {
+        device->zMode = PRESSURE_MODE_SOFT_SMOOTH;
+    }
+    else if (s && (xf86NameCmp(s, "normal") == 0))
+    {
+        device->zMode = PRESSURE_MODE_LINEAR;
+    }
+    else if (s)
+    {
+        xf86Msg(X_ERROR, "%s: invalid Mode ('normal', 'soft' or 'hard').\n",
+            pInfo->name);
+    }
+
+/* Mode */
+    s = xf86FindOptionValue(pInfo->options, "Mode");
+    if (s && (xf86NameCmp(s, "absolute") == 0))
+    {
+        device->flags |= ABSOLUTE_FLAG;
+    }
+    else if (s && (xf86NameCmp(s, "relative") == 0)) 
+    {
+        device->flags &= ~ABSOLUTE_FLAG;
+    }
+    else if (s)
+    {
+        xf86Msg(X_ERROR, "%s: invalid Mode ('absolute' or 'relative').\n",
+            pInfo->name);
+        device->flags |= ABSOLUTE_FLAG;
+    }
+    xf86Msg(X_CONFIG, "%s is in %s mode\n", pInfo->name,
+        (device->flags & ABSOLUTE_FLAG) ? "absolute" : "relative");
+
+#ifdef HAVE_LINUX_INPUT_H
+    /* The define-name is accurate; the XFree86 keyword is not. We are
+     * reading from a Linux kernel "Input" device. The Input device
+     * layer generally supports mice, joysticks, and keyboards. As
+     * an extension, the Input device layer also supports HID devices.
+     * HID is a standard specified by the USB Implementors Forum. Ergo,
+     * 99.9% of HID devices are USB devices.
+     *
+     * This option is misnamed, misunderstood, misanthrope. Maybe.
+     */
+    if (xf86SetBoolOption(pInfo->options, "USB",
+                          (common->open == xf86AiptekHIDOpen)))
+    {
+        pInfo->read_input=xf86AiptekHIDReadInput;
+        common->open=xf86AiptekHIDOpen;
+        xf86Msg(X_CONFIG, "%s: reading USB link\n", pInfo->name);
+    }
+#else
+    if (xf86SetBoolOption(pInfo->options, "USB", 0))
+    {
+        xf86Msg(X_ERROR, "The Aiptek USB driver isn't available for your platform.\n");
+        goto SetupProc_fail;
+    }
+#endif
+
+/* ScreenNo */
+    device->screenNo = xf86SetIntOption(pInfo->options, "ScreenNo", VALUE_NA);
+    if (device->screenNo != VALUE_NA)
+    {
+        xf86Msg(X_CONFIG, "%s: attached to screen number %d\n",
+                pInfo->name, device->screenNo);
+    }
+
+/* KeepShape */
+    if (xf86SetBoolOption(pInfo->options, "KeepShape", 0))
+    {
+        device->flags |= KEEP_SHAPE_FLAG;
+        xf86Msg(X_CONFIG, "%s: keeps shape\n", pInfo->name);
+    }
+
+/* XSize */
+    device->xSize = xf86SetIntOption(pInfo->options, "XSize", device->xSize);
+    device->xSize = xf86SetIntOption(pInfo->options, "SizeX", device->xSize);
+    if (device->xSize != VALUE_NA) 
+    {
+        xf86Msg(X_CONFIG, "%s: XSize/SizeX = %d\n", pInfo->name,
+                device->xSize);
+    }
+
+/* YSize */
+    device->ySize = xf86SetIntOption(pInfo->options, "YSize", device->ySize);
+    device->ySize = xf86SetIntOption(pInfo->options, "SizeY", device->ySize);
+    if (device->ySize != VALUE_NA) 
+    {
+        xf86Msg(X_CONFIG, "%s: YSize/SizeY = %d\n", pInfo->name,
+                device->ySize);
+    }
+
+/* XOffset */
+    device->xOffset = xf86SetIntOption(pInfo->options, "XOffset",
+            device->xOffset);
+    device->xOffset = xf86SetIntOption(pInfo->options, "OffsetX",
+            device->xOffset);
+    if (device->xOffset != VALUE_NA)
+    {
+        xf86Msg(X_CONFIG, "%s: XOffset/OffsetX = %d\n", pInfo->name,
+                device->xOffset);
+    }
+
+/* YOffset */
+    device->yOffset = xf86SetIntOption(pInfo->options, "YOffset",
+            device->yOffset);
+    device->yOffset = xf86SetIntOption(pInfo->options, "OffsetY",
+            device->yOffset);
+    if (device->yOffset != VALUE_NA)
+    {
+        xf86Msg(X_CONFIG, "%s: YOffset/OffsetY = %d\n", pInfo->name,
+                device->yOffset);
+    }
+
+/* XThreshold */
+    device->xThreshold = xf86SetIntOption(pInfo->options, "XThreshold",
+            device->xThreshold);
+    device->xThreshold = xf86SetIntOption(pInfo->options, "ThresholdX",
+            device->xThreshold);
+    if (device->xThreshold != VALUE_NA)
+    {
+        xf86Msg(X_CONFIG, "%s: XThreshold/ThresholdX = %d\n",
+                pInfo->name, device->xThreshold);
+    }
+
+/* YThreshold */
+    device->yThreshold = xf86SetIntOption(pInfo->options, "YThreshold",
+            device->yThreshold);
+    device->yThreshold = xf86SetIntOption(pInfo->options, "ThresholdY",
+            device->yThreshold);
+    if (device->yThreshold != VALUE_NA)
+    {
+        xf86Msg(X_CONFIG, "%s: YThreshold/ThresholdY = %d\n",
+                pInfo->name, device->yThreshold);
+    }
+
+/* ZThreshold */
+    device->zThreshold = xf86SetIntOption(pInfo->options, "ZThreshold",
+            device->zThreshold);
+    device->zThreshold = xf86SetIntOption(pInfo->options, "ThresholdZ",
+            device->zThreshold);
+    if (device->zThreshold != VALUE_NA)
+    {
+        xf86Msg(X_CONFIG, "%s: ZThreshold/ThresholdZ = %d\n",
+                pInfo->name, device->zThreshold);
+    }
+
+/* XTiltThreshold */
+    device->xTiltThreshold = xf86SetIntOption(pInfo->options, "XTiltThreshold",
+            device->xTiltThreshold);
+    device->xTiltThreshold = xf86SetIntOption(pInfo->options, "ThresholdXTilt",
+            device->xTiltThreshold);
+    if (device->xTiltThreshold != VALUE_NA)
+    {
+        xf86Msg(X_CONFIG, "%s: XTiltThreshold = %d\n",
+                pInfo->name, device->xTiltThreshold);
+    }
+
+/* YTiltThreshold */
+    device->yTiltThreshold = xf86SetIntOption(pInfo->options, "YTiltThreshold",
+            device->yTiltThreshold);
+    device->yTiltThreshold = xf86SetIntOption(pInfo->options, "ThresholdYTilt",
+            device->yTiltThreshold);
+    if (device->yTiltThreshold != VALUE_NA)
+    {
+        xf86Msg(X_CONFIG, "%s: YTiltThreshold = %d\n",
+                pInfo->name, device->yTiltThreshold);
+    }
+
+/* XMax */
+    device->xMax = xf86SetIntOption(pInfo->options, "XMax", device->xMax);
+    device->xMax = xf86SetIntOption(pInfo->options, "MaxX", device->xMax);
+    if (device->xMax != VALUE_NA)
+    {
+        xf86Msg(X_CONFIG, "%s: XMax/MaxX = %d\n", pInfo->name,
+                device->xMax);
+    }
+
+/* YMax */
+    device->yMax = xf86SetIntOption(pInfo->options, "YMax", device->yMax);
+    device->yMax = xf86SetIntOption(pInfo->options, "MaxY", device->yMax);
+    if (device->yMax != VALUE_NA)
+    {
+        xf86Msg(X_CONFIG, "%s: YMax/MaxY = %d\n", pInfo->name,
+                device->yMax);
+    }
+
+/* ZMax */
+    device->zMax = xf86SetIntOption(pInfo->options, "ZMax", device->zMax);
+    device->zMax = xf86SetIntOption(pInfo->options, "MaxZ", device->zMax);
+    if (device->zMax != VALUE_NA)
+    {
+        xf86Msg(X_CONFIG, "%s: ZMax/MaxZ = %d\n", pInfo->name,
+                device->zMax);
+    }
+
+/* ZMin */
+    device->zMin = xf86SetIntOption(pInfo->options, "ZMin", device->zMin);
+    device->zMin = xf86SetIntOption(pInfo->options, "MinZ", device->zMin);
+    if (device->zMin != VALUE_NA)
+    {
+        xf86Msg(X_CONFIG, "%s: ZMin/MinZ = %d\n", pInfo->name,
+                device->zMin);
+    }
+
+/* TopX */
+    device->xTop = xf86SetIntOption(pInfo->options, "TopX", device->xTop);
+    device->xTop = xf86SetIntOption(pInfo->options, "XTop", device->xTop);
+    if (device->xTop != VALUE_NA)
+    {
+        xf86Msg(X_CONFIG, "%s: TopX/XTop = %d\n", pInfo->name,
+                device->xTop);
+    }
+
+/* TopY */
+    device->yTop = xf86SetIntOption(pInfo->options, "TopY", device->yTop);
+    device->yTop = xf86SetIntOption(pInfo->options, "YTop", device->yTop);
+    if (device->yTop != VALUE_NA)
+    {
+        xf86Msg(X_CONFIG, "%s: TopY/YTop = %d\n", pInfo->name,
+                device->yTop);
+    }
+
+/* BottomX */
+    device->xBottom = xf86SetIntOption(pInfo->options, "BottomX",
+            device->xBottom);
+    device->xBottom = xf86SetIntOption(pInfo->options, "XBottom",
+            device->xBottom);
+    if (device->xBottom != VALUE_NA)
+    {
+        xf86Msg(X_CONFIG, "%s: BottomX/XBottom = %d\n", pInfo->name,
+                device->xBottom);
+    }
+
+/* BottomY */
+    device->yBottom = xf86SetIntOption(pInfo->options, "BottomY",
+            device->yBottom);
+    device->yBottom = xf86SetIntOption(pInfo->options, "YBottom",
+            device->yBottom);
+    if (device->yBottom != VALUE_NA)
+    {
+        xf86Msg(X_CONFIG, "%s: BottomY/YBottom = %d\n", pInfo->name,
+                device->yBottom);
+    }
+
+/* InvX */
+    if (xf86SetBoolOption(pInfo->options, "InvX", FALSE))
+    {
+        device->flags |= INVX_FLAG;
+        xf86Msg(X_CONFIG, "%s: InvX\n", pInfo->name);
+    }
+
+/* InvY */
+    if (xf86SetBoolOption(pInfo->options, "InvY", FALSE))
+    {
+        device->flags |= INVY_FLAG;
+        xf86Msg(X_CONFIG, "%s: InvY\n", pInfo->name);
+    }
+
+/* BaudRate */
+    {
+        int val;
+        val = xf86SetIntOption(pInfo->options, "BaudRate", 0);
+
+        switch(val)
+        {
+            case 19200:
+                break;
+            case 9600:
+                break;
+            default:
+                xf86Msg(X_ERROR, "%s: Illegal BaudRate (9600 or 19200).",
+                        pInfo->name);
+                break;
+        }
+        xf86Msg(X_CONFIG, "%s: BaudRate %u\n", pInfo->name, val);
+    }
+    xf86Msg(X_CONFIG, "%s: xf86AiptekInit() finished\n", pInfo->name);
+
+    return Success;
+
+SetupProc_fail:
+    if (common)
+        free(common);
+    if (device)
+        free(device);
+    if (pInfo)
+        free(pInfo);
+    return BadValue;
+}
+
+/*
+ ***************************************************************************
+ *
+ * Dynamic loading functions
+ *
+ ***************************************************************************
+ */
+/*
+ * xf86AiptekUnplug --
+ *
+ * called when the module subsection is found in XF86Config
+ */
+static void
+xf86AiptekUnplug(pointer p)
+{
+    DBG(1, "xf86AiptekUnplug\n");
+}
+
+/*
+ * xf86AiptekPlug --
+ *
+ * called when the module subsection is found in XF86Config
+ */
+static pointer
+xf86AiptekPlug(pointer    module,
+               pointer    options,
+               int*       errmaj,
+               int*       errmin)
+{
+    DBG(1, "xf86AiptekPlug\n");
+
+    xf86AddInputDriver(&AIPTEK, module, 0);
+
+    return module;
+}
+
+static XF86ModuleVersionInfo xf86AiptekVersionRec =
+{
+    "aiptek",
+    MODULEVENDORSTRING,
+    MODINFOSTRING1,
+    MODINFOSTRING2,
+    XORG_VERSION_CURRENT,
+    PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL,
+    ABI_CLASS_XINPUT,
+    ABI_XINPUT_VERSION,
+    MOD_CLASS_XINPUT,
+    {0, 0, 0, 0}        /* signature, to be patched into the file by
+                         * a tool
+                         * */
+};
+
+_X_EXPORT XF86ModuleData aiptekModuleData =
+{
+    &xf86AiptekVersionRec,
+    xf86AiptekPlug,
+    xf86AiptekUnplug
+};
+
+/* end of xf86Aiptek.c */
Index: driver/xf86-input-aiptek/create-1.4.1-abi-patch/xf86-input-aiptek-1.4.1-new/src
===================================================================
--- driver/xf86-input-aiptek/create-1.4.1-abi-patch/xf86-input-aiptek-1.4.1-new/src	(nonexistent)
+++ driver/xf86-input-aiptek/create-1.4.1-abi-patch/xf86-input-aiptek-1.4.1-new/src	(revision 5)

Property changes on: driver/xf86-input-aiptek/create-1.4.1-abi-patch/xf86-input-aiptek-1.4.1-new/src
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-input-aiptek/create-1.4.1-abi-patch/xf86-input-aiptek-1.4.1-new
===================================================================
--- driver/xf86-input-aiptek/create-1.4.1-abi-patch/xf86-input-aiptek-1.4.1-new	(nonexistent)
+++ driver/xf86-input-aiptek/create-1.4.1-abi-patch/xf86-input-aiptek-1.4.1-new	(revision 5)

Property changes on: driver/xf86-input-aiptek/create-1.4.1-abi-patch/xf86-input-aiptek-1.4.1-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-input-aiptek/create-1.4.1-abi-patch
===================================================================
--- driver/xf86-input-aiptek/create-1.4.1-abi-patch	(nonexistent)
+++ driver/xf86-input-aiptek/create-1.4.1-abi-patch	(revision 5)

Property changes on: driver/xf86-input-aiptek/create-1.4.1-abi-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-input-aiptek/patches/README
===================================================================
--- driver/xf86-input-aiptek/patches/README	(nonexistent)
+++ driver/xf86-input-aiptek/patches/README	(revision 5)
@@ -0,0 +1,6 @@
+
+/* begin *
+
+   TODO: Leave some comment here.
+
+ * end */
Index: driver/xf86-input-aiptek/patches
===================================================================
--- driver/xf86-input-aiptek/patches	(nonexistent)
+++ driver/xf86-input-aiptek/patches	(revision 5)

Property changes on: driver/xf86-input-aiptek/patches
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-input-aiptek
===================================================================
--- driver/xf86-input-aiptek	(nonexistent)
+++ driver/xf86-input-aiptek	(revision 5)

Property changes on: driver/xf86-input-aiptek
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-input-evdev/Makefile
===================================================================
--- driver/xf86-input-evdev/Makefile	(nonexistent)
+++ driver/xf86-input-evdev/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-input-evdev
+
+versions    = 2.10.6
+pkgname     = xf86-input-evdev
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-input-evdev
===================================================================
--- driver/xf86-input-evdev	(nonexistent)
+++ driver/xf86-input-evdev	(revision 5)

Property changes on: driver/xf86-input-evdev
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-input-joystick/Makefile
===================================================================
--- driver/xf86-input-joystick/Makefile	(nonexistent)
+++ driver/xf86-input-joystick/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-input-joystick
+
+versions    = 1.6.4
+pkgname     = xf86-input-joystick
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-input-joystick
===================================================================
--- driver/xf86-input-joystick	(nonexistent)
+++ driver/xf86-input-joystick	(revision 5)

Property changes on: driver/xf86-input-joystick
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-input-keyboard/Makefile
===================================================================
--- driver/xf86-input-keyboard/Makefile	(nonexistent)
+++ driver/xf86-input-keyboard/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-input-keyboard
+
+versions    = 2.0.0
+pkgname     = xf86-input-keyboard
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-input-keyboard
===================================================================
--- driver/xf86-input-keyboard	(nonexistent)
+++ driver/xf86-input-keyboard	(revision 5)

Property changes on: driver/xf86-input-keyboard
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-input-libinput/Makefile
===================================================================
--- driver/xf86-input-libinput/Makefile	(nonexistent)
+++ driver/xf86-input-libinput/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-input-libinput
+
+versions    = 1.2.1
+pkgname     = xf86-input-libinput
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-input-libinput
===================================================================
--- driver/xf86-input-libinput	(nonexistent)
+++ driver/xf86-input-libinput	(revision 5)

Property changes on: driver/xf86-input-libinput
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-input-mouse/Makefile
===================================================================
--- driver/xf86-input-mouse/Makefile	(nonexistent)
+++ driver/xf86-input-mouse/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-input-mouse
+
+versions    = 1.9.4
+pkgname     = xf86-input-mouse
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-input-mouse
===================================================================
--- driver/xf86-input-mouse	(nonexistent)
+++ driver/xf86-input-mouse	(revision 5)

Property changes on: driver/xf86-input-mouse
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-input-penmount/Makefile
===================================================================
--- driver/xf86-input-penmount/Makefile	(nonexistent)
+++ driver/xf86-input-penmount/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-input-penmount
+
+versions    = 1.5.0
+pkgname     = xf86-input-penmount
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-input-penmount
===================================================================
--- driver/xf86-input-penmount	(nonexistent)
+++ driver/xf86-input-penmount	(revision 5)

Property changes on: driver/xf86-input-penmount
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-input-synaptics/Makefile
===================================================================
--- driver/xf86-input-synaptics/Makefile	(nonexistent)
+++ driver/xf86-input-synaptics/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-input-synaptics
+
+versions    = 1.9.2
+pkgname     = xf86-input-synaptics
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-input-synaptics
===================================================================
--- driver/xf86-input-synaptics	(nonexistent)
+++ driver/xf86-input-synaptics	(revision 5)

Property changes on: driver/xf86-input-synaptics
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-input-vmmouse/Makefile
===================================================================
--- driver/xf86-input-vmmouse/Makefile	(nonexistent)
+++ driver/xf86-input-vmmouse/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-input-vmmouse
+
+versions    = 13.2.0
+pkgname     = xf86-input-vmmouse
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-input-vmmouse
===================================================================
--- driver/xf86-input-vmmouse	(nonexistent)
+++ driver/xf86-input-vmmouse	(revision 5)

Property changes on: driver/xf86-input-vmmouse
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-input-void/Makefile
===================================================================
--- driver/xf86-input-void/Makefile	(nonexistent)
+++ driver/xf86-input-void/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-input-void
+
+versions    = 1.4.2
+pkgname     = xf86-input-void
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-input-void
===================================================================
--- driver/xf86-input-void	(nonexistent)
+++ driver/xf86-input-void	(revision 5)

Property changes on: driver/xf86-input-void
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-input-wacom/Makefile
===================================================================
--- driver/xf86-input-wacom/Makefile	(nonexistent)
+++ driver/xf86-input-wacom/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-input-wacom
+
+versions    = 1.1.0
+pkgname     = xf86-input-wacom
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-input-wacom
===================================================================
--- driver/xf86-input-wacom	(nonexistent)
+++ driver/xf86-input-wacom	(revision 5)

Property changes on: driver/xf86-input-wacom
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-amdgpu/Makefile
===================================================================
--- driver/xf86-video-amdgpu/Makefile	(nonexistent)
+++ driver/xf86-video-amdgpu/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-amdgpu
+
+versions    = 23.0.0
+pkgname     = xf86-video-amdgpu
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-amdgpu
===================================================================
--- driver/xf86-video-amdgpu	(nonexistent)
+++ driver/xf86-video-amdgpu	(revision 5)

Property changes on: driver/xf86-video-amdgpu
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-apm/Makefile
===================================================================
--- driver/xf86-video-apm/Makefile	(nonexistent)
+++ driver/xf86-video-apm/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-apm
+
+versions    = 1.3.0
+pkgname     = xf86-video-apm
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-apm
===================================================================
--- driver/xf86-video-apm	(nonexistent)
+++ driver/xf86-video-apm	(revision 5)

Property changes on: driver/xf86-video-apm
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-ark/Makefile
===================================================================
--- driver/xf86-video-ark/Makefile	(nonexistent)
+++ driver/xf86-video-ark/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-ark
+
+versions    = 0.7.5
+pkgname     = xf86-video-ark
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-ark
===================================================================
--- driver/xf86-video-ark	(nonexistent)
+++ driver/xf86-video-ark	(revision 5)

Property changes on: driver/xf86-video-ark
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-ast/Makefile
===================================================================
--- driver/xf86-video-ast/Makefile	(nonexistent)
+++ driver/xf86-video-ast/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-ast
+
+versions    = 1.1.6
+pkgname     = xf86-video-ast
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-ast
===================================================================
--- driver/xf86-video-ast	(nonexistent)
+++ driver/xf86-video-ast	(revision 5)

Property changes on: driver/xf86-video-ast
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-ati/Makefile
===================================================================
--- driver/xf86-video-ati/Makefile	(nonexistent)
+++ driver/xf86-video-ati/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-ati
+
+versions    = 19.1.0
+pkgname     = xf86-video-ati
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-ati
===================================================================
--- driver/xf86-video-ati	(nonexistent)
+++ driver/xf86-video-ati	(revision 5)

Property changes on: driver/xf86-video-ati
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-chips/Makefile
===================================================================
--- driver/xf86-video-chips/Makefile	(nonexistent)
+++ driver/xf86-video-chips/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-chips
+
+versions    = 1.4.0
+pkgname     = xf86-video-chips
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-chips
===================================================================
--- driver/xf86-video-chips	(nonexistent)
+++ driver/xf86-video-chips	(revision 5)

Property changes on: driver/xf86-video-chips
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-cirrus/Makefile
===================================================================
--- driver/xf86-video-cirrus/Makefile	(nonexistent)
+++ driver/xf86-video-cirrus/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-cirrus
+
+versions    = 1.6.0
+pkgname     = xf86-video-cirrus
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-cirrus
===================================================================
--- driver/xf86-video-cirrus	(nonexistent)
+++ driver/xf86-video-cirrus	(revision 5)

Property changes on: driver/xf86-video-cirrus
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-dummy/Makefile
===================================================================
--- driver/xf86-video-dummy/Makefile	(nonexistent)
+++ driver/xf86-video-dummy/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-dummy
+
+versions    = 0.4.0
+pkgname     = xf86-video-dummy
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-dummy
===================================================================
--- driver/xf86-video-dummy	(nonexistent)
+++ driver/xf86-video-dummy	(revision 5)

Property changes on: driver/xf86-video-dummy
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-fbdev/Makefile
===================================================================
--- driver/xf86-video-fbdev/Makefile	(nonexistent)
+++ driver/xf86-video-fbdev/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-fbdev
+
+versions    = 0.5.0
+pkgname     = xf86-video-fbdev
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-fbdev
===================================================================
--- driver/xf86-video-fbdev	(nonexistent)
+++ driver/xf86-video-fbdev	(revision 5)

Property changes on: driver/xf86-video-fbdev
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-geode/Makefile
===================================================================
--- driver/xf86-video-geode/Makefile	(nonexistent)
+++ driver/xf86-video-geode/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-geode
+
+versions    = 2.11.20
+pkgname     = xf86-video-geode
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-geode
===================================================================
--- driver/xf86-video-geode	(nonexistent)
+++ driver/xf86-video-geode	(revision 5)

Property changes on: driver/xf86-video-geode
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-glide/Makefile
===================================================================
--- driver/xf86-video-glide/Makefile	(nonexistent)
+++ driver/xf86-video-glide/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-glide
+
+versions    = 1.2.2
+pkgname     = xf86-video-glide
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-glide
===================================================================
--- driver/xf86-video-glide	(nonexistent)
+++ driver/xf86-video-glide	(revision 5)

Property changes on: driver/xf86-video-glide
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-glint/Makefile
===================================================================
--- driver/xf86-video-glint/Makefile	(nonexistent)
+++ driver/xf86-video-glint/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-glint
+
+versions    = 1.2.9
+pkgname     = xf86-video-glint
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-glint
===================================================================
--- driver/xf86-video-glint	(nonexistent)
+++ driver/xf86-video-glint	(revision 5)

Property changes on: driver/xf86-video-glint
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-i128/Makefile
===================================================================
--- driver/xf86-video-i128/Makefile	(nonexistent)
+++ driver/xf86-video-i128/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-i128
+
+versions    = 1.4.0
+pkgname     = xf86-video-i128
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-i128
===================================================================
--- driver/xf86-video-i128	(nonexistent)
+++ driver/xf86-video-i128	(revision 5)

Property changes on: driver/xf86-video-i128
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-i740/Makefile
===================================================================
--- driver/xf86-video-i740/Makefile	(nonexistent)
+++ driver/xf86-video-i740/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-i740
+
+versions    = 1.4.0
+pkgname     = xf86-video-i740
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-i740
===================================================================
--- driver/xf86-video-i740	(nonexistent)
+++ driver/xf86-video-i740	(revision 5)

Property changes on: driver/xf86-video-i740
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-i810/Makefile
===================================================================
--- driver/xf86-video-i810/Makefile	(nonexistent)
+++ driver/xf86-video-i810/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-i810
+
+versions    = 1.7.4
+pkgname     = xf86-video-i810
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-i810
===================================================================
--- driver/xf86-video-i810	(nonexistent)
+++ driver/xf86-video-i810	(revision 5)

Property changes on: driver/xf86-video-i810
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-intel/Makefile
===================================================================
--- driver/xf86-video-intel/Makefile	(nonexistent)
+++ driver/xf86-video-intel/Makefile	(revision 5)
@@ -0,0 +1,60 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-intel
+
+versions    = 2.99.917.2
+pkgname     = xf86-video-intel
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+patches      = $(CURDIR)/patches/xf86-video-intel-2.99.917.2-die-attributes.patch
+patches     += $(CURDIR)/patches/xf86-video-intel-2.99.917.2-sna-output-attach-edid.patch
+patches     += $(CURDIR)/patches/xf86-video-intel-2.99.917.2-sna-video-definitions.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-2.99.917.2-die-attributes-patch         ; ./create.patch.sh ) ; \
+	 ( cd create-2.99.917.2-sna-output-attach-edid-patch ; ./create.patch.sh ) ; \
+	 ( cd create-2.99.917.2-sna-video-definitions-patch  ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s) $(patches)
Index: driver/xf86-video-intel/create-2.99.917.2-die-attributes-patch/create.patch.sh
===================================================================
--- driver/xf86-video-intel/create-2.99.917.2-die-attributes-patch/create.patch.sh	(nonexistent)
+++ driver/xf86-video-intel/create-2.99.917.2-die-attributes-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=2.99.917.2
+
+tar --files-from=file.list -xjvf ../xf86-video-intel-$VERSION.tar.bz2
+mv xf86-video-intel-$VERSION xf86-video-intel-$VERSION-orig
+
+cp -rf ./xf86-video-intel-$VERSION-new ./xf86-video-intel-$VERSION
+
+diff --unified -Nr  xf86-video-intel-$VERSION-orig  xf86-video-intel-$VERSION > xf86-video-intel-$VERSION-die-attributes.patch
+
+mv xf86-video-intel-$VERSION-die-attributes.patch ../patches
+
+rm -rf ./xf86-video-intel-$VERSION
+rm -rf ./xf86-video-intel-$VERSION-orig

Property changes on: driver/xf86-video-intel/create-2.99.917.2-die-attributes-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: driver/xf86-video-intel/create-2.99.917.2-die-attributes-patch/file.list
===================================================================
--- driver/xf86-video-intel/create-2.99.917.2-die-attributes-patch/file.list	(nonexistent)
+++ driver/xf86-video-intel/create-2.99.917.2-die-attributes-patch/file.list	(revision 5)
@@ -0,0 +1 @@
+xf86-video-intel-2.99.917.2/test/test.h
Index: driver/xf86-video-intel/create-2.99.917.2-die-attributes-patch/xf86-video-intel-2.99.917.2-new/test/test.h
===================================================================
--- driver/xf86-video-intel/create-2.99.917.2-die-attributes-patch/xf86-video-intel-2.99.917.2-new/test/test.h	(nonexistent)
+++ driver/xf86-video-intel/create-2.99.917.2-die-attributes-patch/xf86-video-intel-2.99.917.2-new/test/test.h	(revision 5)
@@ -0,0 +1,133 @@
+#ifndef TEST_H
+#define TEST_H
+
+#include <stdint.h>
+#include <time.h>
+
+#include <X11/Xlib.h>
+#include <X11/extensions/XShm.h>
+#include <X11/extensions/Xrender.h>
+
+#define DEFAULT_ITERATIONS 20
+
+enum target {
+	ROOT,
+	CHILD,
+	PIXMAP,
+};
+#define TARGET_FIRST ROOT
+#define TARGET_LAST PIXMAP
+
+enum mask {
+	MASK_NONE,
+	MASK_NONE_AA,
+	MASK_A1,
+	MASK_A8,
+};
+
+struct test {
+	struct test_display {
+		Display *dpy;
+		Window root;
+		XShmSegmentInfo shm;
+		int max_shm_size;
+		int has_shm_pixmaps;
+		int width, height, depth;
+		XRenderPictFormat *format;
+		enum { REF, OUT } target;
+	} out, ref;
+};
+
+void die(const char *fmt, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
+
+#define die_unless(expr) do{ if (!(expr)) die("verification failed: %s\n", #expr); } while(0)
+
+void test_init(struct test *test, int argc, char **argv);
+
+void test_compare(struct test *out,
+		  Drawable out_draw, XRenderPictFormat *out_format,
+		  Drawable ref_draw, XRenderPictFormat *ref_format,
+		  int x, int y, int w, int h, const char *info);
+
+#define MAX_DELTA 3
+int pixel_difference(uint32_t a, uint32_t b);
+
+static inline int pixel_equal(int depth, uint32_t a, uint32_t b)
+{
+	if (depth != 32) {
+		uint32_t mask = (1 << depth) - 1;
+		a &= mask;
+		b &= mask;
+	}
+
+	if (a == b)
+		return 1;
+
+	return pixel_difference(a, b) < MAX_DELTA;
+}
+
+void
+test_init_image(XImage *ximage,
+		XShmSegmentInfo *shm,
+		XRenderPictFormat *format,
+		int width, int height);
+
+const char *test_target_name(enum target target);
+
+struct test_target {
+	struct test_display *dpy;
+	Drawable draw;
+	GC gc;
+	XRenderPictFormat *format;
+	Picture picture;
+	int width, height, depth;
+	enum target target;
+};
+
+void test_target_create_render(struct test_display *dpy,
+			       enum target target,
+			       struct test_target *tt);
+void test_target_destroy_render(struct test_display *dpy,
+				struct test_target *tt);
+
+static inline uint32_t depth_mask(int depth)
+{
+	if (depth == 32)
+		return 0xffffffff;
+	else
+		return (1 << depth) - 1;
+}
+
+static inline uint32_t color(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha)
+{
+	uint16_t ra = red * alpha;
+	uint16_t ga = green * alpha;
+	uint16_t ba = blue * alpha;
+
+	return alpha << 24 | ra >> 8 << 16 | ga >> 8 << 8 | ba >> 8;
+}
+
+static inline uint32_t xrender_color(const XRenderColor *c)
+{
+	uint32_t ra = c->red * c->alpha;
+	uint32_t ga = c->green * c->alpha;
+	uint32_t ba = c->blue * c->alpha;
+
+	return c->alpha >> 8 << 24 | ra >> 24 << 16 | ga >> 24 << 8 | ba >> 24;
+}
+
+void test_timer_start(struct test_display *t, struct timespec *tv);
+double test_timer_stop(struct test_display *t, struct timespec *tv);
+
+#ifndef MAX
+#define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
+
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
+#endif
+
+#define SETS(I) ((I) >= 12 ? 1 : 1 << (12 - (I)))
+#define REPS(I) (1 << (I))
+
+#endif
Index: driver/xf86-video-intel/create-2.99.917.2-die-attributes-patch/xf86-video-intel-2.99.917.2-new/test
===================================================================
--- driver/xf86-video-intel/create-2.99.917.2-die-attributes-patch/xf86-video-intel-2.99.917.2-new/test	(nonexistent)
+++ driver/xf86-video-intel/create-2.99.917.2-die-attributes-patch/xf86-video-intel-2.99.917.2-new/test	(revision 5)

Property changes on: driver/xf86-video-intel/create-2.99.917.2-die-attributes-patch/xf86-video-intel-2.99.917.2-new/test
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-intel/create-2.99.917.2-die-attributes-patch/xf86-video-intel-2.99.917.2-new
===================================================================
--- driver/xf86-video-intel/create-2.99.917.2-die-attributes-patch/xf86-video-intel-2.99.917.2-new	(nonexistent)
+++ driver/xf86-video-intel/create-2.99.917.2-die-attributes-patch/xf86-video-intel-2.99.917.2-new	(revision 5)

Property changes on: driver/xf86-video-intel/create-2.99.917.2-die-attributes-patch/xf86-video-intel-2.99.917.2-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-intel/create-2.99.917.2-die-attributes-patch
===================================================================
--- driver/xf86-video-intel/create-2.99.917.2-die-attributes-patch	(nonexistent)
+++ driver/xf86-video-intel/create-2.99.917.2-die-attributes-patch	(revision 5)

Property changes on: driver/xf86-video-intel/create-2.99.917.2-die-attributes-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch/create.patch.sh
===================================================================
--- driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch/create.patch.sh	(nonexistent)
+++ driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=2.99.917.2
+
+tar --files-from=file.list -xjvf ../xf86-video-intel-$VERSION.tar.bz2
+mv xf86-video-intel-$VERSION xf86-video-intel-$VERSION-orig
+
+cp -rf ./xf86-video-intel-$VERSION-new ./xf86-video-intel-$VERSION
+
+diff --unified -Nr  xf86-video-intel-$VERSION-orig  xf86-video-intel-$VERSION > xf86-video-intel-$VERSION-sna-output-attach-edid.patch
+
+mv xf86-video-intel-$VERSION-sna-output-attach-edid.patch ../patches
+
+rm -rf ./xf86-video-intel-$VERSION
+rm -rf ./xf86-video-intel-$VERSION-orig

Property changes on: driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch/file.list
===================================================================
--- driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch/file.list	(nonexistent)
+++ driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch/file.list	(revision 5)
@@ -0,0 +1 @@
+xf86-video-intel-2.99.917.2/src/sna/sna_display.c
Index: driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch/xf86-video-intel-2.99.917.2-new/src/sna/sna_display.c
===================================================================
--- driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch/xf86-video-intel-2.99.917.2-new/src/sna/sna_display.c	(nonexistent)
+++ driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch/xf86-video-intel-2.99.917.2-new/src/sna/sna_display.c	(revision 5)
@@ -0,0 +1,9830 @@
+/*
+ * Copyright © 2007 Red Hat, Inc.
+ * Copyright © 2013-2014 Intel Corporation
+ *
+ * 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:
+ *    Dave Airlie <airlied@redhat.com>
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdint.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <poll.h>
+#include <ctype.h>
+#include <dirent.h>
+
+#if HAVE_ALLOCA_H
+#include <alloca.h>
+#elif defined __GNUC__
+#define alloca __builtin_alloca
+#elif defined _AIX
+#define alloca __alloca
+#elif defined _MSC_VER
+#include <malloc.h>
+#define alloca _alloca
+#else
+void *alloca(size_t);
+#endif
+
+#define _PARSE_EDID_
+/* Jump through a few hoops in order to fixup EDIDs */
+#undef VERSION
+#undef REVISION
+
+#include "sna.h"
+#include "sna_reg.h"
+#include "fb/fbpict.h"
+#include "intel_options.h"
+#include "backlight.h"
+
+#include <xf86Crtc.h>
+#include <xf86RandR12.h>
+#include <cursorstr.h>
+
+#if XF86_CRTC_VERSION >= 3
+#define HAS_GAMMA 1
+#else
+#define HAS_GAMMA 0
+#endif
+
+#include <X11/Xatom.h>
+#if defined(HAVE_X11_EXTENSIONS_DPMSCONST_H)
+#include <X11/extensions/dpmsconst.h>
+#else
+#define DPMSModeOn 0
+#define DPMSModeOff 3
+#endif
+#include <xf86DDC.h> /* for xf86InterpretEDID */
+
+#include <xf86drm.h>
+
+#ifdef HAVE_VALGRIND
+#include <valgrind.h>
+#include <memcheck.h>
+#endif
+
+#define FAIL_CURSOR_IOCTL 0
+
+/* Minor discrepancy between 32-bit/64-bit ABI in old kernels */
+union compat_mode_get_connector{
+	struct drm_mode_get_connector conn;
+	uint32_t pad[20];
+};
+
+#define KNOWN_MODE_FLAGS ((1<<14)-1)
+
+#ifndef MONITOR_EDID_COMPLETE_RAWDATA
+#define MONITOR_EDID_COMPLETE_RAWDATA 1
+#endif
+
+#ifndef DEFAULT_DPI
+#define DEFAULT_DPI 96
+#endif
+
+#define OUTPUT_STATUS_CACHE_MS 15000
+
+#define DRM_MODE_PAGE_FLIP_ASYNC 0x02
+
+#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2
+#define DRM_PLANE_TYPE_OVERLAY 0
+#define DRM_PLANE_TYPE_PRIMARY 1
+#define DRM_PLANE_TYPE_CURSOR  2
+
+#define LOCAL_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xb9, struct local_mode_obj_get_properties)
+struct local_mode_obj_get_properties {
+	uint64_t props_ptr;
+	uint64_t prop_values_ptr;
+	uint32_t count_props;
+	uint32_t obj_id;
+	uint32_t obj_type;
+	uint32_t pad;
+};
+#define LOCAL_MODE_OBJECT_CRTC 0xcccccccc
+#define LOCAL_MODE_OBJECT_PLANE 0xeeeeeeee
+
+struct local_mode_set_plane {
+	uint32_t plane_id;
+	uint32_t crtc_id;
+	uint32_t fb_id; /* fb object contains surface format type */
+	uint32_t flags;
+
+	/* Signed dest location allows it to be partially off screen */
+	int32_t crtc_x, crtc_y;
+	uint32_t crtc_w, crtc_h;
+
+	/* Source values are 16.16 fixed point */
+	uint32_t src_x, src_y;
+	uint32_t src_h, src_w;
+};
+#define LOCAL_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct local_mode_set_plane)
+
+struct local_mode_get_plane {
+	uint32_t plane_id;
+
+	uint32_t crtc_id;
+	uint32_t fb_id;
+
+	uint32_t possible_crtcs;
+	uint32_t gamma_size;
+
+	uint32_t count_format_types;
+	uint64_t format_type_ptr;
+};
+#define LOCAL_IOCTL_MODE_GETPLANE DRM_IOWR(0xb6, struct local_mode_get_plane)
+
+struct local_mode_get_plane_res {
+	uint64_t plane_id_ptr;
+	uint64_t count_planes;
+};
+#define LOCAL_IOCTL_MODE_GETPLANERESOURCES DRM_IOWR(0xb5, struct local_mode_get_plane_res)
+
+#if 1
+#define __DBG DBG
+#else
+#define __DBG(x)
+#endif
+
+#define DBG_NATIVE_ROTATION ~0 /* minimum RR_Rotate_0 */
+
+extern XF86ConfigPtr xf86configptr;
+
+struct sna_cursor {
+	struct sna_cursor *next;
+	uint32_t *image;
+	bool transformed;
+	Rotation rotation;
+	int ref;
+	int size;
+	int last_width;
+	int last_height;
+	unsigned handle;
+	unsigned serial;
+	unsigned alloc;
+};
+
+struct sna_crtc {
+	struct sna_crtc_public public;
+	uint32_t id;
+	xf86CrtcPtr base;
+	struct drm_mode_modeinfo kmode;
+	PixmapPtr slave_pixmap;
+	DamagePtr slave_damage;
+	struct kgem_bo *bo, *shadow_bo, *client_bo, *cache_bo;
+	struct sna_cursor *cursor;
+	unsigned int last_cursor_size;
+	uint32_t offset;
+	bool shadow;
+	bool fallback_shadow;
+	bool transform;
+	bool cursor_transform;
+	bool hwcursor;
+	bool flip_pending;
+
+	struct pict_f_transform cursor_to_fb, fb_to_cursor;
+
+	RegionRec crtc_damage;
+	uint16_t shadow_bo_width, shadow_bo_height;
+
+	uint32_t rotation;
+	struct plane {
+		uint32_t id;
+		uint32_t type;
+		struct {
+			uint32_t prop;
+			uint32_t supported;
+			uint32_t current;
+		} rotation;
+		struct {
+			uint32_t prop;
+			uint64_t values[2];
+		} color_encoding;
+		struct list link;
+	} primary;
+	struct list sprites;
+
+	struct drm_color_lut *gamma_lut;
+	uint64_t gamma_lut_prop;
+	uint64_t gamma_lut_blob;
+	uint32_t gamma_lut_size;
+
+	uint32_t mode_serial, flip_serial;
+
+	uint32_t last_seq, wrap_seq;
+	struct ust_msc swap;
+
+	sna_flip_handler_t flip_handler;
+	struct kgem_bo *flip_bo;
+	void *flip_data;
+
+	struct list shadow_link;
+};
+
+struct sna_property {
+	drmModePropertyPtr kprop;
+	int num_atoms; /* if range prop, num_atoms == 1; if enum prop, num_atoms == num_enums + 1 */
+	Atom *atoms;
+};
+
+struct sna_output {
+	xf86OutputPtr base;
+	unsigned id;
+	unsigned serial;
+
+	unsigned possible_encoders;
+	unsigned attached_encoders;
+
+	unsigned int is_panel : 1;
+	unsigned int add_default_modes : 1;
+	int connector_type;
+	int connector_type_id;
+
+	uint32_t link_status_idx;
+
+	uint32_t edid_idx;
+	uint32_t edid_blob_id;
+	uint32_t edid_len;
+	void *edid_raw;
+	void *fake_edid_raw;
+
+	bool has_panel_limits;
+	int panel_hdisplay;
+	int panel_vdisplay;
+
+	uint32_t dpms_id;
+	uint8_t dpms_mode;
+	struct backlight backlight;
+	int backlight_active_level;
+
+	uint32_t last_detect;
+	uint32_t status;
+	unsigned int hotplug_count;
+	bool update_properties;
+	bool reprobe;
+
+	int num_modes;
+	struct drm_mode_modeinfo *modes;
+
+	int num_props;
+	uint32_t *prop_ids;
+	uint64_t *prop_values;
+	struct sna_property *props;
+};
+
+enum { /* XXX copied from hw/xfree86/modes/xf86Crtc.c */
+	OPTION_PREFERRED_MODE,
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,14,99,1,0)
+	OPTION_ZOOM_MODES,
+#endif
+	OPTION_POSITION,
+	OPTION_BELOW,
+	OPTION_RIGHT_OF,
+	OPTION_ABOVE,
+	OPTION_LEFT_OF,
+	OPTION_ENABLE,
+	OPTION_DISABLE,
+	OPTION_MIN_CLOCK,
+	OPTION_MAX_CLOCK,
+	OPTION_IGNORE,
+	OPTION_ROTATE,
+	OPTION_PANNING,
+	OPTION_PRIMARY,
+	OPTION_DEFAULT_MODES,
+};
+
+static void __sna_output_dpms(xf86OutputPtr output, int dpms, int fixup);
+static void sna_crtc_disable_cursor(struct sna *sna, struct sna_crtc *crtc);
+static bool sna_crtc_flip(struct sna *sna, struct sna_crtc *crtc,
+			  struct kgem_bo *bo, int x, int y);
+static void sna_crtc_gamma_set(xf86CrtcPtr crtc,
+			       CARD16 *red, CARD16 *green,
+			       CARD16 *blue, int size);
+
+static bool is_zaphod(ScrnInfoPtr scrn)
+{
+	return xf86IsEntityShared(scrn->entityList[0]);
+}
+
+static bool
+sna_zaphod_match(struct sna *sna, const char *output)
+{
+	const char *s, *colon;
+	char t[20];
+	unsigned int i = 0;
+
+	s = xf86GetOptValString(sna->Options, OPTION_ZAPHOD);
+	if (s == NULL)
+		return false;
+
+	colon = strchr(s, ':');
+	if (colon) /* Skip over the ZaphodPipes */
+		s = colon + 1;
+
+	do {
+		/* match any outputs in a comma list, stopping at whitespace */
+		switch (*s) {
+		case '\0':
+			t[i] = '\0';
+			return strcmp(t, output) == 0;
+
+		case ',':
+			t[i] ='\0';
+			if (strcmp(t, output) == 0)
+				return TRUE;
+			i = 0;
+			break;
+
+		case ' ':
+		case '\t':
+		case '\n':
+		case '\r':
+			break;
+
+		default:
+			t[i++] = *s;
+			break;
+		}
+
+		s++;
+	} while (i < sizeof(t));
+
+	return false;
+}
+
+static unsigned
+get_zaphod_crtcs(struct sna *sna)
+{
+	const char *str, *colon;
+	unsigned crtcs = 0;
+
+	str = xf86GetOptValString(sna->Options, OPTION_ZAPHOD);
+	if (str == NULL || (colon = strchr(str, ':')) == NULL) {
+		DBG(("%s: no zaphod pipes, using screen number: %x\n",
+		     __FUNCTION__,
+		     sna->scrn->confScreen->device->screen));
+		return 1 << sna->scrn->confScreen->device->screen;
+	}
+
+	DBG(("%s: ZaphodHeads='%s'\n", __FUNCTION__, str));
+	while (str < colon) {
+		char *end;
+		unsigned crtc = strtoul(str, &end, 0);
+		if (end == str)
+			break;
+		DBG(("%s: adding CRTC %d to zaphod pipes\n",
+		     __FUNCTION__, crtc));
+		crtcs |= 1 << crtc;
+		str = end + 1;
+	}
+	DBG(("%s: ZaphodPipes=%x\n", __FUNCTION__, crtcs));
+	return crtcs;
+}
+
+inline static unsigned count_to_mask(int x)
+{
+	return (1 << x) - 1;
+}
+
+static inline struct sna_output *to_sna_output(xf86OutputPtr output)
+{
+	return output->driver_private;
+}
+
+static inline int to_connector_id(xf86OutputPtr output)
+{
+	assert(to_sna_output(output));
+	assert(to_sna_output(output)->id);
+	return to_sna_output(output)->id;
+}
+
+static inline struct sna_crtc *to_sna_crtc(xf86CrtcPtr crtc)
+{
+	return crtc->driver_private;
+}
+
+static inline unsigned __sna_crtc_pipe(struct sna_crtc *crtc)
+{
+	return crtc->public.flags >> 8 & 0xff;
+}
+
+static inline unsigned __sna_crtc_id(struct sna_crtc *crtc)
+{
+	return crtc->id;
+}
+
+uint32_t sna_crtc_id(xf86CrtcPtr crtc)
+{
+	return __sna_crtc_id(to_sna_crtc(crtc));
+}
+
+static inline bool event_pending(int fd)
+{
+	struct pollfd pfd;
+	pfd.fd = fd;
+	pfd.events = POLLIN;
+	return poll(&pfd, 1, 0) == 1;
+}
+
+static bool sna_mode_wait_for_event(struct sna *sna)
+{
+	struct pollfd pfd;
+	pfd.fd = sna->kgem.fd;
+	pfd.events = POLLIN;
+	return poll(&pfd, 1, -1) == 1;
+}
+
+static inline uint32_t fb_id(struct kgem_bo *bo)
+{
+	return bo->delta;
+}
+
+unsigned sna_crtc_count_sprites(xf86CrtcPtr crtc)
+{
+	struct plane *sprite;
+	unsigned count;
+
+	count = 0;
+	list_for_each_entry(sprite, &to_sna_crtc(crtc)->sprites, link)
+		count++;
+
+	return count;
+}
+
+static struct plane *lookup_sprite(struct sna_crtc *crtc, unsigned idx)
+{
+	struct plane *sprite;
+
+	list_for_each_entry(sprite, &crtc->sprites, link)
+		if (idx-- == 0)
+			return sprite;
+
+	return NULL;
+}
+
+uint32_t sna_crtc_to_sprite(xf86CrtcPtr crtc, unsigned idx)
+{
+	struct plane *sprite;
+
+	assert(to_sna_crtc(crtc));
+
+	sprite = lookup_sprite(to_sna_crtc(crtc), idx);
+	return sprite ? sprite->id : 0;
+}
+
+bool sna_crtc_is_transformed(xf86CrtcPtr crtc)
+{
+	assert(to_sna_crtc(crtc));
+	return to_sna_crtc(crtc)->transform;
+}
+
+static inline bool msc64(struct sna_crtc *sna_crtc, uint32_t seq, uint64_t *msc)
+{
+	bool record = true;
+	if (seq < sna_crtc->last_seq) {
+		if (sna_crtc->last_seq - seq > 0x40000000) {
+			sna_crtc->wrap_seq++;
+			DBG(("%s: pipe=%d wrapped; was %u, now %u, wraps=%u\n",
+			     __FUNCTION__, __sna_crtc_pipe(sna_crtc),
+			     sna_crtc->last_seq, seq, sna_crtc->wrap_seq));
+		} else {
+			DBG(("%s: pipe=%d msc went backwards; was %u, now %u; ignoring for last_swap\n",
+			     __FUNCTION__, __sna_crtc_pipe(sna_crtc), sna_crtc->last_seq, seq));
+
+			record = false;
+		}
+	}
+	*msc = (uint64_t)sna_crtc->wrap_seq << 32 | seq;
+	return record;
+}
+
+uint64_t sna_crtc_record_swap(xf86CrtcPtr crtc,
+			      int tv_sec, int tv_usec, unsigned seq)
+{
+	struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+	uint64_t msc;
+
+	assert(sna_crtc);
+
+	if (msc64(sna_crtc, seq, &msc)) {
+		DBG(("%s: recording last swap on pipe=%d, frame %d [msc=%08lld], time %d.%06d\n",
+		     __FUNCTION__, __sna_crtc_pipe(sna_crtc), seq, (long long)msc,
+		     tv_sec, tv_usec));
+		sna_crtc->swap.tv_sec = tv_sec;
+		sna_crtc->swap.tv_usec = tv_usec;
+		sna_crtc->swap.msc = msc;
+	} else {
+		DBG(("%s: swap event on pipe=%d, frame %d [msc=%08lld], time %d.%06d\n",
+		     __FUNCTION__, __sna_crtc_pipe(sna_crtc), seq, (long long)msc,
+		     tv_sec, tv_usec));
+	}
+
+	return msc;
+}
+
+const struct ust_msc *sna_crtc_last_swap(xf86CrtcPtr crtc)
+{
+	static struct ust_msc zero;
+
+	if (crtc == NULL) {
+		return &zero;
+	} else {
+		struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+		assert(sna_crtc);
+		return &sna_crtc->swap;
+	}
+}
+
+#ifndef NDEBUG
+static void gem_close(int fd, uint32_t handle);
+static void assert_scanout(struct kgem *kgem, struct kgem_bo *bo,
+			   int width, int height)
+{
+	struct drm_mode_fb_cmd info;
+
+	assert(bo->scanout);
+
+	VG_CLEAR(info);
+	info.fb_id = fb_id(bo);
+
+	assert(drmIoctl(kgem->fd, DRM_IOCTL_MODE_GETFB, &info) == 0);
+	gem_close(kgem->fd, info.handle);
+
+	assert(width <= info.width && height <= info.height);
+}
+#else
+#define assert_scanout(k, b, w, h)
+#endif
+
+static void assert_crtc_fb(struct sna *sna, struct sna_crtc *crtc)
+{
+#ifndef NDEBUG
+	struct drm_mode_crtc mode = { .crtc_id = __sna_crtc_id(crtc) };
+	drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCRTC, &mode);
+	assert(mode.fb_id == fb_id(crtc->bo));
+#endif
+}
+
+static unsigned get_fb(struct sna *sna, struct kgem_bo *bo,
+		       int width, int height)
+{
+	ScrnInfoPtr scrn = sna->scrn;
+	struct drm_mode_fb_cmd arg;
+
+	if (!kgem_bo_is_fenced(&sna->kgem, bo))
+		return 0;
+
+	assert(bo->refcnt);
+	assert(bo->proxy == NULL);
+	assert(!bo->snoop);
+	assert(8*bo->pitch >= width * scrn->bitsPerPixel);
+	assert(height * bo->pitch <= kgem_bo_size(bo)); /* XXX crtc offset */
+	if (fb_id(bo)) {
+		DBG(("%s: reusing fb=%d for handle=%d\n",
+		     __FUNCTION__, fb_id(bo), bo->handle));
+		assert_scanout(&sna->kgem, bo, width, height);
+		return fb_id(bo);
+	}
+
+	DBG(("%s: create fb %dx%d@%d/%d\n",
+	     __FUNCTION__, width, height, scrn->depth, scrn->bitsPerPixel));
+
+	assert(bo->tiling != I915_TILING_Y || sna->kgem.can_scanout_y);
+	assert((bo->pitch & 63) == 0);
+	assert(scrn->vtSema); /* must be master */
+
+	VG_CLEAR(arg);
+	arg.width = width;
+	arg.height = height;
+	arg.pitch = bo->pitch;
+	arg.bpp = scrn->bitsPerPixel;
+	arg.depth = scrn->depth;
+	arg.handle = bo->handle;
+
+	if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_ADDFB, &arg)) {
+		/* Try again with the fancy version */
+		struct local_mode_fb_cmd2 {
+			uint32_t fb_id;
+			uint32_t width, height;
+			uint32_t pixel_format;
+			uint32_t flags;
+
+			uint32_t handles[4];
+			uint32_t pitches[4]; /* pitch for each plane */
+			uint32_t offsets[4]; /* offset of each plane */
+			uint64_t modifiers[4];
+		} f;
+#define LOCAL_IOCTL_MODE_ADDFB2 DRM_IOWR(0xb8, struct local_mode_fb_cmd2)
+		memset(&f, 0, sizeof(f));
+		f.width = width;
+		f.height = height;
+		/* XXX interlaced */
+		f.flags = 1 << 1; /* +modifiers */
+		f.handles[0] = bo->handle;
+		f.pitches[0] = bo->pitch;
+
+		switch (bo->tiling) {
+		case I915_TILING_NONE:
+			break;
+		case I915_TILING_X:
+			/* I915_FORMAT_MOD_X_TILED */
+			f.modifiers[0] = (uint64_t)1 << 56 | 1;
+			break;
+		case I915_TILING_Y:
+			/* I915_FORMAT_MOD_X_TILED */
+			f.modifiers[0] = (uint64_t)1 << 56 | 2;
+			break;
+		}
+
+#define fourcc(a,b,c,d) ((a) | (b) << 8 | (c) << 16 | (d) << 24)
+		switch (scrn->depth) {
+		default:
+			ERR(("%s: unhandled screen format, depth=%d\n",
+			     __FUNCTION__, scrn->depth));
+			goto fail;
+		case 8:
+			f.pixel_format = fourcc('C', '8', ' ', ' ');
+			break;
+		case 15:
+			f.pixel_format = fourcc('X', 'R', '1', '5');
+			break;
+		case 16:
+			f.pixel_format = fourcc('R', 'G', '1', '6');
+			break;
+		case 24:
+			f.pixel_format = fourcc('X', 'R', '2', '4');
+			break;
+		case 30:
+			f.pixel_format = fourcc('X', 'R', '3', '0');
+			break;
+		}
+#undef fourcc
+
+		if (drmIoctl(sna->kgem.fd, LOCAL_IOCTL_MODE_ADDFB2, &f)) {
+fail:
+			xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+				   "%s: failed to add fb: %dx%d depth=%d, bpp=%d, pitch=%d: %d\n",
+				   __FUNCTION__, width, height,
+				   scrn->depth, scrn->bitsPerPixel, bo->pitch, errno);
+			return 0;
+		}
+
+		arg.fb_id = f.fb_id;
+	}
+	assert(arg.fb_id != 0);
+	bo->delta = arg.fb_id;
+	DBG(("%s: attached fb=%d to handle=%d\n",
+	     __FUNCTION__, bo->delta, arg.handle));
+
+	bo->scanout = true;
+	return bo->delta;
+}
+
+static uint32_t gem_create(int fd, int size)
+{
+	struct drm_i915_gem_create create;
+
+	assert((size & 4095) == 0);
+
+	VG_CLEAR(create);
+	create.handle = 0;
+	create.size = size;
+	(void)drmIoctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create);
+
+	return create.handle;
+}
+
+static void *gem_mmap(int fd, int handle, int size)
+{
+	struct drm_i915_gem_mmap_gtt mmap_arg;
+	struct drm_i915_gem_set_domain set_domain;
+	void *ptr;
+
+	VG_CLEAR(mmap_arg);
+	mmap_arg.handle = handle;
+	if (drmIoctl(fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &mmap_arg))
+		return NULL;
+
+	ptr = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, mmap_arg.offset);
+	if (ptr == MAP_FAILED)
+		return NULL;
+
+	VG_CLEAR(set_domain);
+	set_domain.handle = handle;
+	set_domain.read_domains = I915_GEM_DOMAIN_GTT;
+	set_domain.write_domain = I915_GEM_DOMAIN_GTT;
+	if (drmIoctl(fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &set_domain)) {
+		munmap(ptr, size);
+		return NULL;
+	}
+
+	return ptr;
+}
+
+static void gem_close(int fd, uint32_t handle)
+{
+	struct drm_gem_close close;
+
+	VG_CLEAR(close);
+	close.handle = handle;
+	(void)drmIoctl(fd, DRM_IOCTL_GEM_CLOSE, &close);
+}
+
+#define BACKLIGHT_NAME             "Backlight"
+#define BACKLIGHT_DEPRECATED_NAME  "BACKLIGHT"
+static Atom backlight_atom, backlight_deprecated_atom;
+
+#if HAVE_UDEV
+static void
+sna_backlight_uevent(int fd, void *closure)
+{
+	struct sna *sna = closure;
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	int i;
+
+	DBG(("%s()\n", __FUNCTION__));
+
+	/* Drain the event queue */
+	while (event_pending(fd)) {
+		struct udev_device *dev;
+
+		DBG(("%s: waiting for uevent\n", __FUNCTION__));
+		dev = udev_monitor_receive_device(sna->mode.backlight_monitor);
+		if (dev == NULL)
+			break;
+
+		udev_device_unref(dev);
+	}
+
+	/* Query all backlights for any changes */
+	DBG(("%s: probing backlights for changes\n", __FUNCTION__));
+	for (i = 0; i < sna->mode.num_real_output; i++) {
+		xf86OutputPtr output = config->output[i];
+		struct sna_output *sna_output = to_sna_output(output);
+		int val;
+
+		if (sna_output->dpms_mode != DPMSModeOn)
+			continue;
+
+		val = backlight_get(&sna_output->backlight);
+		if (val < 0)
+			continue;
+		DBG(("%s(%s): backlight '%s' was %d, now %d\n",
+		     __FUNCTION__, output->name, sna_output->backlight.iface,
+		     sna_output->backlight_active_level, val));
+
+		if (val == sna_output->backlight_active_level)
+			continue;
+
+		sna_output->backlight_active_level = val;
+
+		if (output->randr_output) {
+			DBG(("%s(%s): sending change notification\n", __FUNCTION__, output->name));
+			RRChangeOutputProperty(output->randr_output,
+					       backlight_atom, XA_INTEGER,
+					       32, PropModeReplace, 1, &val,
+					       TRUE, FALSE);
+			RRChangeOutputProperty(output->randr_output,
+					       backlight_deprecated_atom, XA_INTEGER,
+					       32, PropModeReplace, 1, &val,
+					       TRUE, FALSE);
+		}
+	}
+	DBG(("%s: complete\n", __FUNCTION__));
+}
+
+static void sna_backlight_pre_init(struct sna *sna)
+{
+	struct udev *u;
+	struct udev_monitor *mon;
+
+#if !USE_BACKLIGHT
+	return;
+#endif
+
+	u = udev_new();
+	if (!u)
+		return;
+
+	mon = udev_monitor_new_from_netlink(u, "udev");
+	if (!mon)
+		goto free_udev;
+
+	if (udev_monitor_filter_add_match_subsystem_devtype(mon, "backlight", NULL))
+		goto free_monitor;
+
+	if (udev_monitor_enable_receiving(mon))
+		goto free_monitor;
+
+	sna->mode.backlight_handler =
+		xf86AddGeneralHandler(udev_monitor_get_fd(mon),
+				      sna_backlight_uevent, sna);
+	if (!sna->mode.backlight_handler)
+		goto free_monitor;
+
+	DBG(("%s: installed backlight monitor\n", __FUNCTION__));
+	sna->mode.backlight_monitor = mon;
+
+	return;
+
+free_monitor:
+	udev_monitor_unref(mon);
+free_udev:
+	udev_unref(u);
+}
+
+static void sna_backlight_drain_uevents(struct sna *sna)
+{
+	if (sna->mode.backlight_monitor == NULL)
+		return;
+
+	DBG(("%s()\n", __FUNCTION__));
+	sna_backlight_uevent(udev_monitor_get_fd(sna->mode.backlight_monitor),
+			     sna);
+}
+
+static void sna_backlight_close(struct sna *sna)
+{
+	struct udev *u;
+
+	if (sna->mode.backlight_handler == NULL)
+		return;
+
+	xf86RemoveGeneralHandler(sna->mode.backlight_handler);
+
+	u = udev_monitor_get_udev(sna->mode.backlight_monitor);
+	udev_monitor_unref(sna->mode.backlight_monitor);
+	udev_unref(u);
+
+	sna->mode.backlight_handler = NULL;
+	sna->mode.backlight_monitor = NULL;
+}
+#else
+static void sna_backlight_pre_init(struct sna *sna) { }
+static void sna_backlight_drain_uevents(struct sna *sna) { }
+static void sna_backlight_close(struct sna *sna) { }
+#endif
+
+static void
+sna_output_backlight_disable(struct sna_output *sna_output)
+{
+	xf86OutputPtr output = sna_output->base;
+
+	xf86DrvMsg(output->scrn->scrnIndex, X_ERROR,
+		   "Failed to set backlight %s for output %s, disabling\n",
+		   sna_output->backlight.iface, output->name);
+	backlight_disable(&sna_output->backlight);
+	if (output->randr_output) {
+		RRDeleteOutputProperty(output->randr_output, backlight_atom);
+		RRDeleteOutputProperty(output->randr_output, backlight_deprecated_atom);
+	}
+}
+
+static int
+sna_output_backlight_set(struct sna_output *sna_output, int level)
+{
+	int ret = 0;
+
+	DBG(("%s(%s) level=%d, max=%d\n", __FUNCTION__,
+	     sna_output->base->name, level, sna_output->backlight.max));
+
+	if (backlight_set(&sna_output->backlight, level)) {
+		sna_output_backlight_disable(sna_output);
+		ret = -1;
+	}
+
+	/* Consume the uevent notification now so that we don't misconstrue
+	 * the change latter when we wake up and the output is in a different
+	 * state.
+	 */
+	sna_backlight_drain_uevents(to_sna(sna_output->base->scrn));
+	return ret;
+}
+
+static bool
+has_native_backlight(struct sna_output *sna_output)
+{
+	return sna_output->backlight.type == BL_RAW;
+}
+
+static void
+sna_output_backlight_off(struct sna_output *sna_output)
+{
+	/* Trust the kernel to turn the native backlight off. However, we
+	 * do explicitly turn the backlight back on (when we wake the output)
+	 * just in case a third party turns it off!
+	 */
+	if (has_native_backlight(sna_output))
+		return;
+
+	DBG(("%s(%s)\n", __FUNCTION__, sna_output->base->name));
+	backlight_off(&sna_output->backlight);
+	sna_output_backlight_set(sna_output, 0);
+}
+
+static void
+sna_output_backlight_on(struct sna_output *sna_output)
+{
+	DBG(("%s(%s)\n", __FUNCTION__, sna_output->base->name));
+	sna_output_backlight_set(sna_output,
+				 sna_output->backlight_active_level);
+	if (backlight_on(&sna_output->backlight) < 0)
+		sna_output_backlight_disable(sna_output);
+}
+
+static int
+sna_output_backlight_get(xf86OutputPtr output)
+{
+	struct sna_output *sna_output = output->driver_private;
+	int level = backlight_get(&sna_output->backlight);
+	DBG(("%s(%s) level=%d, max=%d\n", __FUNCTION__,
+	     output->name, level, sna_output->backlight.max));
+	return level;
+}
+
+static char *
+has_user_backlight_override(xf86OutputPtr output)
+{
+	struct sna *sna = to_sna(output->scrn);
+	const char *str;
+
+	str = xf86GetOptValString(sna->Options, OPTION_BACKLIGHT);
+	if (str == NULL)
+		return NULL;
+
+	DBG(("%s(%s) requested %s\n", __FUNCTION__, output->name, str));
+	if (*str == '\0')
+		return (char *)str;
+
+	if (!backlight_exists(str)) {
+		xf86DrvMsg(output->scrn->scrnIndex, X_ERROR,
+			   "Unrecognised backlight control interface '%s'\n",
+			   str);
+		return NULL;
+	}
+
+	return strdup(str);
+}
+
+static int get_device_minor(int fd)
+{
+	struct stat st;
+
+	if (fstat(fd, &st) || !S_ISCHR(st.st_mode))
+		return -1;
+
+	return st.st_rdev & 0x63;
+}
+
+static const char * const sysfs_connector_types[] = {
+	/* DRM_MODE_CONNECTOR_Unknown */	"Unknown",
+	/* DRM_MODE_CONNECTOR_VGA */		"VGA",
+	/* DRM_MODE_CONNECTOR_DVII */		"DVI-I",
+	/* DRM_MODE_CONNECTOR_DVID */		"DVI-D",
+	/* DRM_MODE_CONNECTOR_DVIA */		"DVI-A",
+	/* DRM_MODE_CONNECTOR_Composite */	"Composite",
+	/* DRM_MODE_CONNECTOR_SVIDEO */		"SVIDEO",
+	/* DRM_MODE_CONNECTOR_LVDS */		"LVDS",
+	/* DRM_MODE_CONNECTOR_Component */	"Component",
+	/* DRM_MODE_CONNECTOR_9PinDIN */	"DIN",
+	/* DRM_MODE_CONNECTOR_DisplayPort */	"DP",
+	/* DRM_MODE_CONNECTOR_HDMIA */		"HDMI-A",
+	/* DRM_MODE_CONNECTOR_HDMIB */		"HDMI-B",
+	/* DRM_MODE_CONNECTOR_TV */		"TV",
+	/* DRM_MODE_CONNECTOR_eDP */		"eDP",
+	/* DRM_MODE_CONNECTOR_VIRTUAL */	"Virtual",
+	/* DRM_MODE_CONNECTOR_DSI */		"DSI",
+	/* DRM_MODE_CONNECTOR_DPI */		"DPI"
+};
+
+static char *has_connector_backlight(xf86OutputPtr output)
+{
+	struct sna_output *sna_output = output->driver_private;
+	struct sna *sna = to_sna(output->scrn);
+	char path[1024];
+	DIR *dir;
+	struct dirent *de;
+	int minor, len;
+	char *str = NULL;
+
+	if (sna_output->connector_type >= ARRAY_SIZE(sysfs_connector_types))
+		return NULL;
+
+	minor = get_device_minor(sna->kgem.fd);
+	if (minor < 0)
+		return NULL;
+
+	len = snprintf(path, sizeof(path),
+		       "/sys/class/drm/card%d-%s-%d",
+		       minor,
+		       sysfs_connector_types[sna_output->connector_type],
+		       sna_output->connector_type_id);
+	DBG(("%s: lookup %s\n", __FUNCTION__, path));
+
+	dir = opendir(path);
+	if (dir == NULL)
+		return NULL;
+
+	while ((de = readdir(dir))) {
+		struct stat st;
+
+		if (*de->d_name == '.')
+			continue;
+
+		snprintf(path + len, sizeof(path) - len,
+			 "/%s", de->d_name);
+
+		if (stat(path, &st))
+			continue;
+
+		if (!S_ISDIR(st.st_mode))
+			continue;
+
+		DBG(("%s: testing %s as backlight\n",
+		     __FUNCTION__, de->d_name));
+
+		if (backlight_exists(de->d_name)) {
+			str = strdup(de->d_name); /* leak! */
+			break;
+		}
+	}
+
+	closedir(dir);
+	return str;
+}
+
+static void
+sna_output_backlight_init(xf86OutputPtr output)
+{
+	struct sna_output *sna_output = output->driver_private;
+	struct pci_device *pci;
+	MessageType from;
+	char *best_iface;
+
+#if !USE_BACKLIGHT
+	return;
+#endif
+
+	if (sna_output->is_panel) {
+		from = X_CONFIG;
+		best_iface = has_user_backlight_override(output);
+		if (best_iface)
+			goto done;
+	}
+
+	best_iface = has_connector_backlight(output);
+	if (best_iface)
+		goto done;
+
+	if (!sna_output->is_panel)
+		return;
+
+	/* XXX detect right backlight for multi-GPU/panels */
+	from = X_PROBED;
+	pci = xf86GetPciInfoForEntity(to_sna(output->scrn)->pEnt->index);
+	if (pci != NULL)
+		best_iface = backlight_find_for_device(pci);
+
+done:
+	DBG(("%s(%s) opening backlight %s\n", __FUNCTION__,
+	     output->name, best_iface ?: "none"));
+	sna_output->backlight_active_level =
+		backlight_open(&sna_output->backlight, best_iface);
+	DBG(("%s(%s): initial backlight value %d\n",
+	     __FUNCTION__, output->name, sna_output->backlight_active_level));
+	if (sna_output->backlight_active_level < 0)
+		return;
+
+	switch (sna_output->backlight.type) {
+	case BL_FIRMWARE: best_iface = (char *)"firmware"; break;
+	case BL_PLATFORM: best_iface = (char *)"platform"; break;
+	case BL_RAW: best_iface = (char *)"raw"; break;
+	default: best_iface = (char *)"unknown"; break;
+	}
+	xf86DrvMsg(output->scrn->scrnIndex, from,
+		   "Found backlight control interface %s (type '%s') for output %s\n",
+		   sna_output->backlight.iface, best_iface, output->name);
+}
+
+#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(22, 0)
+static inline int sigio_block(void)
+{
+	return 0;
+}
+static inline void sigio_unblock(int was_blocked)
+{
+	(void)was_blocked;
+}
+#elif XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,12,99,901,0)
+static inline int sigio_block(void)
+{
+	OsBlockSIGIO();
+	return 0;
+}
+static inline void sigio_unblock(int was_blocked)
+{
+	OsReleaseSIGIO();
+	(void)was_blocked;
+}
+#else
+#include <xf86_OSproc.h>
+static inline int sigio_block(void)
+{
+	return xf86BlockSIGIO();
+}
+static inline void sigio_unblock(int was_blocked)
+{
+	xf86UnblockSIGIO(was_blocked);
+}
+#endif
+
+static char *canonical_kmode_name(const struct drm_mode_modeinfo *kmode)
+{
+	char tmp[32], *buf;
+	int len;
+
+	len = sprintf(tmp, "%dx%d%s",
+		      kmode->hdisplay, kmode->vdisplay,
+		      kmode->flags & V_INTERLACE ? "i" : "");
+	if ((unsigned)len >= sizeof(tmp))
+		return NULL;
+
+	buf = malloc(len + 1);
+	if (buf == NULL)
+		return NULL;
+
+	return memcpy(buf, tmp, len + 1);
+}
+
+static char *get_kmode_name(const struct drm_mode_modeinfo *kmode)
+{
+	if (*kmode->name == '\0')
+		return canonical_kmode_name(kmode);
+
+	return strdup(kmode->name);
+}
+
+static DisplayModePtr
+mode_from_kmode(ScrnInfoPtr scrn,
+		const struct drm_mode_modeinfo *kmode,
+		DisplayModePtr mode)
+{
+	DBG(("kmode: %s, clock=%d, %d %d %d %d %d, %d %d %d %d %d, flags=%x, type=%x\n",
+	     kmode->name, kmode->clock,
+	     kmode->hdisplay, kmode->hsync_start, kmode->hsync_end, kmode->htotal, kmode->hskew,
+	     kmode->vdisplay, kmode->vsync_start, kmode->vsync_end, kmode->vtotal, kmode->vscan,
+	     kmode->flags, kmode->type));
+
+	mode->status = MODE_OK;
+
+	mode->Clock = kmode->clock;
+
+	mode->HDisplay = kmode->hdisplay;
+	mode->HSyncStart = kmode->hsync_start;
+	mode->HSyncEnd = kmode->hsync_end;
+	mode->HTotal = kmode->htotal;
+	mode->HSkew = kmode->hskew;
+
+	mode->VDisplay = kmode->vdisplay;
+	mode->VSyncStart = kmode->vsync_start;
+	mode->VSyncEnd = kmode->vsync_end;
+	mode->VTotal = kmode->vtotal;
+	mode->VScan = kmode->vscan;
+
+	mode->VRefresh = kmode->vrefresh;
+	mode->Flags = kmode->flags;
+	mode->name = get_kmode_name(kmode);
+
+	if (kmode->type & DRM_MODE_TYPE_DRIVER)
+		mode->type = M_T_DRIVER;
+	if (kmode->type & DRM_MODE_TYPE_PREFERRED)
+		mode->type |= M_T_PREFERRED;
+
+	if (mode->status == MODE_OK && kmode->flags & ~KNOWN_MODE_FLAGS)
+		mode->status = MODE_BAD; /* unknown flags => unhandled */
+
+	xf86SetModeCrtc(mode, scrn->adjustFlags);
+	return mode;
+}
+
+static void
+mode_to_kmode(struct drm_mode_modeinfo *kmode, DisplayModePtr mode)
+{
+	memset(kmode, 0, sizeof(*kmode));
+
+	kmode->clock = mode->Clock;
+	kmode->hdisplay = mode->HDisplay;
+	kmode->hsync_start = mode->HSyncStart;
+	kmode->hsync_end = mode->HSyncEnd;
+	kmode->htotal = mode->HTotal;
+	kmode->hskew = mode->HSkew;
+
+	kmode->vdisplay = mode->VDisplay;
+	kmode->vsync_start = mode->VSyncStart;
+	kmode->vsync_end = mode->VSyncEnd;
+	kmode->vtotal = mode->VTotal;
+	kmode->vscan = mode->VScan;
+
+	kmode->vrefresh = mode->VRefresh;
+	kmode->flags = mode->Flags;
+	if (mode->name)
+		strncpy(kmode->name, mode->name, DRM_DISPLAY_MODE_LEN);
+	kmode->name[DRM_DISPLAY_MODE_LEN-1] = 0;
+}
+
+static void
+sna_crtc_force_outputs_on(xf86CrtcPtr crtc)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
+	/* All attached outputs are valid, so update our timestamps */
+	unsigned now = GetTimeInMillis();
+	int i;
+
+	assert(to_sna_crtc(crtc));
+	DBG(("%s(pipe=%d)\n", __FUNCTION__, sna_crtc_pipe(crtc)));
+
+	/* DPMS handling by the kernel is inconsistent, so after setting a
+	 * mode on an output presume that we intend for it to be on, or that
+	 * the kernel will force it on.
+	 *
+	 * So force DPMS to be on for all connected outputs, and restore
+	 * the backlight.
+	 */
+	for (i = 0; i < config->num_output; i++) {
+		xf86OutputPtr output = config->output[i];
+
+		if (output->crtc != crtc)
+			continue;
+
+		__sna_output_dpms(output, DPMSModeOn, false);
+		if (to_sna_output(output)->last_detect)
+			to_sna_output(output)->last_detect = now;
+	}
+
+#if XF86_CRTC_VERSION >= 3
+	crtc->active = TRUE;
+#endif
+}
+
+static void
+sna_crtc_force_outputs_off(xf86CrtcPtr crtc)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
+	int i;
+
+	assert(to_sna_crtc(crtc));
+	DBG(("%s(pipe=%d)\n", __FUNCTION__, sna_crtc_pipe(crtc)));
+
+	/* DPMS handling by the kernel is inconsistent, so after setting a
+	 * mode on an output presume that we intend for it to be on, or that
+	 * the kernel will force it on.
+	 *
+	 * So force DPMS to be on for all connected outputs, and restore
+	 * the backlight.
+	 */
+	for (i = 0; i < config->num_output; i++) {
+		xf86OutputPtr output = config->output[i];
+
+		if (output->crtc != crtc)
+			continue;
+
+		__sna_output_dpms(output, DPMSModeOff, false);
+	}
+}
+
+static unsigned
+rotation_reflect(unsigned rotation)
+{
+	unsigned other_bits;
+
+	/* paranoia for future extensions */
+	other_bits = rotation & ~RR_Rotate_All;
+
+	/* flip the reflection to compensate for reflecting the rotation */
+	other_bits ^= RR_Reflect_X | RR_Reflect_Y;
+
+	/* Reflect the screen by rotating the rotation bit,
+	 * which has to have at least RR_Rotate_0 set. This allows
+	 * us to reflect any of the rotation bits, not just 0.
+	 */
+	rotation &= RR_Rotate_All;
+	assert(rotation);
+	rotation <<= 2; /* RR_Rotate_0 -> RR_Rotate_180 etc */
+	rotation |= rotation >> 4; /* RR_Rotate_270' to RR_Rotate_90 */
+	rotation &= RR_Rotate_All;
+	assert(rotation);
+
+	return rotation | other_bits;
+}
+
+static unsigned
+rotation_reduce(struct plane *p, unsigned rotation)
+{
+	/* If unsupported try exchanging rotation for a reflection */
+	if (rotation & ~p->rotation.supported) {
+		unsigned new_rotation = rotation_reflect(rotation);
+		if ((new_rotation & p->rotation.supported) == new_rotation)
+			rotation = new_rotation;
+	}
+
+	/* Only one rotation bit should be set */
+	assert(is_power_of_two(rotation & RR_Rotate_All));
+
+	return rotation;
+}
+
+static bool
+rotation_set(struct sna *sna, struct plane *p, uint32_t desired)
+{
+#define LOCAL_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xbA, struct local_mode_obj_set_property)
+	struct local_mode_obj_set_property {
+		uint64_t value;
+		uint32_t prop_id;
+		uint32_t obj_id;
+		uint32_t obj_type;
+		uint32_t pad;
+	} prop;
+
+	if (desired == p->rotation.current)
+		return true;
+
+	if ((desired & p->rotation.supported) != desired) {
+		errno = EINVAL;
+		return false;
+	}
+
+	DBG(("%s: obj=%d, type=%x prop=%d set-rotation=%x\n",
+	     __FUNCTION__, p->id, LOCAL_MODE_OBJECT_PLANE, p->rotation.prop, desired));
+
+	assert(p->id);
+	assert(p->rotation.prop);
+
+	VG_CLEAR(prop);
+	prop.obj_id = p->id;
+	prop.obj_type = LOCAL_MODE_OBJECT_PLANE;
+	prop.prop_id = p->rotation.prop;
+	prop.value = desired;
+
+	if (drmIoctl(sna->kgem.fd, LOCAL_IOCTL_MODE_OBJ_SETPROPERTY, &prop))
+		return false;
+
+	p->rotation.current = desired;
+	return true;
+}
+
+static void
+rotation_reset(struct plane *p)
+{
+	if (p->rotation.prop == 0)
+		return;
+
+	p->rotation.current = 0;
+}
+
+bool sna_crtc_set_sprite_rotation(xf86CrtcPtr crtc,
+				  unsigned idx,
+				  uint32_t rotation)
+{
+	struct plane *sprite;
+	assert(to_sna_crtc(crtc));
+
+	sprite = lookup_sprite(to_sna_crtc(crtc), idx);
+	if (!sprite)
+		return false;
+
+	DBG(("%s: CRTC:%d [pipe=%d], sprite=%u set-rotation=%x\n",
+	     __FUNCTION__,
+	     sna_crtc_id(crtc), sna_crtc_pipe(crtc),
+	     sprite->id, rotation));
+
+	return rotation_set(to_sna(crtc->scrn), sprite,
+			    rotation_reduce(sprite, rotation));
+}
+
+#if HAS_DEBUG_FULL
+#if !HAS_DEBUG_FULL
+#define LogF ErrorF
+#endif
+struct kmsg {
+	int fd;
+	int saved_loglevel;
+};
+
+static int kmsg_get_debug(void)
+{
+	int v = -1;
+	int fd;
+
+	fd = open("/sys/module/drm/parameters/debug", O_RDONLY);
+	if (fd != -1) {
+		char buf[128];
+		int len;
+
+		len = read(fd, buf, sizeof(buf) - 1);
+		if (len != -1) {
+			buf[len] = '\0';
+			v = atoi(buf);
+		}
+		close(fd);
+	}
+
+	return v;
+}
+
+static void kmsg_set_debug(int v)
+{
+	char buf[128];
+	int len;
+	int fd;
+
+	len = snprintf(buf, sizeof(buf), "%d\n", v);
+
+	fd = open("/sys/module/drm/parameters/debug", O_WRONLY);
+	if (fd != -1) {
+		write(fd, buf, len);
+		close(fd);
+	}
+}
+
+static void kmsg_open(struct kmsg *k)
+{
+	k->saved_loglevel = kmsg_get_debug();
+	if (k->saved_loglevel != -1)
+		kmsg_set_debug(0xff);
+
+	k->fd = open("/dev/kmsg", O_RDONLY | O_NONBLOCK);
+	if (k->fd != -1)
+		lseek(k->fd, 0, SEEK_END);
+}
+
+static void kmsg_close(struct kmsg *k, int dump)
+{
+	FILE *file;
+
+	file = NULL;
+	if (k->fd != -1 && dump)
+		file = fdopen(k->fd, "r");
+	if (file) {
+		size_t len = 0;
+		char *line = NULL;
+
+		while (getline(&line, &len, file) != -1) {
+			char *start = strchr(line, ';');
+			if (start)
+				LogF("KMSG: %s", start + 1);
+		}
+
+		free(line);
+		fclose(file);
+	}
+
+	if (k->fd != -1)
+		close(k->fd);
+
+	if (k->saved_loglevel != -1)
+		kmsg_set_debug(k->saved_loglevel);
+}
+#else
+struct kmsg { int unused; };
+static void kmsg_open(struct kmsg *k) {}
+static void kmsg_close(struct kmsg *k, int dump) {}
+#endif
+
+static int
+sna_crtc_apply(xf86CrtcPtr crtc)
+{
+	struct sna *sna = to_sna(crtc->scrn);
+	struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
+	struct drm_mode_crtc arg;
+	uint32_t output_ids[32];
+	int output_count = 0;
+	int sigio, i;
+	struct kmsg kmsg;
+	int ret = EINVAL;
+
+	DBG(("%s CRTC:%d [pipe=%d], handle=%d\n", __FUNCTION__,
+	     __sna_crtc_id(sna_crtc), __sna_crtc_pipe(sna_crtc),
+	     sna_crtc->bo->handle));
+	if (!sna_crtc->kmode.clock) {
+		ERR(("%s(CRTC:%d [pipe=%d]): attempted to set an invalid mode\n",
+		     __FUNCTION__, __sna_crtc_id(sna_crtc), __sna_crtc_pipe(sna_crtc)));
+		return EINVAL;
+	}
+
+	kmsg_open(&kmsg);
+	sigio = sigio_block();
+
+	assert(sna->mode.num_real_output < ARRAY_SIZE(output_ids));
+	sna_crtc_disable_cursor(sna, sna_crtc);
+
+	if (!rotation_set(sna, &sna_crtc->primary, sna_crtc->rotation)) {
+		memset(&arg, 0, sizeof(arg));
+		arg.crtc_id = __sna_crtc_id(sna_crtc);
+		(void)drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_SETCRTC, &arg);
+	}
+
+	if (!rotation_set(sna, &sna_crtc->primary, sna_crtc->rotation)) {
+		ERR(("%s: set-primary-rotation failed (rotation-id=%d, rotation=%d) on CRTC:%d [pipe=%d], errno=%d\n",
+		     __FUNCTION__, sna_crtc->primary.rotation.prop, sna_crtc->rotation, __sna_crtc_id(sna_crtc), __sna_crtc_pipe(sna_crtc), errno));
+		sna_crtc->primary.rotation.supported &= ~sna_crtc->rotation;
+		goto unblock;
+	}
+	DBG(("%s: CRTC:%d [pipe=%d] primary rotation set to %x\n",
+	     __FUNCTION__, __sna_crtc_id(sna_crtc), __sna_crtc_pipe(sna_crtc), sna_crtc->rotation));
+
+	for (i = 0; i < sna->mode.num_real_output; i++) {
+		xf86OutputPtr output = config->output[i];
+
+		/* Make sure we mark the output as off (and save the backlight)
+		 * before the kernel turns it off due to changing the pipe.
+		 * This is necessary as the kernel may turn off the backlight
+		 * and we lose track of the user settings.
+		 */
+		if (output->crtc == NULL)
+			__sna_output_dpms(output, DPMSModeOff, false);
+
+		if (output->crtc != crtc)
+			continue;
+
+		/* Skip over any hotunplugged outputs so that we can
+		 * recover in cases where the previous mode is now
+		 * only partially valid.
+		 */
+		if (!to_sna_output(output)->id)
+			continue;
+
+		DBG(("%s: attaching output '%s' %d [%d] to crtc:%d (pipe %d) (possible crtc:%x, possible clones:%x)\n",
+		     __FUNCTION__, output->name, i, to_connector_id(output),
+		     __sna_crtc_id(sna_crtc), __sna_crtc_pipe(sna_crtc),
+		     (uint32_t)output->possible_crtcs,
+		     (uint32_t)output->possible_clones));
+
+		assert(output->possible_crtcs & (1 << __sna_crtc_pipe(sna_crtc)) ||
+		       is_zaphod(crtc->scrn));
+
+		output_ids[output_count] = to_connector_id(output);
+		if (++output_count == ARRAY_SIZE(output_ids)) {
+			DBG(("%s: too many outputs (%d) for me!\n",
+			     __FUNCTION__, output_count));
+			goto unblock;
+		}
+	}
+	if (output_count == 0) {
+		DBG(("%s: no outputs\n", __FUNCTION__));
+		goto unblock;
+	}
+
+	VG_CLEAR(arg);
+	arg.crtc_id = __sna_crtc_id(sna_crtc);
+	arg.fb_id = fb_id(sna_crtc->bo);
+	if (sna_crtc->transform || sna_crtc->slave_pixmap) {
+		arg.x = 0;
+		arg.y = 0;
+		sna_crtc->offset = 0;
+	} else {
+		arg.x = crtc->x;
+		arg.y = crtc->y;
+		sna_crtc->offset = arg.y << 16 | arg.x;
+	}
+	arg.set_connectors_ptr = (uintptr_t)output_ids;
+	arg.count_connectors = output_count;
+	arg.mode = sna_crtc->kmode;
+	arg.mode_valid = 1;
+
+	DBG(("%s: applying crtc [%d, pipe=%d] mode=%dx%d+%d+%d@%d, fb=%d%s%s update to %d outputs [%d...]\n",
+	     __FUNCTION__, __sna_crtc_id(sna_crtc), __sna_crtc_pipe(sna_crtc),
+	     arg.mode.hdisplay,
+	     arg.mode.vdisplay,
+	     arg.x, arg.y,
+	     arg.mode.clock,
+	     arg.fb_id,
+	     sna_crtc->shadow ? " [shadow]" : "",
+	     sna_crtc->transform ? " [transformed]" : "",
+	     output_count, output_count ? output_ids[0] : 0));
+
+	ret = 0;
+	if (unlikely(drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_SETCRTC, &arg))) {
+		ret = errno;
+		goto unblock;
+	}
+
+	sna_crtc->mode_serial++;
+	sna_crtc_force_outputs_on(crtc);
+
+unblock:
+	sigio_unblock(sigio);
+	kmsg_close(&kmsg, ret);
+	return ret;
+}
+
+static bool overlap(const BoxRec *a, const BoxRec *b)
+{
+	if (a->x1 >= b->x2)
+		return false;
+	if (a->x2 <= b->x1)
+		return false;
+
+	if (a->y1 >= b->y2)
+		return false;
+	if (a->y2 <= b->y1)
+		return false;
+
+	return true;
+}
+
+static void defer_event(struct sna *sna, struct drm_event *base)
+{
+	if (sna->mode.shadow_nevent == sna->mode.shadow_size) {
+		int size = sna->mode.shadow_size * 2;
+		void *ptr;
+
+		ptr = realloc(sna->mode.shadow_events,
+			      sizeof(struct drm_event_vblank)*size);
+		if (!ptr)
+			return;
+
+		sna->mode.shadow_events = ptr;
+		sna->mode.shadow_size = size;
+	}
+
+	memcpy(&sna->mode.shadow_events[sna->mode.shadow_nevent++],
+	       base, sizeof(struct drm_event_vblank));
+	DBG(("%s: deferring event count=%d\n",
+	     __func__, sna->mode.shadow_nevent));
+}
+
+static void flush_events(struct sna *sna)
+{
+	int n;
+
+	if (!sna->mode.shadow_nevent)
+		return;
+
+	DBG(("%s: flushing %d events=%d\n", __func__, sna->mode.shadow_nevent));
+
+	for (n = 0; n < sna->mode.shadow_nevent; n++) {
+		struct drm_event_vblank *vb = &sna->mode.shadow_events[n];
+
+		if ((uintptr_t)(vb->user_data) & 2)
+			sna_present_vblank_handler(vb);
+		else
+			sna_dri2_vblank_handler(vb);
+	}
+
+	sna->mode.shadow_nevent = 0;
+}
+
+
+static bool wait_for_shadow(struct sna *sna,
+			    struct sna_pixmap *priv,
+			    unsigned flags)
+{
+	PixmapPtr pixmap = priv->pixmap;
+	struct kgem_bo *bo, *tmp;
+	int flip_active;
+	bool ret = true;
+
+	DBG(("%s: enabled? %d flags=%x, flips=%d, pixmap=%ld [front?=%d], handle=%d, shadow=%d\n",
+	     __FUNCTION__, sna->mode.shadow_enabled,
+	     flags, sna->mode.flip_active,
+	     pixmap->drawable.serialNumber, pixmap == sna->front,
+	     priv->gpu_bo->handle, sna->mode.shadow->handle));
+
+	assert(priv->move_to_gpu_data == sna);
+	assert(sna->mode.shadow != priv->gpu_bo);
+
+	if (flags == 0 || pixmap != sna->front || !sna->mode.shadow_enabled)
+		goto done;
+
+	assert(sna->mode.shadow_damage);
+
+	if ((flags & MOVE_WRITE) == 0) {
+		if ((flags & __MOVE_SCANOUT) == 0) {
+			struct sna_crtc *crtc;
+
+			list_for_each_entry(crtc, &sna->mode.shadow_crtc, shadow_link) {
+				if (overlap(&sna->mode.shadow_region.extents,
+					    &crtc->base->bounds)) {
+					DrawableRec draw;
+					RegionRec region;
+
+					draw.width = crtc->base->mode.HDisplay;
+					draw.height = crtc->base->mode.VDisplay;
+					draw.depth = sna->front->drawable.depth;
+					draw.bitsPerPixel = sna->front->drawable.bitsPerPixel;
+
+					DBG(("%s: copying replaced CRTC: (%d, %d), (%d, %d), handle=%d\n",
+					     __FUNCTION__,
+					     crtc->base->bounds.x1,
+					     crtc->base->bounds.y1,
+					     crtc->base->bounds.x2,
+					     crtc->base->bounds.y2,
+					     crtc->client_bo->handle));
+
+					ret &= sna->render.copy_boxes(sna, GXcopy,
+								      &draw, crtc->client_bo, -crtc->base->bounds.x1, -crtc->base->bounds.y1,
+								      &pixmap->drawable, priv->gpu_bo, 0, 0,
+								      &crtc->base->bounds, 1,
+								      0);
+
+					region.extents = crtc->base->bounds;
+					region.data = NULL;
+					RegionSubtract(&sna->mode.shadow_region, &sna->mode.shadow_region, &region);
+				}
+			}
+		}
+
+		return ret;
+	}
+
+	assert(sna->mode.shadow_active);
+
+	flip_active = sna->mode.flip_active;
+	if (flip_active) {
+		struct sna_crtc *crtc;
+		list_for_each_entry(crtc, &sna->mode.shadow_crtc, shadow_link)
+			flip_active -= crtc->flip_pending;
+		DBG(("%s: %d flips still pending, shadow flip_active=%d\n",
+		     __FUNCTION__, sna->mode.flip_active, flip_active));
+	}
+
+	bo = sna->mode.shadow;
+	if (flip_active) {
+		bo = kgem_create_2d(&sna->kgem,
+				    pixmap->drawable.width,
+				    pixmap->drawable.height,
+				    pixmap->drawable.bitsPerPixel,
+				    priv->gpu_bo->tiling,
+				    CREATE_EXACT | CREATE_SCANOUT);
+		if (bo == NULL)
+			return false;
+
+		DBG(("%s: replacing still-attached GPU bo handle=%d, flips=%d\n",
+		     __FUNCTION__, priv->gpu_bo->tiling, sna->mode.flip_active));
+
+		RegionUninit(&sna->mode.shadow_region);
+		sna->mode.shadow_region.extents.x1 = 0;
+		sna->mode.shadow_region.extents.y1 = 0;
+		sna->mode.shadow_region.extents.x2 = pixmap->drawable.width;
+		sna->mode.shadow_region.extents.y2 = pixmap->drawable.height;
+		sna->mode.shadow_region.data = NULL;
+	}
+
+	if (bo->refcnt > 1) {
+		bo = kgem_create_2d(&sna->kgem,
+				    pixmap->drawable.width,
+				    pixmap->drawable.height,
+				    pixmap->drawable.bitsPerPixel,
+				    priv->gpu_bo->tiling,
+				    CREATE_EXACT | CREATE_SCANOUT);
+		if (bo != NULL) {
+			DBG(("%s: replacing exported GPU bo\n",
+			     __FUNCTION__));
+
+			RegionUninit(&sna->mode.shadow_region);
+			sna->mode.shadow_region.extents.x1 = 0;
+			sna->mode.shadow_region.extents.y1 = 0;
+			sna->mode.shadow_region.extents.x2 = pixmap->drawable.width;
+			sna->mode.shadow_region.extents.y2 = pixmap->drawable.height;
+			sna->mode.shadow_region.data = NULL;
+		} else
+			bo = sna->mode.shadow;
+	}
+
+	RegionSubtract(&sna->mode.shadow_region,
+		       &sna->mode.shadow_region,
+		       &sna->mode.shadow_cancel);
+
+	while (!list_is_empty(&sna->mode.shadow_crtc)) {
+		struct sna_crtc *crtc =
+			list_first_entry(&sna->mode.shadow_crtc, struct sna_crtc, shadow_link);
+		if (overlap(&crtc->base->bounds,
+			    &sna->mode.shadow_region.extents)) {
+			RegionRec region;
+			DrawableRec draw;
+
+			draw.width = crtc->base->mode.HDisplay;
+			draw.height = crtc->base->mode.VDisplay;
+			draw.depth = sna->front->drawable.depth;
+			draw.bitsPerPixel = sna->front->drawable.bitsPerPixel;
+
+			DBG(("%s: copying replaced CRTC: (%d, %d), (%d, %d), handle=%d\n",
+			     __FUNCTION__,
+			     crtc->base->bounds.x1,
+			     crtc->base->bounds.y1,
+			     crtc->base->bounds.x2,
+			     crtc->base->bounds.y2,
+			     crtc->client_bo->handle));
+
+			ret = sna->render.copy_boxes(sna, GXcopy,
+						     &draw, crtc->client_bo, -crtc->base->bounds.x1, -crtc->base->bounds.y1,
+						     &pixmap->drawable, bo, 0, 0,
+						     &crtc->base->bounds, 1,
+						     0);
+
+
+			region.extents = crtc->base->bounds;
+			region.data = NULL;
+			RegionSubtract(&sna->mode.shadow_region, &sna->mode.shadow_region, &region);
+		}
+
+		crtc->client_bo->active_scanout--;
+		kgem_bo_destroy(&sna->kgem, crtc->client_bo);
+		crtc->client_bo = NULL;
+		list_del(&crtc->shadow_link);
+	}
+
+	if (RegionNotEmpty(&sna->mode.shadow_region)) {
+		DBG(("%s: copying existing GPU damage: %dx(%d, %d), (%d, %d)\n",
+		     __FUNCTION__, region_num_rects(&sna->mode.shadow_region),
+		     sna->mode.shadow_region.extents.x1,
+		     sna->mode.shadow_region.extents.y1,
+		     sna->mode.shadow_region.extents.x2,
+		     sna->mode.shadow_region.extents.y2));
+		if (!sna->render.copy_boxes(sna, GXcopy,
+					    &pixmap->drawable, priv->gpu_bo, 0, 0,
+					    &pixmap->drawable, bo, 0, 0,
+					    region_rects(&sna->mode.shadow_region),
+					    region_num_rects(&sna->mode.shadow_region),
+					    0))
+			ERR(("%s: copy failed\n", __FUNCTION__));
+	}
+
+	if (priv->cow)
+		sna_pixmap_undo_cow(sna, priv, 0);
+
+	sna_pixmap_unmap(pixmap, priv);
+
+	DBG(("%s: setting front pixmap to handle=%d\n", __FUNCTION__, bo->handle));
+	assert(sna->mode.shadow->active_scanout);
+	sna->mode.shadow->active_scanout--;
+	tmp = priv->gpu_bo;
+	priv->gpu_bo = bo;
+	if (bo != sna->mode.shadow)
+		kgem_bo_destroy(&sna->kgem, sna->mode.shadow);
+	sna->mode.shadow = tmp;
+	sna->mode.shadow->active_scanout++;
+	assert(sna->mode.shadow->active_scanout);
+
+	sna_dri2_pixmap_update_bo(sna, pixmap, bo);
+
+done:
+	RegionEmpty(&sna->mode.shadow_cancel);
+	RegionEmpty(&sna->mode.shadow_region);
+	sna->mode.shadow_dirty = false;
+
+	priv->move_to_gpu_data = NULL;
+	priv->move_to_gpu = NULL;
+
+	assert(sna->mode.shadow->active_scanout);
+	return ret;
+}
+
+bool sna_pixmap_discard_shadow_damage(struct sna_pixmap *priv,
+				      const RegionRec *region)
+{
+	struct sna *sna;
+
+	if (priv->move_to_gpu != wait_for_shadow)
+		return false;
+
+	sna = priv->move_to_gpu_data;
+	if (region) {
+		DBG(("%s: discarding region %dx[(%d, %d), (%d, %d)] from damage %dx[(%d, %d], (%d, %d)]\n",
+		     __FUNCTION__,
+		     region_num_rects(region),
+		     region->extents.x1, region->extents.y1,
+		     region->extents.x2, region->extents.y2,
+		     region_num_rects(&sna->mode.shadow_region),
+		     sna->mode.shadow_region.extents.x1, sna->mode.shadow_region.extents.y1,
+		     sna->mode.shadow_region.extents.x2, sna->mode.shadow_region.extents.y2));
+
+		RegionSubtract(&sna->mode.shadow_region,
+			       &sna->mode.shadow_region,
+			       (RegionPtr)region);
+		RegionUnion(&sna->mode.shadow_cancel,
+			    &sna->mode.shadow_cancel,
+			    (RegionPtr)region);
+	} else {
+		DBG(("%s: discarding all damage %dx[(%d, %d], (%d, %d)]\n",
+		     __FUNCTION__,
+		     region_num_rects(&sna->mode.shadow_region),
+		     sna->mode.shadow_region.extents.x1, sna->mode.shadow_region.extents.y1,
+		     sna->mode.shadow_region.extents.x2, sna->mode.shadow_region.extents.y2));
+		RegionEmpty(&sna->mode.shadow_region);
+
+		RegionUninit(&sna->mode.shadow_cancel);
+		sna->mode.shadow_cancel.extents.x1 = 0;
+		sna->mode.shadow_cancel.extents.y1 = 0;
+		sna->mode.shadow_cancel.extents.x2 = sna->front->drawable.width;
+		sna->mode.shadow_cancel.extents.y2 = sna->front->drawable.height;
+		sna->mode.shadow_cancel.data = NULL;
+	}
+
+	return RegionNil(&sna->mode.shadow_region);
+}
+
+static void sna_mode_damage(DamagePtr damage, RegionPtr region, void *closure)
+{
+	struct sna *sna = closure;
+
+	if (sna->mode.rr_active)
+		return;
+
+	/* Throw away the rectangles if the region grows too big */
+	region = DamageRegion(damage);
+	if (region->data) {
+		RegionRec dup;
+
+		dup = *region;
+		RegionUninit(&dup);
+
+		region->data = NULL;
+	}
+}
+
+static bool sna_mode_enable_shadow(struct sna *sna)
+{
+	ScreenPtr screen = to_screen_from_sna(sna);
+
+	DBG(("%s\n", __FUNCTION__));
+	assert(sna->mode.shadow == NULL);
+	assert(sna->mode.shadow_damage == NULL);
+	assert(sna->mode.shadow_active == 0);
+	assert(!sna->mode.shadow_enabled);
+
+	sna->mode.shadow_damage = DamageCreate(sna_mode_damage, NULL,
+					       DamageReportRawRegion,
+					       TRUE, screen, sna);
+	if (!sna->mode.shadow_damage)
+		return false;
+
+	DamageRegister(&sna->front->drawable, sna->mode.shadow_damage);
+	sna->mode.shadow_enabled = true;
+	return true;
+}
+
+static void sna_mode_disable_shadow(struct sna *sna)
+{
+	struct sna_pixmap *priv;
+
+	if (!sna->mode.shadow_damage) {
+		assert(!sna->mode.shadow_enabled);
+		return;
+	}
+
+	DBG(("%s\n", __FUNCTION__));
+
+	priv = sna_pixmap(sna->front);
+	if (priv->move_to_gpu == wait_for_shadow)
+		priv->move_to_gpu(sna, priv, 0);
+
+	DamageUnregister(&sna->front->drawable, sna->mode.shadow_damage);
+	DamageDestroy(sna->mode.shadow_damage);
+	sna->mode.shadow_damage = NULL;
+	sna->mode.shadow_enabled = false;
+
+	if (sna->mode.shadow) {
+		sna->mode.shadow->active_scanout--;
+		kgem_bo_destroy(&sna->kgem, sna->mode.shadow);
+		sna->mode.shadow = NULL;
+	}
+
+	assert(sna->mode.shadow_active == 0);
+	sna->mode.shadow_dirty = false;
+}
+
+static void sna_crtc_slave_damage(DamagePtr damage, RegionPtr region, void *closure)
+{
+	struct sna_crtc *crtc = closure;
+	struct sna *sna = to_sna(crtc->base->scrn);
+	RegionPtr scr;
+
+	DBG(("%s: pushing damage [(%d, %d), (%d, %d) x %d] to CRTC [pipe=%d] (%d, %d)\n",
+	     __FUNCTION__,
+	     region->extents.x1, region->extents.y1, region->extents.x2, region->extents.y2,
+	     region_num_rects(region),
+	     __sna_crtc_pipe(crtc), crtc->base->x, crtc->base->y));
+
+	assert(crtc->slave_damage == damage);
+	assert(sna->mode.shadow_damage);
+
+	RegionTranslate(region, crtc->base->x, crtc->base->y);
+	scr = DamageRegion(sna->mode.shadow_damage);
+	RegionUnion(scr, scr, region);
+	RegionTranslate(region, -crtc->base->x, -crtc->base->y);
+}
+
+static bool sna_crtc_enable_shadow(struct sna *sna, struct sna_crtc *crtc)
+{
+	if (crtc->shadow) {
+		assert(sna->mode.shadow_damage && sna->mode.shadow_active);
+		return true;
+	}
+
+	DBG(("%s: enabling for crtc %d\n", __FUNCTION__, __sna_crtc_id(crtc)));
+
+	if (!sna->mode.shadow_active) {
+		if (!sna_mode_enable_shadow(sna))
+			return false;
+		assert(sna->mode.shadow_damage);
+		assert(sna->mode.shadow == NULL);
+	}
+
+	if (crtc->slave_pixmap) {
+		assert(crtc->slave_damage == NULL);
+
+		DBG(("%s: enabling PRIME slave tracking on CRTC %d [pipe=%d], pixmap=%ld\n",
+		     __FUNCTION__, __sna_crtc_id(crtc), __sna_crtc_pipe(crtc), crtc->slave_pixmap->drawable.serialNumber));
+		crtc->slave_damage = DamageCreate(sna_crtc_slave_damage, NULL,
+						  DamageReportRawRegion, TRUE,
+						  to_screen_from_sna(sna),
+						  crtc);
+		if (crtc->slave_damage == NULL) {
+			if (!--sna->mode.shadow_active)
+				sna_mode_disable_shadow(sna);
+			return false;
+		}
+
+		DamageRegister(&crtc->slave_pixmap->drawable, crtc->slave_damage);
+	}
+
+	crtc->shadow = true;
+	sna->mode.shadow_active++;
+	return true;
+}
+
+static void sna_crtc_disable_override(struct sna *sna, struct sna_crtc *crtc)
+{
+	if (crtc->client_bo == NULL)
+		return;
+
+	assert(crtc->client_bo->refcnt >= crtc->client_bo->active_scanout);
+	crtc->client_bo->active_scanout--;
+
+	if (!crtc->transform) {
+		DrawableRec tmp;
+
+		tmp.width = crtc->base->mode.HDisplay;
+		tmp.height = crtc->base->mode.VDisplay;
+		tmp.depth = sna->front->drawable.depth;
+		tmp.bitsPerPixel = sna->front->drawable.bitsPerPixel;
+
+		sna->render.copy_boxes(sna, GXcopy,
+				       &tmp, crtc->client_bo, -crtc->base->bounds.x1, -crtc->base->bounds.y1,
+				       &sna->front->drawable, __sna_pixmap_get_bo(sna->front), 0, 0,
+				       &crtc->base->bounds, 1, 0);
+		list_del(&crtc->shadow_link);
+	}
+	kgem_bo_destroy(&sna->kgem, crtc->client_bo);
+	crtc->client_bo = NULL;
+}
+
+static void sna_crtc_disable_shadow(struct sna *sna, struct sna_crtc *crtc)
+{
+	crtc->fallback_shadow = false;
+	if (!crtc->shadow)
+		return;
+
+	DBG(("%s: disabling for crtc %d\n", __FUNCTION__, __sna_crtc_id(crtc)));
+	assert(sna->mode.shadow_active > 0);
+
+	if (crtc->slave_damage) {
+		assert(crtc->slave_pixmap);
+		DamageUnregister(&crtc->slave_pixmap->drawable, crtc->slave_damage);
+		DamageDestroy(crtc->slave_damage);
+		crtc->slave_damage = NULL;
+	}
+
+	sna_crtc_disable_override(sna, crtc);
+
+	if (!--sna->mode.shadow_active)
+		sna_mode_disable_shadow(sna);
+
+	crtc->shadow = false;
+}
+
+static void
+__sna_crtc_disable(struct sna *sna, struct sna_crtc *sna_crtc)
+{
+	sna_crtc->mode_serial++;
+
+	sna_crtc_disable_cursor(sna, sna_crtc);
+	rotation_set(sna, &sna_crtc->primary, RR_Rotate_0);
+	sna_crtc_disable_shadow(sna, sna_crtc);
+
+	if (sna_crtc->bo) {
+		DBG(("%s: releasing handle=%d from scanout, active=%d\n",
+		     __FUNCTION__,sna_crtc->bo->handle, sna_crtc->bo->active_scanout-1));
+		assert(sna_crtc->public.flags & CRTC_ON);
+		assert(sna_crtc->bo->active_scanout);
+		assert(sna_crtc->bo->refcnt >= sna_crtc->bo->active_scanout);
+		sna_crtc->bo->active_scanout--;
+		kgem_bo_destroy(&sna->kgem, sna_crtc->bo);
+		sna_crtc->bo = NULL;
+		sna_crtc->public.flags &= ~CRTC_ON;
+
+		if (sna->mode.hidden) {
+			sna->mode.hidden--;
+			assert(sna->mode.hidden);
+			assert(sna->mode.front_active == 0);
+		} else {
+			assert(sna->mode.front_active);
+			sna->mode.front_active--;
+		}
+		sna->mode.dirty = true;
+	}
+
+	if (sna_crtc->shadow_bo) {
+		kgem_bo_destroy(&sna->kgem, sna_crtc->shadow_bo);
+		sna_crtc->shadow_bo = NULL;
+	}
+	if (sna_crtc->transform) {
+		assert(sna->mode.rr_active);
+		sna->mode.rr_active--;
+		sna_crtc->transform = false;
+	}
+
+	sna_crtc->cursor_transform = false;
+	sna_crtc->hwcursor = true;
+	assert(!sna_crtc->shadow);
+}
+
+static void
+sna_crtc_disable(xf86CrtcPtr crtc, bool force)
+{
+	struct sna *sna = to_sna(crtc->scrn);
+	struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+	struct drm_mode_crtc arg;
+
+	if (sna_crtc == NULL)
+		return;
+
+	if (!force && sna_crtc->bo == NULL)
+		return;
+
+	DBG(("%s: disabling crtc [%d, pipe=%d], force?=%d\n", __FUNCTION__,
+	     __sna_crtc_id(sna_crtc), __sna_crtc_pipe(sna_crtc), force));
+
+	sna_crtc_force_outputs_off(crtc);
+
+	memset(&arg, 0, sizeof(arg));
+	arg.crtc_id = __sna_crtc_id(sna_crtc);
+	(void)drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_SETCRTC, &arg);
+
+	__sna_crtc_disable(sna, sna_crtc);
+}
+
+static void update_flush_interval(struct sna *sna)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	int i, max_vrefresh = 0;
+
+	DBG(("%s: front_active=%d\n", __FUNCTION__, sna->mode.front_active));
+
+	for (i = 0; i < sna->mode.num_real_crtc; i++) {
+		xf86CrtcPtr crtc = config->crtc[i];
+
+		assert(to_sna_crtc(crtc) != NULL);
+
+		if (!crtc->enabled) {
+			DBG(("%s: CRTC:%d (pipe %d) disabled\n",
+			     __FUNCTION__,i, sna_crtc_pipe(crtc)));
+			assert(to_sna_crtc(crtc)->bo == NULL);
+			continue;
+		}
+
+		if (to_sna_crtc(crtc)->bo == NULL) {
+			DBG(("%s: CRTC:%d (pipe %d) turned off\n",
+			     __FUNCTION__,i, sna_crtc_pipe(crtc)));
+			continue;
+		}
+
+		DBG(("%s: CRTC:%d (pipe %d) vrefresh=%f\n",
+		     __FUNCTION__, i, sna_crtc_pipe(crtc),
+		     xf86ModeVRefresh(&crtc->mode)));
+		max_vrefresh = max(max_vrefresh, xf86ModeVRefresh(&crtc->mode));
+	}
+
+	if (max_vrefresh == 0) {
+		assert(sna->mode.front_active == 0);
+		sna->vblank_interval = 0;
+	} else
+		sna->vblank_interval = 1000 / max_vrefresh; /* Hz -> ms */
+
+	DBG(("max_vrefresh=%d, vblank_interval=%d ms\n",
+	       max_vrefresh, sna->vblank_interval));
+}
+
+static struct kgem_bo *sna_create_bo_for_fbcon(struct sna *sna,
+					       const struct drm_mode_fb_cmd *fbcon)
+{
+	struct drm_gem_flink flink;
+	struct kgem_bo *bo;
+	int ret;
+
+	/* Create a new reference for the fbcon so that we can track it
+	 * using a normal bo and so that when we call gem_close on it we
+	 * delete our reference and not fbcon's!
+	 */
+	VG_CLEAR(flink);
+	flink.handle = fbcon->handle;
+	ret = drmIoctl(sna->kgem.fd, DRM_IOCTL_GEM_FLINK, &flink);
+	if (ret)
+		return NULL;
+
+	bo = kgem_create_for_name(&sna->kgem, flink.name);
+	if (bo == NULL)
+		return NULL;
+
+	bo->pitch = fbcon->pitch;
+	return bo;
+}
+
+/* Copy the current framebuffer contents into the front-buffer for a seamless
+ * transition from e.g. plymouth.
+ */
+void sna_copy_fbcon(struct sna *sna)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	struct drm_mode_fb_cmd fbcon;
+	PixmapRec scratch;
+	struct sna_pixmap *priv;
+	struct kgem_bo *bo;
+	BoxRec box;
+	bool ok;
+	int sx, sy;
+	int dx, dy;
+	int i;
+
+	if (wedged(sna) || isGPU(sna->scrn))
+		return;
+
+	DBG(("%s\n", __FUNCTION__));
+	assert((sna->flags & SNA_IS_HOSTED) == 0);
+
+	priv = sna_pixmap_move_to_gpu(sna->front, MOVE_WRITE | __MOVE_SCANOUT);
+	if (priv == NULL)
+		return;
+
+	/* Scan the connectors for a framebuffer and assume that is the fbcon */
+	VG_CLEAR(fbcon);
+	fbcon.fb_id = 0;
+	for (i = 0; i < sna->mode.num_real_crtc; i++) {
+		struct sna_crtc *crtc = to_sna_crtc(config->crtc[i]);
+		struct drm_mode_crtc mode;
+
+		assert(crtc != NULL);
+
+		VG_CLEAR(mode);
+		mode.crtc_id = __sna_crtc_id(crtc);
+		if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCRTC, &mode))
+			continue;
+		if (!mode.fb_id)
+			continue;
+
+		fbcon.fb_id = mode.fb_id;
+		if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETFB, &fbcon)) {
+			fbcon.fb_id = 0;
+			continue;
+		}
+		break;
+	}
+	if (fbcon.fb_id == 0) {
+		DBG(("%s: no fbcon found\n", __FUNCTION__));
+		return;
+	}
+
+	if (fbcon.fb_id == fb_id(priv->gpu_bo)) {
+		DBG(("%s: fb already installed as scanout\n", __FUNCTION__));
+		return;
+	}
+
+	DBG(("%s: found fbcon, size=%dx%d, depth=%d, bpp=%d\n",
+	     __FUNCTION__, fbcon.width, fbcon.height, fbcon.depth, fbcon.bpp));
+
+	bo = sna_create_bo_for_fbcon(sna, &fbcon);
+	if (bo == NULL)
+		return;
+
+	DBG(("%s: fbcon handle=%d\n", __FUNCTION__, bo->handle));
+
+	scratch.drawable.width = fbcon.width;
+	scratch.drawable.height = fbcon.height;
+	scratch.drawable.depth = fbcon.depth;
+	scratch.drawable.bitsPerPixel = fbcon.bpp;
+	scratch.devPrivate.ptr = NULL;
+
+	box.x1 = box.y1 = 0;
+	box.x2 = min(fbcon.width, sna->front->drawable.width);
+	box.y2 = min(fbcon.height, sna->front->drawable.height);
+
+	sx = dx = 0;
+	if (box.x2 < (uint16_t)fbcon.width)
+		sx = (fbcon.width - box.x2) / 2;
+	if (box.x2 < sna->front->drawable.width)
+		dx = (sna->front->drawable.width - box.x2) / 2;
+
+	sy = dy = 0;
+	if (box.y2 < (uint16_t)fbcon.height)
+		sy = (fbcon.height - box.y2) / 2;
+	if (box.y2 < sna->front->drawable.height)
+		dy = (sna->front->drawable.height - box.y2) / 2;
+
+	ok = sna->render.copy_boxes(sna, GXcopy,
+				    &scratch.drawable, bo, sx, sy,
+				    &sna->front->drawable, priv->gpu_bo, dx, dy,
+				    &box, 1, 0);
+	if (!DAMAGE_IS_ALL(priv->gpu_damage))
+		sna_damage_add_box(&priv->gpu_damage, &box);
+
+	kgem_bo_destroy(&sna->kgem, bo);
+
+#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(10, 0)
+	to_screen_from_sna(sna)->canDoBGNoneRoot = ok;
+#endif
+}
+
+static bool use_shadow(struct sna *sna, xf86CrtcPtr crtc)
+{
+	RRTransformPtr transform;
+	PictTransform crtc_to_fb;
+	struct pict_f_transform f_crtc_to_fb, f_fb_to_crtc;
+	unsigned pitch_limit;
+	BoxRec b;
+
+	assert(sna->scrn->virtualX && sna->scrn->virtualY);
+
+	if (sna->flags & SNA_FORCE_SHADOW) {
+		DBG(("%s: forcing shadow\n", __FUNCTION__));
+		return true;
+	}
+
+	if (to_sna_crtc(crtc)->fallback_shadow) {
+		DBG(("%s: fallback shadow\n", __FUNCTION__));
+		return true;
+	}
+
+	if (sna->flags & SNA_TEAR_FREE && to_sna_crtc(crtc)->slave_pixmap) {
+		DBG(("%s: TearFree shadow required\n", __FUNCTION__));
+		return true;
+	}
+
+	if (sna->scrn->virtualX > sna->mode.max_crtc_width ||
+	    sna->scrn->virtualY > sna->mode.max_crtc_height) {
+		DBG(("%s: framebuffer too large (%dx%d) > (%dx%d)\n",
+		    __FUNCTION__,
+		    sna->scrn->virtualX, sna->scrn->virtualY,
+		    sna->mode.max_crtc_width, sna->mode.max_crtc_height));
+		return true;
+	}
+
+	if (!isGPU(sna->scrn)) {
+		struct sna_pixmap *priv;
+
+		priv = sna_pixmap_force_to_gpu(sna->front, MOVE_READ | __MOVE_SCANOUT);
+		if (priv == NULL)
+			return true; /* maybe we can create a bo for the scanout? */
+
+		if (sna->kgem.gen == 071)
+			pitch_limit = priv->gpu_bo->tiling ? 16 * 1024 : 32 * 1024;
+		else if ((sna->kgem.gen >> 3) > 4)
+			pitch_limit = 32 * 1024;
+		else if ((sna->kgem.gen >> 3) == 4)
+			pitch_limit = priv->gpu_bo->tiling ? 16 * 1024 : 32 * 1024;
+		else if ((sna->kgem.gen >> 3) == 3)
+			pitch_limit = priv->gpu_bo->tiling ? 8 * 1024 : 16 * 1024;
+		else
+			pitch_limit = 8 * 1024;
+		DBG(("%s: gpu bo handle=%d tiling=%d pitch=%d, limit=%d\n", __FUNCTION__, priv->gpu_bo->handle, priv->gpu_bo->tiling, priv->gpu_bo->pitch, pitch_limit));
+		if (priv->gpu_bo->pitch > pitch_limit)
+			return true;
+
+		if (priv->gpu_bo->tiling && sna->flags & SNA_LINEAR_FB) {
+			DBG(("%s: gpu bo is tiled, need linear, forcing shadow\n", __FUNCTION__));
+			return true;
+		}
+	}
+
+	transform = NULL;
+	if (crtc->transformPresent)
+		transform = &crtc->transform;
+	if (RRTransformCompute(crtc->x, crtc->y,
+			       crtc->mode.HDisplay, crtc->mode.VDisplay,
+			       crtc->rotation, transform,
+			       &crtc_to_fb,
+			       &f_crtc_to_fb,
+			       &f_fb_to_crtc)) {
+		bool needs_transform = true;
+		unsigned rotation = rotation_reduce(&to_sna_crtc(crtc)->primary, crtc->rotation);
+		DBG(("%s: natively supported rotation? rotation=%x & supported=%x == %d\n",
+		     __FUNCTION__, rotation, to_sna_crtc(crtc)->primary.rotation.supported,
+		     rotation == (rotation & to_sna_crtc(crtc)->primary.rotation.supported)));
+		if ((to_sna_crtc(crtc)->primary.rotation.supported & rotation) == rotation)
+			needs_transform = RRTransformCompute(crtc->x, crtc->y,
+							     crtc->mode.HDisplay, crtc->mode.VDisplay,
+							     RR_Rotate_0, transform,
+							     NULL, NULL, NULL);
+		if (needs_transform) {
+			DBG(("%s: RandR transform present\n", __FUNCTION__));
+			return true;
+		}
+	}
+
+	/* And finally check that it is entirely visible */
+	b.x1 = b.y1 = 0;
+	b.x2 = crtc->mode.HDisplay;
+	b.y2 = crtc->mode.VDisplay;
+	pixman_f_transform_bounds(&f_crtc_to_fb, &b);
+	DBG(("%s? bounds (%d, %d), (%d, %d), framebufer %dx%d\n",
+	     __FUNCTION__, b.x1, b.y1, b.x2, b.y2,
+		 sna->scrn->virtualX, sna->scrn->virtualY));
+
+	if  (b.x1 < 0 || b.y1 < 0 ||
+	     b.x2 > sna->scrn->virtualX ||
+	     b.y2 > sna->scrn->virtualY) {
+		DBG(("%s: scanout is partly outside the framebuffer\n",
+		     __FUNCTION__));
+		return true;
+	}
+
+	return false;
+}
+
+static void set_shadow(struct sna *sna, RegionPtr region)
+{
+	struct sna_pixmap *priv = sna_pixmap(sna->front);
+
+	assert(priv->gpu_bo);
+	assert(sna->mode.shadow);
+	assert(sna->mode.shadow->active_scanout);
+
+	DBG(("%s: waiting for region %dx[(%d, %d), (%d, %d)], front handle=%d, shadow handle=%d\n",
+	     __FUNCTION__,
+	     region_num_rects(region),
+	     region->extents.x1, region->extents.y1,
+	     region->extents.x2, region->extents.y2,
+	     priv->gpu_bo->handle, sna->mode.shadow->handle));
+
+	assert(priv->pinned & PIN_SCANOUT);
+	assert((priv->pinned & PIN_PRIME) == 0);
+	assert(sna->mode.shadow != priv->gpu_bo);
+
+	RegionCopy(&sna->mode.shadow_region, region);
+
+	priv->move_to_gpu = wait_for_shadow;
+	priv->move_to_gpu_data = sna;
+}
+
+static struct kgem_bo *
+get_scanout_bo(struct sna *sna, PixmapPtr pixmap)
+{
+	struct sna_pixmap *priv;
+
+	priv = sna_pixmap_force_to_gpu(pixmap, MOVE_READ | __MOVE_SCANOUT);
+	if (!priv)
+		return NULL;
+
+	if (priv->gpu_bo->pitch & 63) {
+		struct kgem_bo *tmp;
+		BoxRec b;
+
+		DBG(("%s: converting to scanout bo due to bad pitch [%d]\n",
+		     __FUNCTION__, priv->gpu_bo->pitch));
+
+		if (priv->pinned) {
+			DBG(("%s: failed as the Pixmap is already pinned [%x]\n",
+			     __FUNCTION__, priv->pinned));
+			return NULL;
+		}
+
+		tmp = kgem_create_2d(&sna->kgem,
+				     pixmap->drawable.width,
+				     pixmap->drawable.height,
+				     sna->scrn->bitsPerPixel,
+				     priv->gpu_bo->tiling,
+				     CREATE_EXACT | CREATE_SCANOUT);
+		if (tmp == NULL) {
+			DBG(("%s: allocation failed\n", __FUNCTION__));
+			return NULL;
+		}
+
+		b.x1 = 0;
+		b.y1 = 0;
+		b.x2 = pixmap->drawable.width;
+		b.y2 = pixmap->drawable.height;
+
+		if (sna->render.copy_boxes(sna, GXcopy,
+					   &pixmap->drawable, priv->gpu_bo, 0, 0,
+					   &pixmap->drawable, tmp, 0, 0,
+					   &b, 1, COPY_LAST)) {
+			DBG(("%s: copy failed\n", __FUNCTION__));
+			kgem_bo_destroy(&sna->kgem, tmp);
+			return NULL;
+		}
+
+		kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
+		priv->gpu_bo = tmp;
+	}
+
+	priv->pinned |= PIN_SCANOUT;
+	return priv->gpu_bo;
+}
+
+static void shadow_clear(struct sna *sna,
+			 PixmapPtr front, struct kgem_bo *bo,
+			 xf86CrtcPtr crtc)
+{
+	bool ok = false;
+	if (!wedged(sna))
+		ok = sna->render.fill_one(sna, front, bo, 0,
+					  0, 0, crtc->mode.HDisplay, crtc->mode.VDisplay,
+					  GXclear);
+	if (!ok) {
+		void *ptr = kgem_bo_map__gtt(&sna->kgem, bo);
+		if (ptr)
+			memset(ptr, 0, bo->pitch * crtc->mode.VDisplay);
+	}
+	sna->mode.shadow_dirty = true;
+}
+
+static bool rr_active(xf86CrtcPtr crtc)
+{
+	return crtc->transformPresent || crtc->rotation != RR_Rotate_0;
+}
+
+static struct kgem_bo *sna_crtc_attach(xf86CrtcPtr crtc)
+{
+	struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+	ScrnInfoPtr scrn = crtc->scrn;
+	struct sna *sna = to_sna(scrn);
+	struct kgem_bo *bo;
+
+	if (sna_crtc->transform) {
+		assert(sna->mode.rr_active);
+		sna_crtc->transform = false;
+		sna->mode.rr_active--;
+	}
+	sna_crtc->rotation = RR_Rotate_0;
+
+	if (sna_crtc->cache_bo) {
+		kgem_bo_destroy(&sna->kgem, sna_crtc->cache_bo);
+		sna_crtc->cache_bo = NULL;
+	}
+
+	if (use_shadow(sna, crtc)) {
+		PixmapPtr front;
+		unsigned long tiled_limit;
+		int tiling;
+
+force_shadow:
+		if (!sna_crtc_enable_shadow(sna, sna_crtc)) {
+			DBG(("%s: failed to enable crtc shadow\n", __FUNCTION__));
+			return NULL;
+		}
+
+		DBG(("%s: attaching to per-crtc pixmap %dx%d\n",
+		     __FUNCTION__, crtc->mode.HDisplay, crtc->mode.VDisplay));
+
+		bo = sna_crtc->shadow_bo;
+		if (bo) {
+			if (sna_crtc->shadow_bo_width == crtc->mode.HDisplay &&
+			    sna_crtc->shadow_bo_height == crtc->mode.VDisplay) {
+				DBG(("%s: reusing current shadow bo handle=%d\n",
+				     __FUNCTION__, bo->handle));
+				goto out_shadow;
+			}
+
+			kgem_bo_destroy(&sna->kgem, bo);
+			sna_crtc->shadow_bo = NULL;
+		}
+
+		tiling = I915_TILING_X;
+		if (crtc->rotation & (RR_Rotate_90 | RR_Rotate_270) &&
+		    sna->kgem.can_scanout_y)
+			tiling = I915_TILING_Y;
+
+		if (sna->kgem.gen == 071)
+			tiled_limit = 16 * 1024 * 8;
+		else if ((sna->kgem.gen >> 3) > 4)
+			tiled_limit = 32 * 1024 * 8;
+		else if ((sna->kgem.gen >> 3) == 4)
+			tiled_limit = 16 * 1024 * 8;
+		else
+			tiled_limit = 8 * 1024 * 8;
+		if ((unsigned long)crtc->mode.HDisplay * scrn->bitsPerPixel > tiled_limit)
+			tiling = I915_TILING_NONE;
+		if (sna->flags & SNA_LINEAR_FB)
+			tiling = I915_TILING_NONE;
+
+		bo = kgem_create_2d(&sna->kgem,
+				    crtc->mode.HDisplay, crtc->mode.VDisplay,
+				    scrn->bitsPerPixel,
+				    tiling, CREATE_SCANOUT);
+		if (bo == NULL) {
+			DBG(("%s: failed to allocate crtc scanout\n", __FUNCTION__));
+			return NULL;
+		}
+
+		if (!get_fb(sna, bo, crtc->mode.HDisplay, crtc->mode.VDisplay)) {
+			DBG(("%s: failed to bind fb for crtc scanout\n", __FUNCTION__));
+			kgem_bo_destroy(&sna->kgem, bo);
+			return NULL;
+		}
+
+		front = sna_crtc->slave_pixmap ?: sna->front;
+		if (__sna_pixmap_get_bo(front) && !rr_active(crtc)) {
+			BoxRec b;
+
+			b.x1 = crtc->x;
+			b.y1 = crtc->y;
+			b.x2 = crtc->x + crtc->mode.HDisplay;
+			b.y2 = crtc->y + crtc->mode.VDisplay;
+
+			if (b.x1 < 0)
+				b.x1 = 0;
+			if (b.y1 < 0)
+				b.y1 = 0;
+			if (b.x2 > scrn->virtualX)
+				b.x2 = scrn->virtualX;
+			if (b.y2 > scrn->virtualY)
+				b.y2 = scrn->virtualY;
+			if (b.x2 - b.x1 < crtc->mode.HDisplay ||
+			    b.y2 - b.y1 < crtc->mode.VDisplay)
+				shadow_clear(sna, front, bo, crtc);
+
+			if (b.y2 > b.y1 && b.x2 > b.x1) {
+				DrawableRec tmp;
+
+				DBG(("%s: copying onto shadow CRTC: (%d, %d)x(%d, %d) [fb=%dx%d], handle=%d\n",
+				     __FUNCTION__,
+				     b.x1, b.y1,
+				     b.x2-b.x1, b.y2-b.y1,
+				     scrn->virtualX, scrn->virtualY,
+				     bo->handle));
+
+				tmp.width = crtc->mode.HDisplay;
+				tmp.height = crtc->mode.VDisplay;
+				tmp.depth = front->drawable.depth;
+				tmp.bitsPerPixel = front->drawable.bitsPerPixel;
+
+				if (!sna->render.copy_boxes(sna, GXcopy,
+							     &front->drawable, __sna_pixmap_get_bo(front), 0, 0,
+							     &tmp, bo, -crtc->x, -crtc->y,
+							     &b, 1, COPY_LAST))
+					shadow_clear(sna, front, bo, crtc);
+			}
+		} else
+			shadow_clear(sna, front, bo, crtc);
+
+		sna_crtc->shadow_bo_width = crtc->mode.HDisplay;
+		sna_crtc->shadow_bo_height = crtc->mode.VDisplay;
+		sna_crtc->shadow_bo = bo;
+out_shadow:
+		sna_crtc->transform = true;
+		sna->mode.rr_active++;
+		return kgem_bo_reference(bo);
+	} else {
+		if (sna_crtc->shadow_bo) {
+			kgem_bo_destroy(&sna->kgem, sna_crtc->shadow_bo);
+			sna_crtc->shadow_bo = NULL;
+		}
+
+		if (sna_crtc->slave_pixmap) {
+			DBG(("%s: attaching to scanout pixmap\n", __FUNCTION__));
+			bo = get_scanout_bo(sna, sna_crtc->slave_pixmap);
+			if (bo == NULL) {
+				DBG(("%s: failed to pin crtc scanout\n", __FUNCTION__));
+				sna_crtc->fallback_shadow = true;
+				goto force_shadow;
+			}
+
+			if (!get_fb(sna, bo,
+				    sna_crtc->slave_pixmap->drawable.width,
+				    sna_crtc->slave_pixmap->drawable.height)) {
+				DBG(("%s: failed to bind fb for crtc scanout\n", __FUNCTION__));
+				sna_crtc->fallback_shadow = true;
+				goto force_shadow;
+			}
+		} else {
+			DBG(("%s: attaching to framebuffer\n", __FUNCTION__));
+			bo = get_scanout_bo(sna, sna->front);
+			if (bo == NULL) {
+				DBG(("%s: failed to pin framebuffer\n", __FUNCTION__));
+				sna_crtc->fallback_shadow = true;
+				goto force_shadow;
+			}
+
+			if (!get_fb(sna, bo, scrn->virtualX, scrn->virtualY)) {
+				DBG(("%s: failed to bind fb for crtc scanout\n", __FUNCTION__));
+				sna_crtc->fallback_shadow = true;
+				goto force_shadow;
+			}
+		}
+
+		if (sna->flags & SNA_TEAR_FREE) {
+			RegionRec region;
+
+			assert(sna_crtc->slave_pixmap == NULL);
+
+			DBG(("%s: enabling TearFree shadow\n", __FUNCTION__));
+			region.extents.x1 = 0;
+			region.extents.y1 = 0;
+			region.extents.x2 = sna->scrn->virtualX;
+			region.extents.y2 = sna->scrn->virtualY;
+			region.data = NULL;
+
+			if (!sna_crtc_enable_shadow(sna, sna_crtc)) {
+				DBG(("%s: failed to enable crtc shadow\n", __FUNCTION__));
+				return NULL;
+			}
+
+			if (sna->mode.shadow == NULL) {
+				struct kgem_bo *shadow;
+
+				DBG(("%s: creating TearFree shadow bo\n", __FUNCTION__));
+				shadow = kgem_create_2d(&sna->kgem,
+							region.extents.x2,
+							region.extents.y2,
+							scrn->bitsPerPixel,
+							kgem_choose_tiling(&sna->kgem,
+									   I915_TILING_X,
+									   region.extents.x2,
+									   region.extents.y2,
+									   sna->scrn->bitsPerPixel),
+							CREATE_SCANOUT);
+				if (shadow == NULL) {
+					DBG(("%s: failed to allocate TearFree shadow bo\n", __FUNCTION__));
+					sna_crtc->fallback_shadow = true;
+					goto force_shadow;
+				}
+
+				if (!get_fb(sna, shadow,
+					    region.extents.x2,
+					    region.extents.y2)) {
+					DBG(("%s: failed to bind fb for TearFeee shadow\n", __FUNCTION__));
+					kgem_bo_destroy(&sna->kgem, shadow);
+					sna_crtc->fallback_shadow = true;
+					goto force_shadow;
+				}
+
+				assert(__sna_pixmap_get_bo(sna->front) == NULL ||
+				       __sna_pixmap_get_bo(sna->front)->pitch == shadow->pitch);
+				sna->mode.shadow = shadow;
+				sna->mode.shadow->active_scanout++;
+			}
+			set_shadow(sna, &region);
+
+			sna_crtc_disable_override(sna, sna_crtc);
+		} else
+			sna_crtc_disable_shadow(sna, sna_crtc);
+
+		sna_crtc->rotation = rotation_reduce(&sna_crtc->primary, crtc->rotation);
+		assert(sna_crtc->primary.rotation.supported & sna_crtc->rotation);
+		return kgem_bo_reference(bo);
+	}
+}
+
+#define SCALING_EPSILON (1./256)
+
+static bool
+is_affine(const struct pixman_f_transform *t)
+{
+	return (fabs(t->m[2][0]) < SCALING_EPSILON &&
+		fabs(t->m[2][1]) < SCALING_EPSILON);
+}
+
+static double determinant(const struct pixman_f_transform *t)
+{
+	return t->m[0][0]*t->m[1][1] - t->m[1][0]*t->m[0][1];
+}
+
+static bool
+affine_is_pixel_exact(const struct pixman_f_transform *t)
+{
+	double det = t->m[2][2] * determinant(t);
+	if (fabs (det * det - 1.0) < SCALING_EPSILON) {
+		if (fabs(t->m[0][1]) < SCALING_EPSILON &&
+		    fabs(t->m[1][0]) < SCALING_EPSILON)
+			return true;
+
+		if (fabs(t->m[0][0]) < SCALING_EPSILON &&
+		    fabs(t->m[1][1]) < SCALING_EPSILON)
+			return true;
+	}
+
+	return false;
+}
+
+static void sna_crtc_randr(xf86CrtcPtr crtc)
+{
+	struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+	struct pict_f_transform f_crtc_to_fb, f_fb_to_crtc;
+	PictTransform crtc_to_fb;
+	PictFilterPtr filter;
+	xFixed *params;
+	int nparams;
+	RRTransformPtr transform;
+	int needs_transform;
+
+	transform = NULL;
+	if (crtc->transformPresent)
+		transform = &crtc->transform;
+
+	needs_transform =
+		RRTransformCompute(crtc->x, crtc->y,
+				   crtc->mode.HDisplay, crtc->mode.VDisplay,
+				   crtc->rotation, transform,
+				   &crtc_to_fb,
+				   &f_crtc_to_fb,
+				   &f_fb_to_crtc);
+
+	filter = NULL;
+	params = NULL;
+	nparams = 0;
+	if (sna_crtc->transform) {
+#ifdef RANDR_12_INTERFACE
+		if (transform) {
+			if (transform->nparams) {
+				params = malloc(transform->nparams * sizeof(xFixed));
+				if (params) {
+					memcpy(params, transform->params,
+					       transform->nparams * sizeof(xFixed));
+					nparams = transform->nparams;
+					filter = transform->filter;
+				}
+			} else
+				filter = transform->filter;
+		}
+#endif
+		crtc->transform_in_use = needs_transform;
+	} else
+		crtc->transform_in_use = sna_crtc->rotation != RR_Rotate_0;
+
+	/* Recompute the cursor after a potential change in transform */
+	if (sna_crtc->cursor) {
+		assert(sna_crtc->cursor->ref > 0);
+		sna_crtc->cursor->ref--;
+		sna_crtc->cursor = NULL;
+	}
+
+	if (needs_transform) {
+		sna_crtc->hwcursor = is_affine(&f_fb_to_crtc);
+		sna_crtc->cursor_transform =
+			sna_crtc->hwcursor &&
+			!affine_is_pixel_exact(&f_fb_to_crtc);
+	} else {
+		sna_crtc->hwcursor = true;
+		sna_crtc->cursor_transform = false;
+	}
+	DBG(("%s: hwcursor?=%d, cursor_transform?=%d\n",
+	     __FUNCTION__, sna_crtc->hwcursor, sna_crtc->cursor_transform));
+
+	crtc->crtc_to_framebuffer = crtc_to_fb;
+	crtc->f_crtc_to_framebuffer = f_crtc_to_fb;
+	crtc->f_framebuffer_to_crtc = f_fb_to_crtc;
+
+	free(crtc->params);
+	crtc->params  = params;
+	crtc->nparams = nparams;
+
+	crtc->filter = filter;
+	if (filter) {
+		crtc->filter_width  = filter->width;
+		crtc->filter_height = filter->height;
+	} else {
+		crtc->filter_width  = 0;
+		crtc->filter_height = 0;
+	}
+
+	crtc->bounds.x1 = 0;
+	crtc->bounds.x2 = crtc->mode.HDisplay;
+	crtc->bounds.y1 = 0;
+	crtc->bounds.y2 = crtc->mode.VDisplay;
+	pixman_f_transform_bounds(&f_crtc_to_fb, &crtc->bounds);
+
+	DBG(("%s: transform? %d, bounds (%d, %d), (%d, %d)\n",
+	     __FUNCTION__, crtc->transform_in_use,
+	     crtc->bounds.x1, crtc->bounds.y1,
+	     crtc->bounds.x2, crtc->bounds.y2));
+}
+
+static void
+sna_crtc_damage(xf86CrtcPtr crtc)
+{
+	ScreenPtr screen = xf86ScrnToScreen(crtc->scrn);
+	struct sna *sna = to_sna(crtc->scrn);
+	RegionRec region, *damage;
+
+	region.extents = crtc->bounds;
+	region.data = NULL;
+
+	if (region.extents.x1 < 0)
+		region.extents.x1 = 0;
+	if (region.extents.y1 < 0)
+		region.extents.y1 = 0;
+	if (region.extents.x2 > screen->width)
+		region.extents.x2 = screen->width;
+	if (region.extents.y2 > screen->height)
+		region.extents.y2 = screen->height;
+
+	if (region.extents.x2 <= region.extents.x1 ||
+	    region.extents.y2 <= region.extents.y1) {
+		DBG(("%s: crtc not damaged, all-clipped\n", __FUNCTION__));
+		return;
+	}
+
+	DBG(("%s: marking crtc %d as completely damaged (%d, %d), (%d, %d)\n",
+	     __FUNCTION__, sna_crtc_id(crtc),
+	     region.extents.x1, region.extents.y1,
+	     region.extents.x2, region.extents.y2));
+
+	assert(sna->mode.shadow_damage && sna->mode.shadow_active);
+	damage = DamageRegion(sna->mode.shadow_damage);
+	RegionUnion(damage, damage, &region);
+	to_sna_crtc(crtc)->crtc_damage = region;
+
+	DBG(("%s: damage now %dx[(%d, %d), (%d, %d)]\n",
+	     __FUNCTION__,
+	     region_num_rects(damage),
+	     damage->extents.x1, damage->extents.y1,
+	     damage->extents.x2, damage->extents.y2));
+}
+
+static char *outputs_for_crtc(xf86CrtcPtr crtc, char *outputs, int max)
+{
+	struct sna *sna = to_sna(crtc->scrn);
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
+	int len, i;
+
+	for (i = len = 0; i < sna->mode.num_real_output; i++) {
+		xf86OutputPtr output = config->output[i];
+
+		if (output->crtc != crtc)
+			continue;
+
+		len += snprintf(outputs+len, max-len, "%s, ", output->name);
+	}
+	assert(len >= 2);
+	outputs[len-2] = '\0';
+
+	return outputs;
+}
+
+static const char *rotation_to_str(Rotation rotation)
+{
+	switch (rotation & RR_Rotate_All) {
+	case 0:
+	case RR_Rotate_0: return "normal";
+	case RR_Rotate_90: return "left";
+	case RR_Rotate_180: return "inverted";
+	case RR_Rotate_270: return "right";
+	default: return "unknown";
+	}
+}
+
+static const char *reflection_to_str(Rotation rotation)
+{
+	switch (rotation & RR_Reflect_All) {
+	case 0: return "none";
+	case RR_Reflect_X: return "X axis";
+	case RR_Reflect_Y: return "Y axis";
+	case RR_Reflect_X | RR_Reflect_Y: return "X and Y axes";
+	default: return "invalid";
+	}
+}
+
+static void reprobe_connectors(xf86CrtcPtr crtc)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
+	struct sna *sna = to_sna(crtc->scrn);
+	int i;
+
+	for (i = 0; i < sna->mode.num_real_output; i++) {
+		xf86OutputPtr output = config->output[i];
+		if (output->crtc == crtc)
+			to_sna_output(output)->reprobe = true;
+	}
+
+	sna_mode_discover(sna, true);
+}
+
+static Bool
+__sna_crtc_set_mode(xf86CrtcPtr crtc)
+{
+	struct sna *sna = to_sna(crtc->scrn);
+	struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+	struct kgem_bo *saved_bo, *bo;
+	uint32_t saved_offset;
+	bool saved_transform;
+	bool saved_hwcursor;
+	bool saved_cursor_transform;
+	int ret;
+
+	DBG(("%s: CRTC=%d, pipe=%d, hidden?=%d\n", __FUNCTION__,
+	     __sna_crtc_id(sna_crtc), __sna_crtc_pipe(sna_crtc), sna->mode.hidden));
+	if (sna->mode.hidden)
+		return TRUE;
+
+	saved_bo = sna_crtc->bo;
+	saved_transform = sna_crtc->transform;
+	saved_cursor_transform = sna_crtc->cursor_transform;
+	saved_hwcursor = sna_crtc->hwcursor;
+	saved_offset = sna_crtc->offset;
+
+	sna_crtc->fallback_shadow = false;
+retry: /* Attach per-crtc pixmap or direct */
+	bo = sna_crtc_attach(crtc);
+	if (bo == NULL) {
+		xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
+			   "unable to attach scanout\n");
+		goto error;
+	}
+
+	/* Prevent recursion when enabling outputs during execbuffer */
+	if (bo->exec && RQ(bo->rq)->bo == NULL) {
+		_kgem_submit(&sna->kgem);
+		__kgem_bo_clear_dirty(bo);
+	}
+
+	sna_crtc->bo = bo;
+	ret = sna_crtc_apply(crtc);
+	if (ret) {
+		kgem_bo_destroy(&sna->kgem, bo);
+
+		if (!sna_crtc->fallback_shadow) {
+			sna_crtc->fallback_shadow = true;
+			goto retry;
+		}
+
+		xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
+			   "failed to set mode: %s [%d]\n", strerror(ret), ret);
+		goto error;
+	}
+
+	sna_crtc->public.flags |= CRTC_ON;
+	bo->active_scanout++;
+	DBG(("%s: marking handle=%d as active=%d (removing %d from scanout, active=%d)\n",
+	     __FUNCTION__, bo->handle, bo->active_scanout,
+	     saved_bo ? saved_bo->handle : 0, saved_bo ? saved_bo->active_scanout - 1: -1));
+	if (saved_bo) {
+		assert(saved_bo->active_scanout);
+		assert(saved_bo->refcnt >= saved_bo->active_scanout);
+		saved_bo->active_scanout--;
+		kgem_bo_destroy(&sna->kgem, saved_bo);
+	}
+
+	sna_crtc_randr(crtc);
+	if (sna_crtc->transform)
+		sna_crtc_damage(crtc);
+	if (sna_crtc->cursor &&  /* Reload cursor if RandR maybe changed */
+	    (!sna_crtc->hwcursor ||
+	     saved_cursor_transform || sna_crtc->cursor_transform ||
+	     sna_crtc->cursor->rotation != crtc->rotation))
+		sna_crtc_disable_cursor(sna, sna_crtc);
+
+	assert(!sna->mode.hidden);
+	sna->mode.front_active += saved_bo == NULL;
+	sna->mode.dirty = true;
+	DBG(("%s: handle=%d, scanout_active=%d, front_active=%d\n",
+	     __FUNCTION__, bo->handle, bo->active_scanout, sna->mode.front_active));
+
+	return TRUE;
+
+error:
+	sna_crtc->offset = saved_offset;
+	if (sna_crtc->transform) {
+		assert(sna->mode.rr_active);
+		sna->mode.rr_active--;
+	}
+	if (saved_transform)
+		sna->mode.rr_active++;
+	sna_crtc->transform = saved_transform;
+	sna_crtc->cursor_transform = saved_cursor_transform;
+	sna_crtc->hwcursor = saved_hwcursor;
+	sna_crtc->bo = saved_bo;
+
+	reprobe_connectors(crtc);
+	return FALSE;
+}
+
+static Bool
+sna_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
+			Rotation rotation, int x, int y)
+{
+	struct sna *sna = to_sna(crtc->scrn);
+	struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+	struct drm_mode_modeinfo saved_kmode;
+	char outputs[256];
+
+	if (mode->HDisplay == 0 || mode->VDisplay == 0)
+		return FALSE;
+
+	assert(sna_crtc);
+
+	xf86DrvMsg(crtc->scrn->scrnIndex, X_INFO,
+		   "switch to mode %dx%d@%.1f on %s using pipe %d, position (%d, %d), rotation %s, reflection %s\n",
+		   mode->HDisplay, mode->VDisplay, xf86ModeVRefresh(mode),
+		   outputs_for_crtc(crtc, outputs, sizeof(outputs)), __sna_crtc_pipe(sna_crtc),
+		   x, y, rotation_to_str(rotation), reflection_to_str(rotation));
+
+	assert(mode->HDisplay <= sna->mode.max_crtc_width &&
+	       mode->VDisplay <= sna->mode.max_crtc_height);
+
+#if HAS_GAMMA
+	sna_crtc_gamma_set(crtc,
+			   crtc->gamma_red, crtc->gamma_green,
+			   crtc->gamma_blue, crtc->gamma_size);
+#endif
+
+	saved_kmode = sna_crtc->kmode;
+	mode_to_kmode(&sna_crtc->kmode, mode);
+	if (__sna_crtc_set_mode(crtc))
+		return TRUE;
+
+	sna_crtc->kmode = saved_kmode;
+	return FALSE;
+}
+
+static void
+sna_crtc_dpms(xf86CrtcPtr crtc, int mode)
+{
+	DBG(("%s(pipe %d, dpms mode -> %d):= active=%d\n",
+	     __FUNCTION__, sna_crtc_pipe(crtc), mode, mode == DPMSModeOn));
+
+	if (mode == DPMSModeOn && crtc->enabled) {
+		if (__sna_crtc_set_mode(crtc))
+			update_flush_interval(to_sna(crtc->scrn));
+		else
+			mode = DPMSModeOff;
+	}
+
+	if (mode != DPMSModeOn)
+		sna_crtc_disable(crtc, false);
+}
+
+void sna_mode_adjust_frame(struct sna *sna, int x, int y)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	xf86CrtcPtr crtc;
+	int saved_x, saved_y;
+
+	if ((unsigned)config->compat_output >= config->num_output)
+		return;
+
+	crtc = config->output[config->compat_output]->crtc;
+	if (crtc == NULL || !crtc->enabled)
+		return;
+
+	if (crtc->x == x && crtc->y == y)
+		return;
+
+	saved_x = crtc->x;
+	saved_y = crtc->y;
+
+	crtc->x = x;
+	crtc->y = y;
+	if (to_sna_crtc(crtc) && !__sna_crtc_set_mode(crtc)) {
+		crtc->x = saved_x;
+		crtc->y = saved_y;
+	}
+}
+
+static void
+sna_crtc_gamma_set(xf86CrtcPtr crtc,
+		   CARD16 *red, CARD16 *green, CARD16 *blue, int size)
+{
+	struct sna *sna = to_sna(crtc->scrn);
+	struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+	struct drm_color_lut *lut = sna_crtc->gamma_lut;
+	uint32_t blob_size = size * sizeof(lut[0]);
+	uint32_t blob_id;
+	int ret, i;
+
+	DBG(("%s: gamma_size %d\n", __FUNCTION__, size));
+
+	if (!lut) {
+		assert(size == 256);
+
+		drmModeCrtcSetGamma(to_sna(crtc->scrn)->kgem.fd,
+				    sna_crtc_id(crtc),
+				    size, red, green, blue);
+		return;
+	}
+
+	assert(size == sna_crtc->gamma_lut_size);
+
+	for (i = 0; i < size; i++) {
+		lut[i].red = red[i];
+		lut[i].green = green[i];
+		lut[i].blue = blue[i];
+	}
+
+	ret = drmModeCreatePropertyBlob(sna->kgem.fd, lut, blob_size, &blob_id);
+	if (ret)
+		return;
+
+	ret = drmModeObjectSetProperty(sna->kgem.fd,
+				       sna_crtc->id, DRM_MODE_OBJECT_CRTC,
+				       sna_crtc->gamma_lut_prop,
+				       blob_id);
+
+	drmModeDestroyPropertyBlob(sna->kgem.fd, blob_id);
+}
+
+static void
+sna_crtc_destroy(xf86CrtcPtr crtc)
+{
+	struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+	struct plane *sprite, *sn;
+
+	if (sna_crtc == NULL)
+		return;
+
+	free(sna_crtc->gamma_lut);
+
+	list_for_each_entry_safe(sprite, sn, &sna_crtc->sprites, link)
+		free(sprite);
+
+	free(sna_crtc);
+	crtc->driver_private = NULL;
+}
+
+#if HAS_PIXMAP_SHARING
+static Bool
+sna_crtc_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr pixmap)
+{
+	struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+
+	if (sna_crtc == NULL)
+		return FALSE;
+
+	if (pixmap == sna_crtc->slave_pixmap)
+		return TRUE;
+
+	DBG(("%s: CRTC:%d, pipe=%d setting scanout pixmap=%ld\n",
+	     __FUNCTION__, __sna_crtc_id(sna_crtc),  __sna_crtc_pipe(sna_crtc),
+	     pixmap ? pixmap->drawable.serialNumber : 0));
+
+	/* Disable first so that we can unregister the damage tracking */
+	sna_crtc_disable_shadow(to_sna(crtc->scrn), sna_crtc);
+
+	sna_crtc->slave_pixmap = pixmap;
+
+	return TRUE;
+}
+#endif
+
+static const xf86CrtcFuncsRec sna_crtc_funcs = {
+#if XF86_CRTC_VERSION >= 1
+	.dpms = sna_crtc_dpms,
+#endif
+	.set_mode_major = sna_crtc_set_mode_major,
+	.gamma_set = sna_crtc_gamma_set,
+	.destroy = sna_crtc_destroy,
+#if HAS_PIXMAP_SHARING
+	.set_scanout_pixmap = sna_crtc_set_scanout_pixmap,
+#endif
+};
+
+inline static bool prop_has_type_and_name(const struct drm_mode_get_property *prop,
+					  unsigned int type, const char *name)
+{
+	if ((prop->flags & (1 << type)) == 0)
+		return false;
+
+	if (strcmp(prop->name, name))
+		return false;
+
+	return true;
+}
+
+inline static bool prop_is_rotation(const struct drm_mode_get_property *prop)
+{
+	return prop_has_type_and_name(prop, 5, "rotation");
+}
+
+static void parse_rotation_prop(struct sna *sna, struct plane *p,
+				struct drm_mode_get_property *prop,
+				uint64_t value)
+{
+	struct drm_mode_property_enum *enums;
+	int j;
+
+	p->rotation.prop = prop->prop_id;
+	p->rotation.current = value;
+
+	DBG(("%s: found rotation property .id=%d, value=%ld, num_enums=%d\n",
+	     __FUNCTION__, prop->prop_id, value, prop->count_enum_blobs));
+
+	enums = malloc(prop->count_enum_blobs * sizeof(struct drm_mode_property_enum));
+	if (!enums)
+		return;
+
+	prop->count_values = 0;
+	prop->enum_blob_ptr = (uintptr_t)enums;
+
+	if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPROPERTY, prop)) {
+		free(enums);
+		return;
+	}
+
+	/* XXX we assume that the mapping between kernel enum and
+	 * RandR remains fixed for our lifetimes.
+	 */
+	VG(VALGRIND_MAKE_MEM_DEFINED(enums, sizeof(*enums)*prop->count_enum_blobs));
+	for (j = 0; j < prop->count_enum_blobs; j++) {
+		DBG(("%s: rotation[%d] = %s [%lx]\n", __FUNCTION__,
+		     j, enums[j].name, (long)enums[j].value));
+		p->rotation.supported |= 1 << enums[j].value;
+	}
+
+	free(enums);
+}
+
+inline static bool prop_is_color_encoding(const struct drm_mode_get_property *prop)
+{
+	return prop_has_type_and_name(prop, 3, "COLOR_ENCODING");
+}
+
+static void parse_color_encoding_prop(struct sna *sna, struct plane *p,
+				      struct drm_mode_get_property *prop,
+				      uint64_t value)
+{
+	struct drm_mode_property_enum *enums;
+	unsigned int supported = 0;
+	int j;
+
+	DBG(("%s: found color encoding property .id=%d, value=%ld, num_enums=%d\n",
+	     __FUNCTION__, prop->prop_id, (long)value, prop->count_enum_blobs));
+
+	enums = malloc(prop->count_enum_blobs * sizeof(struct drm_mode_property_enum));
+	if (!enums)
+		return;
+
+	prop->count_values = 0;
+	prop->enum_blob_ptr = (uintptr_t)enums;
+
+	if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPROPERTY, prop)) {
+		free(enums);
+		return;
+	}
+
+	VG(VALGRIND_MAKE_MEM_DEFINED(enums, sizeof(*enums)*prop->count_enum_blobs));
+	for (j = 0; j < prop->count_enum_blobs; j++) {
+		if (!strcmp(enums[j].name, "ITU-R BT.601 YCbCr")) {
+			p->color_encoding.values[0] = enums[j].value;
+			supported |= 1 << 0;
+		} else if (!strcmp(enums[j].name, "ITU-R BT.709 YCbCr")) {
+			p->color_encoding.values[1] = enums[j].value;
+			supported |= 1 << 1;
+		}
+	}
+
+	free(enums);
+
+	if (supported == 3)
+		p->color_encoding.prop = prop->prop_id;
+}
+
+void sna_crtc_set_sprite_colorspace(xf86CrtcPtr crtc,
+				    unsigned idx, int colorspace)
+{
+	struct plane *p;
+
+	assert(to_sna_crtc(crtc));
+	assert(colorspace < ARRAY_SIZE(p->color_encoding.values));
+
+	p = lookup_sprite(to_sna_crtc(crtc), idx);
+
+	if (!p->color_encoding.prop)
+		return;
+
+	drmModeObjectSetProperty(to_sna(crtc->scrn)->kgem.fd,
+				 p->id, DRM_MODE_OBJECT_PLANE,
+				 p->color_encoding.prop,
+				 p->color_encoding.values[colorspace]);
+}
+
+typedef void (*parse_prop_func)(struct sna *sna,
+				struct drm_mode_get_property *prop,
+				uint64_t value,
+				void *data);
+static void parse_props(struct sna *sna,
+		       uint32_t obj_type, uint32_t obj_id,
+		       parse_prop_func parse_prop,
+		       void *data)
+{
+#define N_STACK_PROPS 32 /* must be a multiple of 2 */
+	struct local_mode_obj_get_properties arg;
+	uint64_t stack[N_STACK_PROPS + N_STACK_PROPS/2];
+	uint64_t *values = stack;
+	uint32_t *props = (uint32_t *)(values + N_STACK_PROPS);
+	int i;
+
+	memset(&arg, 0, sizeof(struct local_mode_obj_get_properties));
+	arg.obj_id = obj_id;
+	arg.obj_type = obj_type;
+
+	arg.props_ptr = (uintptr_t)props;
+	arg.prop_values_ptr = (uintptr_t)values;
+	arg.count_props = N_STACK_PROPS;
+
+	if (drmIoctl(sna->kgem.fd, LOCAL_IOCTL_MODE_OBJ_GETPROPERTIES, &arg))
+		return;
+
+	DBG(("%s: object %d (type %x) has %d props\n", __FUNCTION__,
+	     obj_id, obj_type, arg.count_props));
+
+	if (arg.count_props > N_STACK_PROPS) {
+		values = malloc(2*sizeof(uint64_t)*arg.count_props);
+		if (values == NULL)
+			return;
+
+		props = (uint32_t *)(values + arg.count_props);
+
+		arg.props_ptr = (uintptr_t)props;
+		arg.prop_values_ptr = (uintptr_t)values;
+
+		if (drmIoctl(sna->kgem.fd, LOCAL_IOCTL_MODE_OBJ_GETPROPERTIES, &arg))
+			arg.count_props = 0;
+	}
+	VG(VALGRIND_MAKE_MEM_DEFINED(arg.props_ptr, sizeof(uint32_t)*arg.count_props));
+	VG(VALGRIND_MAKE_MEM_DEFINED(arg.prop_values_ptr, sizeof(uint64_t)*arg.count_props));
+
+	for (i = 0; i < arg.count_props; i++) {
+		struct drm_mode_get_property prop;
+
+		memset(&prop, 0, sizeof(prop));
+		prop.prop_id = props[i];
+		if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPROPERTY, &prop)) {
+			ERR(("%s: prop[%d].id=%d GETPROPERTY failed with errno=%d\n",
+			     __FUNCTION__, i, props[i], errno));
+			continue;
+		}
+
+		DBG(("%s: prop[%d] .id=%ld, .name=%s, .flags=%x, .value=%ld\n", __FUNCTION__, i,
+		     (long)props[i], prop.name, (unsigned)prop.flags, (long)values[i]));
+
+		parse_prop(sna, &prop, values[i], data);
+	}
+
+	if (values != stack)
+		free(values);
+
+#undef N_STACK_PROPS
+}
+
+static bool prop_is_type(const struct drm_mode_get_property *prop)
+{
+	return prop_has_type_and_name(prop, 3, "type");
+}
+
+static void plane_parse_prop(struct sna *sna,
+			     struct drm_mode_get_property *prop,
+			     uint64_t value, void *data)
+{
+	struct plane *p = data;
+
+	if (prop_is_type(prop))
+		p->type = value;
+	else if (prop_is_rotation(prop))
+		parse_rotation_prop(sna, p, prop, value);
+	else if (prop_is_color_encoding(prop))
+		parse_color_encoding_prop(sna, p, prop, value);
+}
+
+static int plane_details(struct sna *sna, struct plane *p)
+{
+	parse_props(sna, LOCAL_MODE_OBJECT_PLANE, p->id,
+		    plane_parse_prop, p);
+
+	p->rotation.supported &= DBG_NATIVE_ROTATION;
+	if (!xf86ReturnOptValBool(sna->Options, OPTION_ROTATION, TRUE))
+		p->rotation.supported = RR_Rotate_0;
+
+	DBG(("%s: plane=%d type=%d\n", __FUNCTION__, p->id, p->type));
+
+	return p->type;
+}
+
+static void add_sprite_plane(struct sna_crtc *crtc,
+			     struct plane *details)
+{
+	struct plane *sprite = malloc(sizeof(*sprite));
+	if (!sprite)
+		return;
+
+	memcpy(sprite, details, sizeof(*sprite));
+	list_add_tail(&sprite->link, &crtc->sprites);
+}
+
+static void
+sna_crtc_find_planes(struct sna *sna, struct sna_crtc *crtc)
+{
+#define LOCAL_IOCTL_SET_CAP	DRM_IOWR(0x0d, struct local_set_cap)
+	struct local_set_cap {
+		uint64_t name;
+		uint64_t value;
+	} cap;
+	struct local_mode_get_plane_res r;
+	uint32_t stack_planes[32];
+	uint32_t *planes = stack_planes;
+	int i;
+
+	VG_CLEAR(cap);
+	cap.name = DRM_CLIENT_CAP_UNIVERSAL_PLANES;
+	cap.value = 1;
+	(void)drmIoctl(sna->kgem.fd, LOCAL_IOCTL_SET_CAP, &cap);
+
+	VG_CLEAR(r);
+	r.plane_id_ptr = (uintptr_t)planes;
+	r.count_planes = ARRAY_SIZE(stack_planes);
+	if (drmIoctl(sna->kgem.fd, LOCAL_IOCTL_MODE_GETPLANERESOURCES, &r)) {
+		ERR(("%s: GETPLANERESOURCES failed with errno=%d\n", __FUNCTION__, errno));
+		return;
+	}
+
+	DBG(("%s: %d planes\n", __FUNCTION__, (int)r.count_planes));
+
+	if (r.count_planes > ARRAY_SIZE(stack_planes)) {
+		planes = malloc(sizeof(uint32_t)*r.count_planes);
+		if (planes == NULL)
+			return;
+
+		r.plane_id_ptr = (uintptr_t)planes;
+		if (drmIoctl(sna->kgem.fd, LOCAL_IOCTL_MODE_GETPLANERESOURCES, &r))
+			r.count_planes = 0;
+	}
+
+	VG(VALGRIND_MAKE_MEM_DEFINED(planes, sizeof(uint32_t)*r.count_planes));
+
+	for (i = 0; i < r.count_planes; i++) {
+		struct local_mode_get_plane p;
+		struct plane details;
+
+		VG_CLEAR(p);
+		p.plane_id = planes[i];
+		p.count_format_types = 0;
+		if (drmIoctl(sna->kgem.fd, LOCAL_IOCTL_MODE_GETPLANE, &p))
+			continue;
+
+		if ((p.possible_crtcs & (1 << __sna_crtc_pipe(crtc))) == 0)
+			continue;
+
+		DBG(("%s: plane %d is attached to our pipe=%d\n",
+		     __FUNCTION__, planes[i], __sna_crtc_pipe(crtc)));
+
+		details.id = p.plane_id;
+		details.rotation.prop = 0;
+		details.rotation.supported = RR_Rotate_0;
+		details.rotation.current = RR_Rotate_0;
+
+		switch (plane_details(sna, &details)) {
+		default:
+			break;
+
+		case DRM_PLANE_TYPE_PRIMARY:
+			crtc->primary = details;
+			break;
+
+		case DRM_PLANE_TYPE_CURSOR:
+			break;
+
+		case DRM_PLANE_TYPE_OVERLAY:
+			add_sprite_plane(crtc, &details);
+			break;
+		}
+	}
+
+	if (planes != stack_planes)
+		free(planes);
+}
+
+static bool plane_has_format(const uint32_t formats[],
+			     int count_formats,
+			     uint32_t format)
+{
+	int i;
+
+	for (i = 0; i < count_formats; i++) {
+		if (formats[i] == format)
+			return true;
+	}
+
+	return false;
+}
+
+bool sna_has_sprite_format(struct sna *sna, uint32_t format)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	int i;
+
+	if (sna->mode.num_real_crtc == 0)
+		return false;
+
+	for (i = 0; i < sna->mode.num_real_crtc; i++) {
+		struct sna_crtc *sna_crtc = to_sna_crtc(config->crtc[i]);
+		struct plane *plane;
+
+		list_for_each_entry(plane, &sna_crtc->sprites, link) {
+			struct local_mode_get_plane p;
+			uint32_t *formats;
+			int count_formats;
+			bool has_format;
+
+			VG_CLEAR(p);
+			p.plane_id = plane->id;
+			p.count_format_types = 0;
+			if (drmIoctl(sna->kgem.fd,
+				     LOCAL_IOCTL_MODE_GETPLANE,
+				     &p))
+				continue;
+			count_formats = p.count_format_types;
+
+			formats = calloc(count_formats, sizeof(formats[0]));
+			if (!formats)
+				continue;
+
+			p.count_format_types = count_formats;
+			p.format_type_ptr = (uintptr_t)formats;
+			if (drmIoctl(sna->kgem.fd,
+				     LOCAL_IOCTL_MODE_GETPLANE,
+				     &p)) {
+				free(formats);
+				continue;
+			}
+
+			assert(p.count_format_types == count_formats);
+
+			has_format = plane_has_format(formats,
+						      count_formats,
+						      format);
+
+			free(formats);
+
+			/*
+			 * As long as one plane supports the
+			 * format we declare it as supported.
+			 * Not all planes may support it, but
+			 * then the GPU fallback will kick in.
+			 */
+			if (has_format)
+				return true;
+		}
+	}
+
+	return false;
+}
+
+inline static bool prop_is_gamma_lut(const struct drm_mode_get_property *prop)
+{
+	return prop_has_type_and_name(prop, 4, "GAMMA_LUT");
+}
+
+inline static bool prop_is_gamma_lut_size(const struct drm_mode_get_property *prop)
+{
+	return prop_has_type_and_name(prop, 1, "GAMMA_LUT_SIZE");
+}
+
+static void sna_crtc_parse_prop(struct sna *sna,
+				struct drm_mode_get_property *prop,
+				uint64_t value, void *data)
+{
+	struct sna_crtc *crtc = data;
+
+	if (prop_is_gamma_lut(prop)) {
+		crtc->gamma_lut_prop = prop->prop_id;
+		crtc->gamma_lut_blob = value;
+	} else if (prop_is_gamma_lut_size(prop)) {
+		crtc->gamma_lut_size = value;
+	}
+}
+
+static void
+sna_crtc_init__props(struct sna *sna, struct sna_crtc *crtc)
+{
+	ScrnInfoPtr scrn = sna->scrn;
+
+	parse_props(sna, LOCAL_MODE_OBJECT_CRTC, crtc->id,
+		    sna_crtc_parse_prop, crtc);
+
+	/* use high precision gamma LUT for > 8bpc */
+	/* X-Server < 1.20 mishandles > 256 slots / > 8 bpc color maps. */
+	if (scrn->rgbBits <= 8 ||
+	    XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,20,0,0,0))
+		crtc->gamma_lut_size = 0;
+
+	if (crtc->gamma_lut_size) {
+		crtc->gamma_lut = calloc(max(crtc->gamma_lut_size, 256),
+					 sizeof(crtc->gamma_lut[0]));
+		if (!crtc->gamma_lut)
+			crtc->gamma_lut_size = 0;
+	}
+
+	DBG(("%s: CRTC:%d, gamma_lut_size=%d\n", __FUNCTION__,
+	     __sna_crtc_id(crtc), crtc->gamma_lut_size));
+}
+
+static void
+sna_crtc_init__rotation(struct sna *sna, struct sna_crtc *crtc)
+{
+	crtc->rotation = RR_Rotate_0;
+	crtc->primary.rotation.supported = RR_Rotate_0;
+	crtc->primary.rotation.current = RR_Rotate_0;
+}
+
+static void
+sna_crtc_init__cursor(struct sna *sna, struct sna_crtc *crtc)
+{
+	struct drm_mode_cursor arg;
+
+	VG_CLEAR(arg);
+	arg.flags = DRM_MODE_CURSOR_BO;
+	arg.crtc_id = __sna_crtc_id(crtc);
+	arg.width = arg.height = 0;
+	arg.handle = 0;
+
+	(void)drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_CURSOR, &arg);
+	crtc->hwcursor = true;
+}
+
+static bool
+sna_crtc_add(ScrnInfoPtr scrn, unsigned id)
+{
+	struct sna *sna = to_sna(scrn);
+	xf86CrtcPtr crtc;
+	struct sna_crtc *sna_crtc;
+	struct drm_i915_get_pipe_from_crtc_id get_pipe;
+
+	DBG(("%s(%d): is-zaphod? %d\n", __FUNCTION__, id, is_zaphod(scrn)));
+
+	sna_crtc = calloc(sizeof(struct sna_crtc), 1);
+	if (sna_crtc == NULL)
+		return false;
+
+	list_init(&sna_crtc->public.vblank_queue);
+	sna_crtc->id = id;
+
+	VG_CLEAR(get_pipe);
+	get_pipe.pipe = 0;
+	get_pipe.crtc_id = id;
+	if (drmIoctl(sna->kgem.fd,
+		     DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID,
+		     &get_pipe)) {
+		free(sna_crtc);
+		return false;
+	}
+	assert((unsigned)get_pipe.pipe < 256);
+	sna_crtc->public.flags |= get_pipe.pipe << 8;
+
+	if (is_zaphod(scrn) &&
+	    (get_zaphod_crtcs(sna) & (1 << get_pipe.pipe)) == 0) {
+		free(sna_crtc);
+		return true;
+	}
+
+	list_init(&sna_crtc->sprites);
+	sna_crtc_init__rotation(sna, sna_crtc);
+
+	sna_crtc_init__props(sna, sna_crtc);
+
+	sna_crtc_find_planes(sna, sna_crtc);
+
+	DBG(("%s: CRTC:%d [pipe=%d], primary id=%x: supported-rotations=%x, current-rotation=%x\n",
+	     __FUNCTION__, id, get_pipe.pipe,
+	     sna_crtc->primary.id, sna_crtc->primary.rotation.supported, sna_crtc->primary.rotation.current));
+
+	list_init(&sna_crtc->shadow_link);
+
+	crtc = xf86CrtcCreate(scrn, &sna_crtc_funcs);
+	if (crtc == NULL) {
+		free(sna_crtc);
+		return false;
+	}
+
+	sna_crtc_init__cursor(sna, sna_crtc);
+
+	crtc->driver_private = sna_crtc;
+	sna_crtc->base = crtc;
+	DBG(("%s: attached crtc[%d] pipe=%d\n",
+	     __FUNCTION__, id, __sna_crtc_pipe(sna_crtc)));
+
+	return true;
+}
+
+static bool
+is_panel(int type)
+{
+#define DRM_MODE_CONNECTOR_LVDS 7
+#define DRM_MODE_CONNECTOR_eDP 14
+#define DRM_MODE_CONNECTOR_DSI 16
+	return (type == DRM_MODE_CONNECTOR_LVDS ||
+		type == DRM_MODE_CONNECTOR_eDP ||
+		type == DRM_MODE_CONNECTOR_DSI);
+}
+
+static int
+find_property(struct sna *sna, struct sna_output *output, const char *name)
+{
+	struct drm_mode_get_property prop;
+	int i;
+
+	VG_CLEAR(prop);
+	for (i = 0; i < output->num_props; i++) {
+		prop.prop_id = output->prop_ids[i];
+		prop.count_values = 0;
+		prop.count_enum_blobs = 0;
+		if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPROPERTY, &prop))
+			continue;
+
+		if (strcmp(prop.name, name) == 0)
+			return i;
+	}
+
+	return -1;
+}
+
+static void update_properties(struct sna *sna, struct sna_output *output)
+{
+	union compat_mode_get_connector compat_conn;
+	struct drm_mode_modeinfo dummy;
+
+	VG_CLEAR(compat_conn);
+
+	compat_conn.conn.connector_id = output->id;
+	compat_conn.conn.count_props = output->num_props;
+	compat_conn.conn.props_ptr = (uintptr_t)output->prop_ids;
+	compat_conn.conn.prop_values_ptr = (uintptr_t)output->prop_values;
+	compat_conn.conn.count_modes = 1; /* skip detect */
+	compat_conn.conn.modes_ptr = (uintptr_t)&dummy;
+	compat_conn.conn.count_encoders = 0;
+
+	(void)drmIoctl(sna->kgem.fd,
+		       DRM_IOCTL_MODE_GETCONNECTOR,
+		       &compat_conn.conn);
+
+	assert(compat_conn.conn.count_props == output->num_props);
+	output->update_properties = false;
+}
+
+static xf86OutputStatus
+sna_output_detect(xf86OutputPtr output)
+{
+	struct sna *sna = to_sna(output->scrn);
+	struct sna_output *sna_output = output->driver_private;
+	union compat_mode_get_connector compat_conn;
+	uint32_t now;
+
+	DBG(("%s(%s:%d)\n", __FUNCTION__, output->name, sna_output->id));
+	sna_output->update_properties = false;
+
+	if (!sna_output->id) {
+		DBG(("%s(%s) hiding due to lost connection\n", __FUNCTION__, output->name));
+		return XF86OutputStatusDisconnected;
+	}
+
+	/* Cache detections for 15s or hotplug event  */
+	now = GetTimeInMillis();
+	if (sna_output->last_detect != 0 &&
+	    (int32_t)(now - sna_output->last_detect) <= OUTPUT_STATUS_CACHE_MS) {
+		DBG(("%s(%s) reporting cached status (since %dms): %d\n",
+		     __FUNCTION__, output->name, now - sna_output->last_detect,
+		     sna_output->status));
+		sna_output->update_properties = true;
+		return sna_output->status;
+	}
+
+	VG_CLEAR(compat_conn);
+	compat_conn.conn.connector_id = sna_output->id;
+	sna_output->num_modes = compat_conn.conn.count_modes = 0; /* reprobe */
+	compat_conn.conn.count_encoders = 0;
+	compat_conn.conn.count_props = sna_output->num_props;
+	compat_conn.conn.props_ptr = (uintptr_t)sna_output->prop_ids;
+	compat_conn.conn.prop_values_ptr = (uintptr_t)sna_output->prop_values;
+
+	if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCONNECTOR, &compat_conn.conn))
+		return XF86OutputStatusUnknown;
+	DBG(("%s(%s): num modes %d -> %d, num props %d -> %d\n",
+	     __FUNCTION__, output->name,
+	     sna_output->num_modes, compat_conn.conn.count_modes,
+	     sna_output->num_props, compat_conn.conn.count_props));
+
+	assert(compat_conn.conn.count_props == sna_output->num_props);
+
+	while (compat_conn.conn.count_modes && compat_conn.conn.count_modes != sna_output->num_modes) {
+		struct drm_mode_modeinfo *new_modes;
+		int old_count;
+
+		old_count = sna_output->num_modes;
+		new_modes = realloc(sna_output->modes,
+				    sizeof(*sna_output->modes)*compat_conn.conn.count_modes);
+		if (new_modes == NULL)
+			break;
+
+		sna_output->modes = new_modes;
+		sna_output->num_modes = compat_conn.conn.count_modes;
+		compat_conn.conn.modes_ptr = (uintptr_t)sna_output->modes;
+		compat_conn.conn.count_encoders = 0;
+		compat_conn.conn.count_props = 0;
+		if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCONNECTOR, &compat_conn.conn)) {
+			sna_output->num_modes = min(old_count, sna_output->num_modes);
+			break;
+		}
+		VG(VALGRIND_MAKE_MEM_DEFINED(sna_output->modes, sizeof(*sna_output->modes)*sna_output->num_modes));
+	}
+
+	DBG(("%s(%s): found %d modes, connection status=%d\n",
+	     __FUNCTION__, output->name, sna_output->num_modes, compat_conn.conn.connection));
+
+	sna_output->reprobe = false;
+	sna_output->last_detect = now;
+	switch (compat_conn.conn.connection) {
+	case DRM_MODE_CONNECTED:
+		sna_output->status = XF86OutputStatusConnected;
+		output->mm_width = compat_conn.conn.mm_width;
+		output->mm_height = compat_conn.conn.mm_height;
+		break;
+	case DRM_MODE_DISCONNECTED:
+		sna_output->status = XF86OutputStatusDisconnected;
+		break;
+	default:
+	case DRM_MODE_UNKNOWNCONNECTION:
+		sna_output->status = XF86OutputStatusUnknown;
+		break;
+	}
+	return sna_output->status;
+}
+
+static Bool
+sna_output_mode_valid(xf86OutputPtr output, DisplayModePtr mode)
+{
+	struct sna_output *sna_output = output->driver_private;
+	struct sna *sna = to_sna(output->scrn);
+
+	if (mode->HDisplay > sna->mode.max_crtc_width)
+		return MODE_VIRTUAL_X;
+	if (mode->VDisplay > sna->mode.max_crtc_height)
+		return MODE_VIRTUAL_Y;
+
+	/* Check that we can successfully pin this into the global GTT */
+	if ((kgem_can_create_2d(&sna->kgem,
+				mode->HDisplay, mode->VDisplay,
+				sna->scrn->bitsPerPixel) & KGEM_CAN_CREATE_GTT) == 0)
+		return MODE_MEM_VIRT;
+
+	/*
+	 * If the connector type is a panel, we will use the panel limit to
+	 * verfiy whether the mode is valid.
+	 */
+	if (sna_output->has_panel_limits) {
+		if (mode->HDisplay > sna_output->panel_hdisplay ||
+		    mode->VDisplay > sna_output->panel_vdisplay)
+			return MODE_PANEL;
+	}
+
+	return MODE_OK;
+}
+
+static void sna_output_set_parsed_edid(xf86OutputPtr output, xf86MonPtr mon)
+{
+	unsigned conn_mm_width, conn_mm_height;
+
+	/* We set the output size based on values from the kernel */
+	conn_mm_width = output->mm_width;
+	conn_mm_height = output->mm_height;
+
+	xf86OutputSetEDID(output, mon);
+
+	if (output->mm_width != conn_mm_width || output->mm_height != conn_mm_height) {
+		DBG(("%s)%s): kernel and Xorg disagree over physical size: kernel=%dx%dmm, Xorg=%dx%dmm\n",
+		     __FUNCTION__, output->name,
+		     conn_mm_width, conn_mm_height,
+		     output->mm_width, output->mm_height));
+	}
+
+	output->mm_width = conn_mm_width;
+	output->mm_height = conn_mm_height;
+}
+
+static void
+sna_output_attach_edid(xf86OutputPtr output)
+{
+	struct sna *sna = to_sna(output->scrn);
+	struct sna_output *sna_output = output->driver_private;
+	unsigned old_mm_width, old_mm_height;
+	struct drm_mode_get_blob blob;
+	void *old, *raw = NULL;
+	xf86MonPtr mon = NULL;
+
+	if (sna_output->edid_idx == -1)
+		return;
+
+	/* Always refresh the blob as the kernel may randomly update the
+	 * id even if the contents of the blob doesn't change, and a
+	 * request for the stale id will return nothing.
+	 */
+	if (sna_output->update_properties)
+		update_properties(sna, sna_output);
+
+	raw = sna_output->edid_raw;
+	blob.length = sna_output->edid_len;
+
+	if (blob.length && output->MonInfo) {
+		old = alloca(blob.length);
+		memcpy(old, raw, blob.length);
+	} else
+		old = NULL;
+
+	blob.blob_id = sna_output->prop_values[sna_output->edid_idx];
+	if (!blob.blob_id)
+		goto done;
+
+	DBG(("%s(%s): attaching EDID id=%d, current=%d\n",
+	     __FUNCTION__, output->name,
+	     blob.blob_id, sna_output->edid_blob_id));
+	if (blob.blob_id == sna_output->edid_blob_id && 0) { /* sigh */
+		if (output->MonInfo) {
+			/* XXX the property keeps on disappearing... */
+			RRChangeOutputProperty(output->randr_output,
+					       MakeAtom("EDID", strlen("EDID"), TRUE),
+					       XA_INTEGER, 8, PropModeReplace,
+					       sna_output->edid_len,
+					       sna_output->edid_raw,
+					       FALSE, FALSE);
+
+			return;
+		}
+
+		goto skip_read;
+	}
+
+	blob.data = (uintptr_t)raw;
+	do {
+		while (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPROPBLOB, &blob)) {
+			update_properties(sna, sna_output);
+			if (blob.blob_id == sna_output->prop_values[sna_output->edid_idx]) {
+				DBG(("%s(%s): failed to read blob, reusing previous\n",
+				     __FUNCTION__, output->name));
+				goto done;
+			}
+			blob.blob_id = sna_output->prop_values[sna_output->edid_idx];
+		}
+
+		DBG(("%s(%s): retrieving blob id=%d, length=%d\n",
+		     __FUNCTION__, output->name, blob.blob_id, blob.length));
+
+		if (blob.length < 128)
+			goto done;
+
+		if (blob.length > sna_output->edid_len) {
+			raw = realloc(raw, blob.length);
+			if (raw == NULL)
+				goto done;
+
+			VG(memset(raw, 0, blob.length));
+			blob.data = (uintptr_t)raw;
+		}
+	} while (blob.length != sna_output->edid_len &&
+		 drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPROPBLOB, &blob));
+
+	if (blob.length & 127) {
+		/* Truncated EDID! Make sure no one reads too far */
+		*SECTION(NO_EDID, (uint8_t*)raw) = blob.length/128 - 1;
+		blob.length &= -128;
+	}
+
+	if (old &&
+	    blob.length == sna_output->edid_len &&
+	    memcmp(old, raw, blob.length) == 0) {
+		DBG(("%s(%s): EDID + MonInfo is unchanged\n",
+		     __FUNCTION__, output->name));
+		assert(sna_output->edid_raw == raw);
+		sna_output->edid_blob_id = blob.blob_id;
+		RRChangeOutputProperty(output->randr_output,
+				       MakeAtom("EDID", strlen("EDID"), TRUE),
+				       XA_INTEGER, 8, PropModeReplace,
+				       sna_output->edid_len,
+				       sna_output->edid_raw,
+				       FALSE, FALSE);
+		return;
+	}
+
+skip_read:
+	if (raw) {
+		mon = xf86InterpretEDID(output->scrn->scrnIndex, raw);
+		if (mon && blob.length > 128)
+			mon->flags |= MONITOR_EDID_COMPLETE_RAWDATA;
+	}
+
+done:
+	output = sna_output->base;
+	old_mm_width = output->mm_width;
+	old_mm_height = output->mm_height;
+	sna_output_set_parsed_edid(output, mon);
+	if (raw) {
+		sna_output->edid_raw = raw;
+		sna_output->edid_len = blob.length;
+		sna_output->edid_blob_id = blob.blob_id;
+	}
+	output->mm_width = old_mm_width;
+	output->mm_height = old_mm_height;
+}
+
+static void
+sna_output_attach_tile(xf86OutputPtr output)
+{
+#if XF86_OUTPUT_VERSION >= 3
+	struct sna *sna = to_sna(output->scrn);
+	struct sna_output *sna_output = output->driver_private;
+	struct drm_mode_get_blob blob;
+	struct xf86CrtcTileInfo tile_info, *set = NULL;
+	char *tile;
+	int id;
+
+	id = find_property(sna, sna_output, "TILE");
+	DBG(("%s: found? TILE=%d\n", __FUNCTION__, id));
+	if (id == -1)
+		goto out;
+
+	if (sna_output->update_properties)
+		update_properties(sna, sna_output);
+
+	VG_CLEAR(blob);
+	blob.blob_id = sna_output->prop_values[id];
+	blob.length = 0;
+	if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPROPBLOB, &blob))
+		goto out;
+
+	do {
+		id = blob.length;
+		tile = alloca(id + 1);
+		blob.data = (uintptr_t)tile;
+		VG(memset(tile, 0, id));
+		DBG(("%s: reading %d bytes for TILE blob\n", __FUNCTION__, id));
+		if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPROPBLOB, &blob))
+			goto out;
+	} while (id != blob.length);
+
+	tile[blob.length] = '\0'; /* paranoia */
+	DBG(("%s: TILE='%s'\n", __FUNCTION__, tile));
+	if (xf86OutputParseKMSTile(tile, blob.length, &tile_info))
+		set = &tile_info;
+out:
+	xf86OutputSetTile(output, set);
+#endif
+}
+
+static bool duplicate_mode(DisplayModePtr modes, DisplayModePtr m)
+{
+	if (m == NULL)
+		return false;
+
+	while (modes) {
+		if (xf86ModesEqual(modes, m))
+			return true;
+
+		modes = modes->next;
+	}
+
+	return false;
+}
+
+static struct pixel_count {
+	int16_t width, height;
+} common_16_9[] = {
+	{ 640, 360 },
+	{ 720, 405 },
+	{ 864, 486 },
+	{ 960, 540 },
+	{ 1024, 576 },
+	{ 1280, 720 },
+	{ 1366, 768 },
+	{ 1600, 900 },
+	{ 1920, 1080 },
+	{ 2048, 1152 },
+	{ 2560, 1440 },
+	{ 2880, 1620 },
+	{ 3200, 1800 },
+	{ 3840, 2160 },
+	{ 4096, 2304 },
+	{ 5120, 2880 },
+	{ 7680, 4320 },
+	{ 15360, 8640 },
+}, common_16_10[] = {
+	{ 1280, 800 },
+	{ 1400, 900 },
+	{ 1680, 1050 },
+	{ 1920, 1200 },
+	{ 2560, 1600 },
+};
+
+static DisplayModePtr
+default_modes(DisplayModePtr preferred)
+{
+	DisplayModePtr modes;
+	int n;
+
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,6,99,900,0)
+	modes = xf86GetDefaultModes();
+#else
+	modes = xf86GetDefaultModes(0, 0);
+#endif
+
+	/* XXX O(n^2) mode list generation :( */
+
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,4,99,901,0)
+	if (preferred) {
+		DisplayModePtr m;
+
+		/* Add a half-resolution mode useful for large panels */
+		m = xf86GTFMode(preferred->HDisplay/2,
+				preferred->VDisplay/2,
+				xf86ModeVRefresh(preferred),
+				FALSE, FALSE);
+		if (!duplicate_mode(modes, m))
+			modes = xf86ModesAdd(modes, m);
+		else
+			free(m);
+
+		if (preferred->VDisplay * 16 > preferred->HDisplay*9 - preferred->HDisplay/32 &&
+		    preferred->VDisplay * 16 < preferred->HDisplay*9 + preferred->HDisplay/32) {
+			DBG(("Adding 16:9 modes -- %d < %d > %d\n",
+			     preferred->HDisplay*9 - preferred->HDisplay/32,
+			     preferred->VDisplay * 16,
+			     preferred->HDisplay*9 + preferred->HDisplay/32));
+			for (n = 0; n < ARRAY_SIZE(common_16_9); n++) {
+				if (preferred->HDisplay <= common_16_9[n].width ||
+				    preferred->VDisplay <= common_16_9[n].height)
+					break;
+
+				m = xf86GTFMode(common_16_9[n].width,
+						common_16_9[n].height,
+						xf86ModeVRefresh(preferred),
+						FALSE, FALSE);
+				if (!duplicate_mode(modes, m))
+					modes = xf86ModesAdd(modes, m);
+				else
+					free(m);
+			}
+		}
+
+		if (preferred->VDisplay * 16 > preferred->HDisplay*10 - preferred->HDisplay/32 &&
+		    preferred->VDisplay * 16 < preferred->HDisplay*10 + preferred->HDisplay/32) {
+			DBG(("Adding 16:10 modes -- %d < %d > %d\n",
+			     preferred->HDisplay*10 - preferred->HDisplay/32,
+			     preferred->VDisplay * 16,
+			     preferred->HDisplay*10 + preferred->HDisplay/32));
+			for (n = 0; n < ARRAY_SIZE(common_16_10); n++) {
+				if (preferred->HDisplay <= common_16_10[n].width ||
+				    preferred->VDisplay <= common_16_10[n].height)
+					break;
+
+				m = xf86GTFMode(common_16_10[n].width,
+						common_16_10[n].height,
+						xf86ModeVRefresh(preferred),
+						FALSE, FALSE);
+				if (!duplicate_mode(modes, m))
+					modes = xf86ModesAdd(modes, m);
+				else
+					free(m);
+			}
+		}
+	}
+#endif
+
+	return modes;
+}
+
+static DisplayModePtr
+sna_output_add_default_modes(xf86OutputPtr output, DisplayModePtr modes)
+{
+	xf86MonPtr mon = output->MonInfo;
+	DisplayModePtr i, m, preferred = NULL;
+	int max_x = 0, max_y = 0, max_clock = 0;
+	float max_vrefresh = 0.0;
+
+	if (mon && GTF_SUPPORTED(mon->features.msc))
+		return modes;
+
+	for (m = modes; m; m = m->next) {
+		if (m->type & M_T_PREFERRED)
+			preferred = m;
+		max_x = max(max_x, m->HDisplay);
+		max_y = max(max_y, m->VDisplay);
+		max_clock = max(max_clock, m->Clock);
+		max_vrefresh = max(max_vrefresh, xf86ModeVRefresh(m));
+	}
+	max_vrefresh *= (1 + SYNC_TOLERANCE);
+
+	m = default_modes(preferred);
+	xf86ValidateModesSize(output->scrn, m, max_x, max_y, 0);
+
+	for (i = m; i; i = i->next) {
+		if (i->Clock > max_clock)
+			i->status = MODE_CLOCK_HIGH;
+		if (xf86ModeVRefresh(i) > max_vrefresh)
+			i->status = MODE_VSYNC;
+		if (preferred &&
+		    i->HDisplay >= preferred->HDisplay &&
+		    i->VDisplay >= preferred->VDisplay &&
+		    xf86ModeVRefresh(i) >= xf86ModeVRefresh(preferred))
+			i->status = MODE_PANEL;
+	}
+
+	xf86PruneInvalidModes(output->scrn, &m, FALSE);
+
+	return xf86ModesAdd(modes, m);
+}
+
+static DisplayModePtr
+sna_output_override_edid(xf86OutputPtr output)
+{
+	struct sna_output *sna_output = output->driver_private;
+	xf86MonPtr mon = NULL;
+
+	if (sna_output->fake_edid_raw == NULL)
+		return NULL;
+
+	mon = xf86InterpretEDID(output->scrn->scrnIndex, sna_output->fake_edid_raw);
+	if (mon == NULL) {
+		return NULL;
+	}
+
+	mon->flags |= MONITOR_EDID_COMPLETE_RAWDATA;
+
+	xf86OutputSetEDID(output, mon);
+
+	return xf86DDCGetModes(output->scrn->scrnIndex, mon);
+}
+
+static DisplayModePtr
+sna_output_get_modes(xf86OutputPtr output)
+{
+	struct sna_output *sna_output = output->driver_private;
+	DisplayModePtr Modes, current;
+	int i;
+
+	DBG(("%s(%s:%d)\n", __FUNCTION__, output->name, sna_output->id));
+	assert(sna_output->id);
+
+	Modes = sna_output_override_edid(output);
+	if (Modes)
+		return Modes;
+
+	sna_output_attach_edid(output);
+	sna_output_attach_tile(output);
+
+	current = NULL;
+	if (output->crtc && !sna_output->hotplug_count) {
+		struct drm_mode_crtc mode;
+
+		VG_CLEAR(mode);
+		assert(to_sna_crtc(output->crtc));
+		mode.crtc_id = sna_crtc_id(output->crtc);
+
+		if (drmIoctl(to_sna(output->scrn)->kgem.fd, DRM_IOCTL_MODE_GETCRTC, &mode) == 0) {
+			DBG(("%s: CRTC:%d, pipe=%d: has mode?=%d\n", __FUNCTION__,
+			     sna_crtc_id(output->crtc),
+			     sna_crtc_pipe(output->crtc),
+			     mode.mode_valid && mode.mode.clock));
+
+			if (mode.mode_valid && mode.mode.clock) {
+				current = calloc(1, sizeof(DisplayModeRec));
+				if (current) {
+					mode_from_kmode(output->scrn, &mode.mode, current);
+					current->type |= M_T_DRIVER | M_T_PREFERRED;
+				}
+			}
+		}
+	}
+
+	DBG(("%s: adding %d probed modes\n", __FUNCTION__, sna_output->num_modes));
+
+	for (i = 0; i < sna_output->num_modes; i++) {
+		DisplayModePtr mode;
+
+		mode = calloc(1, sizeof(DisplayModeRec));
+		if (mode == NULL)
+			continue;
+
+		mode = mode_from_kmode(output->scrn,
+				       &sna_output->modes[i],
+				       mode);
+		Modes = xf86ModesAdd(Modes, mode);
+		if (current && xf86ModesEqual(mode, current)) {
+			free((void*)current->name);
+			free(current);
+			current = NULL;
+		}
+		if (current && mode->type & M_T_PREFERRED)
+			current->type &= ~M_T_PREFERRED;
+	}
+
+	if (current)
+		Modes = xf86ModesAdd(current, Modes);
+
+	/*
+	 * If the connector type is a panel, we will traverse the kernel mode to
+	 * get the panel limit. And then add all the standard modes to fake
+	 * the fullscreen experience.
+	 * If it is incorrect, please fix me.
+	 */
+	sna_output->has_panel_limits = false;
+	if (sna_output->is_panel) {
+		sna_output->panel_hdisplay = sna_output->panel_vdisplay = 0;
+		for (i = 0; i < sna_output->num_modes; i++) {
+			struct drm_mode_modeinfo *m;
+
+			m = &sna_output->modes[i];
+			if (m->hdisplay > sna_output->panel_hdisplay)
+				sna_output->panel_hdisplay = m->hdisplay;
+			if (m->vdisplay > sna_output->panel_vdisplay)
+				sna_output->panel_vdisplay = m->vdisplay;
+		}
+		sna_output->has_panel_limits =
+			sna_output->panel_hdisplay &&
+			sna_output->panel_vdisplay;
+	}
+
+	if (sna_output->add_default_modes)
+		Modes = sna_output_add_default_modes(output, Modes);
+
+	return Modes;
+}
+
+static void
+sna_output_destroy(xf86OutputPtr output)
+{
+	struct sna_output *sna_output = output->driver_private;
+	int i;
+
+	if (sna_output == NULL)
+		return;
+
+	free(sna_output->edid_raw);
+	free(sna_output->fake_edid_raw);
+
+	for (i = 0; i < sna_output->num_props; i++) {
+		if (sna_output->props[i].kprop == NULL)
+			continue;
+
+		if (sna_output->props[i].atoms) {
+			if (output->randr_output)
+				RRDeleteOutputProperty(output->randr_output, sna_output->props[i].atoms[0]);
+			free(sna_output->props[i].atoms);
+		}
+
+		drmModeFreeProperty(sna_output->props[i].kprop);
+	}
+	free(sna_output->props);
+	free(sna_output->prop_ids);
+	free(sna_output->prop_values);
+
+	backlight_close(&sna_output->backlight);
+
+	free(sna_output);
+	output->driver_private = NULL;
+}
+
+static void
+__sna_output_dpms(xf86OutputPtr output, int dpms, int fixup)
+{
+	struct sna *sna = to_sna(output->scrn);
+	struct sna_output *sna_output = output->driver_private;
+	int old_dpms = sna_output->dpms_mode;
+
+	DBG(("%s(%s:%d): dpms=%d (current: %d), active? %d\n",
+	     __FUNCTION__, output->name, sna_output->id,
+	     dpms, sna_output->dpms_mode,
+	     output->crtc != NULL));
+
+	if (!sna_output->id)
+		return;
+
+	if (old_dpms == dpms)
+		return;
+
+	/* Record the value of the backlight before turning
+	 * off the display, and reset if after turning it on.
+	 * Order is important as the kernel may record and also
+	 * reset the backlight across DPMS. Hence we need to
+	 * record the value before the kernel modifies it
+	 * and reapply it afterwards.
+	 */
+	if (sna_output->backlight.iface && dpms != DPMSModeOn) {
+		if (old_dpms == DPMSModeOn) {
+			sna_output->backlight_active_level = sna_output_backlight_get(output);
+			DBG(("%s(%s:%d): saving current backlight %d\n",
+			     __FUNCTION__, output->name, sna_output->id,
+			     sna_output->backlight_active_level));
+		}
+		sna_output->dpms_mode = dpms;
+		sna_output_backlight_off(sna_output);
+	}
+
+	if (output->crtc &&
+	    drmModeConnectorSetProperty(sna->kgem.fd,
+					sna_output->id,
+					sna_output->dpms_id,
+					dpms)) {
+		DBG(("%s(%s:%d): failed to set DPMS to %d (fixup? %d)\n",
+		     __FUNCTION__, output->name, sna_output->id, dpms, fixup));
+		if (fixup && dpms != DPMSModeOn) {
+			sna_crtc_disable(output->crtc, false);
+			return;
+		}
+	}
+
+	if (sna_output->backlight.iface && dpms == DPMSModeOn) {
+		DBG(("%s(%d:%d: restoring previous backlight %d\n",
+		     __FUNCTION__, output->name, sna_output->id,
+		     sna_output->backlight_active_level));
+		sna_output_backlight_on(sna_output);
+	}
+
+	sna_output->dpms_mode = dpms;
+}
+
+static void
+sna_output_dpms(xf86OutputPtr output, int dpms)
+{
+	__sna_output_dpms(output, dpms, true);
+}
+
+static bool
+sna_property_ignore(drmModePropertyPtr prop)
+{
+	if (!prop)
+		return true;
+
+	/* ignore blob prop */
+	if (prop->flags & DRM_MODE_PROP_BLOB)
+		return true;
+
+	/* ignore standard property */
+	if (!strcmp(prop->name, "EDID") ||
+	    !strcmp(prop->name, "DPMS"))
+		return true;
+
+	return false;
+}
+
+static void
+sna_output_create_ranged_atom(xf86OutputPtr output, Atom *atom,
+			      const char *name, INT32 min, INT32 max,
+			      uint64_t value, Bool immutable)
+{
+	int err;
+	INT32 atom_range[2];
+
+	atom_range[0] = min;
+	atom_range[1] = max;
+
+	*atom = MakeAtom(name, strlen(name), TRUE);
+
+	err = RRConfigureOutputProperty(output->randr_output, *atom, FALSE,
+					TRUE, immutable, 2, atom_range);
+	if (err != 0)
+		xf86DrvMsg(output->scrn->scrnIndex, X_WARNING,
+			   "RRConfigureOutputProperty error, %d\n", err);
+
+	err = RRChangeOutputProperty(output->randr_output, *atom, XA_INTEGER,
+				     32, PropModeReplace, 1, &value,
+				     FALSE, FALSE);
+	if (err != 0)
+		xf86DrvMsg(output->scrn->scrnIndex, X_WARNING,
+			   "RRChangeOutputProperty error, %d\n", err);
+}
+
+static void
+sna_output_create_resources(xf86OutputPtr output)
+{
+	struct sna *sna = to_sna(output->scrn);
+	struct sna_output *sna_output = output->driver_private;
+	int i, j, err;
+
+	sna_output->props = calloc(sna_output->num_props,
+				   sizeof(struct sna_property));
+	if (!sna_output->props)
+		return;
+
+	for (i = 0; i < sna_output->num_props; i++) {
+		struct sna_property *p = &sna_output->props[i];
+
+		p->kprop = drmModeGetProperty(sna->kgem.fd,
+					      sna_output->prop_ids[i]);
+		if (sna_property_ignore(p->kprop)) {
+			drmModeFreeProperty(p->kprop);
+			p->kprop = NULL;
+			continue;
+		}
+
+		if (p->kprop->flags & DRM_MODE_PROP_RANGE) {
+			p->num_atoms = 1;
+			p->atoms = calloc(p->num_atoms, sizeof(Atom));
+			if (!p->atoms)
+				continue;
+
+			sna_output_create_ranged_atom(output, &p->atoms[0],
+						      p->kprop->name,
+						      p->kprop->values[0],
+						      p->kprop->values[1],
+						      sna_output->prop_values[i],
+						      p->kprop->flags & DRM_MODE_PROP_IMMUTABLE ? TRUE : FALSE);
+
+		} else if (p->kprop->flags & DRM_MODE_PROP_ENUM) {
+			p->num_atoms = p->kprop->count_enums + 1;
+			p->atoms = calloc(p->num_atoms, sizeof(Atom));
+			if (!p->atoms)
+				continue;
+
+			p->atoms[0] = MakeAtom(p->kprop->name, strlen(p->kprop->name), TRUE);
+			for (j = 1; j <= p->kprop->count_enums; j++) {
+				struct drm_mode_property_enum *e = &p->kprop->enums[j-1];
+				p->atoms[j] = MakeAtom(e->name, strlen(e->name), TRUE);
+			}
+
+			err = RRConfigureOutputProperty(output->randr_output, p->atoms[0],
+							FALSE, FALSE,
+							p->kprop->flags & DRM_MODE_PROP_IMMUTABLE ? TRUE : FALSE,
+							p->num_atoms - 1, (INT32 *)&p->atoms[1]);
+			if (err != 0) {
+				xf86DrvMsg(output->scrn->scrnIndex, X_WARNING,
+					   "RRConfigureOutputProperty error, %d\n", err);
+			}
+
+			for (j = 0; j < p->kprop->count_enums; j++)
+				if (p->kprop->enums[j].value == sna_output->prop_values[i])
+					break;
+			/* there's always a matching value */
+			err = RRChangeOutputProperty(output->randr_output, p->atoms[0],
+						     XA_ATOM, 32, PropModeReplace, 1, &p->atoms[j+1],
+						     FALSE, FALSE);
+			if (err != 0) {
+				xf86DrvMsg(output->scrn->scrnIndex, X_WARNING,
+					   "RRChangeOutputProperty error, %d\n", err);
+			}
+		}
+	}
+
+	if (sna_output->backlight.iface) {
+		/* Set up the backlight property, which takes effect
+		 * immediately and accepts values only within the
+		 * backlight_range.
+		 */
+		sna_output_create_ranged_atom(output, &backlight_atom,
+					      BACKLIGHT_NAME, 0,
+					      sna_output->backlight.max,
+					      sna_output->backlight_active_level,
+					      FALSE);
+		sna_output_create_ranged_atom(output,
+					      &backlight_deprecated_atom,
+					      BACKLIGHT_DEPRECATED_NAME, 0,
+					      sna_output->backlight.max,
+					      sna_output->backlight_active_level,
+					      FALSE);
+	}
+}
+
+static Bool
+sna_output_set_property(xf86OutputPtr output, Atom property,
+			RRPropertyValuePtr value)
+{
+	struct sna *sna = to_sna(output->scrn);
+	struct sna_output *sna_output = output->driver_private;
+	int i;
+
+	if (property == backlight_atom || property == backlight_deprecated_atom) {
+		INT32 val;
+		int ret = 0;
+
+		if (value->type != XA_INTEGER || value->format != 32 ||
+		    value->size != 1)
+		{
+			return FALSE;
+		}
+
+		val = *(INT32 *)value->data;
+		DBG(("%s: setting backlight to %d (max=%d)\n",
+		     __FUNCTION__, (int)val, sna_output->backlight.max));
+		if (val < 0 || val > sna_output->backlight.max)
+			return FALSE;
+
+		sna_output->backlight_active_level = val;
+		if (sna_output->dpms_mode == DPMSModeOn)
+			ret = sna_output_backlight_set(sna_output, val);
+		return ret == 0;
+	}
+
+	if (!sna_output->id)
+		return TRUE;
+
+	for (i = 0; i < sna_output->num_props; i++) {
+		struct sna_property *p = &sna_output->props[i];
+
+		if (p->atoms == NULL || p->atoms[0] != property)
+			continue;
+
+		if (p->kprop->flags & DRM_MODE_PROP_RANGE) {
+			uint32_t val;
+
+			if (value->type != XA_INTEGER || value->format != 32 ||
+			    value->size != 1)
+				return FALSE;
+
+			val = *(uint32_t *)value->data;
+			drmModeConnectorSetProperty(sna->kgem.fd, sna_output->id,
+						    p->kprop->prop_id, (uint64_t)val);
+			return TRUE;
+		} else if (p->kprop->flags & DRM_MODE_PROP_ENUM) {
+			Atom atom;
+			const char *name;
+			int j;
+
+			if (value->type != XA_ATOM || value->format != 32 || value->size != 1)
+				return FALSE;
+
+			memcpy(&atom, value->data, 4);
+			name = NameForAtom(atom);
+			if (name == NULL)
+				return FALSE;
+
+			/* search for matching name string, then set its value down */
+			for (j = 0; j < p->kprop->count_enums; j++) {
+				if (!strcmp(p->kprop->enums[j].name, name)) {
+					drmModeConnectorSetProperty(sna->kgem.fd, sna_output->id,
+								    p->kprop->prop_id, p->kprop->enums[j].value);
+					return TRUE;
+				}
+			}
+			return FALSE;
+		}
+	}
+
+	/* We didn't recognise this property, just report success in order
+	 * to allow the set to continue, otherwise we break setting of
+	 * common properties like EDID.
+	 */
+	return TRUE;
+}
+
+static Bool
+sna_output_get_property(xf86OutputPtr output, Atom property)
+{
+	struct sna_output *sna_output = output->driver_private;
+	int err, i, j;
+
+	if (property == backlight_atom || property == backlight_deprecated_atom) {
+		INT32 val;
+
+		if (!sna_output->backlight.iface)
+			return FALSE;
+
+		if (sna_output->dpms_mode == DPMSModeOn) {
+			val = sna_output_backlight_get(output);
+			if (val < 0)
+				return FALSE;
+			DBG(("%s(%s): output on, reporting actual backlight value [%d]\n",
+			     __FUNCTION__, output->name, val));
+		} else {
+			val = sna_output->backlight_active_level;
+			DBG(("%s(%s): output off, reporting cached backlight value [%d]\n",
+			     __FUNCTION__, output->name, val));
+		}
+
+		err = RRChangeOutputProperty(output->randr_output, property,
+					     XA_INTEGER, 32, PropModeReplace, 1, &val,
+					     FALSE, FALSE);
+		if (err != 0) {
+			xf86DrvMsg(output->scrn->scrnIndex, X_WARNING,
+				   "RRChangeOutputProperty error, %d\n", err);
+			return FALSE;
+		}
+
+		return TRUE;
+	}
+
+	for (i = 0; i < sna_output->num_props; i++) {
+		struct sna_property *p = &sna_output->props[i];
+
+		if (p->atoms == NULL || p->atoms[0] != property)
+			continue;
+
+		if (sna_output->update_properties && output->scrn->vtSema)
+			update_properties(to_sna(output->scrn), sna_output);
+
+		err = 0;
+		if (p->kprop->flags & DRM_MODE_PROP_RANGE) {
+			err = RRChangeOutputProperty(output->randr_output,
+						     property, XA_INTEGER, 32,
+						     PropModeReplace, 1,
+						     &sna_output->prop_values[i],
+						     FALSE, FALSE);
+		} else if (p->kprop->flags & DRM_MODE_PROP_ENUM) {
+			for (j = 0; j < p->kprop->count_enums; j++) {
+				if (p->kprop->enums[j].value == sna_output->prop_values[i])
+					break;
+			}
+			err = RRChangeOutputProperty(output->randr_output,
+						     property, XA_ATOM, 32,
+						     PropModeReplace, 1,
+						     &p->atoms[j+1],
+						     FALSE, FALSE);
+		}
+
+		if (err != 0)
+			xf86DrvMsg(output->scrn->scrnIndex, X_WARNING,
+				   "RRChangeOutputProperty error, %d\n", err);
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+static const xf86OutputFuncsRec sna_output_funcs = {
+	.create_resources = sna_output_create_resources,
+#ifdef RANDR_12_INTERFACE
+	.set_property = sna_output_set_property,
+	.get_property = sna_output_get_property,
+#endif
+	.dpms = sna_output_dpms,
+	.detect = sna_output_detect,
+	.mode_valid = sna_output_mode_valid,
+
+	.get_modes = sna_output_get_modes,
+	.destroy = sna_output_destroy
+};
+
+static const int subpixel_conv_table[] = {
+	SubPixelUnknown,
+	SubPixelHorizontalRGB,
+	SubPixelHorizontalBGR,
+	SubPixelVerticalRGB,
+	SubPixelVerticalBGR,
+	SubPixelNone
+};
+
+static const char * const output_names[] = {
+	/* DRM_MODE_CONNECTOR_Unknown */	"None",
+	/* DRM_MODE_CONNECTOR_VGA */		"VGA",
+	/* DRM_MODE_CONNECTOR_DVII */		"DVI",
+	/* DRM_MODE_CONNECTOR_DVID */		"DVI",
+	/* DRM_MODE_CONNECTOR_DVIA */		"DVI",
+	/* DRM_MODE_CONNECTOR_Composite */	"Composite",
+	/* DRM_MODE_CONNECTOR_SVIDEO */		"TV",
+	/* DRM_MODE_CONNECTOR_LVDS */		"LVDS",
+	/* DRM_MODE_CONNECTOR_Component */	"CTV",
+	/* DRM_MODE_CONNECTOR_9PinDIN */	"DIN",
+	/* DRM_MODE_CONNECTOR_DisplayPort */	"DP",
+	/* DRM_MODE_CONNECTOR_HDMIA */		"HDMI",
+	/* DRM_MODE_CONNECTOR_HDMIB */		"HDMI",
+	/* DRM_MODE_CONNECTOR_TV */		"TV",
+	/* DRM_MODE_CONNECTOR_eDP */		"eDP",
+	/* DRM_MODE_CONNECTOR_VIRTUAL */	"Virtual",
+	/* DRM_MODE_CONNECTOR_DSI */		"DSI",
+	/* DRM_MODE_CONNECTOR_DPI */		"DPI"
+};
+
+static bool
+output_ignored(ScrnInfoPtr scrn, const char *name)
+{
+	char monitor_name[64];
+	const char *monitor;
+	XF86ConfMonitorPtr conf;
+
+	snprintf(monitor_name, sizeof(monitor_name), "monitor-%s", name);
+	monitor = xf86findOptionValue(scrn->options, monitor_name);
+	if (!monitor)
+		monitor = name;
+
+	conf = xf86findMonitor(monitor,
+			       xf86configptr->conf_monitor_lst);
+	if (conf == NULL && XF86_CRTC_CONFIG_PTR(scrn)->num_output == 0)
+		conf = xf86findMonitor(scrn->monitor->id,
+				       xf86configptr->conf_monitor_lst);
+	if (conf == NULL)
+		return false;
+
+	return xf86CheckBoolOption(conf->mon_option_lst, "Ignore", 0);
+}
+
+static bool
+gather_encoders(struct sna *sna, uint32_t id, int count,
+		struct drm_mode_get_encoder *out)
+{
+	union compat_mode_get_connector compat_conn;
+	struct drm_mode_modeinfo dummy;
+	struct drm_mode_get_encoder enc;
+	uint32_t *ids = NULL;
+
+	DBG(("%s(%d): expected count=%d\n", __FUNCTION__, id, count));
+
+	VG_CLEAR(compat_conn);
+	VG_CLEAR(enc);
+	memset(out, 0, sizeof(*out));
+
+	do {
+		uint32_t *nids;
+
+		nids = realloc(ids, sizeof(*ids) * count);
+		if (nids == NULL) {
+			free(ids);
+			return false;
+		}
+		ids = nids;
+
+		compat_conn.conn.connector_id = id;
+		compat_conn.conn.count_props = 0;
+		compat_conn.conn.count_modes = 1; /* skip detect */
+		compat_conn.conn.modes_ptr = (uintptr_t)&dummy;
+		compat_conn.conn.count_encoders = count;
+		compat_conn.conn.encoders_ptr = (uintptr_t)ids;
+
+		if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCONNECTOR, &compat_conn.conn)) {
+			DBG(("%s: GETCONNECTOR[%d] failed, ret=%d\n", __FUNCTION__, id, errno));
+			compat_conn.conn.count_encoders = count = 0;
+		}
+
+		VG(VALGRIND_MAKE_MEM_DEFINED(ids, sizeof(uint32_t)*compat_conn.conn.count_encoders));
+		if (count == compat_conn.conn.count_encoders)
+			break;
+
+		count = compat_conn.conn.count_encoders;
+	} while (1);
+
+	DBG(("%s(%d): gathering %d encoders\n", __FUNCTION__, id, count));
+	for (count = 0; count < compat_conn.conn.count_encoders; count++) {
+		enc.encoder_id = ids[count];
+		if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETENCODER, &enc)) {
+			DBG(("%s: GETENCODER[%d] failed, ret=%d\n", __FUNCTION__, ids[count], errno));
+			count = 0;
+			break;
+		}
+		DBG(("%s(%d): encoder=%d, possible_crtcs=%x, possible_clones=%x\n",
+		     __FUNCTION__, id, enc.encoder_id, enc.possible_crtcs, enc.possible_clones));
+		out->possible_crtcs |= enc.possible_crtcs;
+		out->possible_clones |= enc.possible_clones;
+
+		for (id = 0; id < sna->mode.num_real_encoder; id++) {
+			if (enc.encoder_id == sna->mode.encoders[id]) {
+				out->crtc_id |= 1 << id;
+				break;
+			}
+		}
+	}
+
+	free(ids);
+	return count > 0;
+}
+
+/* We need to map from kms encoder based possible_clones mask to X output based
+ * possible clones masking. Note that for SDVO and on Haswell with DP/HDMI we
+ * can have more than one output hanging off the same encoder.
+ */
+static void
+sna_mode_compute_possible_outputs(struct sna *sna)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	int encoder_mask[32];
+	int i, j;
+
+	assert(sna->mode.num_real_output < 32);
+	assert(sna->mode.num_real_crtc < 32);
+
+	for (i = 0; i < sna->mode.num_real_output; i++) {
+		xf86OutputPtr output = config->output[i];
+		struct sna_output *sna_output = to_sna_output(output);
+
+		assert(sna_output);
+
+		if (sna_output->id) {
+			output->possible_clones = sna_output->possible_encoders;
+			encoder_mask[i] = sna_output->attached_encoders;
+		} else {
+			output->possible_clones = 0;
+			encoder_mask[i] = 0;
+		}
+	}
+
+	/* Convert from encoder numbering to output numbering */
+	for (i = 0; i < sna->mode.num_real_output; i++) {
+		xf86OutputPtr output = config->output[i];
+		unsigned clones;
+
+		if (output->possible_clones == 0)
+			continue;
+
+		clones = 0;
+		for (j = 0; j < sna->mode.num_real_output; j++)
+			if (i != j && output->possible_clones & encoder_mask[j])
+				clones |= 1 << j;
+		output->possible_clones = clones;
+
+		DBG(("%s: updated output '%s' %d [%d] (possible crtc:%x, possible clones:%x)\n",
+		     __FUNCTION__, output->name, i, to_connector_id(output),
+		     (uint32_t)output->possible_crtcs,
+		     (uint32_t)output->possible_clones));
+	}
+}
+
+static int name_from_path(struct sna *sna,
+			  struct sna_output *sna_output,
+			  char *name)
+{
+	struct drm_mode_get_blob blob;
+	char *path;
+	int id;
+
+	id = find_property(sna, sna_output, "PATH");
+	DBG(("%s: found? PATH=%d\n", __FUNCTION__, id));
+	if (id == -1)
+		return 0;
+
+	VG_CLEAR(blob);
+	blob.blob_id = sna_output->prop_values[id];
+	blob.length = 0;
+	if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPROPBLOB, &blob))
+		return 0;
+
+	do {
+		id = blob.length;
+		path = alloca(id + 1);
+		blob.data = (uintptr_t)path;
+		VG(memset(path, 0, id));
+		DBG(("%s: reading %d bytes for path blob\n", __FUNCTION__, id));
+		if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPROPBLOB, &blob))
+			return 0;
+	} while (id != blob.length);
+
+	path[blob.length] = '\0'; /* paranoia */
+	DBG(("%s: PATH='%s'\n", __FUNCTION__, path));
+
+	/* we only handle MST paths for now */
+	if (strncmp(path, "mst:", 4) == 0) {
+		xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+		char tmp[5], *c;
+		int n;
+
+		c = strchr(path + 4, '-');
+		if (c == NULL)
+			return 0;
+
+		id = c - (path + 4);
+		if (id + 1> 5)
+			return 0;
+
+		memcpy(tmp, path + 4, id);
+		tmp[id] = '\0';
+		id = strtoul(tmp, NULL, 0);
+
+		for (n = 0; n < sna->mode.num_real_output; n++) {
+			if (to_sna_output(config->output[n])->id == id)
+				return snprintf(name, 32, "%s-%s",
+						config->output[n]->name, c + 1);
+		}
+	}
+
+	return 0;
+}
+
+static char *fake_edid_name(xf86OutputPtr output)
+{
+	struct sna *sna = to_sna(output->scrn);
+	const char *str, *colon;
+
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,7,99,901,0)
+	str = xf86GetOptValString(sna->Options, OPTION_EDID);
+#else
+	str = NULL;
+#endif
+	if (str == NULL)
+		return NULL;
+
+	do {
+		colon = strchr(str, ':');
+		if (colon == NULL)
+			return NULL;
+
+		if (strncmp(str, output->name, colon-str) == 0 &&
+		    output->name[colon-str] == '\0') {
+			char *path;
+			int len;
+
+			str = colon + 1;
+			colon = strchr(str, ',');
+			if (colon)
+				len = colon - str;
+			else
+				len = strlen(str);
+
+			path = malloc(len + 1);
+			if (path == NULL)
+				return NULL;
+
+			memcpy(path, str, len);
+			path[len] = '\0';
+			return path;
+		}
+
+		str = strchr(colon + 1, ',');
+		if (str == NULL)
+			return NULL;
+
+		str++;
+	} while (1);
+}
+
+static void
+sna_output_load_fake_edid(xf86OutputPtr output)
+{
+	struct sna_output *sna_output = output->driver_private;
+	const char *filename;
+	FILE *file;
+	void *raw;
+	int size;
+
+	filename = fake_edid_name(output);
+	if (filename == NULL)
+		return;
+
+	file = fopen(filename, "rb");
+	if (file == NULL)
+		goto err;
+
+	fseek(file, 0, SEEK_END);
+	size = ftell(file);
+	if (size % 128) {
+		fclose(file);
+		goto err;
+	}
+
+	raw = malloc(size);
+	if (raw == NULL) {
+		fclose(file);
+		free(raw);
+		goto err;
+	}
+
+	fseek(file, 0, SEEK_SET);
+	if (fread(raw, size, 1, file) != 1) {
+		fclose(file);
+		free(raw);
+		goto err;
+	}
+	fclose(file);
+
+	sna_output->fake_edid_raw = raw;
+
+	xf86DrvMsg(output->scrn->scrnIndex, X_CONFIG,
+		   "Loading EDID from \"%s\" for output %s\n",
+		   filename, output->name);
+	return;
+
+err:
+	xf86DrvMsg(output->scrn->scrnIndex, X_ERROR,
+		   "Could not read EDID file \"%s\" for output %s\n",
+		   filename, output->name);
+}
+
+static int
+sna_output_add(struct sna *sna, unsigned id, unsigned serial)
+{
+	ScrnInfoPtr scrn = sna->scrn;
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+	union compat_mode_get_connector compat_conn;
+	struct drm_mode_get_encoder enc;
+	struct drm_mode_modeinfo dummy;
+	struct sna_output *sna_output;
+	xf86OutputPtr *outputs, output;
+	unsigned possible_encoders, attached_encoders, possible_crtcs;
+	const char *output_name;
+	char name[32];
+	int path, len, i;
+
+	DBG(("%s(%d): serial=%d\n", __FUNCTION__, id, serial));
+
+	COMPILE_TIME_ASSERT(sizeof(struct drm_mode_get_connector) <= sizeof(compat_conn.pad));
+
+	VG_CLEAR(compat_conn);
+	memset(&enc, 0, sizeof(enc));
+
+	compat_conn.conn.connector_id = id;
+	compat_conn.conn.count_props = 0;
+	compat_conn.conn.count_modes = 1; /* skip detect */
+	compat_conn.conn.modes_ptr = (uintptr_t)&dummy;
+	compat_conn.conn.count_encoders = 1;
+	compat_conn.conn.encoders_ptr = (uintptr_t)&enc.encoder_id;
+
+	if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCONNECTOR, &compat_conn.conn)) {
+		DBG(("%s: GETCONNECTOR[%d] failed, ret=%d\n", __FUNCTION__, id, errno));
+		return -1;
+	}
+	assert(compat_conn.conn.connector_id == id);
+	DBG(("%s(%d): has %d associated encoders\n", __FUNCTION__, id, compat_conn.conn.count_encoders));
+
+	if (compat_conn.conn.connector_type < ARRAY_SIZE(output_names))
+		output_name = output_names[compat_conn.conn.connector_type];
+	else
+		output_name = "UNKNOWN";
+	len = snprintf(name, 32, "%s%d", output_name, compat_conn.conn.connector_type_id);
+	if (output_ignored(scrn, name))
+		return 0;
+
+	if (enc.encoder_id) {
+		if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETENCODER, &enc)) {
+			DBG(("%s: GETENCODER[%d] failed, ret=%d\n", __FUNCTION__, enc.encoder_id, errno));
+			return 0;
+		}
+
+		possible_encoders = enc.possible_clones;
+		attached_encoders = 0;
+		for (i = 0; i < sna->mode.num_real_encoder; i++) {
+			if (enc.encoder_id == sna->mode.encoders[i]) {
+				attached_encoders = 1 << i;
+				break;
+			}
+		}
+
+		if (attached_encoders == 0) {
+			DBG(("%s: failed to find attached encoder\n", __FUNCTION__));
+			return 0;
+		}
+
+		possible_crtcs = enc.possible_crtcs;
+		assert(enc.encoder_id == compat_conn.conn.encoder_id || compat_conn.conn.encoder_id == 0);
+	} else {
+		DBG(("%s: unexpected number [%d] of encoders attached\n",
+		     __FUNCTION__, compat_conn.conn.count_encoders));
+		if (!gather_encoders(sna, id, compat_conn.conn.count_encoders, &enc)) {
+			DBG(("%s: gather encoders failed\n", __FUNCTION__));
+			return 0;
+		}
+		possible_encoders = enc.possible_clones;
+		attached_encoders = enc.crtc_id;
+		possible_crtcs = enc.possible_crtcs;
+
+		memset(&enc, 0, sizeof(enc));
+		enc.encoder_id = compat_conn.conn.encoder_id;
+		(void)drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETENCODER, &enc);
+	}
+
+	if (is_zaphod(scrn)) {
+		unsigned zaphod_crtcs;
+
+		if (!sna_zaphod_match(sna, name)) {
+			DBG(("%s: zaphod mismatch, want %s, have %s\n",
+			     __FUNCTION__,
+			     xf86GetOptValString(sna->Options, OPTION_ZAPHOD) ?: "???",
+			     name));
+			return 0;
+		}
+
+		zaphod_crtcs = get_zaphod_crtcs(sna);
+		possible_crtcs &= zaphod_crtcs;
+		if (possible_crtcs == 0) {
+			xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+				   "%s is an invalid output for screen %d\n",
+				   name, scrn->confScreen->device->screen);
+			return -1;
+		}
+
+		possible_crtcs >>= ffs(zaphod_crtcs) - 1;
+	}
+
+	sna_output = calloc(sizeof(struct sna_output), 1);
+	if (!sna_output)
+		return -1;
+
+	sna_output->connector_type = compat_conn.conn.connector_type;
+	sna_output->connector_type_id = compat_conn.conn.connector_type_id;
+	sna_output->num_props = compat_conn.conn.count_props;
+	sna_output->prop_ids = malloc(sizeof(uint32_t)*compat_conn.conn.count_props);
+	sna_output->prop_values = malloc(sizeof(uint64_t)*compat_conn.conn.count_props);
+	if (sna_output->prop_ids == NULL || sna_output->prop_values == NULL) {
+		free(sna_output->prop_ids);
+		free(sna_output->prop_values);
+		free(sna_output);
+		return -1;
+	}
+
+	compat_conn.conn.count_encoders = 0;
+
+	compat_conn.conn.count_modes = 1;
+	compat_conn.conn.modes_ptr = (uintptr_t)&dummy;
+
+	compat_conn.conn.count_props = sna_output->num_props;
+	compat_conn.conn.props_ptr = (uintptr_t)sna_output->prop_ids;
+	compat_conn.conn.prop_values_ptr = (uintptr_t)sna_output->prop_values;
+
+	if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCONNECTOR, &compat_conn.conn)) {
+		DBG(("%s: second! GETCONNECTOR failed, ret=%d\n", __FUNCTION__, errno));
+		goto cleanup;
+	}
+	assert(compat_conn.conn.connector_id == id);
+
+	/* statically constructed property list */
+	assert(sna_output->num_props == compat_conn.conn.count_props);
+	VG(VALGRIND_MAKE_MEM_DEFINED(sna_output->prop_ids, sizeof(uint32_t)*sna_output->num_props));
+	VG(VALGRIND_MAKE_MEM_DEFINED(sna_output->prop_values, sizeof(uint64_t)*sna_output->num_props));
+
+	/* Construct name from topology, and recheck if output is acceptable */
+	path = name_from_path(sna, sna_output, name);
+	if (path) {
+		if (output_ignored(scrn, name)) {
+			len = 0;
+			goto skip;
+		}
+
+		if (is_zaphod(scrn) && !sna_zaphod_match(sna, name)) {
+			DBG(("%s: zaphod mismatch, want %s, have %s\n",
+			     __FUNCTION__,
+			     xf86GetOptValString(sna->Options, OPTION_ZAPHOD) ?: "???",
+			     name));
+			len = 0;
+			goto skip;
+		}
+
+		len = path;
+	}
+
+	/* Check if we are dynamically reattaching an old connector */
+	if (serial) {
+		for (i = 0; i < sna->mode.num_real_output; i++) {
+			output = config->output[i];
+			if (strcmp(output->name, name) == 0) {
+				assert(output->scrn == scrn);
+				assert(output->funcs == &sna_output_funcs);
+
+				/*
+				 * If the old output is still in use, tell
+				 * the kernel to switch it off so we can
+				 * move its resources over to the new id.
+				 */
+				if (output->crtc) {
+					struct drm_mode_crtc arg = {
+						.crtc_id = __sna_crtc_id(to_sna_crtc(output->crtc)),
+					};
+					drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_SETCRTC, &arg);
+					output->crtc = NULL;
+				}
+
+				sna_output_destroy(output);
+				goto reset;
+			}
+		}
+	}
+
+	output = calloc(1, sizeof(*output) + len + 1);
+	if (!output)
+		goto cleanup;
+
+	outputs = realloc(config->output, (config->num_output + 1) * sizeof(output));
+	if (outputs == NULL) {
+		free(output);
+		goto cleanup;
+	}
+
+	output->scrn = scrn;
+	output->funcs = &sna_output_funcs;
+	output->name = (char *)(output + 1);
+	memcpy(output->name, name, len + 1);
+
+	output->use_screen_monitor = config->num_output != 0;
+	xf86OutputUseScreenMonitor(output, !output->use_screen_monitor);
+	assert(output->options);
+
+	DBG(("%s: inserting output #%d of %d\n", __FUNCTION__, sna->mode.num_real_output, config->num_output));
+	for (i = config->num_output; i > sna->mode.num_real_output; i--) {
+		outputs[i] = outputs[i-1];
+		assert(outputs[i]->driver_private == NULL);
+		outputs[i]->possible_clones <<= 1;
+	}
+
+	if (xf86ReturnOptValBool(output->options, OPTION_PRIMARY, FALSE)) {
+		memmove(outputs + 1, outputs, sizeof(output)*config->num_output);
+		outputs[0] = output;
+	} else
+		outputs[i] = output;
+	sna->mode.num_real_output++;
+	config->num_output++;
+	config->output = outputs;
+
+reset:
+	sna_output->id = compat_conn.conn.connector_id;
+	sna_output->is_panel = is_panel(compat_conn.conn.connector_type);
+	sna_output->edid_idx = find_property(sna, sna_output, "EDID");
+	sna_output->link_status_idx =
+		find_property(sna, sna_output, "link-status");
+	if (find_property(sna, sna_output, "scaling mode") != -1)
+		sna_output->add_default_modes =
+			xf86ReturnOptValBool(output->options, OPTION_DEFAULT_MODES, TRUE);
+
+	i = find_property(sna, sna_output, "DPMS");
+	if (i != -1) {
+		sna_output->dpms_id = sna_output->prop_ids[i];
+		sna_output->dpms_mode = sna_output->prop_values[i];
+		DBG(("%s: found 'DPMS' (idx=%d, id=%d), initial value=%d\n",
+		     __FUNCTION__, i, sna_output->dpms_id, sna_output->dpms_mode));
+	} else
+		sna_output->dpms_mode = DPMSModeOff;
+
+	sna_output->possible_encoders = possible_encoders;
+	sna_output->attached_encoders = attached_encoders;
+
+	output->mm_width = compat_conn.conn.mm_width;
+	output->mm_height = compat_conn.conn.mm_height;
+
+	if (compat_conn.conn.subpixel >= ARRAY_SIZE(subpixel_conv_table))
+		compat_conn.conn.subpixel = 0;
+	output->subpixel_order = subpixel_conv_table[compat_conn.conn.subpixel];
+	output->driver_private = sna_output;
+	sna_output->base = output;
+
+	backlight_init(&sna_output->backlight);
+	sna_output_backlight_init(output);
+
+	output->possible_crtcs = possible_crtcs & count_to_mask(sna->mode.num_real_crtc);
+	output->interlaceAllowed = TRUE;
+
+	sna_output_load_fake_edid(output);
+
+	if (serial) {
+		if (output->randr_output == NULL) {
+			output->randr_output = RROutputCreate(xf86ScrnToScreen(scrn), name, len, output);
+			if (output->randr_output == NULL)
+				goto cleanup;
+		}
+
+		RROutputChanged(output->randr_output, TRUE);
+		sna_output_create_resources(output);
+		RRPostPendingProperties(output->randr_output);
+
+		sna_output->serial = serial;
+	} else {
+		/* stash the active CRTC id for our probe function */
+		if (compat_conn.conn.connection != DRM_MODE_DISCONNECTED)
+			output->crtc = (void *)(uintptr_t)enc.crtc_id;
+	}
+
+	DBG(("%s: created output '%s' %d, encoder=%d (possible crtc:%x, attached encoders:%x, possible clones:%x), serial=%d, edid=%d, dpms=%d, crtc=%lu\n",
+	     __FUNCTION__, name, id, enc.encoder_id,
+	     (uint32_t)output->possible_crtcs,
+	     sna_output->attached_encoders,
+	     sna_output->possible_encoders,
+	     serial, sna_output->edid_idx, sna_output->dpms_id,
+	     (unsigned long)(uintptr_t)output->crtc));
+	assert(sna_output->id == id);
+
+	xf86DrvMsg(scrn->scrnIndex, X_INFO,
+		   "Enabled output %s\n",
+		   output->name);
+	return 1;
+
+cleanup:
+	len = -1;
+skip:
+	free(sna_output->prop_ids);
+	free(sna_output->prop_values);
+	free(sna_output);
+	return len;
+}
+
+static int output_rank(const void *A, const void *B)
+{
+	const xf86OutputPtr *a = A;
+	const xf86OutputPtr *b = B;
+	struct sna_output *sa = to_sna_output(*a);
+	struct sna_output *sb = to_sna_output(*b);
+
+	if (sa->is_panel != sb->is_panel)
+		return sb->is_panel - sa->is_panel;
+
+	return strcmp((*a)->name, (*b)->name);
+}
+
+static void sort_config_outputs(struct sna *sna)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	qsort(config->output, sna->mode.num_real_output, sizeof(*config->output), output_rank);
+	config->compat_output = 0; /* make sure it is a sane value */
+	sna_mode_compute_possible_outputs(sna);
+}
+
+static void sort_randr_outputs(struct sna *sna, ScreenPtr screen)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	rrScrPriv(screen);
+	int i;
+
+	assert(pScrPriv->numOutputs == config->num_output);
+	for (i = 0; i < config->num_output; i++) {
+		assert(config->output[i]->randr_output);
+		pScrPriv->outputs[i] = config->output[i]->randr_output;
+	}
+}
+
+static bool disable_unused_crtc(struct sna *sna)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	bool update = false;
+	int o, c;
+
+	DBG(("%s\n", __FUNCTION__));
+
+	for (c = 0; c < sna->mode.num_real_crtc; c++) {
+		xf86CrtcPtr crtc = config->crtc[c];
+
+		if (!crtc->enabled) {
+			sna_crtc_disable(crtc, false);
+			continue;
+		}
+
+		for (o = 0; o < sna->mode.num_real_output; o++) {
+			xf86OutputPtr output = config->output[o];
+			if (output->crtc == crtc)
+				break;
+		}
+
+		if (o == sna->mode.num_real_output) {
+			DBG(("%s: CRTC:%d was enabled with no outputs\n",
+			     __FUNCTION__, sna_crtc_id(crtc)));
+			crtc->enabled = false;
+			update = true;
+		}
+	}
+
+	if (update) {
+		DBG(("%s: disabling unused functions\n", __FUNCTION__));
+		xf86DisableUnusedFunctions(sna->scrn);
+	}
+
+	return update;
+}
+
+bool sna_mode_find_hotplug_connector(struct sna *sna, unsigned id)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	int i;
+
+	for (i = 0; i < sna->mode.num_real_output; i++) {
+		struct sna_output *output = to_sna_output(config->output[i]);
+		if (output->id == id) {
+			output->reprobe = true;
+			return true;
+		}
+	}
+
+	return false;
+}
+
+static bool
+output_retrain_link(struct sna *sna, struct sna_output *output)
+{
+	struct sna_crtc *crtc = to_sna_crtc(output->base->crtc);
+	int crtc_x = crtc->offset & 0xffff;
+	int crtc_y = crtc->offset >> 16;
+
+	if (!crtc->bo)
+		return false;
+
+	return sna_crtc_flip(sna, crtc, crtc->bo, crtc_x, crtc_y);
+}
+
+static bool
+output_check_link(struct sna *sna, struct sna_output *output)
+{
+	uint64_t link_status;
+
+	if (!output->base->crtc)
+		return true;
+
+	if (output->link_status_idx == -1)
+		return true;
+
+#define LINK_STATUS_GOOD 0
+	link_status = output->prop_values[output->link_status_idx];
+	DBG(("%s: link_status=%d\n", __FUNCTION__, link_status));
+	if (link_status == LINK_STATUS_GOOD)
+		return true;
+
+	/* Perform a modeset as required for "link-status" = BAD */
+	if (!output_retrain_link(sna, output))
+		return false;
+
+	/* Query the "link-status" again to confirm the modeset */
+	update_properties(sna, output);
+
+	link_status = output->prop_values[output->link_status_idx];
+	DBG(("%s: link_status=%d after modeset\n", __FUNCTION__, link_status));
+	return link_status == LINK_STATUS_GOOD;
+}
+
+static bool
+output_check_status(struct sna *sna, struct sna_output *output)
+{
+	union compat_mode_get_connector compat_conn;
+	struct drm_mode_modeinfo dummy;
+	struct drm_mode_get_blob blob;
+	xf86OutputStatus status;
+	char *edid;
+
+	VG_CLEAR(compat_conn);
+
+	compat_conn.conn.connection = -1;
+	compat_conn.conn.connector_id = output->id;
+	compat_conn.conn.count_modes = 1; /* skip detect */
+	compat_conn.conn.modes_ptr = (uintptr_t)&dummy;
+	compat_conn.conn.count_encoders = 0;
+	compat_conn.conn.props_ptr = (uintptr_t)output->prop_ids;
+	compat_conn.conn.prop_values_ptr = (uintptr_t)output->prop_values;
+	compat_conn.conn.count_props = output->num_props;
+
+	if (drmIoctl(sna->kgem.fd,
+		     DRM_IOCTL_MODE_GETCONNECTOR,
+		     &compat_conn.conn) == 0)
+		output->update_properties = false;
+
+	if (!output_check_link(sna, output))
+		return false;
+
+	if (output->reprobe)
+		return false;
+
+	switch (compat_conn.conn.connection) {
+	case DRM_MODE_CONNECTED:
+		status = XF86OutputStatusConnected;
+		break;
+	case DRM_MODE_DISCONNECTED:
+		status = XF86OutputStatusDisconnected;
+		break;
+	default:
+	case DRM_MODE_UNKNOWNCONNECTION:
+		status = XF86OutputStatusUnknown;
+		break;
+	}
+	if (output->status != status)
+		return false;
+
+	if (status != XF86OutputStatusConnected)
+		return true;
+
+	if (output->num_modes != compat_conn.conn.count_modes)
+		return false;
+
+	if (output->edid_len == 0)
+		return false;
+
+	edid = alloca(output->edid_len);
+
+	VG_CLEAR(blob);
+	blob.blob_id = output->prop_values[output->edid_idx];
+	blob.length = output->edid_len;
+	blob.data = (uintptr_t)edid;
+	if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPROPBLOB, &blob))
+		return false;
+
+	if (blob.length != output->edid_len)
+		return false;
+
+	return memcmp(edid, output->edid_raw, output->edid_len) == 0;
+}
+
+void sna_mode_discover(struct sna *sna, bool tell)
+{
+	ScreenPtr screen = xf86ScrnToScreen(sna->scrn);
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	bool force = sna->flags & SNA_REPROBE;
+	struct drm_mode_card_res res;
+	uint32_t connectors[32], now;
+	unsigned changed = 0;
+	unsigned serial;
+	int i, j;
+
+	DBG(("%s()\n", __FUNCTION__));
+	sna->flags &= ~SNA_REPROBE;
+
+	VG_CLEAR(connectors);
+
+	memset(&res, 0, sizeof(res));
+	res.count_connectors = 32;
+	res.connector_id_ptr = (uintptr_t)connectors;
+
+	if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETRESOURCES, &res))
+		return;
+
+	DBG(("%s: now %d (was %d) connectors, %d encoders, %d crtc\n", __FUNCTION__,
+	     res.count_connectors, sna->mode.num_real_output,
+	     res.count_encoders, res.count_crtcs));
+	if (res.count_connectors > 32)
+		res.count_connectors = 32;
+
+	assert(sna->mode.num_real_crtc == res.count_crtcs || is_zaphod(sna->scrn));
+	assert(sna->mode.max_crtc_width  == res.max_width);
+	assert(sna->mode.max_crtc_height == res.max_height);
+	assert(sna->mode.num_real_encoder == res.count_encoders);
+
+	serial = ++sna->mode.serial;
+	if (serial == 0)
+		serial = ++sna->mode.serial;
+
+	if (force) {
+		changed = 4;
+		now = 0;
+	} else
+		now = GetTimeInMillis();
+	for (i = 0; i < res.count_connectors; i++) {
+		DBG(("%s: connector[%d] = %d\n", __FUNCTION__, i, connectors[i]));
+		for (j = 0; j < sna->mode.num_real_output; j++) {
+			xf86OutputPtr output = config->output[j];
+			if (to_sna_output(output)->id == connectors[i]) {
+				DBG(("%s: found %s (id=%d)\n", __FUNCTION__, output->name, connectors[i]));
+				assert(to_sna_output(output)->id);
+				to_sna_output(output)->serial = serial;
+				break;
+			}
+		}
+		if (j == sna->mode.num_real_output) {
+			DBG(("%s: adding id=%d\n", __FUNCTION__, connectors[i]));
+			changed |= sna_output_add(sna, connectors[i], serial) > 0;
+		}
+	}
+
+	for (i = 0; i < sna->mode.num_real_output; i++) {
+		xf86OutputPtr output = config->output[i];
+		struct sna_output *sna_output = to_sna_output(output);
+
+		if (sna_output->id == 0)
+			continue;
+
+		if (sna_output->serial == serial) {
+			if (output_check_status(sna, sna_output)) {
+				DBG(("%s: output %s (id=%d), retained state\n",
+				     __FUNCTION__, output->name, sna_output->id));
+				sna_output->last_detect = now;
+			} else {
+				DBG(("%s: output %s (id=%d), changed state, reprobing\n",
+				     __FUNCTION__, output->name, sna_output->id));
+				sna_output->hotplug_count++;
+				sna_output->last_detect = 0;
+				changed |= 4;
+			}
+			continue;
+		}
+
+		DBG(("%s: removing output %s (id=%d), serial=%u [now %u]\n",
+		     __FUNCTION__, output->name, sna_output->id,
+		    sna_output->serial, serial));
+
+		xf86DrvMsg(sna->scrn->scrnIndex, X_INFO,
+			   "Disabled output %s\n",
+			   output->name);
+		sna_output->id = 0;
+		sna_output->last_detect = 0;
+		output->crtc = NULL;
+		RROutputChanged(output->randr_output, TRUE);
+		changed |= 2;
+	}
+
+	/* Have the list of available outputs been updated? */
+	if (changed & 3) {
+		DBG(("%s: outputs changed, broadcasting\n", __FUNCTION__));
+
+		sna_mode_set_primary(sna);
+
+		/* Reorder user visible listing */
+		sort_config_outputs(sna);
+		sort_randr_outputs(sna, screen);
+
+		if (changed & 2)
+			disable_unused_crtc(sna);
+
+		xf86RandR12TellChanged(screen);
+	}
+
+	/* If anything has changed, refresh the RandR information.
+	 * Note this could recurse once from udevless RRGetInfo() probes,
+	 * but only once.
+	 */
+	if (changed && tell)
+		RRGetInfo(screen, TRUE);
+}
+
+/* Since we only probe the current mode on startup, we may not have the full
+ * list of modes available until the user explicitly requests them. Fake a
+ * hotplug event after a second after starting to fill in any missing modes.
+ */
+CARD32 sna_mode_coldplug(OsTimerPtr timer, CARD32 now, void *data)
+{
+	struct sna *sna = data;
+	ScreenPtr screen = xf86ScrnToScreen(sna->scrn);
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	bool reprobe = false;
+	int i;
+
+	DBG(("%s()\n", __FUNCTION__));
+
+	for (i = 0; i < sna->mode.num_real_output; i++) {
+		xf86OutputPtr output = config->output[i];
+		struct sna_output *sna_output = to_sna_output(output);
+
+		if (sna_output->id == 0)
+			continue;
+		if (sna_output->last_detect)
+			continue;
+		if (output->status == XF86OutputStatusDisconnected)
+			continue;
+
+		DBG(("%s: output %s connected, needs reprobe\n",
+		     __FUNCTION__, output->name));
+		reprobe = true;
+	}
+
+	if (reprobe) {
+		RRGetInfo(screen, TRUE);
+		RRTellChanged(screen);
+	}
+	free(timer);
+	return 0;
+}
+
+static void copy_front(struct sna *sna, PixmapPtr old, PixmapPtr new)
+{
+	struct sna_pixmap *old_priv, *new_priv;
+
+	DBG(("%s\n", __FUNCTION__));
+
+	if (wedged(sna) || isGPU(sna->scrn))
+		return;
+
+	old_priv = sna_pixmap_force_to_gpu(old, MOVE_READ);
+	if (!old_priv)
+		return;
+
+	new_priv = sna_pixmap_force_to_gpu(new, MOVE_WRITE | __MOVE_SCANOUT);
+	if (!new_priv)
+		return;
+
+	if (old_priv->clear) {
+		bool ok = false;
+		if (!wedged(sna))
+			ok = sna->render.fill_one(sna, new, new_priv->gpu_bo,
+						  old_priv->clear_color,
+						  0, 0,
+						  new->drawable.width,
+						  new->drawable.height,
+						  GXcopy);
+		if (!ok) {
+			void *ptr = kgem_bo_map__gtt(&sna->kgem, new_priv->gpu_bo);
+			if (ptr)
+				memset(ptr, 0, new_priv->gpu_bo->pitch*new->drawable.height);
+		}
+		new_priv->clear = true;
+		new_priv->clear_color = old_priv->clear_color;
+	} else {
+		BoxRec box;
+		int16_t sx, sy, dx, dy;
+
+		if (new->drawable.width >= old->drawable.width &&
+		    new->drawable.height >= old->drawable.height)
+		{
+			int nx = (new->drawable.width + old->drawable.width - 1) / old->drawable.width;
+			int ny = (new->drawable.height + old->drawable.height - 1) / old->drawable.height;
+
+			box.x1 = box.y1 = 0;
+
+			dy = 0;
+			for (sy = 0; sy < ny; sy++) {
+				box.y2 = old->drawable.height;
+				if (box.y2 + dy > new->drawable.height)
+					box.y2 = new->drawable.height - dy;
+
+				dx = 0;
+				for (sx = 0; sx < nx; sx++) {
+					box.x2 = old->drawable.width;
+					if (box.x2 + dx > new->drawable.width)
+						box.x2 = new->drawable.width - dx;
+
+					(void)sna->render.copy_boxes(sna, GXcopy,
+								     &old->drawable, old_priv->gpu_bo, 0, 0,
+								     &new->drawable, new_priv->gpu_bo, dx, dy,
+								     &box, 1, 0);
+					dx += old->drawable.width;
+				}
+				dy += old->drawable.height;
+			}
+		} else {
+			box.x1 = box.y1 = 0;
+			box.x2 = min(old->drawable.width, new->drawable.width);
+			box.y2 = min(old->drawable.height, new->drawable.height);
+
+			sx = dx = 0;
+			if (box.x2 < old->drawable.width)
+				sx = (old->drawable.width - box.x2) / 2;
+			if (box.x2 < new->drawable.width)
+				dx = (new->drawable.width - box.x2) / 2;
+
+			sy = dy = 0;
+			if (box.y2 < old->drawable.height)
+				sy = (old->drawable.height - box.y2) / 2;
+			if (box.y2 < new->drawable.height)
+				dy = (new->drawable.height - box.y2) / 2;
+
+			DBG(("%s: copying box (%dx%d) from (%d, %d) to (%d, %d)\n",
+			     __FUNCTION__, box.x2, box.y2, sx, sy, dx, dy));
+
+			if (box.x2 != new->drawable.width || box.y2 != new->drawable.height) {
+				bool ok = false;
+				if (!wedged(sna))
+					ok = sna->render.fill_one(sna, new, new_priv->gpu_bo, 0,
+								  0, 0,
+								  new->drawable.width,
+								  new->drawable.height,
+								  GXclear);
+				if (!ok) {
+					void *ptr = kgem_bo_map__gtt(&sna->kgem, new_priv->gpu_bo);
+					if (ptr)
+						memset(ptr, 0, new_priv->gpu_bo->pitch*new->drawable.height);
+				}
+			}
+			(void)sna->render.copy_boxes(sna, GXcopy,
+						     &old->drawable, old_priv->gpu_bo, sx, sy,
+						     &new->drawable, new_priv->gpu_bo, dx, dy,
+						     &box, 1, 0);
+		}
+	}
+
+	sna_damage_all(&new_priv->gpu_damage, new);
+}
+
+static Bool
+sna_mode_resize(ScrnInfoPtr scrn, int width, int height)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+	struct sna *sna = to_sna(scrn);
+	ScreenPtr screen = xf86ScrnToScreen(scrn);
+	PixmapPtr new_front;
+	int i;
+
+	DBG(("%s (%d, %d) -> (%d, %d)\n", __FUNCTION__,
+	     scrn->virtualX, scrn->virtualY,
+	     width, height));
+	assert((sna->flags & SNA_IS_HOSTED) == 0);
+
+	if (scrn->virtualX == width && scrn->virtualY == height)
+		return TRUE;
+
+	/* Paranoid defense against rogue internal calls by Xorg */
+	if (width == 0 || height == 0)
+		return FALSE;
+
+	assert(sna->front);
+	assert(screen->GetScreenPixmap(screen) == sna->front);
+
+	DBG(("%s: creating new framebuffer %dx%d\n",
+	     __FUNCTION__, width, height));
+
+	new_front = screen->CreatePixmap(screen,
+					 width, height, scrn->depth,
+					 SNA_CREATE_FB);
+	if (!new_front)
+		return FALSE;
+
+	xf86DrvMsg(scrn->scrnIndex, X_INFO,
+		   "resizing framebuffer to %dx%d\n",
+		   width, height);
+
+	for (i = 0; i < sna->mode.num_real_crtc; i++)
+		sna_crtc_disable_shadow(sna, to_sna_crtc(config->crtc[i]));
+	assert(sna->mode.shadow_active == 0);
+	assert(!sna->mode.shadow_enabled);
+	assert(sna->mode.shadow_damage == NULL);
+	assert(sna->mode.shadow == NULL);
+
+	/* Flush pending shadow updates */
+	if (sna->mode.flip_active) {
+		DBG(("%s: waiting for %d outstanding TearFree flips\n",
+		     __FUNCTION__, sna->mode.flip_active));
+		while (sna->mode.flip_active && sna_mode_wait_for_event(sna))
+			sna_mode_wakeup(sna);
+	}
+
+	/* Cancel a pending [un]flip (as the pixmaps no longer match) */
+	sna_present_cancel_flip(sna);
+	copy_front(sna, sna->front, new_front);
+
+	screen->SetScreenPixmap(new_front);
+	assert(screen->GetScreenPixmap(screen) == new_front);
+	assert(sna->front == new_front);
+	screen->DestroyPixmap(new_front); /* owned by screen now */
+
+	scrn->virtualX = width;
+	scrn->virtualY = height;
+	scrn->displayWidth = width;
+
+	/* Only update the CRTCs if we are in control */
+	if (!scrn->vtSema)
+		return TRUE;
+
+	for (i = 0; i < sna->mode.num_real_crtc; i++) {
+		xf86CrtcPtr crtc = config->crtc[i];
+
+		assert(to_sna_crtc(crtc) != NULL);
+		if (to_sna_crtc(crtc)->bo == NULL)
+			continue;
+
+		if (!__sna_crtc_set_mode(crtc))
+			sna_crtc_disable(crtc, false);
+	}
+
+	sna_mode_wakeup(sna);
+	kgem_clean_scanout_cache(&sna->kgem);
+
+	return TRUE;
+}
+
+/* cursor handling */
+static void
+rotate_coord(Rotation rotation, int size,
+	     int x_dst, int y_dst,
+	     int *x_src, int *y_src)
+{
+	int t;
+
+	switch (rotation & 0xf) {
+	case RR_Rotate_0:
+		break;
+	case RR_Rotate_90:
+		t = x_dst;
+		x_dst = size - y_dst - 1;
+		y_dst = t;
+		break;
+	case RR_Rotate_180:
+		x_dst = size - x_dst - 1;
+		y_dst = size - y_dst - 1;
+		break;
+	case RR_Rotate_270:
+		t = x_dst;
+		x_dst = y_dst;
+		y_dst = size - t - 1;
+		break;
+	}
+
+	if (rotation & RR_Reflect_X)
+		x_dst = size - x_dst - 1;
+	if (rotation & RR_Reflect_Y)
+		y_dst = size - y_dst - 1;
+
+	*x_src = x_dst;
+	*y_src = y_dst;
+}
+
+static struct sna_cursor *__sna_create_cursor(struct sna *sna, int size)
+{
+	struct sna_cursor *c;
+
+	for (c = sna->cursor.cursors; c; c = c->next) {
+		if (c->ref == 0 && c->alloc >= size) {
+			__DBG(("%s: stealing handle=%d, serial=%d, rotation=%d, alloc=%d\n",
+			       __FUNCTION__, c->handle, c->serial, c->rotation, c->alloc));
+			return c;
+		}
+	}
+
+	__DBG(("%s(size=%d, num_stash=%d)\n", __FUNCTION__, size, sna->cursor.num_stash));
+
+	c = sna->cursor.stash;
+	assert(c);
+
+	c->alloc = ALIGN(size, 4096);
+	c->handle = gem_create(sna->kgem.fd, c->alloc);
+	if (c->handle == 0)
+		return NULL;
+
+	/* Old hardware uses physical addresses, which the kernel
+	 * implements in an incoherent fashion requiring a pwrite.
+	 */
+	if (sna->cursor.use_gtt) {
+		c->image = gem_mmap(sna->kgem.fd, c->handle, c->alloc);
+		if (c->image == NULL) {
+			gem_close(sna->kgem.fd, c->handle);
+			return NULL;
+		}
+	} else
+		c->image = NULL;
+
+	__DBG(("%s: handle=%d, allocated %d\n", __FUNCTION__, c->handle, size));
+
+	c->ref = 0;
+	c->serial = 0;
+	c->rotation = 0;
+	c->last_width = c->last_height = 0; /* all clear */
+	c->size = size;
+
+	sna->cursor.num_stash--;
+	sna->cursor.stash = c->next;
+
+	c->next = sna->cursor.cursors;
+	sna->cursor.cursors = c;
+
+	return c;
+}
+
+static uint32_t *get_cursor_argb(CursorPtr c)
+{
+#ifdef ARGB_CURSOR
+	return (uint32_t *)c->bits->argb;
+#else
+	return NULL;
+#endif
+}
+
+static int __cursor_size(int width, int height)
+{
+	int i, size;
+
+	i = MAX(width, height);
+	for (size = 64; size < i; size <<= 1)
+		;
+
+	return size;
+}
+
+static struct sna_cursor *__sna_get_cursor(struct sna *sna, xf86CrtcPtr crtc)
+{
+	struct sna_cursor *cursor;
+	const uint8_t *source, *mask;
+	const uint32_t *argb;
+	uint32_t *image;
+	int width, height, pitch, size, x, y;
+	bool transformed;
+	Rotation rotation;
+
+	assert(sna->cursor.ref);
+
+	cursor = to_sna_crtc(crtc)->cursor;
+	__DBG(("%s: current cursor handle=%d, serial=%d [expected %d]\n",
+	       __FUNCTION__,
+	       cursor ? cursor->handle : 0,
+	       cursor ? cursor->serial : 0,
+	       sna->cursor.serial));
+	if (cursor && cursor->serial == sna->cursor.serial) {
+		assert(cursor->size == sna->cursor.size || cursor->transformed);
+		assert(cursor->rotation == (!to_sna_crtc(crtc)->cursor_transform && crtc->transform_in_use) ? crtc->rotation : RR_Rotate_0);
+		assert(cursor->ref);
+		return cursor;
+	}
+
+	__DBG(("%s: cursor=%dx%d, pitch=%d, serial=%d, argb?=%d\n", __FUNCTION__,
+	       sna->cursor.ref->bits->width,
+	       sna->cursor.ref->bits->height,
+	       get_cursor_argb(sna->cursor.ref) ? 4*sna->cursor.ref->bits->width : BitmapBytePad(sna->cursor.ref->bits->width),
+	       sna->cursor.serial,
+	       get_cursor_argb(sna->cursor.ref) != NULL));
+
+	transformed = to_sna_crtc(crtc)->cursor_transform;
+	rotation = (!transformed && crtc->transform_in_use) ? crtc->rotation : RR_Rotate_0;
+
+	if (transformed) {
+		struct pixman_box16 box;
+
+		box.x1 = box.y1 = 0;
+		box.x2 = sna->cursor.ref->bits->width;
+		box.y2 = sna->cursor.ref->bits->height;
+
+		pixman_f_transform_bounds(&crtc->f_crtc_to_framebuffer, &box);
+		size = __cursor_size(box.x2 - box.x1, box.y2 - box.y1);
+		__DBG(("%s: transformed cursor %dx%d -> %dx%d\n",
+		       __FUNCTION__ ,
+		       sna->cursor.ref->bits->width,
+		       sna->cursor.ref->bits->height,
+		       box.x2 - box.x1, box.y2 - box.y1));
+	} else
+		size = sna->cursor.size;
+
+	if (crtc->transform_in_use) {
+		RRTransformPtr T = NULL;
+		struct pixman_vector v;
+
+		if (crtc->transformPresent) {
+			T = &crtc->transform;
+
+			/* Cancel any translation from this affine
+			 * transformation. We just want to rotate and scale
+			 * the cursor image.
+			 */
+			v.vector[0] = 0;
+			v.vector[1] = 0;
+			v.vector[2] = pixman_fixed_1;
+			pixman_transform_point(&crtc->transform.transform, &v);
+		}
+
+		RRTransformCompute(0, 0, size, size, crtc->rotation, T, NULL,
+				   &to_sna_crtc(crtc)->cursor_to_fb,
+				   &to_sna_crtc(crtc)->fb_to_cursor);
+		if (T)
+			pixman_f_transform_translate(
+					&to_sna_crtc(crtc)->cursor_to_fb,
+					&to_sna_crtc(crtc)->fb_to_cursor,
+					-pixman_fixed_to_double(v.vector[0]),
+					-pixman_fixed_to_double(v.vector[1]));
+
+		__DBG(("%s: cursor_to_fb [%f %f %f, %f %f %f, %f %f %f]\n",
+		       __FUNCTION__,
+		       to_sna_crtc(crtc)->cursor_to_fb.m[0][0],
+		       to_sna_crtc(crtc)->cursor_to_fb.m[0][1],
+		       to_sna_crtc(crtc)->cursor_to_fb.m[0][2],
+		       to_sna_crtc(crtc)->cursor_to_fb.m[1][0],
+		       to_sna_crtc(crtc)->cursor_to_fb.m[1][1],
+		       to_sna_crtc(crtc)->cursor_to_fb.m[1][2],
+		       to_sna_crtc(crtc)->cursor_to_fb.m[2][0],
+		       to_sna_crtc(crtc)->cursor_to_fb.m[2][1],
+		       to_sna_crtc(crtc)->cursor_to_fb.m[2][2]));
+	}
+
+	/* Don't allow phys cursor sharing */
+	if (sna->cursor.use_gtt && !transformed) {
+		for (cursor = sna->cursor.cursors; cursor; cursor = cursor->next) {
+			if (cursor->serial == sna->cursor.serial &&
+			    cursor->rotation == rotation &&
+			    !cursor->transformed) {
+				__DBG(("%s: reusing handle=%d, serial=%d, rotation=%d, size=%d\n",
+				       __FUNCTION__, cursor->handle, cursor->serial, cursor->rotation, cursor->size));
+				assert(cursor->size == sna->cursor.size);
+				return cursor;
+			}
+		}
+	}
+
+	cursor = to_sna_crtc(crtc)->cursor;
+	if (cursor && cursor->alloc < 4*size*size)
+		cursor = NULL;
+
+	if (cursor == NULL) {
+		cursor = __sna_create_cursor(sna, 4*size*size);
+		if (cursor == NULL) {
+			DBG(("%s: failed to allocate cursor\n", __FUNCTION__));
+			return NULL;
+		}
+	}
+
+	width  = sna->cursor.ref->bits->width;
+	height = sna->cursor.ref->bits->height;
+	source = sna->cursor.ref->bits->source;
+	mask = sna->cursor.ref->bits->mask;
+	argb = get_cursor_argb(sna->cursor.ref);
+	pitch = BitmapBytePad(width);
+
+	image = cursor->image;
+	if (image == NULL || transformed) {
+		image = sna->cursor.scratch;
+		cursor->last_width = cursor->last_height = size;
+	}
+	if (size > cursor->size ||
+	    width < cursor->last_width ||
+	    height < cursor->last_height ||
+	    rotation != cursor->rotation)
+		memset(image, 0, 4*size*size);
+	if (rotation == RR_Rotate_0) {
+		if (argb == NULL) {
+			for (y = 0; y < height; y++) {
+				uint32_t *p = image + y*size;
+				for (x = 0; x < width; x++) {
+					int byte = x / 8;
+					uint8_t bit = 1 << (x & 7);
+					uint32_t pixel;
+
+					if (mask[byte] & bit) {
+						if (source[byte] & bit)
+							pixel = sna->cursor.fg;
+						else
+							pixel = sna->cursor.bg;
+					} else
+						pixel = 0;
+
+					*p++ = pixel;
+				}
+				mask += pitch;
+				source += pitch;
+			}
+			if (transformed) {
+				__DBG(("%s: Applying affine BLT to bitmap\n", __FUNCTION__));
+				affine_blt(image, cursor->image, 32,
+					   0, 0, width, height, size * 4,
+					   0, 0, size, size, size * 4,
+					   &to_sna_crtc(crtc)->cursor_to_fb);
+				image = cursor->image;
+			}
+		} else if (transformed) {
+			__DBG(("%s: Applying affine BLT to ARGB\n", __FUNCTION__));
+			affine_blt(argb, cursor->image, 32,
+				   0, 0, width, height, width * 4,
+				   0, 0, size, size, size * 4,
+				   &to_sna_crtc(crtc)->cursor_to_fb);
+			image = cursor->image;
+		} else
+			memcpy_blt(argb, image, 32,
+				   width * 4, size * 4,
+				   0, 0,
+				   0, 0,
+				   width, height);
+	} else {
+		for (y = 0; y < size; y++)
+			for (x = 0; x < size; x++) {
+				uint32_t pixel;
+				int xin, yin;
+
+				rotate_coord(rotation, size, x, y, &xin, &yin);
+				if (xin < width && yin < height)
+					if (argb == NULL) {
+						int byte = xin / 8;
+						int bit = xin & 7;
+						if (mask[yin*pitch + byte] & (1 << bit)) {
+							if (source[yin*pitch + byte] & (1 << bit))
+								pixel = sna->cursor.fg;
+							else
+								pixel = sna->cursor.bg;
+						} else
+							pixel = 0;
+					} else
+						pixel = argb[yin * width + xin];
+				else
+					pixel = 0;
+				image[y * size + x] = pixel;
+			}
+	}
+
+	if (image != cursor->image) {
+		struct drm_i915_gem_pwrite pwrite;
+
+		VG_CLEAR(pwrite);
+		pwrite.handle = cursor->handle;
+		pwrite.offset = 0;
+		pwrite.size = 4*size*size;
+		pwrite.data_ptr = (uintptr_t)image;
+		if (drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GEM_PWRITE, &pwrite))
+			__DBG(("%s: cursor update (pwrite) failed: %d\n", __FUNCTION__, errno));
+	}
+
+	cursor->size = size;
+	cursor->rotation = rotation;
+	cursor->transformed = transformed;
+	cursor->serial = sna->cursor.serial;
+	if (transformed) {
+		/* mark the transformed rectangle as dirty, not input */
+		cursor->last_width = size;
+		cursor->last_height = size;
+	} else {
+		cursor->last_width = width;
+		cursor->last_height = height;
+	}
+	return cursor;
+}
+
+static unsigned char *
+sna_realize_cursor(xf86CursorInfoPtr info, CursorPtr cursor)
+{
+	return NULL;
+}
+
+static void __restore_swcursor(ScrnInfoPtr scrn)
+{
+	struct sna *sna = to_sna(scrn);
+
+	DBG(("%s: attempting to restore SW cursor\n", __FUNCTION__));
+	xf86CursorResetCursor(scrn->pScreen);
+
+	/* Try to switch back to the HW cursor on the next cursor update */
+	sna->cursor.disable = false;
+
+	RemoveBlockAndWakeupHandlers((void *)__restore_swcursor,
+				     (void *)NoopDDA,
+				     scrn);
+}
+
+static void restore_swcursor(struct sna *sna)
+{
+	sna->cursor.info->HideCursor(sna->scrn);
+
+	/* XXX Force the cursor to be restored (avoiding recursion) */
+	FreeCursor(sna->cursor.ref, None);
+	sna->cursor.ref = NULL;
+
+	RegisterBlockAndWakeupHandlers((void *)__restore_swcursor,
+				       (void *)NoopDDA,
+				       sna->scrn);
+}
+
+static void
+sna_show_cursors(ScrnInfoPtr scrn)
+{
+	xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+	struct sna *sna = to_sna(scrn);
+	struct kmsg kmsg;
+	int sigio, c;
+
+	DBG(("%s: cursor?=%d\n", __FUNCTION__, sna->cursor.ref != NULL));
+	if (sna->cursor.ref == NULL)
+		return;
+
+	kmsg_open(&kmsg);
+	sigio = sigio_block();
+	for (c = 0; c < sna->mode.num_real_crtc; c++) {
+		xf86CrtcPtr crtc = xf86_config->crtc[c];
+		struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+		struct drm_mode_cursor arg;
+		struct sna_cursor *cursor;
+
+		assert(sna_crtc != NULL);
+		if (sna_crtc->bo == NULL)
+			continue;
+
+		if (!crtc->cursor_in_range) {
+			DBG(("%s: skipping cursor outside CRTC (pipe=%d)\n",
+			     __FUNCTION__, sna_crtc_pipe(crtc)));
+			continue;
+		}
+
+		cursor = __sna_get_cursor(sna, crtc);
+		if (cursor == NULL ||
+		    (sna_crtc->cursor == cursor && sna_crtc->last_cursor_size == cursor->size)) {
+			DBG(("%s: skipping cursor already show on CRTC (pipe=%d)\n",
+			     __FUNCTION__, sna_crtc_pipe(crtc)));
+			continue;
+		}
+
+		DBG(("%s: CRTC pipe=%d, handle->%d\n", __FUNCTION__,
+		     sna_crtc_pipe(crtc), cursor->handle));
+
+		VG_CLEAR(arg);
+		arg.flags = DRM_MODE_CURSOR_BO;
+		arg.crtc_id = __sna_crtc_id(sna_crtc);
+		arg.width = arg.height = cursor->size;
+		arg.handle = cursor->handle;
+
+		if (!FAIL_CURSOR_IOCTL &&
+		    drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_CURSOR, &arg) == 0) {
+			if (sna_crtc->cursor) {
+				assert(sna_crtc->cursor->ref > 0);
+				sna_crtc->cursor->ref--;
+			}
+			cursor->ref++;
+			sna_crtc->cursor = cursor;
+			sna_crtc->last_cursor_size = cursor->size;
+		} else {
+			ERR(("%s: failed to show cursor on CRTC:%d [pipe=%d], disabling hwcursor: errno=%d\n",
+			     __FUNCTION__, sna_crtc_id(crtc), sna_crtc_pipe(crtc), errno));
+			sna->cursor.disable = true;
+		}
+	}
+	sigio_unblock(sigio);
+	sna->cursor.active = true;
+	kmsg_close(&kmsg, sna->cursor.disable);
+
+	if (unlikely(sna->cursor.disable))
+		restore_swcursor(sna);
+}
+
+static void
+sna_set_cursor_colors(ScrnInfoPtr scrn, int _bg, int _fg)
+{
+	struct sna *sna = to_sna(scrn);
+	uint32_t fg = _fg, bg = _bg;
+
+	__DBG(("%s(bg=%08x, fg=%08x)\n", __FUNCTION__, bg, fg));
+
+	/* Save ARGB versions of these colors */
+	fg |= 0xff000000;
+	bg |= 0xff000000;
+	if (fg == sna->cursor.fg && bg == sna->cursor.bg)
+		return;
+
+	sna->cursor.fg = fg;
+	sna->cursor.bg = bg;
+
+	if (sna->cursor.ref == NULL)
+		return;
+
+	if (get_cursor_argb(sna->cursor.ref))
+		return;
+
+	sna->cursor.serial++;
+	__DBG(("%s: serial->%d\n", __FUNCTION__, sna->cursor.serial));
+
+	sna_show_cursors(scrn);
+}
+
+static void
+sna_crtc_disable_cursor(struct sna *sna, struct sna_crtc *crtc)
+{
+	struct drm_mode_cursor arg;
+	int sigio;
+
+	if (!crtc->cursor)
+		return;
+
+	sigio = sigio_block();
+	if (crtc->cursor) {
+		DBG(("%s: CRTC:%d, handle=%d\n", __FUNCTION__, __sna_crtc_id(crtc), crtc->cursor->handle));
+		assert(crtc->cursor->ref > 0);
+		crtc->cursor->ref--;
+		crtc->cursor = NULL;
+		crtc->last_cursor_size = 0;
+
+		VG_CLEAR(arg);
+		arg.flags = DRM_MODE_CURSOR_BO;
+		arg.crtc_id = __sna_crtc_id(crtc);
+		arg.width = arg.height = 0;
+		arg.handle = 0;
+
+		(void)drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_CURSOR, &arg);
+	}
+	sigio_unblock(sigio);
+}
+
+static void
+sna_disable_cursors(ScrnInfoPtr scrn)
+{
+	xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+	struct sna *sna = to_sna(scrn);
+	int sigio, c;
+
+	DBG(("%s\n", __FUNCTION__));
+
+	sigio = sigio_block();
+	for (c = 0; c < sna->mode.num_real_crtc; c++) {
+		assert(to_sna_crtc(xf86_config->crtc[c]));
+		sna_crtc_disable_cursor(sna, to_sna_crtc(xf86_config->crtc[c]));
+	}
+	sigio_unblock(sigio);
+}
+
+static void
+sna_hide_cursors(ScrnInfoPtr scrn)
+{
+	xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+	struct sna *sna = to_sna(scrn);
+	struct sna_cursor *cursor, **prev;
+	int sigio, c;
+
+	DBG(("%s\n", __FUNCTION__));
+	sna->cursor.active = false;
+
+	sigio = sigio_block();
+	for (c = 0; c < sna->mode.num_real_crtc; c++) {
+		assert(to_sna_crtc(xf86_config->crtc[c]));
+		sna_crtc_disable_cursor(sna, to_sna_crtc(xf86_config->crtc[c]));
+	}
+
+	for (prev = &sna->cursor.cursors; (cursor = *prev) != NULL; ) {
+		assert(cursor->ref == 0);
+
+		if (cursor->serial == sna->cursor.serial) {
+			prev = &cursor->next;
+			continue;
+		}
+
+		*prev = cursor->next;
+		if (cursor->image)
+			munmap(cursor->image, cursor->alloc);
+		gem_close(sna->kgem.fd, cursor->handle);
+
+		cursor->next = sna->cursor.stash;
+		sna->cursor.stash = cursor;
+		sna->cursor.num_stash++;
+	}
+
+	sigio_unblock(sigio);
+}
+
+static void
+sna_set_cursor_position(ScrnInfoPtr scrn, int x, int y)
+{
+	xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+	struct sna *sna = to_sna(scrn);
+	struct kmsg kmsg;
+	int sigio, c;
+
+	__DBG(("%s(%d, %d), cursor? %d\n", __FUNCTION__,
+	       x, y, sna->cursor.ref!=NULL));
+	if (sna->cursor.ref == NULL)
+		return;
+
+	kmsg_open(&kmsg);
+	sigio = sigio_block();
+	sna->cursor.last_x = x;
+	sna->cursor.last_y = y;
+
+	/* undo what xf86HWCurs did to the coordinates */
+	x += scrn->frameX0;
+	y += scrn->frameY0;
+	for (c = 0; c < sna->mode.num_real_crtc; c++) {
+		xf86CrtcPtr crtc = xf86_config->crtc[c];
+		struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+		struct sna_cursor *cursor = NULL;
+		struct drm_mode_cursor arg;
+
+		assert(sna_crtc != NULL);
+
+		VG_CLEAR(arg);
+		arg.flags = 0;
+		arg.crtc_id = __sna_crtc_id(sna_crtc);
+		arg.handle = 0;
+
+		if (sna_crtc->bo == NULL)
+			goto disable;
+
+		cursor = __sna_get_cursor(sna, crtc);
+		if (cursor == NULL)
+			cursor = sna_crtc->cursor;
+		if (cursor == NULL) {
+			__DBG(("%s: failed to grab cursor, disabling\n", __FUNCTION__));
+			goto disable;
+		}
+
+		if (crtc->transform_in_use) {
+			int xhot = sna->cursor.ref->bits->xhot;
+			int yhot = sna->cursor.ref->bits->yhot;
+			struct pict_f_vector v, hot;
+
+			v.v[0] = x + xhot + .5;
+			v.v[1] = y + yhot + .5;
+			v.v[2] = 1.;
+			pixman_f_transform_point(&crtc->f_framebuffer_to_crtc, &v);
+
+			hot.v[0] = xhot;
+			hot.v[1] = yhot;
+			hot.v[2] = 1.;
+			pixman_f_transform_point(&sna_crtc->fb_to_cursor, &hot);
+
+			arg.x = floor(v.v[0] - hot.v[0]);
+			arg.y = floor(v.v[1] - hot.v[1]);
+		} else {
+			arg.x = x - crtc->x;
+			arg.y = y - crtc->y;
+		}
+
+		if (arg.x < crtc->mode.HDisplay && arg.x > -sna->cursor.size &&
+		    arg.y < crtc->mode.VDisplay && arg.y > -sna->cursor.size) {
+			if (sna_crtc->cursor != cursor || sna_crtc->last_cursor_size != cursor->size) {
+				arg.flags |= DRM_MODE_CURSOR_BO;
+				arg.handle = cursor->handle;
+			}
+
+			arg.width = arg.height = cursor->size;
+			arg.flags |= DRM_MODE_CURSOR_MOVE;
+			crtc->cursor_in_range = true;
+		} else {
+			crtc->cursor_in_range = false;
+disable:
+			if (sna_crtc->cursor) {
+				arg.flags = DRM_MODE_CURSOR_BO;
+				arg.width = arg.height = 0;
+			}
+			cursor = NULL;
+		}
+
+		__DBG(("%s: CRTC:%d (%d, %d), handle=%d, flags=%x (old cursor handle=%d), move? %d, update handle? %d\n",
+		       __FUNCTION__, __sna_crtc_id(sna_crtc), arg.x, arg.y, arg.handle, arg.flags, sna_crtc->cursor ? sna_crtc->cursor->handle : 0,
+		       arg.flags & DRM_MODE_CURSOR_MOVE, arg.flags & DRM_MODE_CURSOR_BO));
+
+		if (arg.flags == 0)
+			continue;
+
+		if (!FAIL_CURSOR_IOCTL &&
+		    drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_CURSOR, &arg) == 0) {
+			if (arg.flags & DRM_MODE_CURSOR_BO) {
+				if (sna_crtc->cursor) {
+					assert(sna_crtc->cursor->ref > 0);
+					sna_crtc->cursor->ref--;
+				}
+				sna_crtc->cursor = cursor;
+				if (cursor) {
+					sna_crtc->last_cursor_size = cursor->size;
+					cursor->ref++;
+				} else
+					sna_crtc->last_cursor_size = 0;
+			}
+		} else {
+			ERR(("%s: failed to update cursor on CRTC:%d [pipe=%d], disabling hwcursor: errno=%d\n",
+			     __FUNCTION__, sna_crtc_id(crtc), sna_crtc_pipe(crtc), errno));
+			/* XXX How to force switch back to SW cursor?
+			 * Right now we just want until the next cursor image
+			 * change, which is fairly frequent.
+			 */
+			sna->cursor.disable = true;
+		}
+	}
+	sigio_unblock(sigio);
+	kmsg_close(&kmsg, sna->cursor.disable);
+
+	if (unlikely(sna->cursor.disable))
+		restore_swcursor(sna);
+}
+
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,99,902,2)
+static Bool
+sna_load_cursor_argb2(ScrnInfoPtr scrn, CursorPtr cursor)
+{
+	return TRUE;
+}
+
+static Bool
+sna_load_cursor_image2(ScrnInfoPtr scrn, unsigned char *src)
+{
+	return TRUE;
+}
+#endif
+
+static void
+sna_load_cursor_argb(ScrnInfoPtr scrn, CursorPtr cursor)
+{
+}
+
+static void
+sna_load_cursor_image(ScrnInfoPtr scrn, unsigned char *src)
+{
+}
+
+static bool
+sna_cursor_preallocate(struct sna *sna)
+{
+	while (sna->cursor.num_stash < 0) {
+		struct sna_cursor *cursor = malloc(sizeof(*cursor));
+		if (!cursor)
+			return false;
+
+		cursor->next = sna->cursor.stash;
+		sna->cursor.stash = cursor;
+
+		sna->cursor.num_stash++;
+	}
+
+	return true;
+}
+
+static bool
+transformable_cursor(struct sna *sna, CursorPtr cursor)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	int i;
+
+	for (i = 0; i < sna->mode.num_real_crtc; i++) {
+		xf86CrtcPtr crtc = config->crtc[i];
+		struct pixman_box16 box;
+		int size;
+
+		if (!to_sna_crtc(crtc)->hwcursor) {
+			DBG(("%s: hwcursor disabled on CRTC:%d [pipe=%d]\n",
+			     __FUNCTION__, sna_crtc_id(crtc), sna_crtc_pipe(crtc)));
+			return false;
+		}
+
+		if (!sna->cursor.use_gtt || !sna->cursor.scratch) {
+			DBG(("%s: unable to use GTT curosor access [%d] or no scratch [%d]\n",
+			     __FUNCTION__, sna->cursor.use_gtt, sna->cursor.scratch));
+			return false;
+		}
+
+		box.x1 = box.y1 = 0;
+		box.x2 = cursor->bits->width;
+		box.y2 = cursor->bits->height;
+
+		if (!pixman_f_transform_bounds(&crtc->f_crtc_to_framebuffer,
+					       &box)) {
+			DBG(("%s: unable to transform bounds\n", __FUNCTION__));
+			return false;
+		}
+
+		size = __cursor_size(box.x2 - box.x1, box.y2 - box.y1);
+		if (size > sna->cursor.max_size) {
+			DBG(("%s: transformed cursor size=%d too large, max=%d\n",
+			     __FUNCTION__, size, sna->cursor.max_size));
+			return false;
+		}
+	}
+
+	return true;
+}
+
+static Bool
+sna_use_hw_cursor(ScreenPtr screen, CursorPtr cursor)
+{
+	struct sna *sna = to_sna_from_screen(screen);
+
+	DBG(("%s (%dx%d)?\n", __FUNCTION__,
+	     cursor->bits->width, cursor->bits->height));
+
+	if (sna->cursor.disable)
+		return FALSE;
+
+	/* cursors are invariant */
+	if (cursor == sna->cursor.ref)
+		return TRUE;
+
+	if (sna->cursor.ref) {
+		FreeCursor(sna->cursor.ref, None);
+		sna->cursor.ref = NULL;
+	}
+
+	sna->cursor.size =
+		__cursor_size(cursor->bits->width, cursor->bits->height);
+	if (sna->cursor.size > sna->cursor.max_size) {
+		DBG(("%s: cursor size=%d too large, max %d: using sw cursor\n",
+		     __FUNCTION__, sna->cursor.size, sna->cursor.max_size));
+		return FALSE;
+	}
+
+	if (sna->mode.rr_active && !transformable_cursor(sna, cursor)) {
+		DBG(("%s: RandR active [%d] and non-transformable cursor: using sw cursor\n",
+		     __FUNCTION__, sna->mode.rr_active));
+		return FALSE;
+	}
+
+	if (!sna_cursor_preallocate(sna)) {
+		DBG(("%s: cursor preallocation failed: using sw cursor\n", __FUNCTION__));
+		return FALSE;
+	}
+
+	sna->cursor.ref = cursor;
+	cursor->refcnt++;
+	sna->cursor.serial++;
+
+	DBG(("%s(%dx%d): ARGB?=%d, serial->%d, size->%d\n", __FUNCTION__,
+	       cursor->bits->width,
+	       cursor->bits->height,
+	       get_cursor_argb(cursor) != NULL,
+	       sna->cursor.serial,
+	       sna->cursor.size));
+	return TRUE;
+}
+
+static void
+sna_cursor_pre_init(struct sna *sna)
+{
+	struct local_get_cap {
+		uint64_t name;
+		uint64_t value;
+	} cap;
+	int v;
+
+	if (sna->mode.num_real_crtc == 0)
+		return;
+
+#define LOCAL_IOCTL_GET_CAP	DRM_IOWR(0x0c, struct local_get_cap)
+#ifndef DRM_CAP_CURSOR_WIDTH
+#define DRM_CAP_CURSOR_WIDTH	0x8
+#endif
+#ifndef DRM_CAP_CURSOR_HEIGHT
+#define DRM_CAP_CURSOR_HEIGHT	0x9
+#endif
+
+#define I915_PARAM_HAS_COHERENT_PHYS_GTT 29
+
+	sna->cursor.max_size = 64;
+
+	cap.value = 0;
+	cap.name = DRM_CAP_CURSOR_WIDTH;
+	if (drmIoctl(sna->kgem.fd, LOCAL_IOCTL_GET_CAP, &cap) == 0)
+		sna->cursor.max_size = cap.value;
+
+	cap.name = DRM_CAP_CURSOR_HEIGHT;
+	if (drmIoctl(sna->kgem.fd, LOCAL_IOCTL_GET_CAP, &cap) == 0 &&
+	    cap.value < sna->cursor.max_size)
+		sna->cursor.max_size = cap.value;
+
+	v = -1; /* No param uses the sign bit, reserve it for errors */
+	if (sna->kgem.gen >= 033) {
+		v = 1;
+	} else {
+		drm_i915_getparam_t gp = {
+			I915_PARAM_HAS_COHERENT_PHYS_GTT,
+			&v,
+		};
+		(void)drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GETPARAM, &gp);
+	}
+	sna->cursor.use_gtt = v > 0;
+	DBG(("%s: cursor updates use_gtt?=%d\n",
+	     __FUNCTION__, sna->cursor.use_gtt));
+
+	sna->cursor.scratch = malloc(sna->cursor.max_size * sna->cursor.max_size * 4);
+	if (!sna->cursor.scratch && !sna->cursor.use_gtt)
+		sna->cursor.max_size = 0;
+
+	sna->cursor.num_stash = -sna->mode.num_real_crtc;
+
+	xf86DrvMsg(sna->scrn->scrnIndex, X_PROBED,
+		   "Using a maximum size of %dx%d for hardware cursors\n",
+		   sna->cursor.max_size, sna->cursor.max_size);
+}
+
+static void
+sna_cursor_close(struct sna *sna)
+{
+	sna->cursor.serial = 0;
+	sna_hide_cursors(sna->scrn);
+
+	while (sna->cursor.stash) {
+		struct sna_cursor *cursor = sna->cursor.stash;
+		sna->cursor.stash = cursor->next;
+		free(cursor);
+	}
+
+	sna->cursor.num_stash = -sna->mode.num_real_crtc;
+}
+
+bool
+sna_cursors_init(ScreenPtr screen, struct sna *sna)
+{
+	xf86CursorInfoPtr cursor_info;
+
+	if (sna->cursor.max_size == 0)
+		return false;
+
+	cursor_info = xf86CreateCursorInfoRec();
+	if (cursor_info == NULL)
+		return false;
+
+	cursor_info->MaxWidth = sna->cursor.max_size;
+	cursor_info->MaxHeight = sna->cursor.max_size;
+	cursor_info->Flags = (HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |
+			      HARDWARE_CURSOR_UPDATE_UNHIDDEN |
+			      HARDWARE_CURSOR_ARGB);
+
+	cursor_info->RealizeCursor = sna_realize_cursor;
+	cursor_info->SetCursorColors = sna_set_cursor_colors;
+	cursor_info->SetCursorPosition = sna_set_cursor_position;
+	cursor_info->LoadCursorImage = sna_load_cursor_image;
+	cursor_info->HideCursor = sna_hide_cursors;
+	cursor_info->ShowCursor = sna_show_cursors;
+	cursor_info->UseHWCursor = sna_use_hw_cursor;
+#ifdef ARGB_CURSOR
+	cursor_info->UseHWCursorARGB = sna_use_hw_cursor;
+	cursor_info->LoadCursorARGB = sna_load_cursor_argb;
+#endif
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,99,902,3)
+	cursor_info->LoadCursorImageCheck = sna_load_cursor_image2;
+#ifdef ARGB_CURSOR
+	cursor_info->LoadCursorARGBCheck = sna_load_cursor_argb2;
+#endif
+#endif
+
+	if (!xf86InitCursor(screen, cursor_info)) {
+		xf86DestroyCursorInfoRec(cursor_info);
+		return false;
+	}
+
+	sna->cursor.info = cursor_info;
+	return true;
+}
+
+static void
+sna_cursors_reload(struct sna *sna)
+{
+	DBG(("%s: active?=%d\n", __FUNCTION__, sna->cursor.active));
+	if (sna->cursor.active)
+		sna_set_cursor_position(sna->scrn,
+					sna->cursor.last_x,
+					sna->cursor.last_y);
+}
+
+static void
+sna_cursors_fini(struct sna *sna)
+{
+	if (sna->cursor.info) {
+		xf86DestroyCursorInfoRec(sna->cursor.info);
+		sna->cursor.info = NULL;
+	}
+
+	if (sna->cursor.ref) {
+		FreeCursor(sna->cursor.ref, None);
+		sna->cursor.ref = NULL;
+	}
+}
+
+static bool
+sna_crtc_flip(struct sna *sna, struct sna_crtc *crtc, struct kgem_bo *bo, int x, int y)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	struct drm_mode_crtc arg;
+	uint32_t output_ids[32];
+	int output_count = 0;
+	int i;
+
+	DBG(("%s CRTC:%d [pipe=%d], handle=%d\n", __FUNCTION__, __sna_crtc_id(crtc), __sna_crtc_pipe(crtc), bo->handle));
+
+	assert(sna->mode.num_real_output < ARRAY_SIZE(output_ids));
+	assert(crtc->bo);
+	assert(crtc->kmode.clock);
+
+	for (i = 0; i < sna->mode.num_real_output; i++) {
+		xf86OutputPtr output = config->output[i];
+
+		if (output->crtc != crtc->base)
+			continue;
+
+		DBG(("%s: attaching output '%s' %d [%d] to crtc:%d (pipe %d) (possible crtc:%x, possible clones:%x)\n",
+		     __FUNCTION__, output->name, i, to_connector_id(output),
+		     __sna_crtc_id(crtc), __sna_crtc_pipe(crtc),
+		     (uint32_t)output->possible_crtcs,
+		     (uint32_t)output->possible_clones));
+
+		assert(output->possible_crtcs & (1 << __sna_crtc_pipe(crtc)) ||
+		       is_zaphod(sna->scrn));
+
+		output_ids[output_count] = to_connector_id(output);
+		if (++output_count == ARRAY_SIZE(output_ids))
+			return false;
+	}
+	assert(output_count);
+
+	VG_CLEAR(arg);
+	arg.crtc_id = __sna_crtc_id(crtc);
+	arg.fb_id = fb_id(bo);
+	assert(arg.fb_id);
+	arg.x = x;
+	arg.y = y;
+	arg.set_connectors_ptr = (uintptr_t)output_ids;
+	arg.count_connectors = output_count;
+	arg.mode = crtc->kmode;
+	arg.mode_valid = 1;
+
+	DBG(("%s: applying crtc [%d, pipe=%d] mode=%dx%d+%d+%d@%d, fb=%d across %d outputs [%d...]\n",
+	     __FUNCTION__, __sna_crtc_id(crtc), __sna_crtc_pipe(crtc),
+	     arg.mode.hdisplay,
+	     arg.mode.vdisplay,
+	     arg.x, arg.y,
+	     arg.mode.clock,
+	     arg.fb_id,
+	     output_count, output_count ? output_ids[0] : 0));
+
+	if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_SETCRTC, &arg))
+		return false;
+
+	crtc->offset = y << 16 | x;
+	__kgem_bo_clear_dirty(bo);
+	return true;
+}
+
+static void sna_mode_restore(struct sna *sna)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	int error = 0;
+	int i;
+
+	assert(!sna->mode.hidden);
+
+	for (i = 0; i < sna->mode.num_real_crtc; i++) {
+		xf86CrtcPtr crtc = config->crtc[i];
+
+		assert(to_sna_crtc(crtc) != NULL);
+		if (to_sna_crtc(crtc)->bo == NULL)
+			continue;
+
+		assert(crtc->enabled);
+		if (!__sna_crtc_set_mode(crtc)) {
+			sna_crtc_disable(crtc, false);
+			error++;
+		}
+	}
+	sna_mode_wakeup(sna);
+	while (sna->mode.flip_active && sna_mode_wakeup(sna))
+		;
+	update_flush_interval(sna);
+	sna_cursors_reload(sna);
+	sna->mode.dirty = false;
+
+	if (error)
+		xf86DrvMsg(sna->scrn->scrnIndex, X_ERROR,
+			   "Failed to restore display configuration\n");
+}
+
+bool sna_needs_page_flip(struct sna *sna, struct kgem_bo *bo)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	int i;
+
+	for (i = 0; i < sna->mode.num_real_crtc; i++) {
+		struct sna_crtc *crtc = config->crtc[i]->driver_private;
+
+		if (crtc->bo == NULL)
+			continue;
+
+		if (crtc->bo == bo)
+			continue;
+
+		return true;
+	}
+
+	return false;
+}
+
+int
+sna_page_flip(struct sna *sna,
+	      struct kgem_bo *bo,
+	      sna_flip_handler_t handler,
+	      void *data)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	const int width = sna->scrn->virtualX;
+	const int height = sna->scrn->virtualY;
+	int sigio;
+	int count = 0;
+	int i;
+
+	DBG(("%s: handle %d attached\n", __FUNCTION__, bo->handle));
+	assert(bo->refcnt);
+
+	assert((sna->flags & SNA_IS_HOSTED) == 0);
+	assert(sna->mode.flip_active == 0);
+	assert(sna->mode.front_active);
+	assert(!sna->mode.hidden);
+	assert(sna->scrn->vtSema);
+
+	if ((sna->flags & (data ? SNA_HAS_FLIP : SNA_HAS_ASYNC_FLIP)) == 0)
+		return 0;
+
+	kgem_bo_submit(&sna->kgem, bo);
+	__kgem_bo_clear_dirty(bo);
+
+	sigio = sigio_block();
+	for (i = 0; i < sna->mode.num_real_crtc; i++) {
+		struct sna_crtc *crtc = config->crtc[i]->driver_private;
+		struct drm_mode_crtc_page_flip arg;
+		uint32_t crtc_offset;
+		int fixup;
+
+		DBG(("%s: crtc %d id=%d, pipe=%d active? %d\n",
+		     __FUNCTION__, i, __sna_crtc_id(crtc), __sna_crtc_pipe(crtc), crtc->bo != NULL));
+		if (crtc->bo == NULL)
+			continue;
+		assert(!crtc->transform);
+		assert(!crtc->slave_pixmap);
+		assert(crtc->bo->active_scanout);
+		assert(crtc->bo->refcnt >= crtc->bo->active_scanout);
+		assert(crtc->flip_bo == NULL);
+
+		assert_crtc_fb(sna, crtc);
+		if (data == NULL && crtc->bo == bo)
+			goto next_crtc;
+
+		arg.crtc_id = __sna_crtc_id(crtc);
+		arg.fb_id = get_fb(sna, bo, width, height);
+		if (arg.fb_id == 0) {
+			assert(count == 0);
+			break;
+		}
+
+		fixup = 0;
+		crtc_offset = crtc->base->y << 16 | crtc->base->x;
+
+		if (bo->pitch != crtc->bo->pitch || crtc_offset != crtc->offset) {
+			DBG(("%s: changing pitch (%d == %d) or offset (%x == %x)\n",
+			     __FUNCTION__,
+			     bo->pitch, crtc->bo->pitch,
+			     crtc_offset, crtc->offset));
+fixup_flip:
+			fixup = 1;
+			if (crtc->bo != bo && sna_crtc_flip(sna, crtc, bo, crtc->base->x, crtc->base->y)) {
+update_scanout:
+				DBG(("%s: removing handle=%d [active_scanout=%d] from scanout, installing handle=%d [active_scanout=%d]\n",
+				     __FUNCTION__, crtc->bo->handle, crtc->bo->active_scanout,
+				     bo->handle, bo->active_scanout));
+				assert(crtc->bo->active_scanout);
+				assert(crtc->bo->refcnt >= crtc->bo->active_scanout);
+				crtc->bo->active_scanout--;
+				kgem_bo_destroy(&sna->kgem, crtc->bo);
+
+				if (crtc->shadow_bo) {
+					kgem_bo_destroy(&sna->kgem, crtc->shadow_bo);
+					crtc->shadow_bo = NULL;
+				}
+
+				crtc->bo = kgem_bo_reference(bo);
+				crtc->bo->active_scanout++;
+
+				if (data == NULL)
+					goto next_crtc;
+
+				/* queue a flip in order to send the event */
+			} else
+				goto error;
+		}
+
+		/* Only the reference crtc will finally deliver its page flip
+		 * completion event. All other crtc's events will be discarded.
+		 */
+		if (data) {
+			arg.user_data = (uintptr_t)crtc;
+			arg.flags = DRM_MODE_PAGE_FLIP_EVENT;
+		} else {
+			arg.user_data = 0;
+			arg.flags = DRM_MODE_PAGE_FLIP_ASYNC;
+		}
+		arg.reserved = 0;
+
+retry_flip:
+		DBG(("%s: crtc %d id=%d, pipe=%d  --> fb %d\n",
+		     __FUNCTION__, i, __sna_crtc_id(crtc), __sna_crtc_pipe(crtc), arg.fb_id));
+		if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_PAGE_FLIP, &arg)) {
+			ERR(("%s: pageflip failed with err=%d\n", __FUNCTION__, errno));
+
+			if (errno == EBUSY) {
+				struct drm_mode_crtc mode;
+
+				memset(&mode, 0, sizeof(mode));
+				mode.crtc_id = __sna_crtc_id(crtc);
+				drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCRTC, &mode);
+
+				DBG(("%s: crtc=%d, valid?=%d, fb attached?=%d, expected=%d\n",
+				     __FUNCTION__,
+				     mode.crtc_id, mode.mode_valid,
+				     mode.fb_id, fb_id(crtc->bo)));
+
+				if (mode.fb_id != fb_id(crtc->bo))
+					goto fixup_flip;
+
+				if (count == 0)
+					break;
+
+				DBG(("%s: throttling on busy flip / waiting for kernel to catch up\n", __FUNCTION__));
+				drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GEM_THROTTLE, 0);
+				sna->kgem.need_throttle = false;
+
+				goto retry_flip;
+			}
+
+			if (!fixup)
+				goto fixup_flip;
+
+error:
+			xf86DrvMsg(sna->scrn->scrnIndex, X_ERROR,
+					"page flipping failed, on CRTC:%d (pipe=%d), disabling %s page flips\n",
+					__sna_crtc_id(crtc), __sna_crtc_pipe(crtc), data ? "synchronous": "asynchronous");
+
+			if (count || crtc->bo == bo)
+				sna_mode_restore(sna);
+
+			sna->flags &= ~(data ? SNA_HAS_FLIP : SNA_HAS_ASYNC_FLIP);
+			count = 0;
+			break;
+		}
+
+		if (data) {
+			assert(crtc->flip_bo == NULL);
+			assert(handler);
+			crtc->flip_handler = handler;
+			crtc->flip_data = data;
+			crtc->flip_bo = kgem_bo_reference(bo);
+			crtc->flip_bo->active_scanout++;
+			crtc->flip_serial = crtc->mode_serial;
+			crtc->flip_pending = true;
+			sna->mode.flip_active++;
+
+			DBG(("%s: recording flip on CRTC:%d handle=%d, active_scanout=%d, serial=%d\n",
+			     __FUNCTION__, __sna_crtc_id(crtc), crtc->flip_bo->handle, crtc->flip_bo->active_scanout, crtc->flip_serial));
+		} else
+			goto update_scanout;
+next_crtc:
+		count++;
+	}
+	sigio_unblock(sigio);
+
+	DBG(("%s: page flipped %d crtcs\n", __FUNCTION__, count));
+	return count;
+}
+
+static const xf86CrtcConfigFuncsRec sna_mode_funcs = {
+	.resize = sna_mode_resize,
+};
+
+static void set_size_range(struct sna *sna)
+{
+	/* We lie slightly as we expect no single monitor to exceed the
+	 * crtc limits, so if the mode exceeds the scanout restrictions,
+	 * we will quietly convert that to per-crtc pixmaps.
+	 */
+	xf86CrtcSetSizeRange(sna->scrn, 8, 8, INT16_MAX, INT16_MAX);
+}
+
+#if HAS_GAMMA
+static void set_gamma(uint16_t *curve, int size, double value)
+{
+	int i;
+
+	value = 1/value;
+	for (i = 0; i < size; i++)
+		curve[i] = 256*(size-1)*pow(i/(double)(size-1), value);
+}
+
+static void output_set_gamma(xf86OutputPtr output, xf86CrtcPtr crtc)
+{
+	XF86ConfMonitorPtr mon = output->conf_monitor;
+
+	if (!mon)
+		return;
+
+	DBG(("%s: red=%f\n", __FUNCTION__, mon->mon_gamma_red));
+	if (mon->mon_gamma_red >= GAMMA_MIN &&
+	    mon->mon_gamma_red <= GAMMA_MAX &&
+	    mon->mon_gamma_red != 1.0)
+		set_gamma(crtc->gamma_red, crtc->gamma_size,
+			  mon->mon_gamma_red);
+
+	DBG(("%s: green=%f\n", __FUNCTION__, mon->mon_gamma_green));
+	if (mon->mon_gamma_green >= GAMMA_MIN &&
+	    mon->mon_gamma_green <= GAMMA_MAX &&
+	    mon->mon_gamma_green != 1.0)
+		set_gamma(crtc->gamma_green, crtc->gamma_size,
+			  mon->mon_gamma_green);
+
+	DBG(("%s: blue=%f\n", __FUNCTION__, mon->mon_gamma_blue));
+	if (mon->mon_gamma_blue >= GAMMA_MIN &&
+	    mon->mon_gamma_blue <= GAMMA_MAX &&
+	    mon->mon_gamma_blue != 1.0)
+		set_gamma(crtc->gamma_blue, crtc->gamma_size,
+			  mon->mon_gamma_blue);
+}
+
+static bool
+crtc_get_gamma_lut(xf86CrtcPtr crtc,
+		   CARD16 *red, CARD16 *green, CARD16 *blue, int size)
+{
+
+	struct sna *sna = to_sna(crtc->scrn);
+	struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+	struct drm_color_lut *lut = sna_crtc->gamma_lut;
+	struct drm_mode_get_blob blob;
+	int lut_size, i;
+
+	DBG(("%s: gamma_size %d\n", __FUNCTION__, size));
+
+	memset(&blob, 0, sizeof(blob));
+	blob.blob_id = sna_crtc->gamma_lut_blob;
+
+	if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPROPBLOB, &blob))
+		return false;
+
+	lut_size = blob.length / sizeof(lut[0]);
+
+	if (lut_size == 0 ||
+	    lut_size > max(sna_crtc->gamma_lut_size, 256))
+		return false;
+
+	blob.data = (uintptr_t)lut;
+
+	if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPROPBLOB, &blob))
+		return false;
+
+	for (i = 0; i < size; i++) {
+		struct drm_color_lut *entry =
+			&lut[i * (lut_size - 1) / (size - 1)];
+
+		red[i] = entry->red;
+		green[i] = entry->green;
+		blue[i] = entry->blue;
+	}
+
+	return red[size - 1] &&
+		green[size - 1] &&
+		blue[size - 1];
+}
+
+static bool crtc_get_gamma_legacy(xf86CrtcPtr crtc,
+				  CARD16 *red,
+				  CARD16 *green,
+				  CARD16 *blue,
+				  int size)
+{
+	struct sna *sna = to_sna(crtc->scrn);
+	struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+	struct drm_mode_crtc_lut lut = {
+		.crtc_id = __sna_crtc_id(sna_crtc),
+		.gamma_size = size,
+		.red = (uintptr_t)red,
+		.green = (uintptr_t)green,
+		.blue = (uintptr_t)blue,
+	};
+
+	if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETGAMMA, &lut) != 0)
+		return false;
+
+	VG(VALGRIND_MAKE_MEM_DEFINED(red, size*sizeof(red[0])));
+	VG(VALGRIND_MAKE_MEM_DEFINED(green, size*sizeof(green[0])));
+	VG(VALGRIND_MAKE_MEM_DEFINED(blue, size*sizeof(blue[0])));
+
+	return red[size - 1] &&
+		green[size - 1] &&
+		blue[size - 1];
+}
+
+static void crtc_init_gamma(xf86CrtcPtr crtc)
+{
+	struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+	uint16_t *gamma;
+	int size;
+
+	assert(sna_crtc);
+
+	size = sna_crtc->gamma_lut_size;
+	if (!size)
+		size = 256;
+
+	/* Initialize the gamma ramps */
+	gamma = NULL;
+	if (crtc->gamma_size == size)
+		gamma = crtc->gamma_red;
+	if (gamma == NULL)
+		gamma = malloc(3 * size * sizeof(uint16_t));
+	if (gamma) {
+		uint16_t *red = gamma;
+		uint16_t *green = gamma + size;
+		uint16_t *blue = gamma + 2 * size;
+		bool gamma_set;
+
+		if (sna_crtc->gamma_lut_size)
+			gamma_set = crtc_get_gamma_lut(crtc, red,
+						       green, blue, size);
+		else
+			gamma_set = crtc_get_gamma_legacy(crtc, red,
+							  green, blue, size);
+
+		DBG(("%s: CRTC:%d, pipe=%d: gamma set?=%d\n",
+		     __FUNCTION__, __sna_crtc_id(sna_crtc), __sna_crtc_pipe(sna_crtc),
+		     gamma_set));
+		if (!gamma_set) {
+			int i;
+
+			for (i = 0; i < size; i++) {
+				uint16_t val = i * 0xffff / (size - 1);
+
+				red[i] = val;
+				green[i] = val;
+				blue[i] = val;
+			}
+		}
+
+		if (red != crtc->gamma_red) {
+			free(crtc->gamma_red);
+			crtc->gamma_red = red;
+			crtc->gamma_green = green;
+			crtc->gamma_blue = blue;
+			crtc->gamma_size = size;
+		}
+	}
+}
+#else
+static void output_set_gamma(xf86OutputPtr output, xf86CrtcPtr crtc) { }
+static void crtc_init_gamma(xf86CrtcPtr crtc) { }
+#endif
+
+static const char *preferred_mode(xf86OutputPtr output)
+{
+	const char *mode;
+
+	mode = xf86GetOptValString(output->options, OPTION_PREFERRED_MODE);
+	if (mode)
+		return mode;
+
+	if (output->scrn->display->modes && *output->scrn->display->modes)
+		return *output->scrn->display->modes;
+
+	return NULL;
+}
+
+static bool sna_probe_initial_configuration(struct sna *sna)
+{
+	ScrnInfoPtr scrn = sna->scrn;
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+	int crtc_active, crtc_enabled;
+	int width, height;
+	int i, j;
+
+	assert((sna->flags & SNA_IS_HOSTED) == 0);
+
+	if ((sna->flags & SNA_IS_SLAVED) == 0) {
+		const int user_overrides[] = {
+			OPTION_POSITION,
+			OPTION_BELOW,
+			OPTION_RIGHT_OF,
+			OPTION_ABOVE,
+			OPTION_LEFT_OF,
+			OPTION_ROTATE,
+			OPTION_PANNING,
+		};
+		if (xf86ReturnOptValBool(sna->Options, OPTION_REPROBE, FALSE)) {
+			DBG(("%s: user requests reprobing\n", __FUNCTION__));
+			return false;
+		}
+
+		/* First scan through all outputs and look for user overrides */
+		for (i = 0; i < sna->mode.num_real_output; i++) {
+			xf86OutputPtr output = config->output[i];
+
+			for (j = 0; j < ARRAY_SIZE(user_overrides); j++) {
+				if (xf86GetOptValString(output->options, user_overrides[j])) {
+					DBG(("%s: user placement [%d] for %s\n",
+					     __FUNCTION__,
+					     user_overrides[j],
+					     output->name));
+					return false;
+				}
+			}
+		}
+	}
+
+	/* Copy the existing modes on each CRTCs */
+	crtc_active = crtc_enabled = 0;
+	for (i = 0; i < sna->mode.num_real_crtc; i++) {
+		xf86CrtcPtr crtc = config->crtc[i];
+		struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+		struct drm_mode_crtc mode;
+
+		crtc->enabled = FALSE;
+		crtc->desiredMode.status = MODE_NOMODE;
+
+		crtc_init_gamma(crtc);
+
+		/* Retrieve the current mode */
+		VG_CLEAR(mode);
+		mode.crtc_id = __sna_crtc_id(sna_crtc);
+		if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCRTC, &mode))
+			continue;
+
+		DBG(("%s: CRTC:%d, pipe=%d: has mode?=%d\n", __FUNCTION__,
+		     __sna_crtc_id(sna_crtc), __sna_crtc_pipe(sna_crtc),
+		     mode.mode_valid && mode.mode.clock));
+
+		if (!mode.mode_valid || mode.mode.clock == 0)
+			continue;
+
+		mode_from_kmode(scrn, &mode.mode, &crtc->desiredMode);
+		crtc->desiredRotation = sna_crtc->primary.rotation.current;
+		crtc->desiredX = mode.x;
+		crtc->desiredY = mode.y;
+		crtc->desiredTransformPresent = FALSE;
+		crtc_active++;
+	}
+
+	/* Reconstruct outputs pointing to active CRTC */
+	for (i = 0; i < sna->mode.num_real_output; i++) {
+		xf86OutputPtr output = config->output[i];
+		uint32_t crtc_id;
+
+		assert(to_sna_output(output));
+
+		crtc_id = (uintptr_t)output->crtc;
+		output->crtc = NULL;
+		output->status = XF86OutputStatusUnknown;
+		if (sna->flags & SNA_IS_SLAVED)
+			continue;
+
+		if (crtc_id == 0) {
+			DBG(("%s: not using output %s, disconnected\n",
+			     __FUNCTION__, output->name));
+			continue;
+		}
+
+		if (xf86ReturnOptValBool(output->options, OPTION_DISABLE, 0)) {
+			DBG(("%s: not using output %s, manually disabled\n",
+			     __FUNCTION__, output->name));
+			continue;
+		}
+
+		for (j = 0; j < sna->mode.num_real_crtc; j++) {
+			xf86CrtcPtr crtc = config->crtc[j];
+
+			assert(to_sna_crtc(crtc));
+			if (sna_crtc_id(crtc) != crtc_id)
+				continue;
+
+			if (crtc->desiredMode.status == MODE_OK) {
+				DisplayModePtr M;
+				const char *pref;
+
+				pref = preferred_mode(output);
+				if (pref && strcmp(pref, crtc->desiredMode.name)) {
+					DBG(("%s: output %s user requests a different preferred mode %s, found %s\n",
+					     __FUNCTION__, output->name, pref, crtc->desiredMode.name));
+					return false;
+				}
+
+				xf86DrvMsg(scrn->scrnIndex, X_PROBED,
+					   "Output %s using initial mode %s on pipe %d\n",
+					   output->name,
+					   crtc->desiredMode.name,
+					   sna_crtc_pipe(crtc));
+
+				output->crtc = crtc;
+				output->status = XF86OutputStatusConnected;
+				crtc->enabled = TRUE;
+				crtc_enabled++;
+
+				output_set_gamma(output, crtc);
+
+				if (output->conf_monitor) {
+					output->mm_width = output->conf_monitor->mon_width;
+					output->mm_height = output->conf_monitor->mon_height;
+				}
+
+#if 0
+				sna_output_attach_edid(output);
+				sna_output_attach_tile(output);
+#endif
+
+				if (output->mm_width == 0 || output->mm_height == 0) {
+					output->mm_height = (crtc->desiredMode.VDisplay * 254) / (10*DEFAULT_DPI);
+					output->mm_width = (crtc->desiredMode.HDisplay * 254) / (10*DEFAULT_DPI);
+				}
+
+				M = calloc(1, sizeof(DisplayModeRec));
+				if (M) {
+					*M = crtc->desiredMode;
+					M->name = strdup(M->name);
+					output->probed_modes =
+						xf86ModesAdd(output->probed_modes, M);
+				}
+			}
+
+			break;
+		}
+
+		if (j == sna->mode.num_real_crtc) {
+			/* Can not find the earlier associated CRTC, bail */
+			DBG(("%s: existing setup conflicts with output assignment (Zaphod), reprobing\n",
+			     __FUNCTION__));
+			return false;
+		}
+	}
+
+	if (crtc_active != crtc_enabled) {
+		DBG(("%s: only enabled %d out of %d active CRTC, forcing a reconfigure\n",
+		     __FUNCTION__, crtc_enabled, crtc_active));
+		return false;
+	}
+
+	width = height = 0;
+	for (i = 0; i < sna->mode.num_real_crtc; i++) {
+		xf86CrtcPtr crtc = config->crtc[i];
+		int w, h;
+
+		if (!crtc->enabled)
+			continue;
+
+		w = crtc->desiredX + crtc->desiredMode.HDisplay;
+		if (w > width)
+			width = w;
+		h = crtc->desiredY + crtc->desiredMode.VDisplay;
+		if (h > height)
+			height = h;
+	}
+
+	/* Prefer the native panel size if any */
+	if (!width || !height) {
+		for (i = 0; i < sna->mode.num_real_output; i++) {
+			xf86OutputPtr output = config->output[i];
+			struct sna_output *sna_output = to_sna_output(output);
+
+			if (!sna_output->is_panel)
+				continue;
+
+			DBG(("%s: querying panel '%s' for preferred unattached size\n",
+			     __FUNCTION__, output->name));
+
+			if (sna_output_detect(output) != XF86OutputStatusConnected)
+				continue;
+
+			if (sna_output->num_modes == 0)
+				continue;
+
+			width  = sna_output->modes[0].hdisplay;
+			height = sna_output->modes[0].vdisplay;
+
+			DBG(("%s: panel '%s' is %dx%d\n",
+			     __FUNCTION__, output->name, width, height));
+			break;
+		}
+	}
+
+	if (!width || !height) {
+		width = 1024;
+		height = 768;
+	}
+
+	scrn->display->frameX0 = 0;
+	scrn->display->frameY0 = 0;
+	scrn->display->virtualX = width;
+	scrn->display->virtualY = height;
+
+	scrn->virtualX = width;
+	scrn->virtualY = height;
+
+	xf86SetScrnInfoModes(sna->scrn);
+	DBG(("%s: SetScrnInfoModes = %p\n", __FUNCTION__, scrn->modes));
+	return scrn->modes != NULL;
+}
+
+static void
+sanitize_outputs(struct sna *sna)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	int i;
+
+	for (i = 0; i < config->num_output; i++)
+		config->output[i]->crtc = NULL;
+}
+
+static bool has_flip(struct sna *sna)
+{
+	drm_i915_getparam_t gp;
+	int v;
+
+	if (sna->flags & SNA_NO_FLIP)
+		return false;
+
+	v = 0;
+
+	VG_CLEAR(gp);
+	gp.param = I915_PARAM_HAS_PAGEFLIPPING;
+	gp.value = &v;
+
+	if (drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GETPARAM, &gp))
+		return false;
+
+	VG(VALGRIND_MAKE_MEM_DEFINED(&v, sizeof(v)));
+	return v > 0;
+}
+
+static bool has_flip__async(struct sna *sna)
+{
+#define DRM_CAP_ASYNC_PAGE_FLIP 0x7
+	struct local_get_cap {
+		uint64_t name;
+		uint64_t value;
+	} cap = { .name = DRM_CAP_ASYNC_PAGE_FLIP, };
+
+	if (sna->flags & SNA_NO_FLIP)
+		return false;
+
+	if (drmIoctl(sna->kgem.fd, LOCAL_IOCTL_GET_CAP, &cap) == 0)
+		return cap.value > 0;
+
+	return false;
+}
+
+static void
+probe_capabilities(struct sna *sna)
+{
+	sna->flags &= ~(SNA_HAS_FLIP | SNA_HAS_ASYNC_FLIP);
+	if (has_flip(sna))
+		sna->flags |= SNA_HAS_FLIP;
+	if (has_flip__async(sna) && (sna->flags & SNA_TEAR_FREE) == 0)
+		sna->flags |= SNA_HAS_ASYNC_FLIP;
+	DBG(("%s: page flips? %s, async? %s\n", __FUNCTION__,
+	     sna->flags & SNA_HAS_FLIP ? "enabled" : "disabled",
+	     sna->flags & SNA_HAS_ASYNC_FLIP ? "enabled" : "disabled"));
+}
+
+void
+sna_crtc_config_notify(ScreenPtr screen)
+{
+	struct sna *sna = to_sna_from_screen(screen);
+
+	DBG(("%s(dirty?=%d)\n", __FUNCTION__, sna->mode.dirty));
+	if (!sna->mode.dirty)
+		return;
+
+	if (disable_unused_crtc(sna)) {
+		/* This will have recursed, so simply bail at this point */
+		assert(sna->mode.dirty == false);
+#ifdef RANDR_12_INTERFACE
+		xf86RandR12TellChanged(screen);
+#endif
+		return;
+	}
+
+	/* Flush any events completed by the modeset */
+	sna_mode_wakeup(sna);
+
+	update_flush_interval(sna);
+	sna->cursor.disable = false; /* Reset HW cursor until the next fail */
+	sna_cursors_reload(sna);
+
+	probe_capabilities(sna);
+	sna_present_update(sna);
+
+	/* Allow TearFree to come back on when everything is off */
+	if (!sna->mode.front_active && sna->flags & SNA_WANT_TEAR_FREE) {
+		if ((sna->flags & SNA_TEAR_FREE) == 0)
+			DBG(("%s: enable TearFree next modeset\n",
+			     __FUNCTION__));
+
+		sna->flags |= SNA_TEAR_FREE;
+	}
+
+	sna->mode.dirty = false;
+}
+
+#if HAS_PIXMAP_SHARING
+#define sna_setup_provider(scrn) xf86ProviderSetup(scrn, NULL, "Intel")
+#else
+#define sna_setup_provider(scrn)
+#endif
+
+bool sna_mode_pre_init(ScrnInfoPtr scrn, struct sna *sna)
+{
+	drmModeResPtr res;
+	int num_fake = 0;
+	int i;
+
+	if (sna->flags & SNA_IS_HOSTED) {
+		sna_setup_provider(scrn);
+		return true;
+	}
+
+	probe_capabilities(sna);
+	sna->mode.hidden = !isGPU(scrn); /* No DPMS passthrough */
+
+	if (!xf86GetOptValInteger(sna->Options, OPTION_VIRTUAL, &num_fake))
+		num_fake = 1;
+
+	res = drmModeGetResources(sna->kgem.fd);
+	if (res &&
+	    (res->count_crtcs == 0 ||
+	     res->count_encoders == 0 ||
+	     res->count_connectors == 0)) {
+		drmModeFreeResources(res);
+		res = NULL;
+	}
+	if (res) {
+		xf86CrtcConfigPtr xf86_config;
+
+		DBG(("%s: found %d CRTC, %d encoders, %d connectors\n",
+		     __FUNCTION__, res->count_crtcs, res->count_encoders, res->count_connectors));
+
+		assert(res->count_crtcs);
+		assert(res->count_connectors);
+
+		xf86CrtcConfigInit(scrn, &sna_mode_funcs);
+
+		xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+		xf86_config->xf86_crtc_notify = sna_crtc_config_notify;
+		xf86_config->compat_output = 0;
+
+		for (i = 0; i < res->count_crtcs; i++)
+			if (!sna_crtc_add(scrn, res->crtcs[i]))
+				return false;
+
+		sna->mode.num_real_crtc = xf86_config->num_crtc;
+
+		sna->mode.num_real_encoder = res->count_encoders;
+		sna->mode.encoders = res->encoders;
+		res->encoders = NULL;
+
+		for (i = 0; i < res->count_connectors; i++)
+			if (sna_output_add(sna, res->connectors[i], 0) < 0)
+				return false;
+
+		sna->mode.num_real_output = xf86_config->num_output;
+
+		sna->mode.max_crtc_width  = res->max_width;
+		sna->mode.max_crtc_height = res->max_height;
+
+		RegionEmpty(&sna->mode.shadow_region);
+		RegionEmpty(&sna->mode.shadow_cancel);
+		list_init(&sna->mode.shadow_crtc);
+
+		drmModeFreeResources(res);
+
+		sna_cursor_pre_init(sna);
+		sna_backlight_pre_init(sna);
+
+		set_size_range(sna);
+	} else {
+		if (num_fake == 0)
+			num_fake = 1;
+	}
+
+	if (!sna_mode_fake_init(sna, num_fake))
+		return false;
+
+	sna->mode.shadow_size = 256;
+	sna->mode.shadow_events = malloc(sna->mode.shadow_size * sizeof(struct drm_event_vblank));
+	if (!sna->mode.shadow_events)
+		return false;
+
+	if (!sna_probe_initial_configuration(sna)) {
+		xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+
+		sanitize_outputs(sna);
+		if (config->num_crtc && config->num_output) {
+			if (!xf86ReturnOptValBool(config->output[0]->options,
+						  OPTION_PRIMARY, FALSE))
+				sort_config_outputs(sna);
+			xf86InitialConfiguration(scrn, TRUE);
+		}
+	}
+	sort_config_outputs(sna);
+
+	sna_setup_provider(scrn);
+	return scrn->modes != NULL;
+}
+
+bool
+sna_mode_wants_tear_free(struct sna *sna)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	bool found = false;
+	FILE *file;
+	int i;
+
+	file = fopen("/sys/module/i915/parameters/enable_fbc", "r");
+	if (file) {
+		int fbc_enabled = 0;
+		int value;
+
+		if (fscanf(file, "%d", &value) == 1)
+			fbc_enabled = value > 0;
+		fclose(file);
+
+		DBG(("%s: module parameter 'enable_fbc' enabled? %d\n",
+		     __FUNCTION__, fbc_enabled));
+
+		if (fbc_enabled)
+			return true;
+	}
+
+	for (i = 0; i < sna->mode.num_real_output; i++) {
+		struct sna_output *output = to_sna_output(config->output[i]);
+		int id = find_property(sna, output, "Panel Self-Refresh");
+		if (id == -1)
+			continue;
+
+		found = true;
+		if (output->prop_values[id] != -1) {
+			DBG(("%s: Panel Self-Refresh detected on %s\n",
+			     __FUNCTION__, config->output[i]->name));
+			return true;
+		}
+	}
+
+	if (!found) {
+		file = fopen("/sys/module/i915/parameters/enable_psr", "r");
+		if (file) {
+			int psr_enabled = 0;
+			int value;
+
+			if (fscanf(file, "%d", &value) == 1)
+				psr_enabled = value > 0;
+			fclose(file);
+
+			DBG(("%s: module parameter 'enable_psr' enabled? %d\n",
+			     __FUNCTION__, psr_enabled));
+
+			if (psr_enabled)
+				return true;
+		}
+	}
+
+	return false;
+}
+
+void
+sna_mode_set_primary(struct sna *sna)
+{
+#ifdef RANDR_12_INTERFACE
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	rrScrPrivPtr rr = rrGetScrPriv(xf86ScrnToScreen(sna->scrn));
+	int i;
+
+	if (rr == NULL || rr->primaryOutput)
+		return;
+
+	for (i = 0; i < sna->mode.num_real_output; i++) {
+		xf86OutputPtr output = config->output[i];
+
+		if (!xf86ReturnOptValBool(output->options, OPTION_PRIMARY, FALSE))
+			continue;
+
+		DBG(("%s: setting PrimaryOutput %s\n", __FUNCTION__, output->name));
+		rr->primaryOutput = output->randr_output;
+		RROutputChanged(rr->primaryOutput, FALSE);
+		rr->layoutChanged = TRUE;
+		break;
+	}
+#endif
+}
+
+bool
+sna_mode_disable(struct sna *sna)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	int i;
+
+	if (sna->flags & SNA_IS_HOSTED)
+		return false;
+
+	if (!sna->scrn->vtSema)
+		return false;
+
+	sna_disable_cursors(sna->scrn);
+	for (i = 0; i < sna->mode.num_real_crtc; i++)
+		sna_crtc_disable(config->crtc[i], false);
+	assert(sna->mode.front_active == 0);
+
+	sna_mode_wakeup(sna);
+	kgem_clean_scanout_cache(&sna->kgem);
+	return true;
+}
+
+void
+sna_mode_enable(struct sna *sna)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	int i;
+
+	DBG(("%s\n", __FUNCTION__));
+
+	if (sna->flags & SNA_IS_HOSTED)
+		return;
+
+	if (!sna->scrn->vtSema)
+		return;
+
+	if (sna->mode.hidden) {
+		DBG(("%s: hidden outputs\n", __FUNCTION__));
+		return;
+	}
+
+	for (i = 0; i < sna->mode.num_real_crtc; i++) {
+		xf86CrtcPtr crtc = config->crtc[i];
+
+		DBG(("%s: crtc[%d].enabled?=%d\n", __FUNCTION__, i, crtc->enabled));
+		assert(to_sna_crtc(crtc) != NULL);
+		if (!crtc->enabled)
+			continue;
+
+		if (crtc->mode.Clock == 0)
+			continue;
+
+		__sna_crtc_set_mode(crtc);
+	}
+
+	update_flush_interval(sna);
+	sna_cursors_reload(sna);
+	sna->mode.dirty = false;
+}
+
+static void sna_randr_close(struct sna *sna)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	int n;
+
+	/* The RR structs are freed early during CloseScreen as they
+	 * are tracked as Resources. However, we may be tempted to
+	 * access them during shutdown so decouple them now.
+	 */
+	  for (n = 0; n < config->num_output; n++)
+		  config->output[n]->randr_output = NULL;
+
+	  for (n = 0; n < config->num_crtc; n++)
+		  config->crtc[n]->randr_crtc = NULL;
+}
+
+void
+sna_mode_close(struct sna *sna)
+{
+	sna_randr_close(sna);
+	sna_mode_wakeup(sna);
+
+	if (sna->flags & SNA_IS_HOSTED)
+		return;
+
+	sna_mode_reset(sna);
+
+	sna_cursor_close(sna);
+	sna_cursors_fini(sna);
+
+	sna_backlight_close(sna);
+	sna->mode.dirty = false;
+}
+
+void
+sna_mode_fini(struct sna *sna)
+{
+	free(sna->mode.encoders);
+}
+
+static bool sna_box_intersect(BoxPtr r, const BoxRec *a, const BoxRec *b)
+{
+	r->x1 = a->x1 > b->x1 ? a->x1 : b->x1;
+	r->x2 = a->x2 < b->x2 ? a->x2 : b->x2;
+	if (r->x1 >= r->x2)
+		return false;
+
+	r->y1 = a->y1 > b->y1 ? a->y1 : b->y1;
+	r->y2 = a->y2 < b->y2 ? a->y2 : b->y2;
+	DBG(("%s: (%d, %d), (%d, %d) intersect (%d, %d), (%d, %d) = (%d, %d), (%d, %d)\n",
+	     __FUNCTION__,
+	     a->x1, a->y1, a->x2, a->y2,
+	     b->x1, b->y1, b->x2, b->y2,
+	     r->x1, r->y1, r->x2, r->y2));
+	if (r->y1 >= r->y2)
+		return false;
+
+	return true;
+}
+
+static int sna_box_area(const BoxRec *box)
+{
+	return (int)(box->x2 - box->x1) * (int)(box->y2 - box->y1);
+}
+
+/*
+ * Return the crtc covering 'box'. If two crtcs cover a portion of
+ * 'box', then prefer 'desired'. If 'desired' is NULL, then prefer the crtc
+ * with greater coverage
+ */
+xf86CrtcPtr
+sna_covering_crtc(struct sna *sna, const BoxRec *box, xf86CrtcPtr desired)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	xf86CrtcPtr best_crtc = NULL;
+	int best_coverage = -1, c;
+
+	if (sna->flags & SNA_IS_HOSTED)
+		return NULL;
+
+	/* If we do not own the VT, we do not own the CRTC either */
+	if (!sna->scrn->vtSema) {
+		DBG(("%s: none, VT switched\n", __FUNCTION__));
+		return NULL;
+	}
+
+	if (sna->mode.hidden) {
+		DBG(("%s: none, hidden outputs\n", __FUNCTION__));
+		return NULL;
+	}
+
+	DBG(("%s for box=(%d, %d), (%d, %d)\n",
+	     __FUNCTION__, box->x1, box->y1, box->x2, box->y2));
+
+	if (desired == NULL) {
+		ScreenPtr screen = xf86ScrnToScreen(sna->scrn);
+		rrScrPrivPtr rr = rrGetScrPriv(screen);
+		if (rr && rr->primaryOutput && rr->primaryOutput->pScreen == screen) {
+			xf86OutputPtr output = rr->primaryOutput->devPrivate;
+			DBG(("%s: have PrimaryOutput? %d marking as desired\n", __FUNCTION__, output->crtc != NULL));
+			desired = output->crtc;
+		}
+		assert(!desired || desired->scrn == sna->scrn);
+	}
+	if (desired && to_sna_crtc(desired) && to_sna_crtc(desired)->bo) {
+		BoxRec cover_box;
+		if (sna_box_intersect(&cover_box, &desired->bounds, box)) {
+			DBG(("%s: box overlaps desired crtc: (%d, %d), (%d, %d)\n",
+			     __FUNCTION__,
+			     cover_box.x1, cover_box.y1,
+			     cover_box.x2, cover_box.y2));
+			return desired;
+		}
+		best_crtc = desired;
+		best_coverage = 0;
+	}
+
+	for (c = 0; c < sna->mode.num_real_crtc; c++) {
+		xf86CrtcPtr crtc = config->crtc[c];
+		BoxRec cover_box;
+		int coverage;
+
+		assert(to_sna_crtc(crtc));
+
+		/* If the CRTC is off, treat it as not covering */
+		if (to_sna_crtc(crtc)->bo == NULL) {
+			DBG(("%s: crtc %d off, skipping\n", __FUNCTION__, c));
+			continue;
+		}
+
+		DBG(("%s: crtc %d: (%d, %d), (%d, %d)\n",
+		     __FUNCTION__, c,
+		     crtc->bounds.x1, crtc->bounds.y1,
+		     crtc->bounds.x2, crtc->bounds.y2));
+		if (!memcmp(box, &crtc->bounds, sizeof(*box))) {
+			DBG(("%s: box exactly matches crtc [%d]\n",
+			     __FUNCTION__, c));
+			return crtc;
+		}
+
+		coverage = 0;
+		if (sna_box_intersect(&cover_box, &crtc->bounds, box))
+			coverage = sna_box_area(&cover_box);
+
+		DBG(("%s: box instersects (%d, %d), (%d, %d) of crtc %d\n",
+		     __FUNCTION__,
+		     cover_box.x1, cover_box.y1,
+		     cover_box.x2, cover_box.y2,
+		     c));
+
+		DBG(("%s: box covers %d of crtc %d\n",
+		     __FUNCTION__, coverage, c));
+		if (coverage > best_coverage) {
+			best_crtc = crtc;
+			best_coverage = coverage;
+		}
+	}
+	DBG(("%s: best crtc = %p, coverage = %d\n",
+	     __FUNCTION__, best_crtc, best_coverage));
+	return best_crtc;
+}
+
+static xf86CrtcPtr first_active_crtc(struct sna *sna)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	int n;
+
+	for (n = 0; n < sna->mode.num_real_crtc; n++) {
+		xf86CrtcPtr crtc = config->crtc[n];
+		if (to_sna_crtc(crtc)->bo)
+			return crtc;
+	}
+
+	/* No active, use the first as a placeholder */
+	if (sna->mode.num_real_crtc)
+		return config->crtc[0];
+
+	return NULL;
+}
+
+xf86CrtcPtr sna_primary_crtc(struct sna *sna)
+{
+	rrScrPrivPtr rr = rrGetScrPriv(xf86ScrnToScreen(sna->scrn));
+	if (rr && rr->primaryOutput) {
+		xf86OutputPtr output = rr->primaryOutput->devPrivate;
+		if (output->crtc &&
+		    output->scrn == sna->scrn &&
+		    to_sna_crtc(output->crtc))
+			return output->crtc;
+	}
+
+	return first_active_crtc(sna);
+}
+
+#define MI_LOAD_REGISTER_IMM			(0x22<<23)
+
+static bool sna_emit_wait_for_scanline_hsw(struct sna *sna,
+					   xf86CrtcPtr crtc,
+					   int pipe, int y1, int y2,
+					   bool full_height)
+{
+	uint32_t event;
+	uint32_t *b;
+
+	if (!sna->kgem.has_secure_batches)
+		return false;
+
+	b = kgem_get_batch(&sna->kgem);
+	sna->kgem.nbatch += 17;
+
+	switch (pipe) {
+	default: assert(0); /* fall through */
+	case 0: event = 1 << 0; break;
+	case 1: event = 1 << 8; break;
+	case 2: event = 1 << 14; break;
+	}
+
+	b[0] = MI_LOAD_REGISTER_IMM | 1;
+	b[1] = 0x44050; /* DERRMR */
+	b[2] = ~event;
+	b[3] = MI_LOAD_REGISTER_IMM | 1;
+	b[4] = 0xa188; /* FORCEWAKE_MT */
+	b[5] = 2 << 16 | 2;
+
+	/* The documentation says that the LOAD_SCAN_LINES command
+	 * always comes in pairs. Don't ask me why. */
+	switch (pipe) {
+	default: assert(0); /* fall through */
+	case 0: event = 0 << 19; break;
+	case 1: event = 1 << 19; break;
+	case 2: event = 4 << 19; break;
+	}
+	b[8] = b[6] = MI_LOAD_SCAN_LINES_INCL | event;
+	b[9] = b[7] = (y1 << 16) | (y2-1);
+
+	switch (pipe) {
+	default: assert(0); /* fall through */
+	case 0: event = 1 << 0; break;
+	case 1: event = 1 << 8; break;
+	case 2: event = 1 << 14; break;
+	}
+	b[10] = MI_WAIT_FOR_EVENT | event;
+
+	b[11] = MI_LOAD_REGISTER_IMM | 1;
+	b[12] = 0xa188; /* FORCEWAKE_MT */
+	b[13] = 2 << 16;
+	b[14] = MI_LOAD_REGISTER_IMM | 1;
+	b[15] = 0x44050; /* DERRMR */
+	b[16] = ~0;
+
+	sna->kgem.batch_flags |= I915_EXEC_SECURE;
+	return true;
+}
+
+static bool sna_emit_wait_for_scanline_ivb(struct sna *sna,
+					   xf86CrtcPtr crtc,
+					   int pipe, int y1, int y2,
+					   bool full_height)
+{
+	uint32_t event, *b;
+
+	if (!sna->kgem.has_secure_batches)
+		return false;
+
+	assert(y1 >= 0);
+	assert(y2 > y1);
+	assert(sna->kgem.mode);
+
+	/* Always program one less than the desired value */
+	if (--y1 < 0)
+		y1 = crtc->bounds.y2;
+	y2--;
+
+	switch (pipe) {
+	default:
+		assert(0);
+		/* fall through */
+	case 0:
+		event = 1 << (full_height ? 3 : 0);
+		break;
+	case 1:
+		event = 1 << (full_height ? 11 : 8);
+		break;
+	case 2:
+		event = 1 << (full_height ? 21 : 14);
+		break;
+	}
+
+	b = kgem_get_batch(&sna->kgem);
+
+	/* Both the LRI and WAIT_FOR_EVENT must be in the same cacheline */
+	if (((sna->kgem.nbatch + 6) >> 4) != (sna->kgem.nbatch + 10) >> 4) {
+		int dw = sna->kgem.nbatch + 6;
+		dw = ALIGN(dw, 16) - dw;
+		while (dw--)
+			*b++ = MI_NOOP;
+	}
+
+	b[0] = MI_LOAD_REGISTER_IMM | 1;
+	b[1] = 0x44050; /* DERRMR */
+	b[2] = ~event;
+	b[3] = MI_LOAD_REGISTER_IMM | 1;
+	b[4] = 0xa188; /* FORCEWAKE_MT */
+	b[5] = 2 << 16 | 2;
+	b[6] = MI_LOAD_REGISTER_IMM | 1;
+	b[7] = 0x70068 + 0x1000 * pipe;
+	b[8] = (1 << 31) | (1 << 30) | (y1 << 16) | y2;
+	b[9] = MI_WAIT_FOR_EVENT | event;
+	b[10] = MI_LOAD_REGISTER_IMM | 1;
+	b[11] = 0xa188; /* FORCEWAKE_MT */
+	b[12] = 2 << 16;
+	b[13] = MI_LOAD_REGISTER_IMM | 1;
+	b[14] = 0x44050; /* DERRMR */
+	b[15] = ~0;
+
+	sna->kgem.nbatch = b - sna->kgem.batch + 16;
+
+	sna->kgem.batch_flags |= I915_EXEC_SECURE;
+	return true;
+}
+
+static bool sna_emit_wait_for_scanline_gen6(struct sna *sna,
+					    xf86CrtcPtr crtc,
+					    int pipe, int y1, int y2,
+					    bool full_height)
+{
+	uint32_t *b;
+	uint32_t event;
+
+	if (!sna->kgem.has_secure_batches)
+		return false;
+
+	assert(y1 >= 0);
+	assert(y2 > y1);
+	assert(sna->kgem.mode == KGEM_RENDER);
+
+	/* Always program one less than the desired value */
+	if (--y1 < 0)
+		y1 = crtc->bounds.y2;
+	y2--;
+
+	/* The scanline granularity is 3 bits */
+	y1 &= ~7;
+	y2 &= ~7;
+	if (y2 == y1)
+		return false;
+
+	event = 1 << (3*full_height + pipe*8);
+
+	b = kgem_get_batch(&sna->kgem);
+	sna->kgem.nbatch += 16;
+
+	b[0] = MI_LOAD_REGISTER_IMM | 1;
+	b[1] = 0x44050; /* DERRMR */
+	b[2] = ~event;
+	b[3] = MI_LOAD_REGISTER_IMM | 1;
+	b[4] = 0x4f100; /* magic */
+	b[5] = (1 << 31) | (1 << 30) | pipe << 29 | (y1 << 16) | y2;
+	b[6] = MI_LOAD_REGISTER_IMM | 1;
+	b[7] = 0x2050; /* PSMI_CTL(rcs) */
+	b[8] = 1 << 16 | 1;
+	b[9] = MI_WAIT_FOR_EVENT | event;
+	b[10] = MI_LOAD_REGISTER_IMM | 1;
+	b[11] = 0x2050; /* PSMI_CTL(rcs) */
+	b[12] = 1 << 16;
+	b[13] = MI_LOAD_REGISTER_IMM | 1;
+	b[14] = 0x44050; /* DERRMR */
+	b[15] = ~0;
+
+	sna->kgem.batch_flags |= I915_EXEC_SECURE;
+	return true;
+}
+
+static bool sna_emit_wait_for_scanline_gen4(struct sna *sna,
+					    xf86CrtcPtr crtc,
+					    int pipe, int y1, int y2,
+					    bool full_height)
+{
+	uint32_t event;
+	uint32_t *b;
+
+	if (pipe == 0) {
+		if (full_height)
+			event = MI_WAIT_FOR_PIPEA_SVBLANK;
+		else
+			event = MI_WAIT_FOR_PIPEA_SCAN_LINE_WINDOW;
+	} else {
+		if (full_height)
+			event = MI_WAIT_FOR_PIPEB_SVBLANK;
+		else
+			event = MI_WAIT_FOR_PIPEB_SCAN_LINE_WINDOW;
+	}
+
+	b = kgem_get_batch(&sna->kgem);
+	sna->kgem.nbatch += 5;
+
+	/* The documentation says that the LOAD_SCAN_LINES command
+	 * always comes in pairs. Don't ask me why. */
+	b[2] = b[0] = MI_LOAD_SCAN_LINES_INCL | pipe << 20;
+	b[3] = b[1] = (y1 << 16) | (y2-1);
+	b[4] = MI_WAIT_FOR_EVENT | event;
+
+	return true;
+}
+
+static bool sna_emit_wait_for_scanline_gen2(struct sna *sna,
+					    xf86CrtcPtr crtc,
+					    int pipe, int y1, int y2,
+					    bool full_height)
+{
+	uint32_t *b;
+
+	/*
+	 * Pre-965 doesn't have SVBLANK, so we need a bit
+	 * of extra time for the blitter to start up and
+	 * do its job for a full height blit
+	 */
+	if (full_height)
+		y2 -= 2;
+
+	b = kgem_get_batch(&sna->kgem);
+	sna->kgem.nbatch += 5;
+
+	/* The documentation says that the LOAD_SCAN_LINES command
+	 * always comes in pairs. Don't ask me why. */
+	b[2] = b[0] = MI_LOAD_SCAN_LINES_INCL | pipe << 20;
+	b[3] = b[1] = (y1 << 16) | (y2-1);
+	b[4] = MI_WAIT_FOR_EVENT | 1 << (1 + 4*pipe);
+
+	return true;
+}
+
+bool
+sna_wait_for_scanline(struct sna *sna,
+		      PixmapPtr pixmap,
+		      xf86CrtcPtr crtc,
+		      const BoxRec *clip)
+{
+	bool full_height;
+	int y1, y2, pipe;
+	bool ret;
+
+	assert(crtc != NULL);
+	assert(to_sna_crtc(crtc) != NULL);
+	assert(to_sna_crtc(crtc)->bo != NULL);
+	assert(pixmap == sna->front);
+
+	if (sna->flags & SNA_NO_VSYNC)
+		return false;
+
+	/*
+	 * Make sure we don't wait for a scanline that will
+	 * never occur
+	 */
+	y1 = clip->y1 - crtc->bounds.y1;
+	if (y1 < 0)
+		y1 = 0;
+	y2 = clip->y2 - crtc->bounds.y1;
+	if (y2 > crtc->bounds.y2 - crtc->bounds.y1)
+		y2 = crtc->bounds.y2 - crtc->bounds.y1;
+	DBG(("%s: clipped range = %d, %d\n", __FUNCTION__, y1, y2));
+	if (y2 <= y1 + 4)
+		return false;
+
+	full_height = y1 == 0 && y2 == crtc->bounds.y2 - crtc->bounds.y1;
+
+	if (crtc->mode.Flags & V_INTERLACE) {
+		/* DSL count field lines */
+		y1 /= 2;
+		y2 /= 2;
+	}
+
+	pipe = sna_crtc_pipe(crtc);
+	DBG(("%s: pipe=%d, y1=%d, y2=%d, full_height?=%d\n",
+	     __FUNCTION__, pipe, y1, y2, full_height));
+
+	if (sna->kgem.gen >= 0110)
+		ret = false;
+	else if (sna->kgem.gen == 0101)
+		ret = false; /* chv, vsync method unknown */
+	else if (sna->kgem.gen >= 075)
+		ret = sna_emit_wait_for_scanline_hsw(sna, crtc, pipe, y1, y2, full_height);
+	else if (sna->kgem.gen == 071)
+		ret = false; /* vlv, vsync method unknown */
+	else if (sna->kgem.gen >= 070)
+		ret = sna_emit_wait_for_scanline_ivb(sna, crtc, pipe, y1, y2, full_height);
+	else if (sna->kgem.gen >= 060)
+		ret =sna_emit_wait_for_scanline_gen6(sna, crtc, pipe, y1, y2, full_height);
+	else if (sna->kgem.gen >= 040)
+		ret = sna_emit_wait_for_scanline_gen4(sna, crtc, pipe, y1, y2, full_height);
+	else
+		ret = sna_emit_wait_for_scanline_gen2(sna, crtc, pipe, y1, y2, full_height);
+
+	return ret;
+}
+
+static bool sna_mode_shutdown_crtc(xf86CrtcPtr crtc)
+{
+	struct sna *sna = to_sna(crtc->scrn);
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
+	bool disabled = false;
+	int o;
+
+	xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
+		   "%s: invalid state found on pipe %d, disabling CRTC:%d\n",
+		   __FUNCTION__,
+		   __sna_crtc_pipe(to_sna_crtc(crtc)),
+		   __sna_crtc_id(to_sna_crtc(crtc)));
+	sna_crtc_disable(crtc, true);
+#if XF86_CRTC_VERSION >= 3
+	crtc->active = FALSE;
+#endif
+	if (crtc->enabled) {
+		crtc->enabled = FALSE;
+		disabled = true;
+	}
+
+	for (o = 0; o < sna->mode.num_real_output; o++) {
+		xf86OutputPtr output = config->output[o];
+
+		if (output->crtc != crtc)
+			continue;
+
+		output->funcs->dpms(output, DPMSModeOff);
+		output->crtc = NULL;
+	}
+
+	return disabled;
+}
+
+static bool
+sna_mode_disable_secondary_planes(struct sna *sna)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	bool disabled = false;
+	int c;
+
+	/* Disable all secondary planes on our CRTCs, just in case
+	 * other userspace left garbage in them.
+	 */
+	for (c = 0; c < sna->mode.num_real_crtc; c++) {
+		xf86CrtcPtr crtc = config->crtc[c];
+		struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+		struct plane *plane;
+
+		list_for_each_entry(plane, &sna_crtc->sprites, link) {
+			struct local_mode_get_plane p;
+			struct local_mode_set_plane s;
+
+			VG_CLEAR(p);
+			p.plane_id = plane->id;
+			p.count_format_types = 0;
+			if (drmIoctl(sna->kgem.fd,
+				     LOCAL_IOCTL_MODE_GETPLANE,
+				     &p))
+				continue;
+
+			if (p.fb_id == 0 || p.crtc_id == 0)
+				continue;
+
+			memset(&s, 0, sizeof(s));
+			s.plane_id = p.plane_id;
+			s.crtc_id = p.crtc_id;
+			if (drmIoctl(sna->kgem.fd,
+				     LOCAL_IOCTL_MODE_SETPLANE,
+				     &s))
+				disabled |= sna_mode_shutdown_crtc(crtc);
+		}
+	}
+
+	return disabled;
+}
+
+void sna_mode_check(struct sna *sna)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	bool disabled;
+	int c, o;
+
+	if (sna->flags & SNA_IS_HOSTED)
+		return;
+
+	DBG(("%s: hidden?=%d\n", __FUNCTION__, sna->mode.hidden));
+	if (sna->mode.hidden)
+		return;
+
+	disabled = sna_mode_disable_secondary_planes(sna);
+
+	/* Validate CRTC attachments and force consistency upon the kernel */
+	for (c = 0; c < sna->mode.num_real_crtc; c++) {
+		xf86CrtcPtr crtc = config->crtc[c];
+		struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+		struct drm_mode_crtc mode;
+		uint32_t expected[2];
+
+		assert(sna_crtc);
+
+#if XF86_CRTC_VERSION >= 3
+		assert(sna_crtc->bo == NULL || crtc->active);
+#endif
+		expected[0] = sna_crtc->bo ? fb_id(sna_crtc->bo) : 0;
+		expected[1] = sna_crtc->flip_bo ? fb_id(sna_crtc->flip_bo) : -1;
+
+		VG_CLEAR(mode);
+		mode.crtc_id = __sna_crtc_id(sna_crtc);
+		if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCRTC, &mode))
+			continue;
+
+		DBG(("%s: crtc=%d, valid?=%d, fb attached?=%d, expected=(%d or %d)\n",
+		     __FUNCTION__,
+		     mode.crtc_id, mode.mode_valid,
+		     mode.fb_id, expected[0], expected[1]));
+
+		if (mode.fb_id != expected[0] && mode.fb_id != expected[1])
+			disabled |= sna_mode_shutdown_crtc(crtc);
+	}
+
+	for (o = 0; o < config->num_output; o++) {
+		xf86OutputPtr output = config->output[o];
+		struct sna_output *sna_output;
+
+		if (output->crtc)
+			continue;
+
+		sna_output = to_sna_output(output);
+		if (sna_output == NULL)
+			continue;
+
+		sna_output->dpms_mode = DPMSModeOff;
+	}
+
+	update_flush_interval(sna);
+
+	if (disabled)
+		xf86RandR12TellChanged(xf86ScrnToScreen(sna->scrn));
+}
+
+static bool
+sna_crtc_hide_planes(struct sna *sna, struct sna_crtc *crtc)
+{
+	struct local_mode_set_plane s;
+	struct plane *plane;
+
+	if (crtc->primary.id == 0)
+		return false;
+
+	memset(&s, 0, sizeof(s));
+	s.plane_id = crtc->primary.id;
+	if (drmIoctl(sna->kgem.fd, LOCAL_IOCTL_MODE_SETPLANE, &s))
+		return false;
+
+	list_for_each_entry(plane, &crtc->sprites, link) {
+		s.plane_id = plane->id;
+		(void)drmIoctl(sna->kgem.fd, LOCAL_IOCTL_MODE_SETPLANE, &s);
+	}
+
+	__sna_crtc_disable(sna, crtc);
+	return true;
+}
+
+void sna_mode_reset(struct sna *sna)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	int i;
+
+	if (sna->flags & SNA_IS_HOSTED)
+		return;
+
+	DBG(("%s\n", __FUNCTION__));
+
+	sna_disable_cursors(sna->scrn);
+	for (i = 0; i < sna->mode.num_real_crtc; i++)
+		if (!sna_crtc_hide_planes(sna, to_sna_crtc(config->crtc[i])))
+			sna_crtc_disable(config->crtc[i], true);
+	assert(sna->mode.front_active == 0);
+
+	for (i = 0; i < sna->mode.num_real_crtc; i++) {
+		struct sna_crtc *sna_crtc = to_sna_crtc(config->crtc[i]);
+		struct plane *plane;
+
+		assert(sna_crtc != NULL);
+
+		/* Force the rotation property to be reset on next use */
+		rotation_reset(&sna_crtc->primary);
+		list_for_each_entry(plane, &sna_crtc->sprites, link)
+			rotation_reset(plane);
+	}
+
+	/* VT switching, likely to be fbcon so make the backlight usable */
+	for (i = 0; i < sna->mode.num_real_output; i++) {
+		struct sna_output *sna_output = to_sna_output(config->output[i]);
+
+		assert(sna_output != NULL);
+		if (sna_output->dpms_mode != DPMSModeOff)
+			continue;
+
+		if (!sna_output->backlight.iface)
+			continue;
+
+		sna_output_backlight_set(sna_output,
+					 sna_output->backlight_active_level);
+	}
+
+	/* drain the event queue */
+	sna_mode_wakeup(sna);
+}
+
+static void transformed_box(BoxRec *box, xf86CrtcPtr crtc)
+{
+	box->x1 -= crtc->filter_width >> 1;
+	box->x2 += crtc->filter_width >> 1;
+	box->y1 -= crtc->filter_height >> 1;
+	box->y2 += crtc->filter_height >> 1;
+
+	pixman_f_transform_bounds(&crtc->f_framebuffer_to_crtc, box);
+
+	if (box->x1 < 0)
+		box->x1 = 0;
+	if (box->y1 < 0)
+		box->y1 = 0;
+	if (box->x2 > crtc->mode.HDisplay)
+		box->x2 = crtc->mode.HDisplay;
+	if (box->y2 > crtc->mode.VDisplay)
+		box->y2 = crtc->mode.VDisplay;
+}
+
+inline static DrawablePtr crtc_source(xf86CrtcPtr crtc, int16_t *sx, int16_t *sy)
+{
+	struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+	if (sna_crtc->slave_pixmap) {
+		DBG(("%s: using slave pixmap=%ld, offset (%d, %d)\n",
+		     __FUNCTION__,
+		     sna_crtc->slave_pixmap->drawable.serialNumber,
+		 -crtc->x, -crtc->y));
+		*sx = -crtc->x;
+		*sy = -crtc->y;
+		return &sna_crtc->slave_pixmap->drawable;
+	} else {
+		DBG(("%s: using Screen pixmap=%ld\n",
+		     __FUNCTION__,
+		     to_sna(crtc->scrn)->front->drawable.serialNumber));
+		*sx = *sy = 0;
+		return &to_sna(crtc->scrn)->front->drawable;
+	}
+}
+
+static void
+sna_crtc_redisplay__fallback(xf86CrtcPtr crtc, RegionPtr region, struct kgem_bo *bo)
+{
+	int16_t sx, sy;
+	struct sna *sna = to_sna(crtc->scrn);
+	ScreenPtr screen = xf86ScrnToScreen(crtc->scrn);
+	DrawablePtr draw = crtc_source(crtc, &sx, &sy);
+	PictFormatPtr format;
+	PictTransform T;
+	PicturePtr src, dst;
+	PixmapPtr pixmap;
+	int depth, error;
+	void *ptr;
+
+	DBG(("%s: compositing transformed damage boxes, target handle=%d\n", __FUNCTION__, bo->handle));
+
+	error = sna_render_format_for_depth(draw->depth);
+	depth = PIXMAN_FORMAT_DEPTH(error);
+	format = PictureMatchFormat(screen, depth, error);
+	if (format == NULL) {
+		DBG(("%s: can't find format for depth=%d [%08x]\n",
+		     __FUNCTION__, depth, error));
+		return;
+	}
+
+	DBG(("%s: dst format=%08x, depth=%d, bpp=%d, pitch=%d, size=%dx%d\n",
+	     __FUNCTION__, format->format, depth, draw->bitsPerPixel,
+	     bo->pitch, crtc->mode.HDisplay, crtc->mode.VDisplay));
+
+	if (sx | sy)
+		RegionTranslate(region, sx, sy);
+	error = !sna_drawable_move_region_to_cpu(draw, region, MOVE_READ);
+	if (sx | sy)
+		RegionTranslate(region, -sx, -sy);
+	if (error)
+		return;
+
+	ptr = kgem_bo_map__gtt(&sna->kgem, bo);
+	if (ptr == NULL)
+		return;
+
+	pixmap = sna_pixmap_create_unattached(screen, 0, 0, depth);
+	if (pixmap == NullPixmap)
+		return;
+
+	if (!screen->ModifyPixmapHeader(pixmap,
+					crtc->mode.HDisplay, crtc->mode.VDisplay,
+					depth, draw->bitsPerPixel,
+					bo->pitch, ptr))
+		goto free_pixmap;
+
+	src = CreatePicture(None, draw, format,
+			    0, NULL, serverClient, &error);
+	if (!src)
+		goto free_pixmap;
+
+	pixman_transform_init_translate(&T, sx << 16, sy << 16);
+	pixman_transform_multiply(&T, &T, &crtc->crtc_to_framebuffer);
+	if (!sna_transform_is_integer_translation(&T, &sx, &sy)) {
+#define f2d(x) (((double)(x))/65536.)
+		DBG(("%s: transform=[[%f %f %f], [%f %f %f], [%f %f %f]] (raw [[%x %x %x], [%x %x %x], [%x %x %x]])\n",
+		     __FUNCTION__,
+		     f2d(T.matrix[0][0]),
+		     f2d(T.matrix[0][1]),
+		     f2d(T.matrix[0][2]),
+		     f2d(T.matrix[1][0]),
+		     f2d(T.matrix[1][1]),
+		     f2d(T.matrix[1][2]),
+		     f2d(T.matrix[2][0]),
+		     f2d(T.matrix[2][1]),
+		     f2d(T.matrix[2][2]),
+		     T.matrix[0][0],
+		     T.matrix[0][1],
+		     T.matrix[0][2],
+		     T.matrix[1][0],
+		     T.matrix[1][1],
+		     T.matrix[1][2],
+		     T.matrix[2][0],
+		     T.matrix[2][1],
+		     T.matrix[2][2]));
+#undef f2d
+
+		error = SetPictureTransform(src, &T);
+		if (error)
+			goto free_src;
+		sx = sy = 0;
+	}
+
+	if (crtc->filter && crtc->transform_in_use)
+		SetPicturePictFilter(src, crtc->filter,
+				     crtc->params, crtc->nparams);
+
+	dst = CreatePicture(None, &pixmap->drawable, format,
+			    0, NULL, serverClient, &error);
+	if (!dst)
+		goto free_src;
+
+	kgem_bo_sync__gtt(&sna->kgem, bo);
+
+	if (sigtrap_get() == 0) { /* paranoia */
+		const BoxRec *b = region_rects(region);
+		int n = region_num_rects(region);
+		do {
+			BoxRec box;
+
+			box = *b++;
+			transformed_box(&box, crtc);
+
+			DBG(("%s: (%d, %d)x(%d, %d) -> (%d, %d), (%d, %d)\n",
+			     __FUNCTION__,
+			     b[-1].x1, b[-1].y1, b[-1].x2-b[-1].x1, b[-1].y2-b[-1].y1,
+			     box.x1, box.y1, box.x2, box.y2));
+
+			fbComposite(PictOpSrc, src, NULL, dst,
+				    box.x1 + sx, box.y1 + sy,
+				    0, 0,
+				    box.x1, box.y1,
+				    box.x2 - box.x1, box.y2 - box.y1);
+		} while (--n);
+		sigtrap_put();
+	}
+
+	FreePicture(dst, None);
+free_src:
+	FreePicture(src, None);
+free_pixmap:
+	screen->DestroyPixmap(pixmap);
+}
+
+static void
+sna_crtc_redisplay__composite(xf86CrtcPtr crtc, RegionPtr region, struct kgem_bo *bo)
+{
+	int16_t sx, sy;
+	struct sna *sna = to_sna(crtc->scrn);
+	ScreenPtr screen = xf86ScrnToScreen(crtc->scrn);
+	DrawablePtr draw = crtc_source(crtc, &sx, &sy);
+	struct sna_composite_op tmp;
+	PictFormatPtr format;
+	PictTransform T;
+	PicturePtr src, dst;
+	PixmapPtr pixmap;
+	const BoxRec *b;
+	int n, depth, error;
+
+	DBG(("%s: compositing transformed damage boxes\n", __FUNCTION__));
+
+	error = sna_render_format_for_depth(draw->depth);
+	depth = PIXMAN_FORMAT_DEPTH(error);
+	format = PictureMatchFormat(screen, depth, error);
+	if (format == NULL) {
+		DBG(("%s: can't find format for depth=%d [%08x]\n",
+		     __FUNCTION__, depth, error));
+		return;
+	}
+
+	DBG(("%s: dst format=%08x, depth=%d, bpp=%d, pitch=%d, size=%dx%d\n",
+	     __FUNCTION__, format->format, depth, draw->bitsPerPixel,
+	     bo->pitch, crtc->mode.HDisplay, crtc->mode.VDisplay));
+
+	pixmap = sna_pixmap_create_unattached(screen, 0, 0, depth);
+	if (pixmap == NullPixmap)
+		return;
+
+	if (!screen->ModifyPixmapHeader(pixmap,
+					crtc->mode.HDisplay, crtc->mode.VDisplay,
+					depth, draw->bitsPerPixel,
+					bo->pitch, NULL))
+		goto free_pixmap;
+
+	if (!sna_pixmap_attach_to_bo(pixmap, kgem_bo_reference(bo))) {
+		kgem_bo_destroy(&sna->kgem, bo);
+		goto free_pixmap;
+	}
+
+	src = CreatePicture(None, draw, format,
+			    0, NULL, serverClient, &error);
+	if (!src)
+		goto free_pixmap;
+
+	pixman_transform_init_translate(&T, sx << 16, sy << 16);
+	pixman_transform_multiply(&T, &T, &crtc->crtc_to_framebuffer);
+	if (!sna_transform_is_integer_translation(&T, &sx, &sy)) {
+		error = SetPictureTransform(src, &T);
+		if (error)
+			goto free_src;
+		sx = sy = 0;
+	}
+
+	if (crtc->filter && crtc->transform_in_use)
+		SetPicturePictFilter(src, crtc->filter,
+				     crtc->params, crtc->nparams);
+
+	dst = CreatePicture(None, &pixmap->drawable, format,
+			    0, NULL, serverClient, &error);
+	if (!dst)
+		goto free_src;
+
+	ValidatePicture(src);
+	ValidatePicture(dst);
+
+	/* Composite each box individually as if we are dealing with a rotation
+	 * on a large display, we may have to perform intermediate copies. We
+	 * can then minimise the overdraw by looking at individual boxes rather
+	 * than the bbox.
+	 */
+	n = region_num_rects(region);
+	b = region_rects(region);
+	do {
+		BoxRec box = *b;
+		transformed_box(&box, crtc);
+
+		DBG(("%s: (%d, %d)x(%d, %d) -> (%d, %d), (%d, %d)\n",
+		     __FUNCTION__,
+		     b->x1, b->y1, b->x2-b->x1, b->y2-b->y1,
+		     box.x1, box.y1, box.x2, box.y2));
+
+		if (!sna->render.composite(sna,
+					   PictOpSrc, src, NULL, dst,
+					   sx + box.x1, sy + box.y1,
+					   0, 0,
+					   box.x1, box.y1,
+					   box.x2 - box.x1, box.y2 - box.y1,
+					   0, memset(&tmp, 0, sizeof(tmp)))) {
+			DBG(("%s: unsupported operation!\n", __FUNCTION__));
+			sna_crtc_redisplay__fallback(crtc, region, bo);
+			break;
+		} else {
+			tmp.box(sna, &tmp, &box);
+			tmp.done(sna, &tmp);
+		}
+	} while (b++, --n);
+
+	FreePicture(dst, None);
+free_src:
+	FreePicture(src, None);
+free_pixmap:
+	screen->DestroyPixmap(pixmap);
+}
+
+static void
+sna_crtc_redisplay(xf86CrtcPtr crtc, RegionPtr region, struct kgem_bo *bo)
+{
+	int16_t tx, ty, sx, sy;
+	struct sna *sna = to_sna(crtc->scrn);
+	DrawablePtr draw = crtc_source(crtc, &sx, &sy);
+	struct sna_pixmap *priv = sna_pixmap((PixmapPtr)draw);
+
+	DBG(("%s: crtc %d [pipe=%d], damage (%d, %d), (%d, %d) x %d\n",
+	     __FUNCTION__, sna_crtc_id(crtc), sna_crtc_pipe(crtc),
+	     region->extents.x1, region->extents.y1,
+	     region->extents.x2, region->extents.y2,
+	     region_num_rects(region)));
+
+	if (wedged(sna))
+		goto fallback;
+
+	if (priv->clear) {
+		RegionRec whole;
+
+		DBG(("%s: clear damage boxes\n", __FUNCTION__));
+
+		if (sna_transform_is_integer_translation(&crtc->crtc_to_framebuffer,
+							 &tx, &ty)) {
+			RegionTranslate(region, -tx, -ty);
+		} else {
+			whole.extents = region->extents;
+			whole.data = NULL;
+			transformed_box(&whole.extents, crtc);
+			region = &whole;
+		}
+		if (sna_blt_fill_boxes(sna, GXcopy,
+				       bo, draw->bitsPerPixel,
+				       priv->clear_color,
+				       region_rects(region),
+				       region_num_rects(region)))
+			return;
+	}
+
+	if (crtc->filter == NULL &&
+	    priv->gpu_bo &&
+	    priv->cpu_damage == NULL &&
+	    sna_transform_is_integer_translation(&crtc->crtc_to_framebuffer,
+						 &tx, &ty)) {
+		DrawableRec tmp;
+
+		DBG(("%s: copy damage boxes\n", __FUNCTION__));
+
+		tmp.width = crtc->mode.HDisplay;
+		tmp.height = crtc->mode.VDisplay;
+		tmp.depth = sna->front->drawable.depth;
+		tmp.bitsPerPixel = sna->front->drawable.bitsPerPixel;
+
+		if (sna->render.copy_boxes(sna, GXcopy,
+					   draw, priv->gpu_bo, sx, sy,
+					   &tmp, bo, -tx, -ty,
+					   region_rects(region), region_num_rects(region), 0))
+			return;
+	}
+
+	if (can_render(sna)) {
+		sna_crtc_redisplay__composite(crtc, region, bo);
+		return;
+	}
+
+fallback:
+	sna_crtc_redisplay__fallback(crtc, region, bo);
+}
+
+static void shadow_flip_handler(struct drm_event_vblank *e,
+				void *data)
+{
+	struct sna *sna = data;
+
+	sna->timer_active |= 1 << FLUSH_TIMER;
+	sna->timer_expire[FLUSH_TIMER] =
+		e->tv_sec * 1000 + e->tv_usec / 1000 +
+		sna->vblank_interval / 2;
+}
+
+void sna_shadow_set_crtc(struct sna *sna,
+			 xf86CrtcPtr crtc,
+			 struct kgem_bo *bo)
+{
+	struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+	struct sna_pixmap *priv;
+
+	assert(sna_crtc);
+	DBG(("%s: setting shadow override for CRTC:%d to handle=%d\n",
+	     __FUNCTION__, __sna_crtc_id(sna_crtc), bo->handle));
+
+	assert(sna->flags & SNA_TEAR_FREE);
+	assert(!sna_crtc->transform);
+
+	if (sna_crtc->client_bo != bo) {
+		if (sna_crtc->client_bo) {
+			assert(sna_crtc->client_bo->refcnt >= sna_crtc->client_bo->active_scanout);
+			sna_crtc->client_bo->active_scanout--;
+			kgem_bo_destroy(&sna->kgem, sna_crtc->client_bo);
+		}
+
+		sna_crtc->client_bo = kgem_bo_reference(bo);
+		sna_crtc->client_bo->active_scanout++;
+		assert(sna_crtc->client_bo->refcnt >= sna_crtc->client_bo->active_scanout);
+		sna_crtc_damage(crtc);
+	}
+
+	list_move(&sna_crtc->shadow_link, &sna->mode.shadow_crtc);
+	sna->mode.shadow_dirty = true;
+
+	priv = sna_pixmap(sna->front);
+	assert(priv->gpu_bo);
+	priv->move_to_gpu = wait_for_shadow;
+	priv->move_to_gpu_data = sna;
+}
+
+void sna_shadow_steal_crtcs(struct sna *sna, struct list *list)
+{
+	list_init(list);
+	while (!list_is_empty(&sna->mode.shadow_crtc)) {
+		RegionRec sub, *damage;
+		struct sna_crtc *crtc =
+			list_first_entry(&sna->mode.shadow_crtc,
+					 struct sna_crtc,
+					 shadow_link);
+
+		damage = DamageRegion(sna->mode.shadow_damage);
+		sub.extents = crtc->base->bounds;
+		sub.data = NULL;
+		RegionSubtract(damage, damage, &sub);
+
+		list_move(&crtc->shadow_link, list);
+	}
+}
+
+void sna_shadow_unsteal_crtcs(struct sna *sna, struct list *list)
+{
+	while (!list_is_empty(list)) {
+		struct sna_crtc *crtc =
+			list_first_entry(list,
+					 struct sna_crtc,
+					 shadow_link);
+		assert(crtc->client_bo);
+		sna_shadow_set_crtc(sna, crtc->base, crtc->client_bo);
+	}
+}
+
+void sna_shadow_unset_crtc(struct sna *sna,
+			   xf86CrtcPtr crtc)
+{
+	struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+
+	DBG(("%s: clearin shadow override for CRTC:%d\n",
+	     __FUNCTION__, __sna_crtc_id(sna_crtc)));
+
+	if (sna_crtc->client_bo == NULL)
+		return;
+
+	assert(sna_crtc->client_bo->refcnt >= sna_crtc->client_bo->active_scanout);
+	sna_crtc->client_bo->active_scanout--;
+	kgem_bo_destroy(&sna->kgem, sna_crtc->client_bo);
+	sna_crtc->client_bo = NULL;
+	list_del(&sna_crtc->shadow_link);
+	sna->mode.shadow_dirty = true;
+
+	sna_crtc_damage(crtc);
+}
+
+static bool move_crtc_to_gpu(struct sna *sna)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	int i;
+
+	for (i = 0; i < sna->mode.num_real_crtc; i++) {
+		struct sna_crtc *crtc = to_sna_crtc(config->crtc[i]);
+		unsigned hint;
+
+		assert(crtc);
+
+		if (crtc->bo == NULL)
+			continue;
+
+		if (crtc->slave_pixmap)
+			continue;
+
+		if (crtc->client_bo)
+			continue;
+
+		if (crtc->shadow_bo)
+			continue;
+
+		hint = MOVE_READ | MOVE_ASYNC_HINT | __MOVE_SCANOUT;
+		if (sna->flags & SNA_TEAR_FREE)
+			hint |= __MOVE_FORCE;
+
+		DBG(("%s: CRTC %d [pipe=%d] requires frontbuffer\n",
+		     __FUNCTION__, __sna_crtc_id(crtc), __sna_crtc_pipe(crtc)));
+		return sna_pixmap_move_to_gpu(sna->front, hint);
+	}
+
+	return true;
+}
+
+void sna_mode_redisplay(struct sna *sna)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	RegionPtr region;
+	int i;
+
+	if (sna->mode.hidden) {
+		DBG(("%s: hidden outputs, skipping\n", __FUNCTION__));
+		return;
+	}
+
+	if (!sna->mode.shadow_enabled)
+		return;
+
+	assert(sna->mode.shadow_damage);
+
+	DBG(("%s: posting shadow damage? %d (flips pending? %d, mode reconfiguration pending? %d)\n",
+	     __FUNCTION__,
+	     !RegionNil(DamageRegion(sna->mode.shadow_damage)),
+	     sna->mode.flip_active,
+	     sna->mode.dirty));
+	assert((sna->flags & SNA_IS_HOSTED) == 0);
+	assert(sna->mode.shadow_active);
+
+	if (sna->mode.dirty)
+		return;
+
+	if (sna->mode.flip_active) {
+		DBG(("%s: %d outstanding flips\n",
+		     __FUNCTION__, sna->mode.flip_active));
+		return;
+	}
+
+	region = DamageRegion(sna->mode.shadow_damage);
+	if (RegionNil(region))
+		return;
+
+	DBG(("%s: damage: %dx(%d, %d), (%d, %d)\n",
+	     __FUNCTION__, region_num_rects(region),
+	     region->extents.x1, region->extents.y1,
+	     region->extents.x2, region->extents.y2));
+
+	if (!move_crtc_to_gpu(sna)) {
+		DBG(("%s: forcing scanout update using the CPU\n", __FUNCTION__));
+		if (!sna_pixmap_move_to_cpu(sna->front, MOVE_READ))
+			return;
+
+		for (i = 0; i < sna->mode.num_real_crtc; i++) {
+			xf86CrtcPtr crtc = config->crtc[i];
+			struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+			RegionRec damage;
+
+			assert(sna_crtc != NULL);
+			if (!sna_crtc->shadow)
+				continue;
+
+			assert(crtc->enabled);
+			assert(sna_crtc->transform || sna->flags & SNA_TEAR_FREE);
+
+			damage.extents = crtc->bounds;
+			damage.data = NULL;
+			RegionIntersect(&damage, &damage, region);
+			if (!box_empty(&damage.extents)) {
+				DBG(("%s: fallback intersects pipe=%d [(%d, %d), (%d, %d)]\n",
+				     __FUNCTION__, __sna_crtc_pipe(sna_crtc),
+				     damage.extents.x1, damage.extents.y1,
+				     damage.extents.x2, damage.extents.y2));
+
+				sna_crtc_redisplay__fallback(crtc,
+							     &damage,
+							     sna_crtc->bo);
+			}
+			RegionUninit(&damage);
+
+			if (sna_crtc->slave_damage)
+				DamageEmpty(sna_crtc->slave_damage);
+		}
+
+		RegionEmpty(region);
+		return;
+	}
+
+	{
+		struct sna_pixmap *priv;
+
+		priv = sna_pixmap(sna->front);
+		assert(priv != NULL);
+
+		if (priv->move_to_gpu) {
+			if (priv->move_to_gpu == wait_for_shadow &&
+			    !sna->mode.shadow_dirty) {
+				/* No damage written to new scanout
+				 * (backbuffer), ignore redisplay request
+				 * and continue with the current intact
+				 * scanout (frontbuffer).
+				 */
+				DBG(("%s: shadow idle, skipping update\n", __FUNCTION__));
+				RegionEmpty(region);
+				return;
+			}
+
+			(void)priv->move_to_gpu(sna, priv, 0);
+		}
+
+		assert(priv->move_to_gpu == NULL);
+	}
+
+	for (i = 0; i < sna->mode.num_real_crtc; i++) {
+		xf86CrtcPtr crtc = config->crtc[i];
+		struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+		RegionRec damage;
+		int sigio;
+
+		assert(sna_crtc != NULL);
+		DBG(("%s: crtc[%d] transformed? %d\n",
+		     __FUNCTION__, i, sna_crtc->transform));
+
+		if (!sna_crtc->transform)
+			continue;
+
+		assert(crtc->enabled);
+		assert(sna_crtc->bo);
+
+		damage.extents = crtc->bounds;
+		damage.data = NULL;
+
+		RegionIntersect(&damage, &damage, region);
+		DBG(("%s: crtc[%d] damage? %d[%d]: %dx[(%d, %d), (%d, %d)]\n",
+		     __FUNCTION__, i,
+		     !box_empty(&damage.extents), RegionNotEmpty(&damage),
+		     region_num_rects(&damage),
+		     damage.extents.x1, damage.extents.y1,
+		     damage.extents.x2, damage.extents.y2));
+		sigio = sigio_block();
+		if (!box_empty(&damage.extents)) {
+			if (sna->flags & SNA_TEAR_FREE) {
+				RegionRec new_damage;
+				struct drm_mode_crtc_page_flip arg;
+				struct kgem_bo *bo;
+
+				RegionNull(&new_damage);
+				RegionCopy(&new_damage, &damage);
+
+				bo = sna_crtc->cache_bo;
+				if (bo == NULL) {
+					damage.extents = crtc->bounds;
+					damage.data = NULL;
+					bo = kgem_create_2d(&sna->kgem,
+							    crtc->mode.HDisplay,
+							    crtc->mode.VDisplay,
+							    crtc->scrn->bitsPerPixel,
+							    sna_crtc->bo->tiling,
+							    CREATE_SCANOUT);
+					if (bo == NULL)
+						continue;
+				} else
+					RegionUnion(&damage, &damage, &sna_crtc->crtc_damage);
+				sna_crtc->crtc_damage = new_damage;
+
+				sna_crtc_redisplay(crtc, &damage, bo);
+				kgem_bo_submit(&sna->kgem, bo);
+				__kgem_bo_clear_dirty(bo);
+
+				assert_crtc_fb(sna, sna_crtc);
+				arg.crtc_id = __sna_crtc_id(sna_crtc);
+				arg.fb_id = get_fb(sna, bo,
+						   crtc->mode.HDisplay,
+						   crtc->mode.VDisplay);
+				if (arg.fb_id == 0)
+					goto disable1;
+
+				arg.user_data = (uintptr_t)sna_crtc;
+				arg.flags = DRM_MODE_PAGE_FLIP_EVENT;
+				arg.reserved = 0;
+
+				if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_PAGE_FLIP, &arg)) {
+					if (sna_crtc_flip(sna, sna_crtc, bo, 0, 0)) {
+						DBG(("%s: removing handle=%d [active_scanout=%d] from scanout, installing handle=%d [active_scanout=%d]\n",
+						     __FUNCTION__, sna_crtc->bo->handle, sna_crtc->bo->active_scanout - 1,
+						     bo->handle, bo->active_scanout));
+						assert(sna_crtc->bo->active_scanout);
+						assert(sna_crtc->bo->refcnt >= sna_crtc->bo->active_scanout);
+						sna_crtc->bo->active_scanout--;
+						kgem_bo_destroy(&sna->kgem, sna_crtc->bo);
+
+						sna_crtc->bo = kgem_bo_reference(bo);
+						sna_crtc->bo->active_scanout++;
+					} else {
+						BoxRec box;
+						DrawableRec tmp;
+
+						DBG(("%s: flip [fb=%d] on crtc %d [%d, pipe=%d] failed - %d\n",
+						     __FUNCTION__, arg.fb_id, i, __sna_crtc_id(sna_crtc), __sna_crtc_pipe(sna_crtc), errno));
+						xf86DrvMsg(sna->scrn->scrnIndex, X_ERROR,
+							   "Page flipping failed, disabling TearFree\n");
+						sna->flags &= ~SNA_TEAR_FREE;
+
+disable1:
+						box.x1 = 0;
+						box.y1 = 0;
+						tmp.width = box.x2 = crtc->mode.HDisplay;
+						tmp.height = box.y2 = crtc->mode.VDisplay;
+						tmp.depth = sna->front->drawable.depth;
+						tmp.bitsPerPixel = sna->front->drawable.bitsPerPixel;
+
+						if (!sna->render.copy_boxes(sna, GXcopy,
+									    &sna->front->drawable, bo, 0, 0,
+									    &tmp, sna_crtc->bo, 0, 0,
+									    &box, 1, COPY_LAST)) {
+							xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
+								   "%s: page flipping failed, disabling CRTC:%d (pipe=%d)\n",
+								   __FUNCTION__, __sna_crtc_id(sna_crtc), __sna_crtc_pipe(sna_crtc));
+							sna_crtc_disable(crtc, false);
+						}
+					}
+
+					kgem_bo_destroy(&sna->kgem, bo);
+					sna_crtc->cache_bo = NULL;
+					continue;
+				}
+				sna->mode.flip_active++;
+
+				assert(sna_crtc->flip_bo == NULL);
+				sna_crtc->flip_handler = shadow_flip_handler;
+				sna_crtc->flip_data = sna;
+				sna_crtc->flip_bo = bo;
+				sna_crtc->flip_bo->active_scanout++;
+				sna_crtc->flip_serial = sna_crtc->mode_serial;
+				sna_crtc->flip_pending = true;
+
+				if (sna_crtc->bo != sna->mode.shadow) {
+					assert_scanout(&sna->kgem, sna_crtc->bo,
+						       crtc->mode.HDisplay, crtc->mode.VDisplay);
+					sna_crtc->cache_bo = kgem_bo_reference(sna_crtc->bo);
+				}
+				DBG(("%s: recording flip on CRTC:%d handle=%d, active_scanout=%d, serial=%d\n",
+				     __FUNCTION__, __sna_crtc_id(sna_crtc), sna_crtc->flip_bo->handle, sna_crtc->flip_bo->active_scanout, sna_crtc->flip_serial));
+			} else {
+				sna_crtc_redisplay(crtc, &damage, sna_crtc->bo);
+				kgem_scanout_flush(&sna->kgem, sna_crtc->bo);
+			}
+		}
+		RegionUninit(&damage);
+		sigio_unblock(sigio);
+
+		if (sna_crtc->slave_damage)
+			DamageEmpty(sna_crtc->slave_damage);
+	}
+
+	if (sna->mode.shadow) {
+		struct kgem_bo *new = __sna_pixmap_get_bo(sna->front);
+		struct kgem_bo *old = sna->mode.shadow;
+		struct drm_mode_crtc_page_flip arg;
+		uint32_t fb = 0;
+		int sigio;
+
+		DBG(("%s: flipping TearFree outputs, current scanout handle=%d [active?=%d], new handle=%d [active=%d]\n",
+		     __FUNCTION__, old->handle, old->active_scanout, new->handle, new->active_scanout));
+
+		assert(new != old);
+		assert(new->refcnt);
+
+		arg.flags = DRM_MODE_PAGE_FLIP_EVENT;
+		arg.reserved = 0;
+
+		kgem_bo_submit(&sna->kgem, new);
+		__kgem_bo_clear_dirty(new);
+
+		sigio = sigio_block();
+		for (i = 0; i < sna->mode.num_real_crtc; i++) {
+			struct sna_crtc *crtc = config->crtc[i]->driver_private;
+			struct kgem_bo *flip_bo;
+			int x, y;
+
+			assert(crtc != NULL);
+			DBG(("%s: crtc %d [%d, pipe=%d] active? %d, transformed? %d\n",
+			     __FUNCTION__, i, __sna_crtc_id(crtc), __sna_crtc_pipe(crtc), crtc->bo ? crtc->bo->handle : 0, crtc->transform));
+			if (crtc->bo == NULL || crtc->transform)
+				continue;
+
+			assert(config->crtc[i]->enabled);
+			assert(crtc->flip_bo == NULL);
+			assert_crtc_fb(sna, crtc);
+
+			arg.crtc_id = __sna_crtc_id(crtc);
+			arg.user_data = (uintptr_t)crtc;
+
+			if (crtc->client_bo) {
+				DBG(("%s: apply shadow override bo for CRTC:%d on pipe=%d, handle=%d\n",
+				     __FUNCTION__, __sna_crtc_id(crtc), __sna_crtc_pipe(crtc), crtc->client_bo->handle));
+				arg.fb_id = get_fb(sna, crtc->client_bo,
+						   crtc->base->mode.HDisplay,
+						   crtc->base->mode.VDisplay);
+				assert(arg.fb_id != fb);
+				flip_bo = crtc->client_bo;
+				x = y = 0;
+			} else {
+				if (fb == 0)
+					fb = get_fb(sna, new, sna->scrn->virtualX, sna->scrn->virtualY);
+				if (fb == 0) {
+fixup_shadow:
+					if (sna_pixmap_move_to_gpu(sna->front, MOVE_READ | MOVE_ASYNC_HINT)) {
+						BoxRec box;
+
+						box.x1 = 0;
+						box.y1 = 0;
+						box.x2 = sna->scrn->virtualX;
+						box.y2 = sna->scrn->virtualY;
+						if (sna->render.copy_boxes(sna, GXcopy,
+									   &sna->front->drawable, __sna_pixmap_get_bo(sna->front), 0, 0,
+									   &sna->front->drawable, old, 0, 0,
+									   &box, 1, COPY_LAST)) {
+							kgem_submit(&sna->kgem);
+							RegionEmpty(region);
+						}
+					}
+
+					sigio_unblock(sigio);
+					return;
+				}
+
+				arg.fb_id = fb;
+				flip_bo = new;
+				x = crtc->base->x;
+				y = crtc->base->y;
+			}
+
+			if (crtc->bo == flip_bo) {
+				assert(crtc->bo->refcnt >= crtc->bo->active_scanout);
+				DBG(("%s: flip handle=%d is already on the CRTC\n",
+				     __FUNCTION__, flip_bo->handle));
+				continue;
+			}
+
+			if (flip_bo->pitch != crtc->bo->pitch || (y << 16 | x)  != crtc->offset) {
+				DBG(("%s: changing pitch (new %d =?= old %d) or offset (new %x =?= old %x)\n",
+				     __FUNCTION__,
+				     flip_bo->pitch, crtc->bo->pitch,
+				     y << 16 | x, crtc->offset));
+fixup_flip:
+				if (sna_crtc_flip(sna, crtc, flip_bo, x, y)) {
+					DBG(("%s: removing handle=%d [active_scanout=%d] from scanout, installing handle=%d [active_scanout=%d]\n",
+					     __FUNCTION__, crtc->bo->handle, crtc->bo->active_scanout-1,
+					     flip_bo->handle, flip_bo->active_scanout));
+					assert(flip_bo != crtc->bo);
+					assert(crtc->bo->active_scanout);
+					assert(crtc->bo->refcnt >= crtc->bo->active_scanout);
+					crtc->bo->active_scanout--;
+					kgem_bo_destroy(&sna->kgem, crtc->bo);
+
+					if (crtc->shadow_bo) {
+						kgem_bo_destroy(&sna->kgem, crtc->shadow_bo);
+						crtc->shadow_bo = NULL;
+					}
+
+					crtc->bo = kgem_bo_reference(flip_bo);
+					crtc->bo->active_scanout++;
+				} else {
+					if (sna->flags & SNA_TEAR_FREE) {
+						xf86DrvMsg(sna->scrn->scrnIndex, X_ERROR,
+								"Failed to prepare CRTC for page flipping, disabling TearFree\n");
+						sna->flags &= ~SNA_TEAR_FREE;
+					}
+
+					if (sna->mode.flip_active == 0) {
+						DBG(("%s: abandoning flip attempt\n", __FUNCTION__));
+						goto fixup_shadow;
+					}
+
+					xf86DrvMsg(sna->scrn->scrnIndex, X_ERROR,
+						   "%s: page flipping failed, disabling CRTC:%d (pipe=%d)\n",
+						   __FUNCTION__, __sna_crtc_id(crtc), __sna_crtc_pipe(crtc));
+					sna_crtc_disable(crtc->base, false);
+				}
+				continue;
+			}
+
+			if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_PAGE_FLIP, &arg)) {
+				ERR(("%s: flip [fb=%d] on crtc %d [%d, pipe=%d] failed - %d\n",
+				     __FUNCTION__, arg.fb_id, i, __sna_crtc_id(crtc), __sna_crtc_pipe(crtc), errno));
+				goto fixup_flip;
+			}
+			sna->mode.flip_active++;
+
+			assert(crtc->flip_bo == NULL);
+			crtc->flip_handler = shadow_flip_handler;
+			crtc->flip_data = sna;
+			crtc->flip_bo = kgem_bo_reference(flip_bo);
+			crtc->flip_bo->active_scanout++;
+			crtc->flip_serial = crtc->mode_serial;
+			crtc->flip_pending = true;
+
+			DBG(("%s: recording flip on CRTC:%d handle=%d, active_scanout=%d, serial=%d\n",
+			     __FUNCTION__, __sna_crtc_id(crtc), crtc->flip_bo->handle, crtc->flip_bo->active_scanout, crtc->flip_serial));
+
+			{
+				struct drm_i915_gem_busy busy = { .handle = flip_bo->handle, };
+				if (drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GEM_BUSY, &busy) == 0) {
+					if (busy.busy) {
+						int mode = KGEM_RENDER;
+						if (busy.busy & (0xfffe << 16))
+							mode = KGEM_BLT;
+						DBG(("%s: marking flip bo as busy [%x -> mode=%d]\n", __FUNCTION__, busy.busy, mode));
+						kgem_bo_mark_busy(&sna->kgem, flip_bo, mode);
+					} else
+						__kgem_bo_clear_busy(flip_bo);
+				}
+			}
+		}
+		sigio_unblock(sigio);
+
+		DBG(("%s: flipped %d outputs, shadow active? %d\n",
+		     __FUNCTION__,
+		     sna->mode.flip_active,
+		     sna->mode.shadow ? sna->mode.shadow->handle : 0));
+
+		if (sna->mode.flip_active) {
+			assert(old == sna->mode.shadow);
+			assert(old->refcnt >= 1);
+			set_shadow(sna, region);
+		}
+	} else
+		kgem_submit(&sna->kgem);
+
+	RegionEmpty(region);
+}
+
+int sna_mode_wakeup(struct sna *sna)
+{
+	bool defer_vblanks = sna->mode.flip_active && sna->mode.shadow_enabled;
+	char buffer[1024];
+	int len, i;
+	int ret = 0;
+
+again:
+	/* In order to workaround a kernel bug in not honouring O_NONBLOCK,
+	 * check that the fd is readable before attempting to read the next
+	 * event from drm.
+	 */
+	if (!event_pending(sna->kgem.fd))
+		goto done;
+
+	/* The DRM read semantics guarantees that we always get only
+	 * complete events.
+	 */
+	len = read(sna->kgem.fd, buffer, sizeof (buffer));
+	if (len < (int)sizeof(struct drm_event))
+		goto done;
+
+	/* Note that we cannot rely on the passed in struct sna matching
+	 * the struct sna used for the vblank event (in case it was submitted
+	 * by a different ZaphodHead). When processing the event, we must
+	 * ensure that we only use the pointer passed along with the event.
+	 */
+
+	DBG(("%s: len=%d\n", __FUNCTION__, len));
+
+	i = 0;
+	while (i < len) {
+		struct drm_event *e = (struct drm_event *)&buffer[i];
+		switch (e->type) {
+		case DRM_EVENT_VBLANK:
+			if (defer_vblanks)
+				defer_event(sna, e);
+			else if (((uintptr_t)((struct drm_event_vblank *)e)->user_data) & 2)
+				sna_present_vblank_handler((struct drm_event_vblank *)e);
+			else
+				sna_dri2_vblank_handler((struct drm_event_vblank *)e);
+			break;
+		case DRM_EVENT_FLIP_COMPLETE:
+			{
+				struct drm_event_vblank *vbl = (struct drm_event_vblank *)e;
+				struct sna_crtc *crtc = (void *)(uintptr_t)vbl->user_data;
+				uint64_t msc;
+
+				/* Beware Zaphod! */
+				sna = to_sna(crtc->base->scrn);
+
+				if (msc64(crtc, vbl->sequence, &msc)) {
+					DBG(("%s: recording last swap on pipe=%d, frame %d [%08llx], time %d.%06d\n",
+					     __FUNCTION__, __sna_crtc_pipe(crtc), vbl->sequence, (long long)msc, vbl->tv_sec, vbl->tv_usec));
+					crtc->swap.tv_sec = vbl->tv_sec;
+					crtc->swap.tv_usec = vbl->tv_usec;
+					crtc->swap.msc = msc;
+				}
+				assert(crtc->flip_pending);
+				crtc->flip_pending = false;
+
+				assert(crtc->flip_bo);
+				assert(crtc->flip_bo->active_scanout);
+				assert(crtc->flip_bo->refcnt >= crtc->flip_bo->active_scanout);
+
+				if (crtc->flip_serial == crtc->mode_serial) {
+					DBG(("%s: removing handle=%d [active_scanout=%d] from scanout, installing handle=%d [active_scanout=%d]\n",
+					     __FUNCTION__, crtc->bo->handle, crtc->bo->active_scanout - 1,
+					     crtc->flip_bo->handle, crtc->flip_bo->active_scanout));
+					assert(crtc->bo->active_scanout);
+					assert(crtc->bo->refcnt >= crtc->bo->active_scanout);
+
+					crtc->bo->active_scanout--;
+					kgem_bo_destroy(&sna->kgem, crtc->bo);
+
+					if (crtc->shadow_bo) {
+						kgem_bo_destroy(&sna->kgem, crtc->shadow_bo);
+						crtc->shadow_bo = NULL;
+					}
+
+					crtc->bo = crtc->flip_bo;
+					crtc->flip_bo = NULL;
+
+					assert_crtc_fb(sna, crtc);
+				} else {
+					crtc->flip_bo->active_scanout--;
+					kgem_bo_destroy(&sna->kgem, crtc->flip_bo);
+					crtc->flip_bo = NULL;
+				}
+
+				DBG(("%s: flip complete, pending? %d\n", __FUNCTION__, sna->mode.flip_active));
+				assert(sna->mode.flip_active);
+				if (--sna->mode.flip_active == 0) {
+					assert(crtc->flip_handler);
+					crtc->flip_handler(vbl, crtc->flip_data);
+				}
+			}
+			break;
+		default:
+			break;
+		}
+		i += e->length;
+		ret++;
+	}
+
+	goto again;
+
+done:
+	flush_events(sna);
+	return ret;
+}
Index: driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch/xf86-video-intel-2.99.917.2-new/src/sna
===================================================================
--- driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch/xf86-video-intel-2.99.917.2-new/src/sna	(nonexistent)
+++ driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch/xf86-video-intel-2.99.917.2-new/src/sna	(revision 5)

Property changes on: driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch/xf86-video-intel-2.99.917.2-new/src/sna
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch/xf86-video-intel-2.99.917.2-new/src
===================================================================
--- driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch/xf86-video-intel-2.99.917.2-new/src	(nonexistent)
+++ driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch/xf86-video-intel-2.99.917.2-new/src	(revision 5)

Property changes on: driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch/xf86-video-intel-2.99.917.2-new/src
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch/xf86-video-intel-2.99.917.2-new
===================================================================
--- driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch/xf86-video-intel-2.99.917.2-new	(nonexistent)
+++ driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch/xf86-video-intel-2.99.917.2-new	(revision 5)

Property changes on: driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch/xf86-video-intel-2.99.917.2-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch
===================================================================
--- driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch	(nonexistent)
+++ driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch	(revision 5)

Property changes on: driver/xf86-video-intel/create-2.99.917.2-sna-output-attach-edid-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch/create.patch.sh
===================================================================
--- driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch/create.patch.sh	(nonexistent)
+++ driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=2.99.917.2
+
+tar --files-from=file.list -xjvf ../xf86-video-intel-$VERSION.tar.bz2
+mv xf86-video-intel-$VERSION xf86-video-intel-$VERSION-orig
+
+cp -rf ./xf86-video-intel-$VERSION-new ./xf86-video-intel-$VERSION
+
+diff --unified -Nr  xf86-video-intel-$VERSION-orig  xf86-video-intel-$VERSION > xf86-video-intel-$VERSION-sna-video-definitions.patch
+
+mv xf86-video-intel-$VERSION-sna-video-definitions.patch ../patches
+
+rm -rf ./xf86-video-intel-$VERSION
+rm -rf ./xf86-video-intel-$VERSION-orig

Property changes on: driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch/file.list
===================================================================
--- driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch/file.list	(nonexistent)
+++ driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch/file.list	(revision 5)
@@ -0,0 +1 @@
+xf86-video-intel-2.99.917.2/src/sna/sna_video.h
Index: driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch/xf86-video-intel-2.99.917.2-new/src/sna/sna_video.h
===================================================================
--- driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch/xf86-video-intel-2.99.917.2-new/src/sna/sna_video.h	(nonexistent)
+++ driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch/xf86-video-intel-2.99.917.2-new/src/sna/sna_video.h	(revision 5)
@@ -0,0 +1,290 @@
+/***************************************************************************
+
+Copyright 2000 Intel Corporation.  All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL INTEL, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+#ifndef SNA_VIDEO_H
+#define SNA_VIDEO_H
+
+#include <xf86_OSproc.h>
+#include <xf86xv.h>
+#include <fourcc.h>
+
+#if defined(XvMCExtension) && defined(ENABLE_XVMC)
+#define SNA_XVMC 1
+#endif
+
+#if defined( FOURCC_NV12 )
+#undef FOURCC_NV12
+#endif
+
+#if defined( XVIMAGE_NV12 )
+#undef XVIMAGE_NV12
+#endif
+
+#define FOURCC_XVMC (('C' << 24) + ('M' << 16) + ('V' << 8) + 'X')
+#define FOURCC_RGB565 ((16 << 24) + ('B' << 16) + ('G' << 8) + 'R')
+#define FOURCC_RGB888 ((24 << 24) + ('B' << 16) + ('G' << 8) + 'R')
+#define FOURCC_NV12 (('2' << 24) + ('1' << 16) + ('V' << 8) + 'N')
+#define FOURCC_AYUV (('V' << 24) + ('U' << 16) + ('Y' << 8) + 'A')
+
+/*
+ * Below, a dummy picture type that is used in XvPutImage
+ * only to do an overlay update.
+ * Introduced for the XvMC client lib.
+ * Defined to have a zero data size.
+ */
+#define XVMC_YUV { \
+	FOURCC_XVMC, XvYUV, LSBFirst, \
+	{'X', 'V', 'M', 'C', 0x00, 0x00, 0x00, 0x10, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}, \
+	12, XvPlanar, 3, 0, 0, 0, 0, 8, 8, 8, 1, 2, 2, 1, 2, 2, \
+	{'Y', 'V', 'U', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, \
+	XvTopToBottom \
+}
+
+#define XVMC_RGB565 { \
+	FOURCC_RGB565, XvRGB, LSBFirst, \
+	{'P', 'A', 'S', 'S', 'T', 'H', 'R', 'O', 'U', 'G', 'H', 'R', 'G', 'B', '1', '6'}, \
+	16, XvPacked, 1, 16, 0x1f<<11, 0x3f<<5, 0x1f<<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
+	{'B', 'G', 'R', 'X', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, \
+	XvTopToBottom \
+}
+
+#define XVMC_RGB888 { \
+	FOURCC_RGB888, XvRGB, LSBFirst, \
+	{'P', 'A', 'S', 'S', 'T', 'H', 'R', 'O', 'U', 'G', 'H', 'R', 'G', 'B', '2', '4'}, \
+	32, XvPacked, 1, 24, 0xff<<16, 0xff<<8, 0xff<<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
+	{'B', 'G', 'R', 'X', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, \
+	XvTopToBottom \
+}
+
+/* no standard define for this */
+#define XVIMAGE_NV12 { \
+	FOURCC_NV12, XvYUV, LSBFirst,				\
+	{'N','V','1','2', 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
+	12, XvPlanar, 2, 0, 0, 0, 0, 8, 8, 8, 1, 2, 2, 1, 2, 2, \
+	{'Y','U','V', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, \
+	XvTopToBottom \
+}
+
+#define XVIMAGE_AYUV { \
+	FOURCC_AYUV, XvYUV, LSBFirst, \
+	{'A', 'Y', 'U', 'V', 0x00, 0x00, 0x00, 0x10, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}, \
+	32, XvPacked, 1, 0, 0, 0, 0, 8, 8, 8, 1, 1, 1, 1, 1, 1, \
+	{'A', 'Y', 'U', 'V', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, \
+	XvTopToBottom \
+}
+
+struct sna_video {
+	struct sna *sna;
+
+	int idx; /* XXX expose struct plane instead? */
+
+	int brightness;
+	int contrast;
+	int saturation;
+	xf86CrtcPtr desired_crtc;
+
+	uint32_t gamma0;
+	uint32_t gamma1;
+	uint32_t gamma2;
+	uint32_t gamma3;
+	uint32_t gamma4;
+	uint32_t gamma5;
+
+	unsigned color_key;
+	unsigned color_key_changed;
+	bool has_color_key;
+
+	unsigned colorspace;
+	unsigned colorspace_changed;
+
+	/** YUV data buffers */
+	struct kgem_bo *old_buf[2];
+	struct kgem_bo *buf;
+	int width, height, format;
+
+	int alignment;
+	bool tiled;
+	bool textured;
+
+	struct kgem_bo *bo[4];
+	RegionRec clip;
+
+	int SyncToVblank;	/* -1: auto, 0: off, 1: on */
+	int AlwaysOnTop;
+};
+
+struct sna_video_frame {
+	struct kgem_bo *bo;
+	uint32_t id;
+	uint32_t size;
+	uint32_t UBufOffset;
+	uint32_t VBufOffset;
+	Rotation rotation;
+
+	uint16_t width, height;
+	uint16_t pitch[2];
+
+	/* extents */
+	BoxRec image;
+	BoxRec src;
+};
+
+static inline XvScreenPtr to_xv(ScreenPtr screen)
+{
+	return dixLookupPrivate(&screen->devPrivates, XvGetScreenKey());
+}
+
+void sna_video_init(struct sna *sna, ScreenPtr screen);
+void sna_video_overlay_setup(struct sna *sna, ScreenPtr screen);
+void sna_video_sprite_setup(struct sna *sna, ScreenPtr screen);
+void sna_video_textured_setup(struct sna *sna, ScreenPtr screen);
+void sna_video_destroy_window(WindowPtr win);
+void sna_video_close(struct sna *sna);
+
+XvAdaptorPtr sna_xv_adaptor_alloc(struct sna *sna);
+int sna_xv_fixup_formats(ScreenPtr screen,
+			 XvFormatPtr formats,
+			 int num_formats);
+int sna_xv_alloc_port(unsigned long port, XvPortPtr in, XvPortPtr *out);
+int sna_xv_free_port(XvPortPtr port);
+
+static inline int xvmc_passthrough(int id)
+{
+	switch (id) {
+	case FOURCC_XVMC:
+	case FOURCC_RGB565:
+	case FOURCC_RGB888:
+		return true;
+	default:
+		return false;
+	}
+}
+
+static inline int is_planar_fourcc(int id)
+{
+	switch (id) {
+	case FOURCC_YV12:
+	case FOURCC_I420:
+	case FOURCC_XVMC:
+	case FOURCC_NV12:
+		return 1;
+	default:
+		return 0;
+	}
+}
+
+static inline int is_nv12_fourcc(int id)
+{
+	switch (id) {
+	case FOURCC_NV12:
+		return 1;
+	default:
+		return 0;
+	}
+}
+
+static inline int is_ayuv_fourcc(int id)
+{
+	switch (id) {
+	case FOURCC_AYUV:
+		return 1;
+	default:
+		return 0;
+	}
+}
+
+bool
+sna_video_clip_helper(struct sna_video *video,
+		      struct sna_video_frame *frame,
+		      xf86CrtcPtr *crtc_ret,
+		      BoxPtr dst,
+		      short src_x, short src_y,
+		      short drw_x, short drw_y,
+		      short src_w, short src_h,
+		      short drw_w, short drw_h,
+		      RegionPtr reg);
+
+void
+sna_video_frame_init(struct sna_video *video,
+		     int id, short width, short height,
+		     struct sna_video_frame *frame);
+
+void
+sna_video_frame_set_rotation(struct sna_video *video,
+			     struct sna_video_frame *frame,
+			     Rotation rotation);
+
+struct kgem_bo *
+sna_video_buffer(struct sna_video *video,
+		 struct sna_video_frame *frame);
+
+bool
+sna_video_copy_data(struct sna_video *video,
+		    struct sna_video_frame *frame,
+		    const uint8_t *buf);
+void
+sna_video_fill_colorkey(struct sna_video *video,
+			const RegionRec *clip);
+
+void sna_video_buffer_fini(struct sna_video *video);
+
+void sna_video_free_buffers(struct sna_video *video);
+
+static inline XvPortPtr
+sna_window_get_port(WindowPtr window)
+{
+	return ((void **)__get_private(window, sna_window_key))[2];
+}
+
+static inline void
+sna_window_set_port(WindowPtr window, XvPortPtr port)
+{
+	((void **)__get_private(window, sna_window_key))[2] = port;
+}
+
+static inline int offset_and_clip(int x, int dx)
+{
+	x += dx;
+	if (x <= 0)
+		return 0;
+	if (x >= MAXSHORT)
+		return MAXSHORT;
+	return x;
+}
+
+static inline void init_video_region(RegionRec *region,
+				     DrawablePtr draw,
+				     int drw_x, int drw_y,
+				     int drw_w, int drw_h)
+{
+	region->extents.x1 = offset_and_clip(draw->x, drw_x);
+	region->extents.y1 = offset_and_clip(draw->y, drw_y);
+	region->extents.x2 = offset_and_clip(draw->x, drw_x + drw_w);
+	region->extents.y2 = offset_and_clip(draw->y, drw_y + drw_h);
+	region->data = NULL;
+}
+
+#endif /* SNA_VIDEO_H */
Index: driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch/xf86-video-intel-2.99.917.2-new/src/sna
===================================================================
--- driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch/xf86-video-intel-2.99.917.2-new/src/sna	(nonexistent)
+++ driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch/xf86-video-intel-2.99.917.2-new/src/sna	(revision 5)

Property changes on: driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch/xf86-video-intel-2.99.917.2-new/src/sna
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch/xf86-video-intel-2.99.917.2-new/src
===================================================================
--- driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch/xf86-video-intel-2.99.917.2-new/src	(nonexistent)
+++ driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch/xf86-video-intel-2.99.917.2-new/src	(revision 5)

Property changes on: driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch/xf86-video-intel-2.99.917.2-new/src
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch/xf86-video-intel-2.99.917.2-new
===================================================================
--- driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch/xf86-video-intel-2.99.917.2-new	(nonexistent)
+++ driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch/xf86-video-intel-2.99.917.2-new	(revision 5)

Property changes on: driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch/xf86-video-intel-2.99.917.2-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch
===================================================================
--- driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch	(nonexistent)
+++ driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch	(revision 5)

Property changes on: driver/xf86-video-intel/create-2.99.917.2-sna-video-definitions-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-intel/patches/README
===================================================================
--- driver/xf86-video-intel/patches/README	(nonexistent)
+++ driver/xf86-video-intel/patches/README	(revision 5)
@@ -0,0 +1,6 @@
+
+/* begin *
+
+   TODO: Leave some comment here.
+
+ * end */
Index: driver/xf86-video-intel/patches
===================================================================
--- driver/xf86-video-intel/patches	(nonexistent)
+++ driver/xf86-video-intel/patches	(revision 5)

Property changes on: driver/xf86-video-intel/patches
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-intel
===================================================================
--- driver/xf86-video-intel	(nonexistent)
+++ driver/xf86-video-intel	(revision 5)

Property changes on: driver/xf86-video-intel
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-mach64/Makefile
===================================================================
--- driver/xf86-video-mach64/Makefile	(nonexistent)
+++ driver/xf86-video-mach64/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-mach64
+
+versions    = 6.9.7
+pkgname     = xf86-video-mach64
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-mach64
===================================================================
--- driver/xf86-video-mach64	(nonexistent)
+++ driver/xf86-video-mach64	(revision 5)

Property changes on: driver/xf86-video-mach64
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-mga/Makefile
===================================================================
--- driver/xf86-video-mga/Makefile	(nonexistent)
+++ driver/xf86-video-mga/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-mga
+
+versions    = 2.0.1
+pkgname     = xf86-video-mga
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-mga
===================================================================
--- driver/xf86-video-mga	(nonexistent)
+++ driver/xf86-video-mga	(revision 5)

Property changes on: driver/xf86-video-mga
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-modesetting/Makefile
===================================================================
--- driver/xf86-video-modesetting/Makefile	(nonexistent)
+++ driver/xf86-video-modesetting/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-modesetting
+
+versions    = 0.9.0
+pkgname     = xf86-video-modesetting
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-modesetting
===================================================================
--- driver/xf86-video-modesetting	(nonexistent)
+++ driver/xf86-video-modesetting	(revision 5)

Property changes on: driver/xf86-video-modesetting
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-neomagic/Makefile
===================================================================
--- driver/xf86-video-neomagic/Makefile	(nonexistent)
+++ driver/xf86-video-neomagic/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-neomagic
+
+versions    = 1.3.0
+pkgname     = xf86-video-neomagic
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-neomagic
===================================================================
--- driver/xf86-video-neomagic	(nonexistent)
+++ driver/xf86-video-neomagic	(revision 5)

Property changes on: driver/xf86-video-neomagic
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-newport/Makefile
===================================================================
--- driver/xf86-video-newport/Makefile	(nonexistent)
+++ driver/xf86-video-newport/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-newport
+
+versions    = 0.2.4
+pkgname     = xf86-video-newport
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-newport
===================================================================
--- driver/xf86-video-newport	(nonexistent)
+++ driver/xf86-video-newport	(revision 5)

Property changes on: driver/xf86-video-newport
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-nouveau/Makefile
===================================================================
--- driver/xf86-video-nouveau/Makefile	(nonexistent)
+++ driver/xf86-video-nouveau/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-nouveau
+
+versions    = 1.0.17
+pkgname     = xf86-video-nouveau
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-nouveau
===================================================================
--- driver/xf86-video-nouveau	(nonexistent)
+++ driver/xf86-video-nouveau	(revision 5)

Property changes on: driver/xf86-video-nouveau
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-nv/Makefile
===================================================================
--- driver/xf86-video-nv/Makefile	(nonexistent)
+++ driver/xf86-video-nv/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-nv
+
+versions    = 2.1.22
+pkgname     = xf86-video-nv
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-nv
===================================================================
--- driver/xf86-video-nv	(nonexistent)
+++ driver/xf86-video-nv	(revision 5)

Property changes on: driver/xf86-video-nv
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-omap/Makefile
===================================================================
--- driver/xf86-video-omap/Makefile	(nonexistent)
+++ driver/xf86-video-omap/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-omap
+
+versions    = 0.4.5
+pkgname     = xf86-video-omap
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-omap
===================================================================
--- driver/xf86-video-omap	(nonexistent)
+++ driver/xf86-video-omap	(revision 5)

Property changes on: driver/xf86-video-omap
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-openchrome/Makefile
===================================================================
--- driver/xf86-video-openchrome/Makefile	(nonexistent)
+++ driver/xf86-video-openchrome/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-openchrome
+
+versions    = 0.6.0
+pkgname     = xf86-video-openchrome
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-openchrome
===================================================================
--- driver/xf86-video-openchrome	(nonexistent)
+++ driver/xf86-video-openchrome	(revision 5)

Property changes on: driver/xf86-video-openchrome
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-r128/Makefile
===================================================================
--- driver/xf86-video-r128/Makefile	(nonexistent)
+++ driver/xf86-video-r128/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-r128
+
+versions    = 6.12.1
+pkgname     = xf86-video-r128
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-r128
===================================================================
--- driver/xf86-video-r128	(nonexistent)
+++ driver/xf86-video-r128	(revision 5)

Property changes on: driver/xf86-video-r128
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-rendition/Makefile
===================================================================
--- driver/xf86-video-rendition/Makefile	(nonexistent)
+++ driver/xf86-video-rendition/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-rendition
+
+versions    = 4.2.7
+pkgname     = xf86-video-rendition
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-rendition
===================================================================
--- driver/xf86-video-rendition	(nonexistent)
+++ driver/xf86-video-rendition	(revision 5)

Property changes on: driver/xf86-video-rendition
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-s3/Makefile
===================================================================
--- driver/xf86-video-s3/Makefile	(nonexistent)
+++ driver/xf86-video-s3/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-s3
+
+versions    = 0.7.0
+pkgname     = xf86-video-s3
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-s3
===================================================================
--- driver/xf86-video-s3	(nonexistent)
+++ driver/xf86-video-s3	(revision 5)

Property changes on: driver/xf86-video-s3
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-s3virge/Makefile
===================================================================
--- driver/xf86-video-s3virge/Makefile	(nonexistent)
+++ driver/xf86-video-s3virge/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-s3virge
+
+versions    = 1.11.0
+pkgname     = xf86-video-s3virge
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-s3virge
===================================================================
--- driver/xf86-video-s3virge	(nonexistent)
+++ driver/xf86-video-s3virge	(revision 5)

Property changes on: driver/xf86-video-s3virge
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-savage/Makefile
===================================================================
--- driver/xf86-video-savage/Makefile	(nonexistent)
+++ driver/xf86-video-savage/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-savage
+
+versions    = 2.3.9
+pkgname     = xf86-video-savage
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-savage
===================================================================
--- driver/xf86-video-savage	(nonexistent)
+++ driver/xf86-video-savage	(revision 5)

Property changes on: driver/xf86-video-savage
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-siliconmotion/Makefile
===================================================================
--- driver/xf86-video-siliconmotion/Makefile	(nonexistent)
+++ driver/xf86-video-siliconmotion/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-siliconmotion
+
+versions    = 1.7.9
+pkgname     = xf86-video-siliconmotion
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-siliconmotion
===================================================================
--- driver/xf86-video-siliconmotion	(nonexistent)
+++ driver/xf86-video-siliconmotion	(revision 5)

Property changes on: driver/xf86-video-siliconmotion
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-sis/Makefile
===================================================================
--- driver/xf86-video-sis/Makefile	(nonexistent)
+++ driver/xf86-video-sis/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-sis
+
+versions    = 0.12.0
+pkgname     = xf86-video-sis
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-sis
===================================================================
--- driver/xf86-video-sis	(nonexistent)
+++ driver/xf86-video-sis	(revision 5)

Property changes on: driver/xf86-video-sis
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-sisusb/Makefile
===================================================================
--- driver/xf86-video-sisusb/Makefile	(nonexistent)
+++ driver/xf86-video-sisusb/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-sisusb
+
+versions    = 0.9.7
+pkgname     = xf86-video-sisusb
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-sisusb
===================================================================
--- driver/xf86-video-sisusb	(nonexistent)
+++ driver/xf86-video-sisusb	(revision 5)

Property changes on: driver/xf86-video-sisusb
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-suncg6/Makefile
===================================================================
--- driver/xf86-video-suncg6/Makefile	(nonexistent)
+++ driver/xf86-video-suncg6/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-suncg6
+
+versions    = 1.1.3
+pkgname     = xf86-video-suncg6
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-suncg6
===================================================================
--- driver/xf86-video-suncg6	(nonexistent)
+++ driver/xf86-video-suncg6	(revision 5)

Property changes on: driver/xf86-video-suncg6
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-sunffb/Makefile
===================================================================
--- driver/xf86-video-sunffb/Makefile	(nonexistent)
+++ driver/xf86-video-sunffb/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-sunffb
+
+versions    = 1.2.3
+pkgname     = xf86-video-sunffb
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-sunffb
===================================================================
--- driver/xf86-video-sunffb	(nonexistent)
+++ driver/xf86-video-sunffb	(revision 5)

Property changes on: driver/xf86-video-sunffb
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-tdfx/Makefile
===================================================================
--- driver/xf86-video-tdfx/Makefile	(nonexistent)
+++ driver/xf86-video-tdfx/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-tdfx
+
+versions    = 1.5.0
+pkgname     = xf86-video-tdfx
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-tdfx
===================================================================
--- driver/xf86-video-tdfx	(nonexistent)
+++ driver/xf86-video-tdfx	(revision 5)

Property changes on: driver/xf86-video-tdfx
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-tga/Makefile
===================================================================
--- driver/xf86-video-tga/Makefile	(nonexistent)
+++ driver/xf86-video-tga/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-tga
+
+versions    = 1.2.2
+pkgname     = xf86-video-tga
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-tga
===================================================================
--- driver/xf86-video-tga	(nonexistent)
+++ driver/xf86-video-tga	(revision 5)

Property changes on: driver/xf86-video-tga
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-trident/Makefile
===================================================================
--- driver/xf86-video-trident/Makefile	(nonexistent)
+++ driver/xf86-video-trident/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-trident
+
+versions    = 1.3.8
+pkgname     = xf86-video-trident
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-trident
===================================================================
--- driver/xf86-video-trident	(nonexistent)
+++ driver/xf86-video-trident	(revision 5)

Property changes on: driver/xf86-video-trident
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-tseng/Makefile
===================================================================
--- driver/xf86-video-tseng/Makefile	(nonexistent)
+++ driver/xf86-video-tseng/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-tseng
+
+versions    = 1.2.5
+pkgname     = xf86-video-tseng
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-tseng
===================================================================
--- driver/xf86-video-tseng	(nonexistent)
+++ driver/xf86-video-tseng	(revision 5)

Property changes on: driver/xf86-video-tseng
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-v4l/Makefile
===================================================================
--- driver/xf86-video-v4l/Makefile	(nonexistent)
+++ driver/xf86-video-v4l/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-v4l
+
+versions    = 0.3.0
+pkgname     = xf86-video-v4l
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-v4l
===================================================================
--- driver/xf86-video-v4l	(nonexistent)
+++ driver/xf86-video-v4l	(revision 5)

Property changes on: driver/xf86-video-v4l
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-vboxvideo/Makefile
===================================================================
--- driver/xf86-video-vboxvideo/Makefile	(nonexistent)
+++ driver/xf86-video-vboxvideo/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-vboxvideo
+
+versions    = 1.0.0
+pkgname     = xf86-video-vboxvideo
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-vboxvideo
===================================================================
--- driver/xf86-video-vboxvideo	(nonexistent)
+++ driver/xf86-video-vboxvideo	(revision 5)

Property changes on: driver/xf86-video-vboxvideo
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-vesa/Makefile
===================================================================
--- driver/xf86-video-vesa/Makefile	(nonexistent)
+++ driver/xf86-video-vesa/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-vesa
+
+versions    = 2.6.0
+pkgname     = xf86-video-vesa
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-vesa
===================================================================
--- driver/xf86-video-vesa	(nonexistent)
+++ driver/xf86-video-vesa	(revision 5)

Property changes on: driver/xf86-video-vesa
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-vmware/Makefile
===================================================================
--- driver/xf86-video-vmware/Makefile	(nonexistent)
+++ driver/xf86-video-vmware/Makefile	(revision 5)
@@ -0,0 +1,56 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-vmware
+
+versions    = 13.3.0
+pkgname     = xf86-video-vmware
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+patches     = $(CURDIR)/patches/xf86-video-vmware-13.0.2-xorg.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-13.0.2-xorg-patch ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s) $(patches)
Index: driver/xf86-video-vmware
===================================================================
--- driver/xf86-video-vmware	(nonexistent)
+++ driver/xf86-video-vmware	(revision 5)

Property changes on: driver/xf86-video-vmware
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-voodoo/Makefile
===================================================================
--- driver/xf86-video-voodoo/Makefile	(nonexistent)
+++ driver/xf86-video-voodoo/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-voodoo
+
+versions    = 1.2.6
+pkgname     = xf86-video-voodoo
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-voodoo
===================================================================
--- driver/xf86-video-voodoo	(nonexistent)
+++ driver/xf86-video-voodoo	(revision 5)

Property changes on: driver/xf86-video-voodoo
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-wsfb/Makefile
===================================================================
--- driver/xf86-video-wsfb/Makefile	(nonexistent)
+++ driver/xf86-video-wsfb/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-wsfb
+
+versions    = 0.4.0
+pkgname     = xf86-video-wsfb
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-wsfb
===================================================================
--- driver/xf86-video-wsfb	(nonexistent)
+++ driver/xf86-video-wsfb	(revision 5)

Property changes on: driver/xf86-video-wsfb
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-xgi/Makefile
===================================================================
--- driver/xf86-video-xgi/Makefile	(nonexistent)
+++ driver/xf86-video-xgi/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-xgi
+
+versions    = 1.6.1
+pkgname     = xf86-video-xgi
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-xgi
===================================================================
--- driver/xf86-video-xgi	(nonexistent)
+++ driver/xf86-video-xgi	(revision 5)

Property changes on: driver/xf86-video-xgi
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver/xf86-video-xgixp/Makefile
===================================================================
--- driver/xf86-video-xgixp/Makefile	(nonexistent)
+++ driver/xf86-video-xgixp/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/driver/xf86-video-xgixp
+
+versions    = 1.8.1
+pkgname     = xf86-video-xgixp
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: driver/xf86-video-xgixp
===================================================================
--- driver/xf86-video-xgixp	(nonexistent)
+++ driver/xf86-video-xgixp	(revision 5)

Property changes on: driver/xf86-video-xgixp
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: driver
===================================================================
--- driver	(nonexistent)
+++ driver	(revision 5)

Property changes on: driver
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/Makefile
===================================================================
--- font/Makefile	(nonexistent)
+++ font/Makefile	(revision 5)
@@ -0,0 +1,13 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+SOURCE_REQUIRES += ALL_DIRS
+
+
+include ../../../build-system/core.mk
+
+
+download_clean:
+	@true
+
+.PHONY: download_clean
Index: font/encodings/Makefile
===================================================================
--- font/encodings/Makefile	(nonexistent)
+++ font/encodings/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/encodings
+
+versions    = 1.0.6
+pkgname     = encodings
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/encodings
===================================================================
--- font/encodings	(nonexistent)
+++ font/encodings	(revision 5)

Property changes on: font/encodings
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-adobe-100dpi/Makefile
===================================================================
--- font/font-adobe-100dpi/Makefile	(nonexistent)
+++ font/font-adobe-100dpi/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-adobe-100dpi
+
+versions    = 1.0.3
+pkgname     = font-adobe-100dpi
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-adobe-100dpi
===================================================================
--- font/font-adobe-100dpi	(nonexistent)
+++ font/font-adobe-100dpi	(revision 5)

Property changes on: font/font-adobe-100dpi
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-adobe-75dpi/Makefile
===================================================================
--- font/font-adobe-75dpi/Makefile	(nonexistent)
+++ font/font-adobe-75dpi/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-adobe-75dpi
+
+versions    = 1.0.3
+pkgname     = font-adobe-75dpi
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-adobe-75dpi
===================================================================
--- font/font-adobe-75dpi	(nonexistent)
+++ font/font-adobe-75dpi	(revision 5)

Property changes on: font/font-adobe-75dpi
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-adobe-utopia-100dpi/Makefile
===================================================================
--- font/font-adobe-utopia-100dpi/Makefile	(nonexistent)
+++ font/font-adobe-utopia-100dpi/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-adobe-utopia-100dpi
+
+versions    = 1.0.4
+pkgname     = font-adobe-utopia-100dpi
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-adobe-utopia-100dpi
===================================================================
--- font/font-adobe-utopia-100dpi	(nonexistent)
+++ font/font-adobe-utopia-100dpi	(revision 5)

Property changes on: font/font-adobe-utopia-100dpi
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-adobe-utopia-75dpi/Makefile
===================================================================
--- font/font-adobe-utopia-75dpi/Makefile	(nonexistent)
+++ font/font-adobe-utopia-75dpi/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-adobe-utopia-75dpi
+
+versions    = 1.0.4
+pkgname     = font-adobe-utopia-75dpi
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-adobe-utopia-75dpi
===================================================================
--- font/font-adobe-utopia-75dpi	(nonexistent)
+++ font/font-adobe-utopia-75dpi	(revision 5)

Property changes on: font/font-adobe-utopia-75dpi
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-adobe-utopia-type1/Makefile
===================================================================
--- font/font-adobe-utopia-type1/Makefile	(nonexistent)
+++ font/font-adobe-utopia-type1/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-adobe-utopia-type1
+
+versions    = 1.0.4
+pkgname     = font-adobe-utopia-type1
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-adobe-utopia-type1
===================================================================
--- font/font-adobe-utopia-type1	(nonexistent)
+++ font/font-adobe-utopia-type1	(revision 5)

Property changes on: font/font-adobe-utopia-type1
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-alias/Makefile
===================================================================
--- font/font-alias/Makefile	(nonexistent)
+++ font/font-alias/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-alias
+
+versions    = 1.0.4
+pkgname     = font-alias
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-alias
===================================================================
--- font/font-alias	(nonexistent)
+++ font/font-alias	(revision 5)

Property changes on: font/font-alias
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-arabic-misc/Makefile
===================================================================
--- font/font-arabic-misc/Makefile	(nonexistent)
+++ font/font-arabic-misc/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-arabic-misc
+
+versions    = 1.0.3
+pkgname     = font-arabic-misc
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-arabic-misc
===================================================================
--- font/font-arabic-misc	(nonexistent)
+++ font/font-arabic-misc	(revision 5)

Property changes on: font/font-arabic-misc
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-bh-100dpi/Makefile
===================================================================
--- font/font-bh-100dpi/Makefile	(nonexistent)
+++ font/font-bh-100dpi/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-bh-100dpi
+
+versions    = 1.0.3
+pkgname     = font-bh-100dpi
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-bh-100dpi
===================================================================
--- font/font-bh-100dpi	(nonexistent)
+++ font/font-bh-100dpi	(revision 5)

Property changes on: font/font-bh-100dpi
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-bh-75dpi/Makefile
===================================================================
--- font/font-bh-75dpi/Makefile	(nonexistent)
+++ font/font-bh-75dpi/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-bh-75dpi
+
+versions    = 1.0.3
+pkgname     = font-bh-75dpi
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-bh-75dpi
===================================================================
--- font/font-bh-75dpi	(nonexistent)
+++ font/font-bh-75dpi	(revision 5)

Property changes on: font/font-bh-75dpi
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-bh-lucidatypewriter-100dpi/Makefile
===================================================================
--- font/font-bh-lucidatypewriter-100dpi/Makefile	(nonexistent)
+++ font/font-bh-lucidatypewriter-100dpi/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-bh-lucidatypewriter-100dpi
+
+versions    = 1.0.3
+pkgname     = font-bh-lucidatypewriter-100dpi
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-bh-lucidatypewriter-100dpi
===================================================================
--- font/font-bh-lucidatypewriter-100dpi	(nonexistent)
+++ font/font-bh-lucidatypewriter-100dpi	(revision 5)

Property changes on: font/font-bh-lucidatypewriter-100dpi
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-bh-lucidatypewriter-75dpi/Makefile
===================================================================
--- font/font-bh-lucidatypewriter-75dpi/Makefile	(nonexistent)
+++ font/font-bh-lucidatypewriter-75dpi/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-bh-lucidatypewriter-75dpi
+
+versions    = 1.0.3
+pkgname     = font-bh-lucidatypewriter-75dpi
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-bh-lucidatypewriter-75dpi
===================================================================
--- font/font-bh-lucidatypewriter-75dpi	(nonexistent)
+++ font/font-bh-lucidatypewriter-75dpi	(revision 5)

Property changes on: font/font-bh-lucidatypewriter-75dpi
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-bh-ttf/Makefile
===================================================================
--- font/font-bh-ttf/Makefile	(nonexistent)
+++ font/font-bh-ttf/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-bh-ttf
+
+versions    = 1.0.3
+pkgname     = font-bh-ttf
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-bh-ttf
===================================================================
--- font/font-bh-ttf	(nonexistent)
+++ font/font-bh-ttf	(revision 5)

Property changes on: font/font-bh-ttf
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-bh-type1/Makefile
===================================================================
--- font/font-bh-type1/Makefile	(nonexistent)
+++ font/font-bh-type1/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-bh-type1
+
+versions    = 1.0.3
+pkgname     = font-bh-type1
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-bh-type1
===================================================================
--- font/font-bh-type1	(nonexistent)
+++ font/font-bh-type1	(revision 5)

Property changes on: font/font-bh-type1
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-bitstream-100dpi/Makefile
===================================================================
--- font/font-bitstream-100dpi/Makefile	(nonexistent)
+++ font/font-bitstream-100dpi/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-bitstream-100dpi
+
+versions    = 1.0.3
+pkgname     = font-bitstream-100dpi
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-bitstream-100dpi
===================================================================
--- font/font-bitstream-100dpi	(nonexistent)
+++ font/font-bitstream-100dpi	(revision 5)

Property changes on: font/font-bitstream-100dpi
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-bitstream-75dpi/Makefile
===================================================================
--- font/font-bitstream-75dpi/Makefile	(nonexistent)
+++ font/font-bitstream-75dpi/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-bitstream-75dpi
+
+versions    = 1.0.3
+pkgname     = font-bitstream-75dpi
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-bitstream-75dpi
===================================================================
--- font/font-bitstream-75dpi	(nonexistent)
+++ font/font-bitstream-75dpi	(revision 5)

Property changes on: font/font-bitstream-75dpi
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-bitstream-speedo/Makefile
===================================================================
--- font/font-bitstream-speedo/Makefile	(nonexistent)
+++ font/font-bitstream-speedo/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-bitstream-speedo
+
+versions    = 1.0.2
+pkgname     = font-bitstream-speedo
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-bitstream-speedo
===================================================================
--- font/font-bitstream-speedo	(nonexistent)
+++ font/font-bitstream-speedo	(revision 5)

Property changes on: font/font-bitstream-speedo
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-bitstream-type1/Makefile
===================================================================
--- font/font-bitstream-type1/Makefile	(nonexistent)
+++ font/font-bitstream-type1/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-bitstream-type1
+
+versions    = 1.0.3
+pkgname     = font-bitstream-type1
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-bitstream-type1
===================================================================
--- font/font-bitstream-type1	(nonexistent)
+++ font/font-bitstream-type1	(revision 5)

Property changes on: font/font-bitstream-type1
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-cronyx-cyrillic/Makefile
===================================================================
--- font/font-cronyx-cyrillic/Makefile	(nonexistent)
+++ font/font-cronyx-cyrillic/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-cronyx-cyrillic
+
+versions    = 1.0.3
+pkgname     = font-cronyx-cyrillic
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-cronyx-cyrillic
===================================================================
--- font/font-cronyx-cyrillic	(nonexistent)
+++ font/font-cronyx-cyrillic	(revision 5)

Property changes on: font/font-cronyx-cyrillic
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-cursor-misc/Makefile
===================================================================
--- font/font-cursor-misc/Makefile	(nonexistent)
+++ font/font-cursor-misc/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-cursor-misc
+
+versions    = 1.0.3
+pkgname     = font-cursor-misc
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-cursor-misc
===================================================================
--- font/font-cursor-misc	(nonexistent)
+++ font/font-cursor-misc	(revision 5)

Property changes on: font/font-cursor-misc
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-daewoo-misc/Makefile
===================================================================
--- font/font-daewoo-misc/Makefile	(nonexistent)
+++ font/font-daewoo-misc/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-daewoo-misc
+
+versions    = 1.0.3
+pkgname     = font-daewoo-misc
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-daewoo-misc
===================================================================
--- font/font-daewoo-misc	(nonexistent)
+++ font/font-daewoo-misc	(revision 5)

Property changes on: font/font-daewoo-misc
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-dec-misc/Makefile
===================================================================
--- font/font-dec-misc/Makefile	(nonexistent)
+++ font/font-dec-misc/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-dec-misc
+
+versions    = 1.0.3
+pkgname     = font-dec-misc
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-dec-misc
===================================================================
--- font/font-dec-misc	(nonexistent)
+++ font/font-dec-misc	(revision 5)

Property changes on: font/font-dec-misc
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-ibm-type1/Makefile
===================================================================
--- font/font-ibm-type1/Makefile	(nonexistent)
+++ font/font-ibm-type1/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-ibm-type1
+
+versions    = 1.0.3
+pkgname     = font-ibm-type1
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-ibm-type1
===================================================================
--- font/font-ibm-type1	(nonexistent)
+++ font/font-ibm-type1	(revision 5)

Property changes on: font/font-ibm-type1
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-isas-misc/Makefile
===================================================================
--- font/font-isas-misc/Makefile	(nonexistent)
+++ font/font-isas-misc/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-isas-misc
+
+versions    = 1.0.3
+pkgname     = font-isas-misc
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-isas-misc
===================================================================
--- font/font-isas-misc	(nonexistent)
+++ font/font-isas-misc	(revision 5)

Property changes on: font/font-isas-misc
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-jis-misc/Makefile
===================================================================
--- font/font-jis-misc/Makefile	(nonexistent)
+++ font/font-jis-misc/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-jis-misc
+
+versions    = 1.0.3
+pkgname     = font-jis-misc
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-jis-misc
===================================================================
--- font/font-jis-misc	(nonexistent)
+++ font/font-jis-misc	(revision 5)

Property changes on: font/font-jis-misc
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-micro-misc/Makefile
===================================================================
--- font/font-micro-misc/Makefile	(nonexistent)
+++ font/font-micro-misc/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-micro-misc
+
+versions    = 1.0.3
+pkgname     = font-micro-misc
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-micro-misc
===================================================================
--- font/font-micro-misc	(nonexistent)
+++ font/font-micro-misc	(revision 5)

Property changes on: font/font-micro-misc
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-misc-cyrillic/Makefile
===================================================================
--- font/font-misc-cyrillic/Makefile	(nonexistent)
+++ font/font-misc-cyrillic/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-misc-cyrillic
+
+versions    = 1.0.3
+pkgname     = font-misc-cyrillic
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-misc-cyrillic
===================================================================
--- font/font-misc-cyrillic	(nonexistent)
+++ font/font-misc-cyrillic	(revision 5)

Property changes on: font/font-misc-cyrillic
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-misc-ethiopic/Makefile
===================================================================
--- font/font-misc-ethiopic/Makefile	(nonexistent)
+++ font/font-misc-ethiopic/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-misc-ethiopic
+
+versions    = 1.0.4
+pkgname     = font-misc-ethiopic
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-misc-ethiopic
===================================================================
--- font/font-misc-ethiopic	(nonexistent)
+++ font/font-misc-ethiopic	(revision 5)

Property changes on: font/font-misc-ethiopic
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-misc-meltho/Makefile
===================================================================
--- font/font-misc-meltho/Makefile	(nonexistent)
+++ font/font-misc-meltho/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-misc-meltho
+
+versions    = 1.0.3
+pkgname     = font-misc-meltho
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-misc-meltho
===================================================================
--- font/font-misc-meltho	(nonexistent)
+++ font/font-misc-meltho	(revision 5)

Property changes on: font/font-misc-meltho
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-misc-misc/Makefile
===================================================================
--- font/font-misc-misc/Makefile	(nonexistent)
+++ font/font-misc-misc/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-misc-misc
+
+versions    = 1.1.2
+pkgname     = font-misc-misc
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-misc-misc
===================================================================
--- font/font-misc-misc	(nonexistent)
+++ font/font-misc-misc	(revision 5)

Property changes on: font/font-misc-misc
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-mutt-misc/Makefile
===================================================================
--- font/font-mutt-misc/Makefile	(nonexistent)
+++ font/font-mutt-misc/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-mutt-misc
+
+versions    = 1.0.3
+pkgname     = font-mutt-misc
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-mutt-misc
===================================================================
--- font/font-mutt-misc	(nonexistent)
+++ font/font-mutt-misc	(revision 5)

Property changes on: font/font-mutt-misc
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-schumacher-misc/Makefile
===================================================================
--- font/font-schumacher-misc/Makefile	(nonexistent)
+++ font/font-schumacher-misc/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-schumacher-misc
+
+versions    = 1.1.2
+pkgname     = font-schumacher-misc
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-schumacher-misc
===================================================================
--- font/font-schumacher-misc	(nonexistent)
+++ font/font-schumacher-misc	(revision 5)

Property changes on: font/font-schumacher-misc
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-screen-cyrillic/Makefile
===================================================================
--- font/font-screen-cyrillic/Makefile	(nonexistent)
+++ font/font-screen-cyrillic/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-screen-cyrillic
+
+versions    = 1.0.4
+pkgname     = font-screen-cyrillic
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-screen-cyrillic
===================================================================
--- font/font-screen-cyrillic	(nonexistent)
+++ font/font-screen-cyrillic	(revision 5)

Property changes on: font/font-screen-cyrillic
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-sony-misc/Makefile
===================================================================
--- font/font-sony-misc/Makefile	(nonexistent)
+++ font/font-sony-misc/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-sony-misc
+
+versions    = 1.0.3
+pkgname     = font-sony-misc
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-sony-misc
===================================================================
--- font/font-sony-misc	(nonexistent)
+++ font/font-sony-misc	(revision 5)

Property changes on: font/font-sony-misc
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-sun-misc/Makefile
===================================================================
--- font/font-sun-misc/Makefile	(nonexistent)
+++ font/font-sun-misc/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-sun-misc
+
+versions    = 1.0.3
+pkgname     = font-sun-misc
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-sun-misc
===================================================================
--- font/font-sun-misc	(nonexistent)
+++ font/font-sun-misc	(revision 5)

Property changes on: font/font-sun-misc
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-util/Makefile
===================================================================
--- font/font-util/Makefile	(nonexistent)
+++ font/font-util/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-util
+
+versions    = 1.3.3
+pkgname     = font-util
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-util
===================================================================
--- font/font-util	(nonexistent)
+++ font/font-util	(revision 5)

Property changes on: font/font-util
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-winitzki-cyrillic/Makefile
===================================================================
--- font/font-winitzki-cyrillic/Makefile	(nonexistent)
+++ font/font-winitzki-cyrillic/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-winitzki-cyrillic
+
+versions    = 1.0.3
+pkgname     = font-winitzki-cyrillic
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-winitzki-cyrillic
===================================================================
--- font/font-winitzki-cyrillic	(nonexistent)
+++ font/font-winitzki-cyrillic	(revision 5)

Property changes on: font/font-winitzki-cyrillic
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font/font-xfree86-type1/Makefile
===================================================================
--- font/font-xfree86-type1/Makefile	(nonexistent)
+++ font/font-xfree86-type1/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/font/font-xfree86-type1
+
+versions    = 1.0.4
+pkgname     = font-xfree86-type1
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: font/font-xfree86-type1
===================================================================
--- font/font-xfree86-type1	(nonexistent)
+++ font/font-xfree86-type1	(revision 5)

Property changes on: font/font-xfree86-type1
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: font
===================================================================
--- font	(nonexistent)
+++ font	(revision 5)

Property changes on: font
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/Makefile
===================================================================
--- lib/Makefile	(nonexistent)
+++ lib/Makefile	(revision 5)
@@ -0,0 +1,13 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+SOURCE_REQUIRES += ALL_DIRS
+
+
+include ../../../build-system/core.mk
+
+
+download_clean:
+	@true
+
+.PHONY: download_clean
Index: lib/libAppleWM/Makefile
===================================================================
--- lib/libAppleWM/Makefile	(nonexistent)
+++ lib/libAppleWM/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libAppleWM
+
+versions    = 1.4.1
+pkgname     = libAppleWM
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libAppleWM
===================================================================
--- lib/libAppleWM	(nonexistent)
+++ lib/libAppleWM	(revision 5)

Property changes on: lib/libAppleWM
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libFS/Makefile
===================================================================
--- lib/libFS/Makefile	(nonexistent)
+++ lib/libFS/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libFS
+
+versions    = 1.0.9
+pkgname     = libFS
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libFS
===================================================================
--- lib/libFS	(nonexistent)
+++ lib/libFS	(revision 5)

Property changes on: lib/libFS
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libICE/Makefile
===================================================================
--- lib/libICE/Makefile	(nonexistent)
+++ lib/libICE/Makefile	(revision 5)
@@ -0,0 +1,56 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libICE
+
+versions    = 1.1.1
+pkgname     = libICE
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+patches     = $(CURDIR)/patches/libICE-1.1.1-docbook.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-1.1.1-docbook-patch ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s) $(patches)
Index: lib/libICE/create-1.1.1-docbook-patch/create.patch.sh
===================================================================
--- lib/libICE/create-1.1.1-docbook-patch/create.patch.sh	(nonexistent)
+++ lib/libICE/create-1.1.1-docbook-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=1.1.1
+
+tar --files-from=file.list -xJvf ../libICE-$VERSION.tar.xz
+mv libICE-$VERSION libICE-$VERSION-orig
+
+cp -rf ./libICE-$VERSION-new ./libICE-$VERSION
+
+diff --unified -Nr  libICE-$VERSION-orig  libICE-$VERSION > libICE-$VERSION-docbook.patch
+
+mv libICE-$VERSION-docbook.patch ../patches
+
+rm -rf ./libICE-$VERSION
+rm -rf ./libICE-$VERSION-orig

Property changes on: lib/libICE/create-1.1.1-docbook-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: lib/libICE/create-1.1.1-docbook-patch/file.list
===================================================================
--- lib/libICE/create-1.1.1-docbook-patch/file.list	(nonexistent)
+++ lib/libICE/create-1.1.1-docbook-patch/file.list	(revision 5)
@@ -0,0 +1 @@
+libICE-1.1.1/doc/ICElib.xml
Index: lib/libICE/create-1.1.1-docbook-patch/libICE-1.1.1-new/doc/ICElib.xml
===================================================================
--- lib/libICE/create-1.1.1-docbook-patch/libICE-1.1.1-new/doc/ICElib.xml	(nonexistent)
+++ lib/libICE/create-1.1.1-docbook-patch/libICE-1.1.1-new/doc/ICElib.xml	(revision 5)
@@ -0,0 +1,4581 @@
+<?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"
+[
+<!ENTITY % defs SYSTEM "defs.ent"> %defs;
+]>
+
+
+<book id="ICElib">
+
+<bookinfo>
+   <title>Inter-Client Exchange Library</title>
+   <subtitle>X Consortium Standard</subtitle>
+   <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
+   <releaseinfo>Version 1.0</releaseinfo>
+   <authorgroup>
+     <author>
+       <firstname>Ralph</firstname><surname>Mor</surname>
+       <affiliation><orgname>X Consortium</orgname></affiliation>
+     </author>
+   </authorgroup>
+   <copyright>
+     <year>1993</year><year>1994</year><year>1996</year>
+     <holder>X Consortium</holder>
+   </copyright>
+
+<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 id='Overview_of_ICE'>
+<title>Overview of ICE</title>
+
+<para>
+There are numerous possible inter-client protocols, with many similarities
+and common needs - authentication, version negotiation, byte
+order negotiation, and so on.
+The Inter-Client Exchange (ICE) protocol is intended to provide a framework
+for building such protocols, allowing them to make use of common negotiation
+mechanisms and to be multiplexed over a single transport connection.
+</para>
+</chapter>
+
+<chapter id='The_ICE_Library___C_Language_Interface_to_ICE'>
+<title>The ICE Library - C Language Interface to ICE</title>
+
+<para>
+A client that wishes to utilize ICE must first register the protocols it
+understands with the ICE library.  Each protocol is dynamically assigned
+a major opcode ranging from 1-255 (two clients can use different
+major opcodes for the same protocol).  The next step for the client is either
+to open a connection with another client or to wait for connections made
+by other clients.  Authentication may be required.  A client can both
+initiate connections with other clients and be
+waiting for clients to connect to itself (a nested session manager is an
+example).  Once an ICE connection is established between the two clients, one
+of the clients needs to initiate a
+<function>ProtocolSetup</function>
+in order to
+"activate" a given protocol.  Once the other client accepts the
+<function>ProtocolSetup</function>
+(once again, authentication may be required), the
+two clients are ready to start passing messages specific to that protocol to
+each other.  Multiple protocols may be active on a single ICE connection.
+Clients are responsible for notifying the ICE library when a protocol is no
+longer active on an ICE connection, although ICE does not define how each
+subprotocol triggers a protocol shutdown.
+</para>
+
+<para>
+The ICE library utilizes callbacks to process incoming messages.  Using
+callbacks allows
+<function>ProtocolSetup</function>
+messages and authentication to happen
+behind the scenes.  An additional benefit is that messages never need
+to be buffered up by the library when the client blocks waiting for a
+particular message.
+</para>
+</chapter>
+
+<chapter id='Intended_Audience'>
+<title>Intended Audience</title>
+
+<para>This document is intended primarily for implementors of protocol libraries
+layered on top of ICE.  Typically, applications that wish to utilize ICE
+will make calls into individual protocol libraries rather than directly
+make calls into the ICE library.  However, some applications will have to
+make some initial calls into the ICE library in order to accept ICE
+connections (for example, a session manager accepting connections from
+clients).  But in general, protocol libraries should be designed to hide
+the inner details of ICE from applications.</para>
+</chapter>
+
+<chapter id='Header_Files_and_Library_Name'>
+<title>Header Files and Library Name</title>
+
+
+<para>The header file
+&lt;<symbol role='Pn'>X11/ICE/ICElib.h</symbol>&gt;
+defines all of the ICElib data structures and function prototypes.
+<function>ICElib.h</function>
+includes the header file
+&lt;<symbol role='Pn'>X11/ICE/ICE.h</symbol>&gt;,
+which defines all of the ICElib constants.
+Protocol libraries that need to read and write messages should include
+the header file
+&lt;<symbol role='Pn'>X11/ICE/ICEmsg.h</symbol>&gt;.</para>
+
+<para>Applications should link against ICElib using -lICE.</para>
+</chapter>
+
+<chapter id='Note_on_Prefixes'>
+<title>Note on Prefixes</title>
+
+
+<para>The following name prefixes are used in the library to distinguish between
+a client that initiates a
+<function>ProtocolSetup</function>
+and a client that
+responds with a
+<function>ProtocolReply</function></para>
+
+<itemizedlist>
+  <listitem>
+<para><function>IcePo</function>
+- Ice Protocol Originator</para>
+  </listitem>
+  <listitem>
+<para><function>IcePa</function>
+- Ice Protocol Acceptor</para>
+  </listitem>
+</itemizedlist>
+</chapter>
+
+<chapter id='Protocol_Registration'>
+<title>Protocol Registration</title>
+
+<para>
+In order for two clients to exchange messages for a given protocol, each
+side must register the protocol with the ICE library.  The purpose of
+registration is for each side to obtain a major opcode for the protocol
+and to provide callbacks for processing messages and handling authentication.
+There are two separate registration functions:
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+One to handle the side that does a
+<function>ProtocolSetup</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+One to handle the side that responds with a
+<function>ProtocolReply</function>
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+It is recommended that protocol registration occur before the two clients
+establish an ICE connection.  If protocol registration occurs after an
+ICE connection is created, there can be a brief interval of time in which a
+<function>ProtocolSetup</function>
+is received, but the protocol is not registered.
+If it is not possible to register a protocol before the creation of an
+ICE connection, proper precautions should be taken to avoid the above race
+condition.
+</para>
+
+
+<para>
+The <xref linkend='IceRegisterForProtocolSetup' xrefstyle='select: title'/>
+function should be called for the client that initiates a
+<function>ProtocolSetup</function>
+</para>
+
+<funcsynopsis id='IceRegisterForProtocolSetup'>
+<funcprototype>
+  <funcdef>int <function>IceRegisterForProtocolSetup</function></funcdef>
+    <paramdef>const char<parameter> *protocol_name</parameter></paramdef>
+    <paramdef>const char<parameter> *vendor</parameter></paramdef>
+    <paramdef>const char<parameter> *release</parameter></paramdef>
+    <paramdef>int<parameter> version_count</parameter></paramdef>
+    <paramdef>IcePoVersionRec<parameter> *version_recs</parameter></paramdef>
+    <paramdef>int<parameter> auth_count</parameter></paramdef>
+    <paramdef>char<parameter> **auth_names</parameter></paramdef>
+    <paramdef>IcePoAuthProc<parameter> *auth_procs</parameter></paramdef>
+    <paramdef>IceIOErrorProc<parameter> io_error_proc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>protocol_name</emphasis></term>
+    <listitem>
+      <para>
+A string specifying the name of the protocol to register.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>vendor</emphasis></term>
+    <listitem>
+      <para>A vendor string with semantics specified by the protocol.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>release</emphasis></term>
+    <listitem>
+      <para>A release string with semantics specified by the protocol.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>version_count</emphasis></term>
+    <listitem>
+      <para>The number of different versions of the protocol supported.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>version_recs</emphasis></term>
+    <listitem>
+      <para>List of versions and associated callbacks.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>auth_count</emphasis></term>
+    <listitem>
+      <para>The number of authentication methods supported.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>auth_names</emphasis></term>
+    <listitem>
+      <para>The list of authentication methods supported.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>auth_procs</emphasis></term>
+    <listitem>
+      <para>
+The list of authentication callbacks, one for each authentication method.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>io_error_proc</emphasis></term>
+    <listitem>
+      <para>IO error handler, or NULL.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+<xref linkend='IceRegisterForProtocolSetup' xrefstyle='select: title'/> returns the major
+opcode reserved or -1 if an error occurred.  In order to actually activate
+the protocol, the <xref linkend='IceProtocolSetup' xrefstyle='select: title'/>
+function needs to be called with this major opcode.  Once the protocol is
+activated, all messages for the protocol should be sent using this major
+opcode.
+</para>
+
+<para>
+A protocol library may support multiple versions of the same protocol.
+The version_recs argument specifies a list of supported versions of the
+protocol, which are prioritized in decreasing order of preference.
+Each version record consists of a major and minor version of the protocol
+as well as a callback to be used for processing incoming messages.
+</para>
+
+
+<literallayout remap='Ds'>
+typedef struct {
+	int major_version;
+	int minor_version;
+	IcePoProcessMsgProc process_msg_proc;
+} IcePoVersionRec;
+</literallayout>
+
+<para>The
+<function>IcePoProcessMsgProc</function>
+callback is responsible for processing the set of messages that can be
+received by the client that initiated the
+<function>ProtocolSetup</function>
+For further information,
+see
+<xref linkend='Callbacks_for_Processing_Messages' xrefstyle='select: title'/>
+</para>
+
+<para>Authentication may be required before the protocol can become active.
+The protocol library must register the authentication methods that it
+supports with the ICE library.
+The auth_names and auth_procs arguments are a list of authentication names
+and callbacks that are  prioritized in decreasing order of preference.
+For information on the
+<function>IcePoAuthProc</function>
+callback, see
+<xref linkend='Authentication_Methods' xrefstyle='select: title'/>
+</para>
+
+<para>The
+<xref linkend='IceIOErrorProc' xrefstyle='select: title'/>
+callback is invoked if the ICE connection unexpectedly breaks.
+You should pass NULL for io_error_proc if not interested in being notified.
+For further information,
+<xref linkend='Error_Handling' xrefstyle='select: title'/>
+</para>
+
+
+<para>The
+<xref linkend='IceRegisterForProtocolReply' xrefstyle='select: title'/>
+function should be called for the client that responds to a
+<function>ProtocolSetup</function>
+with a
+<function>ProtocolReply</function></para>
+
+
+<funcsynopsis id='IceRegisterForProtocolReply'>
+<funcprototype>
+  <funcdef>Bool <function>IceRegisterForProtocolReply</function></funcdef>
+    <paramdef>const char<parameter> *protocol_name</parameter></paramdef>
+    <paramdef>const char<parameter> *vendor</parameter></paramdef>
+    <paramdef>const char<parameter> *release</parameter></paramdef>
+    <paramdef>int<parameter> version_count</parameter></paramdef>
+    <paramdef>IcePoVersionRec<parameter> *version_recs</parameter></paramdef>
+    <paramdef>int<parameter> auth_count</parameter></paramdef>
+    <paramdef>const char<parameter> **auth_names</parameter></paramdef>
+    <paramdef>IcePoAuthProc<parameter> *auth_procs</parameter></paramdef>
+    <paramdef>IceHostBasedAuthProc<parameter> host_based_auth_proc</parameter></paramdef>
+    <paramdef>IceProtocolSetupProc<parameter> protocol_setup_proc</parameter></paramdef>
+    <paramdef>IceProtocolActivateProc<parameter> protocol_activate_proc</parameter></paramdef>
+    <paramdef>IceIOErrorProc<parameter> io_error_proc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>protocol_name</emphasis></term>
+    <listitem><para>A string specifying the name of the protocol to register.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>vendor</emphasis></term>
+  <listitem>
+<para>A vendor string with semantics specified by the protocol.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>release</emphasis></term>
+  <listitem>
+<para>A release string with semantics specified by the protocol.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>version_count</emphasis></term>
+  <listitem>
+<para>The number of different versions of the protocol supported.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>version_recs</emphasis></term>
+  <listitem>
+<para>List of versions and associated callbacks.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>auth_count</emphasis></term>
+  <listitem>
+<para>The number of authentication methods supported.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>auth_names</emphasis></term>
+  <listitem>
+<para>The list of authentication methods supported.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>auth_procs</emphasis></term>
+  <listitem>
+<para>The list of authentication callbacks, one for each authentication method.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>host_based_auth_proc</emphasis></term>
+  <listitem>
+<para>Host based authentication callback.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>protocol_setup_proc</emphasis></term>
+  <listitem>
+<para>A callback to be invoked when authentication has succeeded for a
+<function>ProtocolSetup</function>
+but before the
+<function>ProtocolReply</function>
+is sent.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>protocol_activate_proc</emphasis></term>
+  <listitem>
+<para>A callback to be invoked after the
+<function>ProtocolReply</function>
+is sent.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>io_error_proc</emphasis></term>
+  <listitem>
+<para>IO error handler, or NULL.</para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para><xref linkend='IceRegisterForProtocolReply' xrefstyle='select: title'/>
+returns the major opcode reserved or -1 if an error occurred.  The major
+opcode should be used in all subsequent messages sent for this protocol.</para>
+
+<para>A protocol library may support multiple versions of the same protocol.
+The version_recs argument specifies a list of supported versions of the protocol,
+which are prioritized in decreasing order of preference.
+Each version record consists of a major and minor version of the protocol
+as well as a callback to be used for processing incoming messages.</para>
+
+
+<literallayout remap='Ds'>
+typedef struct {
+	int major_version;
+	int minor_version;
+	IcePaProcessMsgProc process_msg_proc;
+} IcePaVersionRec;
+</literallayout>
+
+
+<para>The
+<xref linkend='IcePaProcessMsgProc' xrefstyle='select: title'/>
+callback is responsible for processing the set of messages that can be
+received by the client that accepted the
+<function>ProtocolSetup</function>
+For further information,
+see
+<xref linkend='Callbacks_for_Processing_Messages' xrefstyle='select: title'/>
+</para>
+
+<para>Authentication may be required before the protocol can become active.
+The protocol library must register the authentication methods that it
+supports with the ICE library.
+The auth_names and auth_procs arguments are a list of authentication names
+and callbacks that are prioritized in decreasing order of preference.
+For information on the
+<function>IcePaAuthProc</function>,
+See
+<xref linkend='Authentication_Methods' xrefstyle='select: title'/>
+
+</para>
+
+<para>If authentication fails and the client attempting to initiate
+the
+<function>ProtocolSetup</function>
+has not required authentication, the
+<function>IceHostBasedAuthProc</function>
+callback is invoked with the host name of the originating client.
+If the callback returns
+<function>True</function>
+the
+<function>ProtocolSetup</function>
+will succeed, even though the original
+authentication failed.
+Note that authentication can effectively be disabled by registering an
+<function>IceHostBasedAuthProc</function>
+which always returns
+<function>True</function>
+If no host based
+authentication is allowed, you should pass NULL for host_based_auth_proc.</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Bool <function>HostBasedAuthProc</function></funcdef>
+    <paramdef>char<parameter> *host_name</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>protocol_name</emphasis></term>
+    <listitem><para>The host name of the client that sent the <function>ProtocolSetup</function></para></listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>The host_name argument is a string of the form <emphasis remap='I'>protocol</emphasis>/<emphasis remap='I'>hostname</emphasis>,
+where <emphasis remap='I'>protocol</emphasis> is one of {tcp, decnet, local}.</para>
+
+<para>Because
+<function>ProtocolSetup</function>
+messages and authentication happen behind the scenes
+via callbacks, the protocol library needs some way of being notified when the
+<function>ProtocolSetup</function>
+has completed.
+This occurs in two phases.
+In the first phase, the
+<function>IceProtocolSetupProc</function>
+callback is invoked after authentication has
+successfully completed but before the ICE library sends a
+<function>ProtocolReply</function>
+Any resources required for this protocol should be allocated at this time.
+If the
+<function>IceProtocolSetupProc</function>
+returns a successful status, the ICE library will
+send the
+<function>ProtocolReply</function>
+and then invoke the
+<function>IceProtocolActivateProc</function>
+callback.  Otherwise, an error will be sent to the
+other client in response to the
+<function>ProtocolSetup</function></para>
+
+<para>The
+<function>IceProtocolActivateProc</function>
+is an optional callback and should be registered only if the protocol
+library intends to generate a message immediately following the
+<function>ProtocolReply</function>
+You should pass NULL for protocol_activate_proc if not interested
+in this callback.</para>
+
+<funcsynopsis id='ProtocolSetupProc'>
+<funcprototype>
+  <funcdef>Status <function>ProtocolSetupProc</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>int<parameter> major_version</parameter></paramdef>
+    <paramdef>int<parameter> minor_version</parameter></paramdef>
+    <paramdef>char<parameter> *vendor</parameter></paramdef>
+    <paramdef>char<parameter> *release</parameter></paramdef>
+    <paramdef>IcePointer<parameter> *client_data_ret</parameter></paramdef>
+    <paramdef>char<parameter> **failure_reason_ret</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>protocol_name</emphasis></term>
+    <listitem>
+<para>The ICE connection object.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>major_version</emphasis></term>
+  <listitem>
+<para>The major version of the protocol.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>minor_version</emphasis></term>
+  <listitem>
+<para>The minor version of the protocol.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>vendor</emphasis></term>
+  <listitem>
+<para>The vendor string registered by the protocol originator.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>release</emphasis></term>
+  <listitem>
+<para>The release string registered by the protocol originator.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>client_data_ret</emphasis></term>
+  <listitem>
+<para>Client data to be set by callback.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>failure_reason_ret</emphasis></term>
+  <listitem>
+<para>Failure reason returned.</para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>The pointer stored in the client_data_ret argument will be passed
+to the
+<xref linkend='IcePaProcessMsgProc' xrefstyle='select: title'/>
+callback whenever a message has arrived for this protocol on the
+ICE connection.</para>
+
+<para>The vendor and release strings should be freed with
+<function>free</function>
+when they are no longer needed.</para>
+
+<para>If a failure occurs, the
+<function>IceProtocolSetupProc</function>
+should return a zero status as well as allocate and return a failure
+reason string in failure_reason_ret.
+The ICE library will be responsible for freeing this memory.</para>
+
+<para>The
+<function>IceProtocolActivateProc</function>
+callback is defined as follows:</para>
+
+<funcsynopsis id='ProtocolActivateProc'>
+<funcprototype>
+  <funcdef>void <function>ProtocolActivateProc</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>IcePointer<parameter> client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem><para>The ICE connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>client_data</emphasis></term>
+    <listitem>
+    <para>
+The client data set in the <function>IceProtocolSetupProc</function> callback.
+    </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>The
+<xref linkend='IceIOErrorProc' xrefstyle='select: title'/>
+callback is invoked if the ICE connection unexpectedly breaks.
+You should pass NULL for io_error_proc if not interested in being notified.
+For further information,
+see
+<xref linkend='Error_Handling' xrefstyle='select: title'/>
+</para>
+
+<sect1 id='Callbacks_for_Processing_Messages'>
+<title>Callbacks for Processing Messages</title>
+
+<para>When an application detects that there is new data to read on an ICE
+connection (via
+<function>select</function>
+it calls the
+<xref linkend='IceProcessMessages' xrefstyle='select: title'/>
+function
+<xref linkend='Processing_Messages' xrefstyle='select: title'/>
+
+When
+<xref linkend='IceProcessMessages' xrefstyle='select: title'/>
+reads an ICE message header with a major opcode other than
+zero (reserved for the ICE protocol), it needs to call a function that will
+read the rest of the message, unpack it, and process it accordingly.</para>
+
+<para>If the message arrives at the client that initiated the
+<function>ProtocolSetup</function>
+the
+<function>IcePoProcessMsgProc</function>
+callback is invoked.</para>
+
+<funcsynopsis id='PoProcessMsgProc'>
+<funcprototype>
+  <funcdef>void <function>PoProcessMsgProc</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>IcePointer<parameter> client_data</parameter></paramdef>
+    <paramdef>int<parameter> opcode</parameter></paramdef>
+    <paramdef>unsigned long<parameter> length</parameter></paramdef>
+    <paramdef>Bool<parameter> swap</parameter></paramdef>
+    <paramdef>IceReplyWaitInfo<parameter> *reply_wait</parameter></paramdef>
+    <paramdef>Bool<parameter> *reply_ready_ret</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem><para>The ICE connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>client_data</emphasis></term>
+  <listitem>
+<para>Client data associated with this protocol on the ICE connection.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>opcode</emphasis></term>
+  <listitem>
+<para>The minor opcode of the message.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>length</emphasis></term>
+  <listitem>
+<para>The length (in 8-byte units) of the message beyond the ICE header.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>swap</emphasis></term>
+  <listitem>
+<para>A flag that indicates if byte swapping is necessary.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>reply_wait</emphasis></term>
+  <listitem>
+<para>Indicates if the invoking client is waiting for a reply.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>reply_ready_ret</emphasis></term>
+  <listitem>
+<para>If set to
+<function>True</function>
+a reply is ready.</para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>If the message arrives at the client that accepted the
+<function>ProtocolSetup</function>
+the
+<xref linkend='IcePaProcessMsgProc' xrefstyle='select: title'/>
+callback is invoked.</para>
+
+
+<funcsynopsis id='IcePaProcessMsgProc'>
+<funcprototype>
+  <funcdef>void <function>IcePaProcessMsgProc</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>IcePointer<parameter> client_data</parameter></paramdef>
+    <paramdef>int<parameter> opcode</parameter></paramdef>
+    <paramdef>unsigned long<parameter> length</parameter></paramdef>
+    <paramdef>Bool<parameter> swap</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem><para>The ICE connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>client_data</emphasis></term>
+  <listitem>
+<para>Client data associated with this protocol on the ICE connection.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>opcode</emphasis></term>
+  <listitem>
+<para>The minor opcode of the message.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>length</emphasis></term>
+  <listitem>
+<para>The length (in 8-byte units) of the message beyond the ICE header.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>swap</emphasis></term>
+  <listitem>
+<para>A flag that indicates if byte swapping is necessary.</para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>In order to read the message, both of these callbacks should use the
+macros defined for this purpose (see
+<xref linkend='Reading_ICE_Messages' xrefstyle='select: title'/>.).
+Note that byte swapping may be necessary.
+As a convenience, the length field in the ICE header will be swapped by ICElib
+if necessary.</para>
+
+<para>In both of these callbacks, the client_data argument is a pointer to client
+data that was registered at
+<function>ProtocolSetup</function>
+time.
+In the case of
+<function>IcePoProcessMsgProc</function>
+the client data was set in the call to
+<xref linkend='IceProtocolSetup' xrefstyle='select: title'/>
+In the case of
+<xref linkend='IcePaProcessMsgProc' xrefstyle='select: title'/>
+the client data was set in the
+<function>IceProtocolSetupProc</function>
+callback.</para>
+
+<para>The
+<function>IcePoProcessMsgProc</function>
+callback needs to check the reply_wait argument.
+If reply_wait is NULL ,
+the ICE library expects the function to
+pass the message to the client via a callback.
+For example, if this is a Session Management "Save Yourself" message,
+this function should notify the client of the "Save Yourself" via a callback.
+The details of how such a callback would be defined
+are implementation-dependent.</para>
+
+<para>However, if reply_wait is not NULL ,
+then the client is waiting for
+a reply or an error for a message it previously sent.
+The reply_wait is of type
+<function>IceReplyWaitInfo</function></para>
+
+
+<literallayout remap='Ds'>
+typedef struct {
+	unsigned long sequence_of_request;
+	int major_opcode_of_request;
+	int minor_opcode_of_request;
+	IcePointer reply;
+} IceReplyWaitInfo;
+</literallayout>
+
+<para><function>IceReplyWaitInfo</function>
+contains the major/minor opcodes and sequence number of
+the message for which a reply is being awaited.
+It also contains a pointer to the reply message to be filled in
+(the protocol library should cast this
+<function>IcePointer</function>
+to the appropriate reply type).
+In most cases, the reply will have some fixed-size part, and the client waiting
+for the reply will have provided a pointer to a structure to hold
+this fixed-size data.  If there is variable-length data, it would be
+expected that the
+<function>IcePoProcessMsgProc</function>
+callback will have to allocate additional
+memory and store pointer(s) to that memory in the fixed-size
+structure.  If the entire data is variable length (for example., a single
+variable-length string), then the client waiting for the reply would probably
+just pass a pointer to fixed-size space to hold a pointer, and the
+<function>IcePoProcessMsgProc</function>
+callback would allocate the storage and store the pointer.
+It is the responsibility of the client receiving the reply to
+free any memory allocated on its behalf.</para>
+
+<para>If reply_wait is not NULL and
+<function>IcePoProcessMsgProc</function>
+has a reply or error to return in response to this reply_wait
+(that is, no callback was generated), then the reply_ready_ret argument
+should be set to
+<function>True</function>
+Note that an error should only be returned
+if it corresponds to the reply being waited for.  Otherwise, the
+<function>IcePoProcessMsgProc</function>
+should either handle the error internally or invoke an error handler
+for its library.</para>
+
+<para>If reply_wait is NULL,
+then care must be taken not to store any value in reply_ready_ret,
+because this pointer may also be NULL.</para>
+
+<para>The
+<xref linkend='IcePaProcessMsgProc' xrefstyle='select: title'/>
+callback, on the other hand, should always pass
+the message to the client via a callback.  For example, if this is a Session
+Management "Interact Request" message, this function should notify the
+client of the "Interact Request" via a callback.</para>
+
+<para>The reason the
+<xref linkend='IcePaProcessMsgProc' xrefstyle='select: title'/>
+callback does not have a reply_wait, like
+<function>IcePoProcessMsgProc</function>
+does, is because a process that is acting as
+a server should never block for a reply (infinite blocking can
+occur if the connecting client does not act properly, denying access
+to other clients).</para>
+</sect1>
+
+<sect1 id='Authentication_Methods'>
+<title>Authentication Methods</title>
+
+<para>As already stated, a protocol library must register the authentication
+methods that it supports with the ICE library.  For each authentication
+method, there are two callbacks that may be registered:</para>
+<itemizedlist>
+  <listitem>
+    <para>
+One to handle the side that initiates a <function>ProtocolSetup</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+One to handle the side that accepts or rejects this request
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para><function>IcePoAuthProc</function>
+is the callback invoked for the client that initiated the
+<function>ProtocolSetup</function>
+This callback must be able to respond
+to the initial "Authentication Required" message or subsequent
+"Authentication Next Phase" messages sent by the other client.</para>
+
+
+<funcsynopsis id='IcePoAuthStatus'>
+<funcprototype>
+  <funcdef>IcePoAuthStatus <function>IcePoAuthStatus </function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>IcePointer<parameter> client_data</parameter></paramdef>
+    <paramdef>int<parameter> opcode</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem><para>The ICE connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>auth_state_ptr</emphasis></term>
+  <listitem>
+<para>A pointer to state for use by the authentication callback procedure.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>clean_up</emphasis></term>
+  <listitem>
+<para>If
+<function>True</function>
+authentication is over, and the function
+should clean up any state it was maintaining.  The
+last 6 arguments should be ignored.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>swap</emphasis></term>
+  <listitem>
+<para>If
+<function>True</function>
+the auth_data may have to be byte swapped
+(depending on its contents).</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>auth_datalen</emphasis></term>
+  <listitem>
+<para>The length (in bytes) of the authenticator data.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>auth_data</emphasis></term>
+  <listitem>
+<para>The data from the authenticator.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>reply_datalen_ret</emphasis></term>
+  <listitem>
+<para>The length (in bytes) of the reply data returned.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>reply_data_ret</emphasis></term>
+  <listitem>
+<para>The reply data returned.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>error_string_ret</emphasis></term>
+  <listitem>
+<para>If the authentication procedure encounters an error during
+authentication, it should allocate and return
+an error string.</para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>Authentication may require several phases, depending on the authentication
+method.  As a result, the
+<function>IcePoAuthProc</function>
+may be called more than once when authenticating a client, and
+some state will have to be maintained between each invocation.
+At the start of each
+<function>ProtocolSetup</function>
+*auth_state_ptr is NULL,
+and the function should initialize its state and set
+this pointer.  In subsequent invocations of the callback, the pointer
+should be used to get at any state previously stored by the callback.</para>
+
+<para>If needed, the network ID of the client accepting the
+<function>ProtocolSetup</function>
+can be obtained by calling the
+<function>IceConnectionString</function>
+function.</para>
+
+<para>ICElib will be responsible for freeing the reply_data_ret and
+error_string_ret pointers with
+<function>free</function></para>
+
+<para>The auth_data pointer may point to a volatile block of memory.
+If the data must be kept beyond this invocation of the callback, be sure
+to make a copy of it.</para>
+
+<para>The
+<function>IcePoAuthProc</function>
+should return one of four values:</para>
+<itemizedlist>
+  <listitem>
+<para><function>IcePoAuthHaveReply</function>
+- a reply is available.</para>
+  </listitem>
+  <listitem>
+<para><function>IcePoAuthRejected</function>
+- authentication rejected.</para>
+  </listitem>
+  <listitem>
+<para><function>IcePoAuthFailed</function>
+- authentication failed.</para>
+  </listitem>
+  <listitem>
+<para><function>IcePoAuthDoneCleanup</function>
+- done cleaning up.</para>
+  </listitem>
+</itemizedlist>
+
+<para><function>IcePaAuthProc</function>
+is the callback invoked for the client that received the
+<function>ProtocolSetup</function></para>
+
+<funcsynopsis id='PoAuthStatus'>
+<funcprototype>
+  <funcdef>IcePoAuthStatus <function>PoAuthStatus </function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>IcePointer<parameter> *auth_state_ptr</parameter></paramdef>
+    <paramdef>Bool<parameter> swap</parameter></paramdef>
+    <paramdef>int<parameter> auth_datalen</parameter></paramdef>
+    <paramdef>IcePointer<parameter> auth_data</parameter></paramdef>
+    <paramdef>int<parameter> *reply_datalen_ret</parameter></paramdef>
+    <paramdef>IcePointer<parameter> *reply_data_ret</parameter></paramdef>
+    <paramdef>char<parameter> **error_string_ret</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem><para>The ICE connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>auth_state_ptr</emphasis></term>
+    <listitem>
+<para>A pointer to state for use by the authentication callback procedure.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>swap</emphasis></term>
+    <listitem>
+<para>If
+<function>True</function>
+auth_data may have to be byte swapped
+(depending on its contents).</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>auth_datalen</emphasis></term>
+    <listitem>
+<para>The length (in bytes) of the protocol originator authentication data.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>auth_data</emphasis></term>
+    <listitem>
+<para>The authentication data from the protocol originator.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>reply_datalen_ret</emphasis></term>
+    <listitem>
+<para>The length of the authentication data returned.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>reply_data_ret</emphasis></term>
+    <listitem>
+<para>The authentication data returned.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>error_string_ret</emphasis></term>
+    <listitem>
+<para>If authentication is rejected or fails, an error
+string is returned.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>Authentication may require several phases, depending on the authentication
+method.  As a result, the
+<function>IcePaAuthProc</function>
+may be called more than once when authenticating a client, and
+some state will have to be maintained between each invocation.
+At the start of each
+<function>ProtocolSetup</function>
+auth_datalen is zero,
+*auth_state_ptr is NULL,
+and the function should initialize its state and set
+this pointer.  In subsequent invocations of the callback, the pointer
+should be used to get at any state previously stored by the callback.</para>
+
+<para>If needed, the network ID of the client accepting the
+<function>ProtocolSetup</function>
+can be obtained by calling the
+<function>IceConnectionString</function>
+function.</para>
+
+<para>The auth_data pointer may point to a volatile block of memory.
+If the data must be kept beyond this invocation of the callback, be sure
+to make a copy of it.</para>
+
+<para>ICElib will be responsible for transmitting and freeing the reply_data_ret and
+error_string_ret pointers with
+<function>free</function></para>
+
+<para>
+The <function>IcePaAuthProc</function> should return one of four values:
+</para>
+
+
+<itemizedlist>
+  <listitem>
+    <para>
+<function>IcePaAuthContinue</function> - continue (or start) authentication.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>IcePaAuthAccepted</function> - authentication accepted.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>IcePaAuthRejected</function> - authentication rejected.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>IcePaAuthFailed</function> - authentication failed.
+    </para>
+  </listitem>
+</itemizedlist>
+</sect1>
+
+</chapter>
+
+<chapter id='ICE_Connections'>
+<title>ICE Connections</title>
+
+<para>
+In order for two clients to establish an ICE connection, one client has to be
+waiting for connections, and the other client has to initiate the connection.
+Most clients will initiate connections, so we discuss that first.
+</para>
+
+<sect1 id='Opening_an_ICE_Connection'>
+<title>Opening an ICE Connection</title>
+
+
+<para>
+To open an ICE connection with another client (that is, waiting
+for connections), use <xref linkend='IceOpenConnection' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='IceOpenConnection'>
+<funcprototype>
+  <funcdef>IceConn <function>IceOpenConnection</function></funcdef>
+    <paramdef>char<parameter> *network_ids_list</parameter></paramdef>
+    <paramdef>IcePointer<parameter> context</parameter></paramdef>
+    <paramdef>Bool<parameter> must_authenticate</parameter></paramdef>
+    <paramdef>int<parameter> major_opcode_check</parameter></paramdef>
+    <paramdef>int<parameter> error_length</parameter></paramdef>
+    <paramdef>char<parameter> *error_string_ret</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>network_ids_list</emphasis></term>
+    <listitem>
+      <para>
+Specifies the network ID(s) of the other client.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>context</emphasis></term>
+    <listitem>
+      <para>
+A pointer to an opaque object or NULL.  Used to determine if an
+ICE connection can be shared (see below).
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>must_authenticate</emphasis></term>
+    <listitem>
+      <para>
+If <function>True</function> the other client may not bypass authentication.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>major_opcode_check</emphasis></term>
+    <listitem>
+      <para>
+Used to force a new ICE connection to be created (see below).
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>error_length</emphasis></term>
+    <listitem>
+      <para>Length of the error_string_ret argument passed in.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>error_string_ret</emphasis></term>
+    <listitem>
+      <para>
+Returns a null-terminated error message, if any.  The error_string_ret
+argument points to user supplied memory.  No more than error_length bytes
+are used.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+<xref linkend='IceOpenConnection' xrefstyle='select: title'/>
+returns an opaque ICE connection object if it succeeds;
+otherwise, it returns NULL.
+</para>
+
+<para>
+The network_ids_list argument contains a list of network IDs separated
+by commas.  An attempt will be made to use the first network ID.  If
+that fails, an attempt will be made using the second network ID, and so on.
+Each network ID has the following format:
+</para>
+
+<informaltable frame='none'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+    <colspec colname='c1' colwidth='1.0*'/>
+    <colspec colname='c2' colwidth='2.0*'/>
+    <tbody>
+      <row>
+        <entry>tcp/&lt;hostname&gt;:&lt;portnumber&gt;</entry>
+        <entry>or</entry>
+      </row>
+      <row>
+        <entry>decnet/&lt;hostname&gt;::&lt;objname&gt;</entry>
+        <entry>or</entry>
+      </row>
+      <row>
+        <entry>local/&lt;hostname&gt;:&lt;path&gt;</entry>
+        <entry></entry>
+      </row>
+    </tbody>
+  </tgroup>
+</informaltable>
+
+
+<para>Most protocol libraries will have some sort of open function that should
+internally make a call into
+<xref linkend='IceOpenConnection' xrefstyle='select: title'/>
+When
+<xref linkend='IceOpenConnection' xrefstyle='select: title'/>
+is called, it may be possible to use a previously opened ICE connection (if
+the target client is the same).  However, there are cases in which shared
+ICE connections are not desired.</para>
+
+<para>The context argument is used to determine if an ICE connection can
+be shared.
+If context is NULL,
+then the caller is always willing to share the connection.
+If context is not NULL,
+then the caller is not willing to use a previously opened ICE connection
+that has a different non-NULL context associated with it.</para>
+
+<para>In addition, if major_opcode_check contains a nonzero major opcode value,
+a previously created ICE connection will be used only if the major opcode
+is not active on the connection.  This can be used to force multiple ICE
+connections between two clients for the same protocol.</para>
+
+<para>Any authentication requirements are handled internally by the ICE library.
+The method by which the authentication data is obtained
+is implementation-dependent.
+  <footnote remap='FS'>
+<para>The X Consortium's ICElib implementation uses an .ICEauthority file (see
+Appendix A).
+  </para></footnote> </para>
+
+<para>After
+<xref linkend='IceOpenConnection' xrefstyle='select: title'/>
+is called, the client is ready to send a
+<function>ProtocolSetup</function>
+(provided that
+<xref linkend='IceRegisterForProtocolSetup' xrefstyle='select: title'/>
+was called) or receive a
+<function>ProtocolSetup</function>
+(provided that
+<xref linkend='IceRegisterForProtocolReply' xrefstyle='select: title'/>
+was called).</para>
+</sect1>
+
+<sect1 id='Listening_for_ICE_Connections'>
+<title>Listening for ICE Connections</title>
+
+<para>Clients wishing to accept ICE connections must first call
+<xref linkend='IceListenForConnections' xrefstyle='select: title'/>
+or
+<xref linkend='IceListenForWellKnownConnections' xrefstyle='select: title'/>
+so that they can listen for connections.  A list of opaque "listen" objects are
+returned, one for each type of transport method that is available
+(for example, Unix Domain, TCP, DECnet, and so on).</para>
+
+<para>Normally clients will let ICElib allocate an available name in each
+transport and return listen objects.  Such a client will then use
+<xref linkend='IceComposeNetworkIdList' xrefstyle='select: title'/>
+to extract the chosen names and make them
+available to other clients for opening the connection.  In certain
+cases it may be necessary for a client to listen for connections
+on pre-arranged transport object names.  Such a client may use
+<xref linkend='IceListenForWellKnownConnections' xrefstyle='select: title'/>
+to specify the names for the listen objects.</para>
+
+<funcsynopsis id='IceListenForConnections'>
+<funcprototype>
+  <funcdef>Status <function>IceListenForConnections</function></funcdef>
+    <paramdef>int<parameter> *count_ret</parameter></paramdef>
+    <paramdef>IceListenObj<parameter> **listen_objs_ret</parameter></paramdef>
+    <paramdef>int<parameter> error_length</parameter></paramdef>
+    <paramdef>char<parameter> *error_string_ret</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>count_ret</emphasis></term>
+    <listitem><para>Returns the number of listen objects created.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>listen_objs_ret</emphasis></term>
+    <listitem><para>Returns a list of pointers to opaque listen objects.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>error_length</emphasis></term>
+  <listitem>
+<para>The length of the error_string_ret argument passed in.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>error_string_ret</emphasis></term>
+  <listitem>
+<para>Returns a null-terminated error message, if any.
+The error_string_ret points to user supplied memory.
+No more than error_length bytes are used.</para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>The return value of
+<xref linkend='IceListenForConnections' xrefstyle='select: title'/>
+is zero for failure and a positive value for success.</para>
+
+<funcsynopsis id='IceListenForWellKnownConnections'>
+<funcprototype>
+  <funcdef>Status <function>IceListenForWellKnownConnections</function></funcdef>
+    <paramdef>char<parameter> *port_id</parameter></paramdef>
+    <paramdef>int<parameter> *count_ret</parameter></paramdef>
+    <paramdef>IceListenObj<parameter> **listen_objs_ret</parameter></paramdef>
+    <paramdef>int<parameter> error_length</parameter></paramdef>
+    <paramdef>char<parameter> *error_string_ret</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>port_id</emphasis></term>
+    <listitem>
+      <para>
+Specifies the port identification for the address(es) to be opened.  The
+value must not contain the slash ("/"> or comma (".") character; thse are
+reserved for future use.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>count_ret</emphasis></term>
+    <listitem>
+      <para>Returns the number of listen objects created.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>listen_objs_ret</emphasis></term>
+    <listitem>
+      <para>
+Returns a list of pointers to opaque listen objects.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>listen_objs_ret</emphasis></term>
+    <listitem>
+      <para>
+Returns a list of pointers to opaque listen objects.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>error_length</emphasis></term>
+    <listitem>
+      <para>
+The length of the error_string_ret argument passed in.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>error_string_ret</emphasis></term>
+    <listitem>
+      <para>
+Returns a null-terminated error message, if any.  The error_string_ret
+points to user supplied memory.  No more than error_length bytes are used.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='IceListenForWellKnownConnections' xrefstyle='select: title'/> constructs a list
+of network IDs by prepending each known transport to port_id and then
+attempts to create listen objects for the result.  Port_id is the portnumber,
+objname, or path portion of the ICE network ID. If a listen object for
+a particular network ID cannot be created the network ID is ignored.
+If no listen objects are created
+<xref linkend='IceListenForWellKnownConnections' xrefstyle='select: title'/>
+returns failure.
+</para>
+
+<para>
+The return value of <xref linkend='IceListenForWellKnownConnections' xrefstyle='select: title'/>
+is zero for failure and a positive value for success.
+</para>
+
+<para>
+To close and free the listen objects, use
+<xref linkend='IceFreeListenObjs' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='IceFreeListenObjs'>
+<funcprototype>
+  <funcdef>void <function>IceFreeListenObjs</function></funcdef>
+    <paramdef>int<parameter> count</parameter></paramdef>
+    <paramdef>IceListenObj<parameter> *listen_objs</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>count</emphasis></term>
+    <listitem>
+      <para>The number of listen objects.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>listen_objs</emphasis></term>
+    <listitem>
+      <para>The listen objects.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+To detect a new connection on a listen object, use
+<function>select</function> on the descriptor associated with
+the listen object.
+</para>
+
+<para>
+To obtain the descriptor, use
+<xref linkend='IceGetListenConnectionNumber' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='IceGetListenConnectionNumber'>
+<funcprototype>
+  <funcdef>int <function>IceGetListenConnectionNumber</function></funcdef>
+    <paramdef>IceListenObj<parameter> *listen_objs</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+  <term><emphasis remap='I'>listen_obj</emphasis></term>
+    <listitem>
+      <para>The listen objects.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+To obtain the network ID string associated with a listen object, use
+<xref linkend='IceGetListenConnectionString' xrefstyle='select: title'/>
+</para>
+
+
+<funcsynopsis id='IceGetListenConnectionString'>
+<funcprototype>
+  <funcdef>char <function>IceGetListenConnectionString</function></funcdef>
+    <paramdef>IceListenObj<parameter> listen_obj</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>listen_obj</emphasis></term>
+    <listitem>
+      <para>The listen objects.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>A network ID has the following format:</para>
+
+<informaltable frame='none'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+    <colspec colname='c1' colwidth='1.0*'/>
+    <colspec colname='c2' colwidth='2.0*'/>
+    <tbody>
+      <row>
+        <entry>tcp/&lt;hostname&gt;:&lt;portnumber&gt;</entry>
+        <entry>or</entry>
+      </row>
+      <row>
+        <entry>decnet/&lt;hostname&gt;::&lt;objname&gt;</entry>
+        <entry>or</entry>
+      </row>
+      <row>
+        <entry>local/&lt;hostname&gt;:&lt;path&gt;</entry>
+        <entry></entry>
+      </row>
+    </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+To compose a string containing a list of network IDs separated by commas
+(the format recognized by <xref linkend='IceOpenConnection' xrefstyle='select: title'/>
+use <xref linkend='IceComposeNetworkIdList' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='IceComposeNetworkIdList'>
+<funcprototype>
+  <funcdef>char <function>IceComposeNetworkIdList</function></funcdef>
+    <paramdef>int<parameter> count</parameter></paramdef>
+    <paramdef>IceListenObj<parameter> *listen_objs</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>count</emphasis></term>
+    <listitem>
+      <para>The number of listen objects.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>listen_objs</emphasis></term>
+    <listitem>
+      <para>The listen objects.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+</sect1>
+
+<sect1 id='Host_Based_Authentication_for_ICE_Connections'>
+<title>Host Based Authentication for ICE Connections</title>
+
+<para>
+If authentication fails when a client attempts to open an
+ICE connection and the initiating client has not required authentication,
+a host based authentication procedure may be invoked to provide
+a last chance for the client to connect.  Each listen object has such a
+callback associated with it, and this callback is set using the
+<xref linkend='IceSetHostBasedAuthProc' xrefstyle='select: title'/>
+function.
+</para>
+
+<funcsynopsis id='IceSetHostBasedAuthProc'>
+<funcprototype>
+  <funcdef>void <function>IceSetHostBasedAuthProc</function></funcdef>
+    <paramdef>IceListenObj<parameter> listen_obj</parameter></paramdef>
+    <paramdef>IceHostBasedAuthProc<parameter> host_based_auth_proc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>IceListenObj</emphasis></term>
+    <listitem>
+      <para>The listen object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>host_based_auth_proc</emphasis></term>
+    <listitem>
+      <para>The host based authentication procedure.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+By default, each listen object has no host based authentication procedure
+associated with it.  Passing NULL for host_based_auth_proc turns off
+host based authentication if it was previously set.
+</para>
+
+
+<funcsynopsis id='HostBasedAuthProc'>
+<funcprototype>
+  <funcdef>Bool <function>HostBasedAuthProc</function></funcdef>
+    <paramdef>char<parameter> *host_name</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>host_name</emphasis></term>
+    <listitem>
+      <para>
+The host name of the client that tried to open an ICE connection.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+The host_name argument is a string in the form
+<emphasis remap='I'>protocol</emphasis>/
+<emphasis remap='I'>hostname</emphasis>,
+where <emphasis remap='I'>protocol</emphasis> is one of
+{tcp, decnet, local}.
+</para>
+
+<para>
+If <function>IceHostBasedAuthProc</function> returns
+<function>True</function>
+access will be granted, even though the original authentication failed.
+Note that authentication can effectively be disabled by registering an
+<function>IceHostBasedAuthProc</function>
+which always returns <function>True</function>
+</para>
+
+<para>
+Host based authentication is also allowed at
+<function>ProtocolSetup</function> time.
+The callback is specified in the
+<xref linkend='IceRegisterForProtocolReply' xrefstyle='select: title'/>
+function (see
+<xref linkend='Protocol_Registration' xrefstyle='select: title'/>).
+</para>
+</sect1>
+
+<sect1 id='Accepting_ICE_Connections'>
+<title>Accepting ICE Connections</title>
+
+
+<para>
+After a connection attempt is detected on a listen object returned by
+<xref linkend='IceListenForConnections' xrefstyle='select: title'/>
+you should call <xref linkend='IceAcceptConnection' xrefstyle='select: title'/>
+This returns a new opaque ICE connection object.
+</para>
+
+<funcsynopsis id='IceAcceptConnection'>
+<funcprototype>
+  <funcdef>IceConn <function>IceAcceptConnection</function></funcdef>
+    <paramdef>IceListenObj<parameter> listen_obj</parameter></paramdef>
+    <paramdef>IceAcceptStatus<parameter> *status_ret</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+
+<variablelist remap='IP'>
+  <varlistentry>
+  <term><emphasis remap='I'>listen_obj</emphasis></term>
+  <listitem>
+<para>The listen object on which a new connection was detected.</para>
+  </listitem>
+  </varlistentry>
+  </variablelist>
+  <variablelist remap='IP'>
+  <varlistentry>
+  <term><emphasis remap='I'>status_ret</emphasis></term>
+  <listitem>
+<para>Return status information.</para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>The status_ret argument is set to one of the following values:</para>
+<itemizedlist>
+  <listitem>
+<para><function>IceAcceptSuccess</function>
+- the accept operation succeeded,
+and the function returns a new connection object.</para>
+  </listitem>
+  <listitem>
+<para><function>IceAcceptFailure</function>
+- the accept operation failed, and the function returns NULL.</para>
+  </listitem>
+  <listitem>
+<para><function>IceAcceptBadMalloc</function>
+- a memory allocation failed, and the function returns NULL.</para>
+  </listitem>
+</itemizedlist>
+
+<para>In general, to detect new connections, you should call
+<function>select</function>
+on the file descriptors associated with the listen objects.
+When a new connection is detected, the
+<xref linkend='IceAcceptConnection' xrefstyle='select: title'/>
+function should be called.
+<xref linkend='IceAcceptConnection' xrefstyle='select: title'/>
+may return a new ICE connection that is in a pending state.  This is because
+before the connection can become valid, authentication may be necessary.
+Because the ICE library cannot block and wait for the connection to
+become valid (infinite blocking can occur if the connecting client
+does not act properly), the application must wait for the connection status
+to become valid.</para>
+
+<para>The following pseudo-code demonstrates how connections are accepted:</para>
+
+<literallayout class="monospaced">
+new_ice_conn = IceAcceptConnection (listen_obj, &amp;accept_status);
+if (accept_status != IceAcceptSuccess)
+{
+     close the file descriptor and return
+}
+
+status = IceConnectionStatus (new_ice_conn);
+time_start = time_now;
+
+while (status == IceConnectPending)
+{
+     select() on {new_ice_conn, all open connections}
+
+     for (each ice_conn in the list of open connections)
+          if (data ready on ice_conn)
+          {
+               status = IceProcessMessages (ice_conn, NULL, NULL);
+               if (status == IceProcessMessagesIOError)
+                    IceCloseConnection(ice_conn);
+          }
+     if data ready on new_ice_conn
+     {
+          /*
+          * IceProcessMessages is called until the connection
+          * is non-pending.  Doing so handles the connection
+          * setup request and any authentication requirements.
+          */
+
+          IceProcessMessages ( new_ice_conn, NULL, NULL);
+          status = IceConnectionStatus (new_ice_conn);
+     }
+     else
+     {
+          if (time_now - time_start &gt; MAX_WAIT_TIME)
+               status = IceConnectRejected;
+     }
+}
+
+if (status == IceConnectAccepted)
+{
+     Add new_ice_conn to the list of open connections
+}
+else
+{
+     IceCloseConnection
+     new_ice_conn
+}
+</literallayout>
+
+<para>After
+<xref linkend='IceAcceptConnection' xrefstyle='select: title'/>
+is called and the connection has been
+validated, the client is ready to receive a
+<function>ProtocolSetup</function>
+(provided
+that
+<xref linkend='IceRegisterForProtocolReply' xrefstyle='select: title'/>
+was called) or send a
+<function>ProtocolSetup</function>
+(provided that
+<xref linkend='IceRegisterForProtocolSetup' xrefstyle='select: title'/>
+was called).</para>
+</sect1>
+
+<sect1 id='Closing_ICE_Connections'>
+<title>Closing ICE Connections</title>
+
+<para>To close an ICE connection created with
+<xref linkend='IceOpenConnection' xrefstyle='select: title'/>
+or
+<xref linkend='IceAcceptConnection' xrefstyle='select: title'/>
+use
+<xref linkend='IceCloseConnection' xrefstyle='select: title'/></para>
+
+<funcsynopsis id='IceCloseConnection'>
+<funcprototype>
+  <funcdef>IceCloseStatus <function>IceCloseConnection</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+  <term><emphasis remap='I'>ice_conn</emphasis></term>
+  <listitem>
+  <para>The ICE connection to close.</para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>To actually close an ICE connection, the following conditions
+must be met:</para>
+
+<itemizedlist>
+  <listitem>
+<para>The <emphasis remap='I'>open reference count</emphasis> must have reached zero on this ICE connection.
+When
+<xref linkend='IceOpenConnection' xrefstyle='select: title'/>
+is called, it tries to use a previously opened
+ICE connection.  If it is able to use an existing connection, it increments
+the open reference count on the connection by one.
+So, to close an ICE connection, each call to
+<xref linkend='IceOpenConnection' xrefstyle='select: title'/>
+must be matched with a call to
+<xref linkend='IceCloseConnection' xrefstyle='select: title'/>
+The connection can be closed only
+on the last call to
+<xref linkend='IceCloseConnection' xrefstyle='select: title'/></para>
+  </listitem>
+  <listitem>
+<para>The <emphasis remap='I'>active protocol count</emphasis> must have reached zero.  Each time a
+<function>ProtocolSetup</function>
+succeeds on the connection, the active protocol count
+is incremented by one.  When the client no longer expects to use the
+protocol on the connection, the
+<xref linkend='IceProtocolShutdown' xrefstyle='select: title'/>
+function should be called, which decrements the active protocol count
+by one (see
+<xref linkend='Protocol_Setup_and_Shutdown' xrefstyle='select: title'/>).
+</para>
+  </listitem>
+  <listitem>
+<para>If shutdown negotiation is enabled on the connection, the client on the other
+side of the ICE connection must agree to have the connection closed.</para>
+
+<para><xref linkend='IceCloseConnection' xrefstyle='select: title'/>
+returns one of the following values:</para>
+  </listitem>
+  <listitem>
+<para><function>IceClosedNow</function>
+- the ICE connection was closed at this time.  The watch procedures were
+invoked and the connection was freed.</para>
+  </listitem>
+  <listitem>
+<para><function>IceClosedASAP</function>
+- an IO error had occurred on the connection, but
+<xref linkend='IceCloseConnection' xrefstyle='select: title'/>
+is being called within a nested
+<xref linkend='IceProcessMessages' xrefstyle='select: title'/>
+The watch procedures have been invoked at this time, but the connection
+will be freed as soon as possible (when the nesting level reaches zero and
+<xref linkend='IceProcessMessages' xrefstyle='select: title'/>
+returns a status of
+<function>IceProcessMessagesConnectionClosed</function></para>
+  </listitem>
+  <listitem>
+<para><function>IceConnectionInUse</function>
+- the connection was not closed at this time, because it is being used by
+other active protocols.</para>
+  </listitem>
+  <listitem>
+<para><function>IceStartedShutdownNegotiation</function>
+- the connection was not closed at this time and shutdown negotiation started
+with the client on the other side of the ICE connection.  When the connection
+is actually closed,
+<xref linkend='IceProcessMessages' xrefstyle='select: title'/>
+will return a status of
+<function>IceProcessMessagesConnectionClosed</function></para>
+  </listitem>
+</itemizedlist>
+
+<para>When it is known that the client on the other side of the ICE connection
+has terminated the connection without initiating shutdown negotiation, the
+<xref linkend='IceSetShutdownNegotiation' xrefstyle='select: title'/>
+function should be called to turn off shutdown negotiation.  This will prevent
+<xref linkend='IceCloseConnection' xrefstyle='select: title'/>
+from writing to a broken connection.</para>
+
+<funcsynopsis id='IceSetShutdownNegotiation'>
+<funcprototype>
+  <funcdef>void <function>IceSetShutdownNegotiation</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>Bool<parameter> negotiate</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+  <term><emphasis remap='I'>ice_conn</emphasis></term>
+  <listitem>
+  <para>A valid ICE connection object.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>negotiate</emphasis></term>
+  <listitem>
+<para>If
+<function>False</function>
+shutdown negotiating will be turned off.</para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>To check the shutdown negotiation status of an ICE connection, use
+<xref linkend='IceCheckShutdownNegotiation' xrefstyle='select: title'/></para>
+
+<funcsynopsis id='IceCheckShutdownNegotiation'>
+<funcprototype>
+  <funcdef>Bool <function>IceCheckShutdownNegotiation</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+  <term><emphasis remap='I'>ice_conn</emphasis></term>
+  <listitem>
+  <para>A valid ICE connection object.</para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para><xref linkend='IceCheckShutdownNegotiation' xrefstyle='select: title'/>
+returns
+<function>True</function>
+if shutdown negotiation will take place on the connection;
+otherwise, it returns
+<function>False</function>
+Negotiation is on by default for a connection.  It
+can only be changed with the
+<xref linkend='IceSetShutdownNegotiation' xrefstyle='select: title'/>
+function.</para>
+</sect1>
+
+<sect1 id='Connection_Watch_Procedures'>
+<title>Connection Watch Procedures</title>
+
+<para>To add a watch procedure that will be called
+each time ICElib opens a new connection via
+<xref linkend='IceOpenConnection' xrefstyle='select: title'/>
+or
+<xref linkend='IceAcceptConnection' xrefstyle='select: title'/>
+or closes a connection via
+<xref linkend='IceCloseConnection' xrefstyle='select: title'/>
+use
+<xref linkend='IceAddConnectionWatch' xrefstyle='select: title'/></para>
+
+<funcsynopsis id='IceAddConnectionWatch'>
+<funcprototype>
+  <funcdef>Status <function>IceAddConnectionWatch</function></funcdef>
+    <paramdef>IceWatchProc<parameter> watch_proc</parameter></paramdef>
+    <paramdef>IcePointer<parameter> client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>watch_proc</emphasis></term>
+    <listitem>
+      <para>
+The watch procedure to invoke when ICElib opens or closes a connection.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>client_data</emphasis></term>
+    <listitem>
+      <para>This pointer will be passed to the watch procedure.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+The return value of <xref linkend='IceAddConnectionWatch' xrefstyle='select: title'/>
+is zero for failure, and a positive value for success.
+</para>
+
+<para>
+Note that several calls to <xref linkend='IceOpenConnection' xrefstyle='select: title'/>
+might share the same ICE connection.  In such a case, the watch procedure
+is only invoked when the connection is first created (after authentication
+succeeds).  Similarly, because connections might be shared, the
+watch procedure is called only if <xref linkend='IceCloseConnection' xrefstyle='select: title'/>
+actually closes the connection (right before the IceConn is freed).
+</para>
+
+<para>
+The watch procedures are very useful for applications that
+need to add a file descriptor to a select mask when a new connection
+is created and remove the file descriptor when the connection is destroyed.
+Because connections are shared, knowing when to add and remove the file
+descriptor from the select mask would be difficult without the watch
+procedures.
+</para>
+
+<para>
+Multiple watch procedures may be registered with the ICE library.
+No assumptions should be made about their order of invocation.
+</para>
+
+<para>
+If one or more ICE connections were already created by the ICE library at the
+time the watch procedure is registered, the watch procedure will instantly
+be invoked for each of these ICE connections (with the opening argument
+set to <function>True</function>
+</para>
+
+<para>
+The watch procedure is of type <function>IceWatchProc</function>
+</para>
+
+<funcsynopsis id='WatchProc'>
+<funcprototype>
+  <funcdef>void <function>WatchProc</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>IcePointer<parameter> client_data</parameter></paramdef>
+    <paramdef>Bool<parameter> opening</parameter></paramdef>
+    <paramdef>IcePointer<parameter> *watch_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>
+The opened or closed ICE connection.  Call
+<function>IceConnectionNumber</function>
+to get the file descriptor associated with this connection.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>client_data</emphasis></term>
+    <listitem>
+      <para>
+Client data specified in the call to
+<xref linkend='IceAddConnectionWatch' xrefstyle='select: title'/>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>opening</emphasis></term>
+    <listitem>
+      <para>
+If <function>True</function> the connection is being opened.  If
+<function>False</function> the connection is being closed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>watch_data</emphasis></term>
+    <listitem>
+      <para>Can be used to save a pointer to client data.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If opening is <function>True</function> the client should set the
+*watch_data pointer to any data it may need to save until the connection
+is closed and the watch procedure is invoked again with opening set to
+<function>False</function>
+</para>
+
+<para>
+To remove a watch procedure, use
+<xref linkend='IceRemoveConnectionWatch' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='IceRemoveConnectionWatch'>
+<funcprototype>
+  <funcdef>void <function>IceRemoveConnectionWatch</function></funcdef>
+    <paramdef>IceWatchProc<parameter> watch_proc</parameter></paramdef>
+    <paramdef>IcePointer<parameter> client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>watch_proc</emphasis></term>
+    <listitem>
+      <para>
+The watch procedure that was passed to
+<xref linkend='IceAddConnectionWatch' xrefstyle='select: title'/>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>client_data</emphasis></term>
+    <listitem>
+      <para>
+The client_data pointer that was passed to
+<xref linkend='IceAddConnectionWatch' xrefstyle='select: title'/>
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+</sect1>
+</chapter>
+
+<chapter id='Protocol_Setup_and_Shutdown'>
+<title>Protocol Setup and Shutdown</title>
+
+<para>
+To activate a protocol on a given ICE connection, use
+<xref linkend='IceProtocolSetup' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='IceProtocolSetup'>
+<funcprototype>
+  <funcdef>IceProtocolSetupStatus <function>IceProtocolSetup</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>int<parameter> my_opcode</parameter></paramdef>
+    <paramdef>IcePointer<parameter> client_data</parameter></paramdef>
+    <paramdef>Bool<parameter> must_authenticate</parameter></paramdef>
+    <paramdef>int<parameter> *major_version_ret</parameter></paramdef>
+    <paramdef>int<parameter> *minor_version_ret</parameter></paramdef>
+    <paramdef>char<parameter> **vendor_ret</parameter></paramdef>
+    <paramdef>char<parameter> **release_ret</parameter></paramdef>
+    <paramdef>int<parameter> error_length</parameter></paramdef>
+    <paramdef>char<parameter> *error_string_ret</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>my_opcode</emphasis></term>
+    <listitem>
+      <para>
+The major opcode of the protocol to be set up, as returned by
+<xref linkend='IceRegisterForProtocolSetup' xrefstyle='select: title'/>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>client_data</emphasis></term>
+    <listitem>
+      <para>
+The client data stored in this pointer will be passed to the
+<function>IcePoProcessMsgProc</function> callback.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>must_authenticate</emphasis></term>
+    <listitem>
+      <para>
+If <function>True</function> the other client may
+not bypass authentication.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>major_version_ret</emphasis></term>
+    <listitem>
+      <para>The major version of the protocol to be used is returned.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>minor_version_ret</emphasis></term>
+    <listitem>
+      <para>The minor version of the protocol to be used is returned.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>vendor_ret</emphasis></term>
+    <listitem>
+      <para>The vendor string specified by the protocol acceptor.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>release_ret</emphasis></term>
+    <listitem>
+      <para>The release string specified by the protocol acceptor.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>error_length</emphasis></term>
+    <listitem>
+      <para>
+Specifies the length of the error_string_ret argument passed in.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>error_string_ret</emphasis></term>
+    <listitem>
+      <para>
+Returns a null-terminated error message, if any.
+The error_string_ret argument points to user supplied memory.
+No more than error_length bytes are used.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The vendor_ret and release_ret strings should be freed with
+<function>free</function> when no longer needed.
+</para>
+
+<para>
+<xref linkend='IceProtocolSetup' xrefstyle='select: title'/> returns one of the following values:
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+<function>IceProtocolSetupSuccess</function> - the major_version_ret,
+minor_version_ret, vendor_ret, release_ret are set.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>IceProtocolSetupFailure</function> or
+<function>IceProtocolSetupIOError</function>
+- check error_string_ret for failure reason.  The major_version_ret,
+minor_version_ret, vendor_ret, release_ret are not set.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>IceProtocolAlreadyActive</function>
+- this protocol is already active on this connection.
+The major_version_ret, minor_version_ret, vendor_ret, release_ret
+are not set.
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+To notify the ICE library when a given protocol will no longer be used
+on an ICE connection, use <xref linkend='IceProtocolShutdown' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='IceProtocolShutdown'>
+<funcprototype>
+  <funcdef>Status <function>IceProtocolShutdown</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>int<parameter> major_opcode</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+  <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>major_opcode</emphasis></term>
+    <listitem>
+      <para>The major opcode of the protocol to shut down.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+The return value of <xref linkend='IceProtocolShutdown' xrefstyle='select: title'/>
+is zero for failure and a positive value for success.
+</para>
+
+<para>
+Failure will occur if the major opcode was never registered OR the protocol
+of the major opcode was never activated on the connection.  By activated,
+we mean that a <function>ProtocolSetup</function> succeeded on the connection.
+Note that ICE does not define how each sub-protocol triggers a
+protocol shutdown.
+</para>
+</chapter>
+
+<chapter id='Processing_Messages'>
+<title>Processing Messages</title>
+
+
+<para>To process incoming messages on an ICE connection, use
+<xref linkend='IceProcessMessages' xrefstyle='select: title'/></para>
+
+<funcsynopsis id='IceProcessMessages'>
+<funcprototype>
+  <funcdef>IceProcessMessagesStatus <function>IceProcessMessages</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>IceReplyWaitInfo<parameter> *reply_wait</parameter></paramdef>
+    <paramdef>Bool<parameter> *reply_ready_ret</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>reply_wait</emphasis></term>
+    <listitem>
+      <para>Indicates if a reply is being waited for.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>reply_ready_ret</emphasis></term>
+    <listitem>
+      <para>
+If set to <function>True</function> on return, a reply is ready.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='IceProcessMessages' xrefstyle='select: title'/> is used in two ways:
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+In the first, a client may generate a message and block by calling
+<xref linkend='IceProcessMessages' xrefstyle='select: title'/> repeatedly until it gets its reply.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+In the second, a client calls <xref linkend='IceProcessMessages' xrefstyle='select: title'/>
+with reply_wait set to NULL in response to <function>select</function>
+showing that there is data to read on the ICE connection.
+The ICE library may process zero or more complete messages.
+Note that messages that are not blocked for are always processed by
+invoking callbacks.
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+<function>IceReplyWaitInfo</function> contains the major/minor opcodes
+and sequence number of the message for which a reply is being awaited.
+It also contains a pointer to the reply message to be filled in (the
+protocol library should cast this <function>IcePointer</function>
+to the appropriate reply type).  In most
+cases, the reply will have some fixed-size part, and the client waiting
+for the reply will have provided a pointer to a structure to hold
+this fixed-size data.  If there is variable-length data, it would be
+expected that the
+<function>IcePoProcessMsgProc</function>
+callback will have to allocate additional
+memory and store pointer(s) to that memory in the fixed-size
+structure.  If the entire data is variable length (for example, a single
+variable-length string), then the client waiting for the reply would probably
+just pass a pointer to fixed-size space to hold a pointer, and the
+<function>IcePoProcessMsgProc</function>
+callback would allocate the storage and store the pointer.
+It is the responsibility of the client receiving the reply to
+free up any memory allocated on its behalf.
+</para>
+
+<literallayout class="monospaced">
+typedef struct {
+     unsigned long sequence_of_request;
+     int major_opcode_of_request;
+     int minor_opcode_of_request;
+     IcePointer reply;
+} IceReplyWaitInfo;
+</literallayout>
+
+<para>
+If reply_wait is not NULL and
+<xref linkend='IceProcessMessages' xrefstyle='select: title'/>
+has a reply or error to return in response to this reply_wait
+(that is, no callback was generated), then the reply_ready_ret argument
+will be set to <function>True</function>
+</para>
+
+<para>
+If reply_wait is NULL, then the caller may also pass NULL for
+reply_ready_ret and be guaranteed that no value will be stored in
+this pointer.
+</para>
+
+<para>
+<xref linkend='IceProcessMessages' xrefstyle='select: title'/> returns one of the following values:
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+<function>IceProcessMessagesSuccess</function> - no error occurred.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>IceProcessMessagesIOError</function> - an IO error occurred,
+and the caller must explicitly close the connection by calling
+<xref linkend='IceCloseConnection' xrefstyle='select: title'/>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>IceProcessMessagesConnectionClosed</function>
+- the ICE connection has been closed (closing of the connection was deferred
+because of shutdown negotiation, or because the
+<xref linkend='IceProcessMessages' xrefstyle='select: title'/>
+nesting level was not zero).  Do not attempt
+to access the ICE connection at this point, since it has been freed.
+    </para>
+  </listitem>
+</itemizedlist>
+
+</chapter>
+
+<chapter id='Ping'>
+<title>Ping</title>
+
+<para>
+To send a "Ping" message to the client on the other side of the
+ICE connection, use <xref linkend='IcePing' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='IcePing'>
+<funcprototype>
+  <funcdef>Status <function>IcePing</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>IcePingReplyProc<parameter> ping_reply_proc</parameter></paramdef>
+    <paramdef>IcePointer<parameter> client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>ping_reply_proc</emphasis></term>
+    <listitem>
+      <para>The callback to invoke when the Ping reply arrives.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>client_data</emphasis></term>
+    <listitem>
+      <para>
+This pointer will be passed to the <function>IcePingReplyProc</function>
+callback.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para><xref linkend='IcePing' xrefstyle='select: title'/>
+returns zero for failure and a positive value for success.</para>
+
+<para>When
+<xref linkend='IceProcessMessages' xrefstyle='select: title'/>
+processes the Ping reply, it will invoke the
+<function>IcePingReplyProc</function>
+callback.</para>
+
+<funcsynopsis id='PingReplyProc'>
+<funcprototype>
+  <funcdef>void <function>PingReplyProc</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>IcePointer<parameter> client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+  <term><emphasis remap='I'>ice_conn</emphasis></term>
+  <listitem>
+<para>A valid ICE connection object.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='I'>client_data</emphasis></term>
+  <listitem>
+<para>The client data specified in the call to
+<xref linkend='IcePing' xrefstyle='select: title'/></para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+</chapter>
+
+<chapter id='Using_ICElib_Informational_Functions'>
+<title>Using ICElib Informational Functions</title>
+
+<funcsynopsis id='IceConnectionStatus'>
+<funcprototype>
+  <funcdef>IceConnectStatus <function>IceConnectionStatus</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para><xref linkend='IceConnectionStatus' xrefstyle='select: title'/>
+returns the status of an ICE connection.  The possible return values are:</para>
+
+<itemizedlist>
+  <listitem>
+<para><function>IceConnectPending</function>
+- the connection is not valid yet (that is, authentication is taking place).
+This is only relevant to connections created by
+<xref linkend='IceAcceptConnection' xrefstyle='select: title'/></para>
+  </listitem>
+  <listitem>
+<para><function>IceConnectAccepted</function>
+- the connection has been accepted.
+This is only relevant to connections created by
+<xref linkend='IceAcceptConnection' xrefstyle='select: title'/></para>
+  </listitem>
+  <listitem>
+<para><function>IceConnectRejected</function>
+- the connection had been rejected  (that is, authentication failed).
+This is only relevant to connections created by
+<xref linkend='IceAcceptConnection' xrefstyle='select: title'/></para>
+  </listitem>
+  <listitem>
+<para><function>IceConnectIOError</function>
+- an IO error has occurred on the connection.</para>
+  </listitem>
+</itemizedlist>
+
+<funcsynopsis id='IceVendor'>
+<funcprototype>
+  <funcdef>char <function> *IceVendor</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para><function>IceVendor</function>
+returns the ICE library vendor identification
+for the other side of the connection.
+The string should be freed with a call to
+<function>free</function>
+when no longer needed.</para>
+
+<funcsynopsis id='IceRelease'>
+<funcprototype>
+  <funcdef>char <function> *IceRelease</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para><function>IceRelease</function>
+returns the release identification of the ICE library
+on the other side of the connection.
+The string should be freed with a call to
+<function>free</function>
+when no longer needed.</para>
+
+<funcsynopsis id='IceProtocolVersion'>
+<funcprototype>
+  <funcdef>int <function> IceProtocolVersion</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para><xref linkend='IceProtocolVersion' xrefstyle='select: title'/>
+returns the major version of the ICE protocol on this connection.</para>
+
+<funcsynopsis id='IceProtocolRevision'>
+<funcprototype>
+  <funcdef>int <function> IceProtocolRevision</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+
+<para><xref linkend='IceProtocolRevision' xrefstyle='select: title'/>
+returns the minor version of the ICE protocol on this connection.</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>int <function> IceConnectionNumber</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+
+<para><function>IceConnectionNumber</function>
+returns the file descriptor of this ICE connection.</para>
+
+<funcsynopsis id='IceConnectionString'>
+<funcprototype>
+  <funcdef>char <function> *IceConnectionString</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para><function>IceConnectionString</function>
+returns the network ID of the client that
+accepted this connection.  The string should be freed with a call to
+<function>free</function>
+when no longer needed.</para>
+
+<funcsynopsis id='IceLastSentSequenceNumber'>
+<funcprototype>
+  <funcdef>unsigned long <function> IceLastSentSequenceNumber</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+
+<para><xref linkend='IceLastSentSequenceNumber' xrefstyle='select: title'/>
+returns the sequence number of the last message sent on this ICE connection.</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>unsigned long <function> IceLastReceivedSequenceNumber</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para><function>IceLastReceivedSequenceNumber</function>
+returns the sequence number of the last message received on this
+ICE connection.</para>
+
+<funcsynopsis id='IceSwapping'>
+<funcprototype>
+  <funcdef>Bool <function> IceSwapping</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+
+<para><xref linkend='IceSwapping' xrefstyle='select: title'/>
+returns
+<function>True</function>
+if byte swapping is necessary when reading messages on the ICE connection.</para>
+
+<funcsynopsis id='IceGetContext'>
+<funcprototype>
+  <funcdef>IcePointer <function> IceGetContext</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para><xref linkend='IceGetContext' xrefstyle='select: title'/>
+returns the context associated with a connection created by
+<xref linkend='IceOpenConnection' xrefstyle='select: title'/></para>
+</chapter>
+
+<chapter id='ICE_Messages'>
+<title>ICE Messages</title>
+
+<para>
+All ICE messages have a standard 8-byte header.  The ICElib macros that
+read and write messages rely on the following naming convention for message
+headers:
+</para>
+
+<literallayout class='monospaced'>
+     CARD8	major_opcode;
+     CARD8	minor_opcode;
+     CARD8	data[2];
+     CARD32	length;
+</literallayout>
+
+<para>
+The 3rd and 4th bytes of the message header can be used as needed.
+The length field is specified in units of 8 bytes.
+</para>
+
+<sect1 id='Sending_ICE_Messages'>
+<title>Sending ICE Messages</title>
+
+<para>
+The ICE library maintains an output buffer used for generating messages.
+Protocol libraries layered on top of ICE may choose to batch messages
+together and flush the output buffer at appropriate times.
+</para>
+
+<para>
+If an IO error has occurred on an ICE connection, all write operations
+will be ignored.  For further information, see
+<xref linkend='Error_Handling' xrefstyle='select: title'/>.
+</para>
+
+
+<para>
+To get the size of the ICE output buffer, use
+<xref linkend='IceGetOutBufSize' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='IceGetOutBufSize'>
+<funcprototype>
+  <funcdef>int <function> IceGetOutBufSize</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+To flush the ICE output buffer, use <xref linkend='IceFlush' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='IceFlush'>
+<funcprototype>
+  <funcdef>int <function> IceFlush</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+Note that the output buffer may be implicitly flushed if there is
+insufficient space to generate a message.
+</para>
+
+<para>The following macros can be used to generate ICE messages:</para>
+
+<funcsynopsis id='IceGetHeader'>
+<funcprototype>
+  <funcdef><function> IceGetHeader</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>int<parameter> major_opcode</parameter></paramdef>
+    <paramdef>int<parameter> minor_opcode</parameter></paramdef>
+    <paramdef>int<parameter> header_size</parameter></paramdef>
+    <paramdef>&lt;C_data_type&gt;<parameter> *pmsg</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>major_opcode</emphasis></term>
+    <listitem>
+      <para>The major opcode of the message.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>minor_opcode</emphasis></term>
+    <listitem>
+      <para>The minor opcode of the message.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>header_size</emphasis></term>
+    <listitem>
+      <para>The size of the message header (in bytes).</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>&lt;C_data_type&gt;</emphasis></term>
+    <listitem>
+      <para>The actual C data type of the message header.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>pmsg</emphasis></term>
+    <listitem>
+      <para>
+The message header pointer.  After this macro is called, the
+library can store data in the message header.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+<xref linkend='IceGetHeader' xrefstyle='select: title'/>
+is used to set up a message header on an ICE connection.
+It sets the major and minor opcodes of the message, and initializes
+the message's length to the length of the header.  If additional
+variable length data follows, the message's length field should be
+updated.
+</para>
+
+
+<funcsynopsis id='IceGetHeaderExtra'>
+<funcprototype>
+  <funcdef><function> IceGetHeaderExtra</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>int<parameter> major_opcode</parameter></paramdef>
+    <paramdef>int<parameter> minor_opcode</parameter></paramdef>
+    <paramdef>int<parameter> header_size</parameter></paramdef>
+    <paramdef>int<parameter> extra</parameter></paramdef>
+    <paramdef>&lt;C_data_type&gt;<parameter> *pmsg</parameter></paramdef>
+    <paramdef>char<parameter> *pdata</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>major_opcode</emphasis></term>
+    <listitem>
+      <para>The major opcode of the message.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>minor_opcode</emphasis></term>
+    <listitem>
+      <para>The minor opcode of the message.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>header_size</emphasis></term>
+    <listitem>
+      <para>The size of the message header (in bytes).</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>extra</emphasis></term>
+    <listitem>
+      <para>
+The size of the extra data beyond the header (in 8-byte units).
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>&lt;C_data_type&gt;</emphasis></term>
+    <listitem>
+      <para>The actual C data type of the message header.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>pmsg</emphasis></term>
+    <listitem>
+      <para>
+The message header pointer.  After this macro is called, the
+library can store data in the message header.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>pdata</emphasis></term>
+    <listitem>
+      <para>
+Returns a pointer to the ICE output buffer that points
+immediately after the message header.  The variable length
+data should be stored here.  If there was not enough room
+in the ICE output buffer, pdata is set to NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+<xref linkend='IceGetHeaderExtra' xrefstyle='select: title'/>
+is used to generate a message with a fixed (and relatively small) amount
+of variable length data.  The complete message must fit in the ICE output
+buffer.
+</para>
+
+<funcsynopsis id='IceSimpleMessage'>
+<funcprototype>
+  <funcdef><function> IceSimpleMessage</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>int<parameter> major_opcode</parameter></paramdef>
+    <paramdef>int<parameter> minor_opcode</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>major_opcode</emphasis></term>
+    <listitem>
+      <para>The major opcode of the message.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>minor_opcode</emphasis></term>
+    <listitem>
+      <para>The minor opcode of the message.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='IceSimpleMessage' xrefstyle='select: title'/>
+is used to generate a message that is identical
+in size to the ICE header message, and has no additional data.
+</para>
+
+<funcsynopsis id='IceErrorHeader'>
+<funcprototype>
+  <funcdef><function> IceErrorHeader</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>int<parameter> offending_major_opcode</parameter></paramdef>
+    <paramdef>int<parameter> offending_minor_opcode</parameter></paramdef>
+    <paramdef>int<parameter> offending_sequence_num</parameter></paramdef>
+    <paramdef>int<parameter> severity</parameter></paramdef>
+    <paramdef>int<parameter> error_class</parameter></paramdef>
+    <paramdef>int<parameter> data_length</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>offending_major_opcode</emphasis></term>
+    <listitem>
+      <para>
+The major opcode of the protocol in which an error was detected.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>offending_minor_opcode</emphasis></term>
+    <listitem>
+      <para>
+The minor opcode of the protocol in which an error was detected.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>offending_sequence_num</emphasis></term>
+    <listitem>
+      <para>The sequence number of the message that caused the error.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>severity</emphasis></term>
+    <listitem>
+      <para>
+<function>IceCanContinue</function>
+<function>IceFatalToProtocol</function>
+or
+<function>IceFatalToConnection</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>error_class</emphasis></term>
+    <listitem>
+      <para>The error class.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>data_length</emphasis></term>
+    <listitem>
+      <para>
+Length of data (in 8-byte units) to be written after the header.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='IceErrorHeader' xrefstyle='select: title'/> sets up an error message header.
+</para>
+
+<para>
+Note that the two clients connected by ICE may be using different
+major opcodes for a given protocol.  The offending_major_opcode passed
+to this macro is the major opcode of the protocol for the client
+sending the error message.
+</para>
+
+<para>
+Generic errors, which are common to all protocols, have classes
+in the range 0x8000..0xFFFF.
+See the <emphasis remap='I'>Inter-Client Exchange Protocol</emphasis>
+standard for more details.
+</para>
+
+<informaltable frame='none'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+    <colspec colname='c1' colwidth='1.0*'/>
+    <colspec colname='c2' colwidth='2.0*'/>
+    <tbody>
+      <row>
+        <entry>IceBadMinor</entry>
+        <entry>0x8000</entry>
+      </row>
+      <row>
+        <entry>IceBadState</entry>
+        <entry>0x8001</entry>
+      </row>
+      <row>
+        <entry>IceBadLength</entry>
+        <entry>0x8002</entry>
+      </row>
+      <row>
+        <entry>IceBadValue</entry>
+        <entry>0x8003</entry>
+      </row>
+    </tbody>
+  </tgroup>
+</informaltable>
+
+<para>Per-protocol errors have classes in the range 0x0000-0x7fff.</para>
+
+<para>
+To write data to an ICE connection, use the
+<xref linkend='IceWriteData' xrefstyle='select: title'/> macro.  If the data fits into the
+ICE output buffer, it is copied there.  Otherwise, the ICE output buffer
+is flushed and the data is directly sent.
+</para>
+
+<para>
+This macro is used in conjunction with
+<xref linkend='IceGetHeader' xrefstyle='select: title'/> and
+<xref linkend='IceErrorHeader' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='IceWriteData'>
+<funcprototype>
+  <funcdef><function> IceWriteData</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>int<parameter> bytes</parameter></paramdef>
+    <paramdef>char<parameter> *data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>bytes</emphasis></term>
+    <listitem>
+      <para>The number of bytes to write.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>data</emphasis></term>
+    <listitem>
+      <para>The data to write.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+To write data as 16-bit quantities, use <xref linkend='IceWriteData16' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='IceWriteData16'>
+<funcprototype>
+  <funcdef><function> IceWriteData16</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>int<parameter> bytes</parameter></paramdef>
+    <paramdef>char<parameter> *data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>bytes</emphasis></term>
+    <listitem>
+      <para>The number of bytes to write.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>data</emphasis></term>
+    <listitem>
+      <para>The data to write.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+To write data as 32-bit quantities, use <xref linkend='IceWriteData32' xrefstyle='select: title'/>
+</para>
+
+
+<funcsynopsis id='IceWriteData32'>
+<funcprototype>
+  <funcdef><function> IceWriteData32</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>int<parameter> bytes</parameter></paramdef>
+    <paramdef>char<parameter> *data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>bytes</emphasis></term>
+    <listitem>
+      <para>The number of bytes to write.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>data</emphasis></term>
+    <listitem>
+      <para>The data to write.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+To write data as 32-bit quantities, use <xref linkend='IceWriteData32' xrefstyle='select: title'/>
+</para>
+
+<para>
+To bypass copying data to the ICE output buffer, use
+<xref linkend='IceSendData' xrefstyle='select: title'/> to directly send data over the network
+connection.  If necessary, the ICE output buffer is first flushed.
+</para>
+
+<funcsynopsis id='IceSendData'>
+<funcprototype>
+  <funcdef><function> IceSendData</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>int<parameter> bytes</parameter></paramdef>
+    <paramdef>char<parameter> *data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>bytes</emphasis></term>
+    <listitem>
+      <para>The number of bytes to send.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>data</emphasis></term>
+    <listitem>
+      <para>The data to send.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+To force 32-bit or 64-bit alignment, use <xref linkend='IceWritePad' xrefstyle='select: title'/>
+A maximum of 7 pad bytes can be specified.
+</para>
+
+<funcsynopsis id='IceWritePad'>
+<funcprototype>
+  <funcdef><function> IceWritePad</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>int<parameter> bytes</parameter></paramdef>
+    <paramdef>char<parameter> *data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>bytes</emphasis></term>
+    <listitem>
+      <para>The number of bytes to write.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>data</emphasis></term>
+    <listitem>
+      <para>The number of pad bytes to write.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+</sect1>
+
+<sect1 id='Reading_ICE_Messages'>
+<title>Reading ICE Messages</title>
+
+
+<para>
+The ICE library maintains an input buffer used for reading messages.
+If the ICE library chooses to perform nonblocking reads (this is
+implementation-dependent), then for every read operation that it makes,
+zero or more complete messages may be read into the input buffer.  As
+a result, for all of the macros described in this section that read
+messages, an actual read operation will occur on the connection only if
+the data is not already present in the input buffer.
+</para>
+
+
+<para>
+To get the size of the ICE input buffer, use
+<xref linkend='IceGetInBufSize' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='IceGetInBufSize'>
+<funcprototype>
+  <funcdef>int<function> IceGetInBufSize</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+When reading messages, care must be taken to check for IO errors.  If
+any IO error occurs in reading any part of a message, the message should
+be thrown out.  After using any of the macros described below for reading
+messages, the <xref linkend='IceValidIO' xrefstyle='select: title'/>
+macro can be used to check if an IO error occurred on the
+connection.  After an IO error has occurred on an ICE connection, all
+read operations will be ignored.  For further information, see
+<xref linkend='Error_Handling' xrefstyle='select: title'/>.
+</para>
+
+
+<funcsynopsis id='IceValidIO'>
+<funcprototype>
+  <funcdef>Bool<function> IceValidIO</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>The following macros can be used to read ICE messages.</para>
+
+<funcsynopsis id='IceReadSimpleMessage'>
+<funcprototype>
+  <funcdef><function> IceReadSimpleMessage</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>&lt;C_data_type&gt;<parameter> *pmsg</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>&lt;C_data_type&gt;</emphasis></term>
+    <listitem>
+      <para>The actual C data type of the message header.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>pmsg</emphasis></term>
+    <listitem>
+      <para>This pointer is set to the message header.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='IceReadSimpleMessage' xrefstyle='select: title'/>
+is used for messages that are identical in size to the 8-byte ICE header, but
+use the spare 2 bytes in the header to encode additional data.  Note that the
+ICE library always reads in these first 8 bytes, so it can obtain the major
+opcode of the message.  <xref linkend='IceReadSimpleMessage' xrefstyle='select: title'/>
+simply returns a pointer to these 8 bytes; it does not actually read any data
+into the input buffer.
+</para>
+
+<para>
+For a message with variable length data, there are two ways of reading
+the message.  One method involves reading the complete message in one
+pass using <xref linkend='IceReadCompleteMessage' xrefstyle='select: title'/>
+The second method involves reading the message header (note that this may
+be larger than the 8-byte ICE header), then reading
+the variable length data in chunks (see
+<xref linkend='IceReadMessageHeader' xrefstyle='select: title'/> and
+<xref linkend='IceReadData' xrefstyle='select: title'/>
+</para>
+
+
+<funcsynopsis id='IceReadCompleteMessage'>
+<funcprototype>
+  <funcdef><function> IceReadCompleteMessage</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>int<parameter> header_size</parameter></paramdef>
+    <paramdef>&lt;C_data_type&gt;<parameter> *pmsg</parameter></paramdef>
+    <paramdef>char<parameter> *pdata</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>header_size</emphasis></term>
+    <listitem>
+      <para>The size of the message header (in bytes).</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>&lt;C_data_type&gt;</emphasis></term>
+    <listitem>
+      <para>The actual C data type of the message header.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>pmsg</emphasis></term>
+    <listitem>
+      <para>This pointer is set to the message header.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>pdata</emphasis></term>
+    <listitem>
+      <para>
+This pointer is set to the variable length data of the message.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If the ICE input buffer has sufficient space,
+<xref linkend='IceReadCompleteMessage' xrefstyle='select: title'/>
+will read the complete message into the
+ICE input buffer.  Otherwise, a buffer will be allocated to hold the
+variable length data.  After the call, the pdata argument should
+be checked against NULL to make sure that there was sufficient memory
+to allocate the buffer.
+</para>
+
+<para>
+After calling <xref linkend='IceReadCompleteMessage' xrefstyle='select: title'/>
+and processing the message, <xref linkend='IceDisposeCompleteMessage' xrefstyle='select: title'/>
+should be called.
+</para>
+
+
+<funcsynopsis id='IceDisposeCompleteMessage'>
+<funcprototype>
+  <funcdef><function> IceDisposeCompleteMessage</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>char<parameter> *pdata</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>pdata</emphasis></term>
+    <listitem>
+      <para>
+The pointer to the variable length data returned in
+<xref linkend='IceReadCompleteMessage' xrefstyle='select: title'/>
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If a buffer had to be allocated to hold the variable length data (because
+it did not fit in the ICE input buffer), it is freed here by ICElib.
+</para>
+
+
+<funcsynopsis id='IceReadMessageHeader'>
+<funcprototype>
+  <funcdef><function> IceReadMessageHeader</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>int<parameter> header_size</parameter></paramdef>
+    <paramdef>&lt;C_data_type&gt;<parameter> *pmsg</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>header_size</emphasis></term>
+    <listitem>
+      <para>The size of the message header (in bytes).</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>&lt;C_data_type&gt;</emphasis></term>
+    <listitem>
+      <para>The actual C data type of the message header.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>pmsg</emphasis></term>
+    <listitem>
+      <para>This pointer is set to the message header.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='IceReadMessageHeader' xrefstyle='select: title'/> reads just the message header.
+The rest of the data should be read with the
+<xref linkend='IceReadData' xrefstyle='select: title'/>
+family of macros.  This method of reading a message should be used when the
+variable length data must be read in chunks.
+</para>
+
+
+<para>
+To read data directly into a user supplied buffer, use
+<xref linkend='IceReadData' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='IceReadData'>
+<funcprototype>
+  <funcdef><function> IceReadData</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>int<parameter> bytes</parameter></paramdef>
+    <paramdef>char<parameter> *pdata</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>bytes</emphasis></term>
+    <listitem>
+      <para>The number of bytes to read.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>pdata</emphasis></term>
+    <listitem>
+      <para>The data is read into this user supplied buffer.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+To read data as 16-bit quantities, use <xref linkend='IceReadData16' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='IceReadData16'>
+<funcprototype>
+  <funcdef><function> IceReadData16</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>Bool<parameter> swap</parameter></paramdef>
+    <paramdef>int<parameter> bytes</parameter></paramdef>
+    <paramdef>char<parameter> *pdata</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>swap</emphasis></term>
+    <listitem>
+      <para>
+If <function>True,</function> the values will be byte swapped.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>bytes</emphasis></term>
+    <listitem>
+      <para>The number of bytes to read.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>pdata</emphasis></term>
+    <listitem>
+      <para>The data is read into this user supplied buffer.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+To read data as 32-bit quantities, use <xref linkend='IceReadData32' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='IceReadData32'>
+<funcprototype>
+  <funcdef><function> IceReadData32</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>Bool<parameter> swap</parameter></paramdef>
+    <paramdef>int<parameter> bytes</parameter></paramdef>
+    <paramdef>char<parameter> *pdata</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>swap</emphasis></term>
+    <listitem>
+      <para>
+If <function>True,</function> the values will be byte swapped.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>bytes</emphasis></term>
+    <listitem>
+      <para>The number of bytes to read.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>pdata</emphasis></term>
+    <listitem>
+      <para>The data is read into this user supplied buffer.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>To force 32-bit or 64-bit alignment, use
+<xref linkend='IceReadPad' xrefstyle='select: title'/>
+A maximum of 7 pad bytes can be specified.</para>
+
+<funcsynopsis id='IceReadPad'>
+<funcprototype>
+  <funcdef><function> IceReadPad</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>int<parameter> bytes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem>
+      <para>A valid ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>bytes</emphasis></term>
+    <listitem>
+      <para>The number of pad bytes.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+</sect1>
+</chapter>
+
+<chapter id='Error_Handling'>
+<title>Error Handling</title>
+
+
+<para>There are two default error handlers in ICElib:</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+One to handle typically fatal conditions (for example,
+a connection dying because a machine crashed)
+    </para>
+  </listitem>
+  <listitem>
+    <para>One to handle ICE-specific protocol errors</para>
+  </listitem>
+</itemizedlist>
+
+<para>
+These error handlers can be changed to user-supplied routines if you
+prefer your own error handling and can be changed as often as you like.
+</para>
+
+
+<para>
+To set the ICE error handler, use <xref linkend='IceSetErrorHandler' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='IceSetErrorHandler'>
+<funcprototype>
+  <funcdef><function> IceSetErrorHandler</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>int<parameter> bytes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>handler</emphasis></term>
+    <listitem>
+      <para>
+The ICE error handler.  You should pass NULL to restore the default handler.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='IceSetErrorHandler' xrefstyle='select: title'/> returns the previous error handler.
+</para>
+
+<para>
+The ICE error handler is invoked when an unexpected ICE protocol
+error (major opcode 0) is encountered.  The action of the default
+handler is to print an explanatory message to
+<function>stderr</function>
+and if the severity is fatal, call
+<function>exit</function>
+with a nonzero value.  If exiting
+is undesirable, the application should register its own error handler.
+</para>
+
+<para>
+Note that errors in other protocol
+domains should be handled by their respective libraries (these libraries
+should have their own error handlers).
+</para>
+
+<para>
+An ICE error handler has the type of <xref linkend='IceErrorHandler' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='IceErrorHandler'>
+<funcprototype>
+  <funcdef>void<function> IceErrorHandler</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>Bool<parameter> swap</parameter></paramdef>
+    <paramdef>int<parameter> offending_minor_opcode</parameter></paramdef>
+    <paramdef>unsigned long<parameter> offending_sequence_num</parameter></paramdef>
+    <paramdef>int<parameter> error_class</parameter></paramdef>
+    <paramdef>int<parameter> severity</parameter></paramdef>
+    <paramdef>IcePointer<parameter> values</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>handler</emphasis></term>
+    <listitem>
+      <para>The ICE connection object.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>swap</emphasis></term>
+    <listitem>
+      <para>A flag that indicates if the values need byte swapping.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>offending_minor_opcode</emphasis></term>
+    <listitem>
+      <para>The ICE minor opcode of the offending message.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>offending_sequence_num</emphasis></term>
+    <listitem>
+      <para>The sequence number of the offending message.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>error_class</emphasis></term>
+    <listitem>
+      <para>The error class of the offending message.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>severity</emphasis></term>
+    <listitem>
+      <para>
+<function>IceCanContinue</function>
+<function>IceFatalToProtocol</function>
+or
+<function>IceFatalToConnection</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>values</emphasis></term>
+    <listitem>
+      <para>
+Any additional error values specific to the minor opcode and class.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>The following error classes are defined at the ICE level:</para>
+
+<literallayout remap='Ds'>
+<function>IceBadMinor</function>
+<function>IceBadState</function>
+<function>IceBadLength</function>
+<function>IceBadValue</function>
+<function>IceBadMajor</function>
+<function>IceNoAuth</function>
+<function>IceNoVersion</function>
+<function>IceSetupFailed</function>
+<function>IceAuthRejected</function>
+<function>IceAuthFailed</function>
+<function>IceProtocolDuplicate</function>
+<function>IceMajorOpcodeDuplicate</function>
+<function>IceUnknownProtocol</function>
+</literallayout>
+
+<para>
+For further information, see
+the <emphasis remap='I'>Inter-Client Exchange Protocol</emphasis> standard.
+</para>
+
+
+<para>
+To handle fatal I/O errors, use <xref linkend='IceSetIOErrorHandler' xrefstyle='select: title'/>
+</para>
+
+
+<funcsynopsis id='IceSetIOErrorHandler'>
+<funcprototype>
+  <funcdef>IceIOErrorHandler<function> IceSetIOErrorHandler</function></funcdef>
+    <paramdef>IceIOErrorHandler<parameter> handler</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>handler</emphasis></term>
+    <listitem>
+      <para>
+The I/O error handler.  You should pass NULL to restore the default handler.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='IceSetIOErrorHandler' xrefstyle='select: title'/> returns the previous
+IO error handler.
+</para>
+
+<para>
+An ICE I/O error handler has the type of
+<xref linkend='IceIOErrorHandler' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='IceIOErrorHandler'>
+<funcprototype>
+  <funcdef>void<function> IceIOErrorHandler</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem><para>The ICE connection object.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para> There are two ways of handling IO errors in ICElib:</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+In the first, the IO error handler does whatever is necessary
+to respond to the IO error and then returns, but it does not call
+<xref linkend='IceCloseConnection' xrefstyle='select: title'/>
+The ICE connection is given a "bad IO" status, and all future reads
+and writes to the connection are ignored.  The next time
+<xref linkend='IceProcessMessages' xrefstyle='select: title'/>
+is called it will return a status of
+<function>IceProcessMessagesIOError</function>
+At that time, the application should call
+<xref linkend='IceCloseConnection' xrefstyle='select: title'/>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+In the second, the IO error handler does call
+<xref linkend='IceCloseConnection' xrefstyle='select: title'/>
+and then uses the <function>longjmp</function>
+call to get back to the application's main event loop.  The
+<function>setjmp</function> and
+<function>longjmp</function>
+calls may not work properly on all platforms,
+and special care must be taken to avoid memory leaks.
+Therefore, this second model is less desirable.
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+Before the application I/O error handler is invoked, protocol libraries
+that were interested in being notified of I/O errors will have their
+<xref linkend='IceIOErrorProc' xrefstyle='select: title'/>
+handlers invoked.  This handler is set up in the protocol registration
+functions (see <xref linkend='IceRegisterForProtocolSetup' xrefstyle='select: title'/> and
+<xref linkend='IceRegisterForProtocolReply' xrefstyle='select: title'/>
+and could be used to clean up state specific to the protocol.
+</para>
+
+
+<funcsynopsis id='IceIOErrorProc'>
+<funcprototype>
+  <funcdef>void<function> IceIOErrorProc</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem><para>The ICE connection object.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+Note that every <xref linkend='IceIOErrorProc' xrefstyle='select: title'/>
+callback must return.  This is required
+because each active protocol must be notified of the broken connection,
+and the application IO error handler must be invoked afterwards.
+</para>
+</chapter>
+
+<chapter id='Multi_Threading_Support'>
+<title>Multi-Threading Support</title>
+
+
+<para>To declare that multiple threads in an application will be using the ICE
+library, use
+<function>IceInitThreads</function></para>
+
+<literallayout remap='FD'>
+Status IceInitThreads()
+</literallayout>
+
+
+<para>The
+<function>IceInitThreads</function>
+function must be the first ICElib function a
+multi-threaded program calls.  It must complete before any other ICElib
+call is made.
+<function>IceInitThreads</function>
+returns a nonzero status if and only if it was able
+to initialize the threads package successfully.
+It is safe to call
+<function>IceInitThreads</function>
+more than once, although the threads package will only be initialized once.</para>
+
+<para>Protocol libraries layered on top of ICElib will have to lock critical
+sections of code that access an ICE connection (for example, when
+generating messages).  Two calls, which are generally implemented as
+macros, are provided:</para>
+
+<funcsynopsis id='IceLockConn'>
+<funcprototype>
+  <funcdef>void<function> IceLockConn</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<funcsynopsis id='IceUnlockConn'>
+<funcprototype>
+  <funcdef>void<function> IceUnlockConn</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem><para>The ICE connection object.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+<para>To keep an ICE connection locked across several ICElib calls, applications use
+<xref linkend='IceAppLockConn' xrefstyle='select: title'/>
+and
+<xref linkend='IceAppUnlockConn' xrefstyle='select: title'/></para>
+
+<funcsynopsis id='IceAppLockConn'>
+<funcprototype>
+  <funcdef>void<function> IceAppLockConn</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem><para>The ICE connection object.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>The
+<xref linkend='IceAppLockConn' xrefstyle='select: title'/>
+function completely locks out other threads using the connection
+until
+<xref linkend='IceAppUnlockConn' xrefstyle='select: title'/>
+is called.  Other threads attempting to use ICElib
+calls on the connection will block.
+If the program has not previously called
+<function>IceInitThreads</function>
+<xref linkend='IceAppLockConn' xrefstyle='select: title'/>
+has no effect.</para>
+
+<funcsynopsis id='IceAppUnlockConn'>
+<funcprototype>
+  <funcdef>void<function> IceAppUnlockConn</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem><para>The ICE connection object.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+<para>The
+<xref linkend='IceAppUnlockConn' xrefstyle='select: title'/>
+function allows other threads to complete ICElib
+calls on the connection that were blocked by a previous call to
+<xref linkend='IceAppLockConn' xrefstyle='select: title'/>
+from this thread.  If the program has not previously called
+<function>IceInitThreads</function>
+<xref linkend='IceAppUnlockConn' xrefstyle='select: title'/>
+has no effect.</para>
+</chapter>
+
+<chapter id='Miscellaneous_Functions'>
+<title>Miscellaneous Functions</title>
+
+
+
+
+<para>To allocate scratch space (for example, when generating
+messages with variable data), use
+<function>IceAllocScratch</function>
+Each ICE connection has one scratch space associated with it.
+The scratch space starts off as empty and grows as needed.
+The contents of the scratch space is not guaranteed to be preserved
+after any ICElib function is called.</para>
+
+
+<funcsynopsis id='IceAllocScratch'>
+<funcprototype>
+  <funcdef>char<function> *IceAllocScratch</function></funcdef>
+    <paramdef>IceConn<parameter> ice_conn</parameter></paramdef>
+    <paramdef>unsigned long<parameter> size</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>ice_conn</emphasis></term>
+    <listitem><para>The ICE connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>size</emphasis></term>
+    <listitem><para>The number of bytes required.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+<para>Note that the memory returned by
+<function>IceAllocScratch</function>
+should not be freed by the caller.
+The ICE library will free the memory when the ICE connection is closed.</para>
+</chapter>
+
+<chapter id='Acknowledgements'>
+<title>Acknowledgements</title>
+
+
+<para>
+Thanks to Bob Scheifler for his thoughtful input on the design
+of the ICE library.  Thanks also to Jordan Brown, Larry Cable, Donna Converse,
+Clive Feather, Stephen Gildea, Vania Joloboff, Kaleb Keithley,
+Stuart Marks, Hiro Miyamoto, Ralph Swick, Jim VanGilder, and Mike Wexler.
+</para>
+</chapter>
+
+<appendix id="authentication_utility_functions">
+<title>Authentication Utility Functions</title>
+
+
+<para>
+As discussed in this document, the means by which authentication data
+is obtained by the ICE library (for
+<function>ConnectionSetup</function>
+messages or
+<function>ProtocolSetup</function>
+messages) is implementation-dependent.&dagger;
+<footnote remap='FS'>
+<para>The X Consortium's ICElib implementation assumes the presence of an
+ICE authority file.
+</para></footnote>
+</para>
+
+<para>
+This appendix describes some utility functions that manipulate an
+ICE authority file.  The authority file can be used to pass authentication
+data between clients.
+</para>
+
+<para>The basic operations on the .ICEauthority file are:</para>
+
+<itemizedlist>
+  <listitem>
+    <para>Get file name</para>
+  </listitem>
+  <listitem>
+    <para>Lock</para>
+  </listitem>
+  <listitem>
+    <para>Unlock</para>
+  </listitem>
+  <listitem>
+    <para>Read entry</para>
+  </listitem>
+  <listitem>
+    <para>Write entry</para>
+  </listitem>
+  <listitem>
+    <para>Search for entry</para>
+  </listitem>
+</itemizedlist>
+
+<para>
+These are fairly low-level operations, and it is expected that a program,
+like "iceauth", would exist to add, remove, and display entries in the file.
+</para>
+
+<para>
+In order to use these utility functions, the
+&lt;<symbol role='Pn'>X11/ICE/ICEutil.h</symbol>&gt;
+header file must be included.
+</para>
+
+<para>
+An entry in the .ICEauthority file is defined by the following data structure:
+</para>
+
+
+<literallayout class="monospaced">
+typedef struct {
+     char *protocol_name;
+     unsigned short protocol_data_length;
+     char *protocol_data;
+     char *network_id;
+     char *auth_name;
+     unsigned short auth_data_length;
+     char *auth_data;
+} IceAuthFileEntry;
+</literallayout>
+
+
+<para>
+The protocol_name member is either "ICE" for connection setup authentication
+or the subprotocol name, such as "XSMP".  For each entry, protocol specific
+data can be specified in the protocol_data member.  This can be used
+to search for old entries that need to be removed from the file.
+</para>
+
+<para>
+The network_id member is the network ID of the client accepting
+authentication (for example, the network ID of a session manager).
+A network ID has the following form:
+</para>
+
+<informaltable frame='none'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+    <colspec colname='c1' colwidth='1.0*'/>
+    <colspec colname='c2' colwidth='2.0*'/>
+    <tbody>
+      <row>
+        <entry>tcp/&lt;hostname&gt;:&lt;portnumber&gt;</entry>
+        <entry>or</entry>
+      </row>
+      <row>
+        <entry>decnet/&lt;hostname&gt;::&lt;objname&gt;</entry>
+        <entry>or</entry>
+      </row>
+      <row>
+        <entry>local/&lt;hostname&gt;:&lt;path&gt;</entry>
+        <entry></entry>
+      </row>
+    </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The auth_name member is the name of the authentication method.
+The auth_data member is the actual authentication data,
+and the auth_data_length member is the number of bytes in the data.
+</para>
+
+<para>
+To obtain the default authorization file name, use
+<function>IceAuthFileName</function>
+</para>
+
+<literallayout remap='FD'>
+char *IceAuthFileName()
+</literallayout>
+
+<para>
+If the ICEAUTHORITY environment variable if set, this value is returned.
+Otherwise, the default authorization file name is $HOME/.ICEauthority.
+This name is statically allocated and should not be freed.
+</para>
+
+<para>
+To synchronously update the authorization file, the file must
+be locked with a call to
+<xref linkend='IceLockAuthFile' xrefstyle='select: title'/>
+This function takes advantage of the fact that the
+<function>link</function>
+system call will fail if the name of the new link already exists.
+</para>
+
+<funcsynopsis id='IceLockAuthFile'>
+<funcprototype>
+  <funcdef>int<function> IceLockAuthFile</function></funcdef>
+    <paramdef>char<parameter> *file_name</parameter></paramdef>
+    <paramdef>int<parameter> retries</parameter></paramdef>
+    <paramdef>int<parameter> timeout</parameter></paramdef>
+    <paramdef>long<parameter> dead</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>file_name</emphasis></term>
+    <listitem><para>The authorization file to lock.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>retries</emphasis></term>
+    <listitem>
+      <para>The number of retries.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>timeout</emphasis></term>
+    <listitem>
+      <para>The number of seconds before each retry.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>dead</emphasis></term>
+    <listitem>
+      <para>
+If a lock already exists that is the specified dead seconds old,
+it is broken.
+A value of zero is used to unconditionally break an old lock.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>One of three values is returned:</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+<function>IceAuthLockSuccess</function> - the lock succeeded.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>IceAuthLockError</function> - a system error occurred, and
+<function>errno</function> may prove useful.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>IceAuthLockTimeout</function> - the specified number of
+retries failed.
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+To unlock an authorization file, use <xref linkend='IceUnlockAuthFile' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='IceUnlockAuthFile'>
+<funcprototype>
+  <funcdef>int<function> IceUnlockAuthFile</function></funcdef>
+    <paramdef>char<parameter> *file_name</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>file_name</emphasis></term>
+    <listitem><para>The authorization file to unlock.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+To read the next entry in an authorization file, use
+<function>IceReadAuthFileEntry</function>
+</para>
+
+<funcsynopsis id='IceReadAuthFileEntry'>
+<funcprototype>
+  <funcdef>IceAuthFileEntry<function> *IceReadAuthFileEntry</function></funcdef>
+    <paramdef>FILE<parameter> *auth_file</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>auth_file</emphasis></term>
+    <listitem><para>The authorization file.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+Note that it is the responsibility of the application to open the file
+for reading before calling this function.  If an error is encountered,
+or there are no more entries to read, NULL is returned.
+</para>
+
+<para>
+Entries should be free with a call to
+<xref linkend='IceFreeAuthFileEntry' xrefstyle='select: title'/>
+</para>
+
+<para>
+To write an entry in an authorization file, use
+<xref linkend='IceWriteAuthFileEntry' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='IceWriteAuthFileEntry'>
+<funcprototype>
+  <funcdef>Status<function> IceWriteAuthFileEntry</function></funcdef>
+    <paramdef>FILE<parameter> *auth_file</parameter></paramdef>
+    <paramdef>IceAuthFileEntry<parameter> *entry</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>auth_file</emphasis></term>
+    <listitem><para>The authorization file.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>entry</emphasis></term>
+    <listitem><para>The entry to write.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+Note that it is the responsibility of the application to open the file
+for writing before calling this function.  The function returns a nonzero
+status if the operation was successful.
+</para>
+
+
+<para>
+To search the default authorization file for an entry that matches a given
+protocol_name/network_id/auth_name tuple, use
+<function>IceGetAuthFileEntry</function>
+</para>
+
+<funcsynopsis id='IceGetAuthFileEntry'>
+<funcprototype>
+  <funcdef>IceAuthFileEntry<function> *IceGetAuthFileEntry</function></funcdef>
+    <paramdef>const char *<parameter>protocol_name</parameter></paramdef>
+    <paramdef>const char *<parameter>network_id</parameter></paramdef>
+    <paramdef>const char *<parameter>auth_name</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>auth_file</emphasis></term>
+    <listitem><para>The name of the protocol to search on.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>network_id</emphasis></term>
+    <listitem>
+      <para>The network ID to search on.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>auth_name</emphasis></term>
+    <listitem>
+      <para>The authentication method to search on.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If <function>IceGetAuthFileEntry</function>
+fails to find such an entry, NULL is returned.
+</para>
+
+
+<para>
+To free an entry returned by
+<function>IceReadAuthFileEntry</function> or
+<function>IceGetAuthFileEntry</function> use
+<xref linkend='IceFreeAuthFileEntry' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='IceFreeAuthFileEntry'>
+<funcprototype>
+  <funcdef>void<function> IceFreeAuthFileEntry</function></funcdef>
+    <paramdef>IceAuthFileEntry<parameter> *entry</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>entry</emphasis></term>
+    <listitem><para>The entry to free.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+</appendix>
+
+<appendix id="mit_magic_cookie_1_authentication">
+<title>MIT-MAGIC-COOKIE-1 Authentication</title>
+
+
+<para>The X Consortium's ICElib implementation supports a simple
+MIT-MAGIC-COOKIE-1 authentication scheme using the authority file utilities
+described in Appendix A.</para>
+
+<para>In this model, an application, such as a session manager, obtains a
+magic cookie by calling
+<function>IceGenerateMagicCookie</function>
+and then stores it in the user's local .ICEauthority file
+so that local clients can connect.  In order to allow remote clients to
+connect, some remote execution mechanism should be used to store the
+magic cookie in the user's .ICEauthority file on a remote machine.</para>
+
+<para>In addition to storing the magic cookie in the .ICEauthority file, the
+application needs to call the
+<xref linkend='IceSetPaAuthData' xrefstyle='select: title'/>
+function in order to store the magic cookie in memory.  When it comes time
+for the MIT-MAGIC-COOKIE-1 authentication procedure to accept or reject the
+connection, it will compare the magic cookie presented by the requestor to
+the magic cookie in memory.</para>
+
+<funcsynopsis id='IceGenerateMagicCookie'>
+<funcprototype>
+  <funcdef>char<function> *IceGenerateMagicCookie</function></funcdef>
+    <paramdef>int<parameter> length</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>length</emphasis></term>
+    <listitem><para>The desired length of the magic cookie.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>The magic cookie returned will be null-terminated.  If memory can not be
+allocated for the magic cookie, the function will return NULL.
+Otherwise, the magic cookie should be freed with a call to
+<function>free</function></para>
+
+
+<para>To store the authentication data in memory, use
+<xref linkend='IceSetPaAuthData' xrefstyle='select: title'/>
+Currently, this function is only used for MIT-MAGIC-COOKIE-1
+authentication, but it may be used for additional authentication
+methods in the future.</para>
+
+<funcsynopsis id='IceSetPaAuthData'>
+<funcprototype>
+  <funcdef>void<function> IceSetPaAuthData</function></funcdef>
+    <paramdef>int<parameter> num_entries</parameter></paramdef>
+    <paramdef>IceAuthDataEntry<parameter> *entries</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>num_entries</emphasis></term>
+    <listitem><para>The number of authentication data entries.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>entries</emphasis></term>
+    <listitem><para>The list of authentication data entries.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+<para>Each entry has associated with it a protocol name
+(for example, "ICE" for ICE connection setup authentication,
+"XSMP" for session management authentication), a network ID for the
+"accepting" client, an authentication name (for example, MIT-MAGIC-COOKIE-1),
+and authentication data.  The ICE library
+will merge these entries with previously set entries, based on the
+(protocol_name, network_id, auth_name) tuple.</para>
+
+
+
+<literallayout class="monospaced">
+typedef struct {
+	char *protocol_name;
+	char *network_id;
+	char *auth_name;
+	unsigned short auth_data_length;
+	char *auth_data;
+} IceAuthDataEntry;
+</literallayout>
+
+</appendix>
+</book>
+
Index: lib/libICE/create-1.1.1-docbook-patch/libICE-1.1.1-new/doc
===================================================================
--- lib/libICE/create-1.1.1-docbook-patch/libICE-1.1.1-new/doc	(nonexistent)
+++ lib/libICE/create-1.1.1-docbook-patch/libICE-1.1.1-new/doc	(revision 5)

Property changes on: lib/libICE/create-1.1.1-docbook-patch/libICE-1.1.1-new/doc
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libICE/create-1.1.1-docbook-patch/libICE-1.1.1-new
===================================================================
--- lib/libICE/create-1.1.1-docbook-patch/libICE-1.1.1-new	(nonexistent)
+++ lib/libICE/create-1.1.1-docbook-patch/libICE-1.1.1-new	(revision 5)

Property changes on: lib/libICE/create-1.1.1-docbook-patch/libICE-1.1.1-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libICE/create-1.1.1-docbook-patch
===================================================================
--- lib/libICE/create-1.1.1-docbook-patch	(nonexistent)
+++ lib/libICE/create-1.1.1-docbook-patch	(revision 5)

Property changes on: lib/libICE/create-1.1.1-docbook-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libICE/patches/README
===================================================================
--- lib/libICE/patches/README	(nonexistent)
+++ lib/libICE/patches/README	(revision 5)
@@ -0,0 +1,6 @@
+
+/* begin *
+
+   TODO: Leave some comment here.
+
+ * end */
Index: lib/libICE/patches
===================================================================
--- lib/libICE/patches	(nonexistent)
+++ lib/libICE/patches	(revision 5)

Property changes on: lib/libICE/patches
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libICE
===================================================================
--- lib/libICE	(nonexistent)
+++ lib/libICE	(revision 5)

Property changes on: lib/libICE
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libSM/Makefile
===================================================================
--- lib/libSM/Makefile	(nonexistent)
+++ lib/libSM/Makefile	(revision 5)
@@ -0,0 +1,56 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libSM
+
+versions    = 1.2.4
+pkgname     = libSM
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+patches     = $(CURDIR)/patches/libSM-1.2.4-docbook.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-1.2.4-docbook-patch ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s) $(patches)
Index: lib/libSM/create-1.2.4-docbook-patch/create.patch.sh
===================================================================
--- lib/libSM/create-1.2.4-docbook-patch/create.patch.sh	(nonexistent)
+++ lib/libSM/create-1.2.4-docbook-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=1.2.4
+
+tar --files-from=file.list -xJvf ../libSM-$VERSION.tar.xz
+mv libSM-$VERSION libSM-$VERSION-orig
+
+cp -rf ./libSM-$VERSION-new ./libSM-$VERSION
+
+diff --unified -Nr  libSM-$VERSION-orig  libSM-$VERSION > libSM-$VERSION-docbook.patch
+
+mv libSM-$VERSION-docbook.patch ../patches
+
+rm -rf ./libSM-$VERSION
+rm -rf ./libSM-$VERSION-orig

Property changes on: lib/libSM/create-1.2.4-docbook-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: lib/libSM/create-1.2.4-docbook-patch/file.list
===================================================================
--- lib/libSM/create-1.2.4-docbook-patch/file.list	(nonexistent)
+++ lib/libSM/create-1.2.4-docbook-patch/file.list	(revision 5)
@@ -0,0 +1 @@
+libSM-1.2.4/doc/SMlib.xml
Index: lib/libSM/create-1.2.4-docbook-patch/libSM-1.2.4-new/doc/SMlib.xml
===================================================================
--- lib/libSM/create-1.2.4-docbook-patch/libSM-1.2.4-new/doc/SMlib.xml	(nonexistent)
+++ lib/libSM/create-1.2.4-docbook-patch/libSM-1.2.4-new/doc/SMlib.xml	(revision 5)
@@ -0,0 +1,3230 @@
+<?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"
+[
+<!ENTITY % defs SYSTEM "defs.ent"> %defs;
+]>
+
+
+<!-- lifted from troff+ms+XMan by doclifter -->
+<book id="SMlib">
+
+<bookinfo>
+   <title>X Session Management Library</title>
+   <subtitle>X Consortium Standard</subtitle>
+   <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
+   <authorgroup>
+      <author>
+         <firstname>Ralph</firstname><surname>Mor</surname>
+         <affiliation><orgname>X Consortium</orgname></affiliation>
+      </author>
+   </authorgroup>
+   <copyright>
+     <year>1993</year><year>1994</year>
+     <holder>X Consortium</holder>
+   </copyright>
+   <releaseinfo>Version 1.0</releaseinfo>
+
+   <legalnotice>
+     <para>
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+&ldquo;Software&rdquo;), 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>
+
+     <para>
+X Window System is a trademark of The Open Group.
+     </para>
+   </legalnotice>
+
+</bookinfo>
+
+<chapter id='Overview_of_Session_Management'>
+  <title>Overview of Session Management</title>
+
+  <abstract>
+    <para>
+The purpose of the X Session Management Protocol (<acronym>XSMP</acronym>)
+is to provide a uniform mechanism for users to save and restore their
+sessions.  A <firstterm>session</firstterm> is a group of clients,
+each of which has a particular state.  The session is controlled by a
+network service called the <firstterm>session manager</firstterm>.
+The session manager issues commands to its clients on behalf of the
+user.  These commands may cause clients to save their state or to
+terminate.  It is expected that the client will save its state in such
+a way that the client can be restarted at a later time and resume its
+operation as if it had never been terminated.  A client's state might
+include information about the file currently being edited, the current
+position of the insertion point within the file, or the start of an
+uncommitted transaction.  The means by which clients are restarted is
+unspecified by this protocol.
+    </para>
+
+    <para>
+For purposes of this protocol, a <firstterm>client</firstterm> of the
+session manager is defined as a connection to the session manager.  A
+client is typically, though not necessarily, a process running an
+application program connected to an X display.  However, a client may
+be connected to more than one X display or not be connected to any X
+displays at all.
+    </para>
+  </abstract>
+</chapter>
+
+<chapter id='The_Session_Management_Library'>
+  <title>The Session Management Library</title>
+  <abstract>
+    <para>
+The Session Management Library (<abbrev>SMlib</abbrev>) is a low-level
+"C" language interface to XSMP.  It is expected that higher level
+toolkits, such as Xt, will hide many of the details of session
+management from clients.  Higher level toolkits might also be developed
+for session managers to use, but no such effort is currently under way.
+    </para>
+  </abstract>
+
+  <para>
+    SMlib has two parts to it:
+    <itemizedlist mark='bullet'>
+      <listitem><para>One set of functions for clients that want to be part of a session</para></listitem>
+      <listitem><para>One set of functions for session managers to call</para></listitem>
+    </itemizedlist>
+  </para>
+
+  <para>
+Some applications will use both sets of functions and act as
+<firstterm>nested session managers</firstterm>.  That is, they will be
+both a session manager and a client of another session.  An example is
+a mail program that could start a text editor for editing the text of
+a mail message.  The mail program is part of a regular session and, at
+the same time, is also acting as a session manager to the editor.
+  </para>
+
+  <para>
+Clients initialize by connecting to the session manager and obtaining
+a <firstterm>client-ID</firstterm> that uniquely identifies them in
+the session.  The session manager maintains a list of properties for
+each client in the session.  These properties describe the client's
+environment and, most importantly, describe how the client can be
+restarted (via an <property>SmRestartCommand</property>). Clients are
+expected to save their state in such a way as to allow multiple
+instantiations of themselves to be managed independently.  For
+example, clients may use their client-ID as part of a filename in
+which to store the state for a particular instantiation.  The
+client-ID should be saved as part of the <property>SmRestartCommand</property>
+so that the client will retain the same ID after it is restarted.
+  </para>
+
+  <para>
+Once the client initializes itself with the session manager, it must
+be ready to respond to messages from the session manager.  For
+example, it might be asked to save its state or to terminate.  In the
+case of a shutdown, the session manager might give each client a
+chance to interact with the user and cancel the shutdown.
+  </para>
+</chapter>
+
+<chapter id='Understanding_SMlibs_Dependence_on_ICE'>
+  <title>Understanding SMlib's Dependence on ICE</title>
+
+  <para>
+The X Session Management Protocol is layered on top of the
+Inter-Client Exchange (<acronym>ICE</acronym>) Protocol.  The ICE
+protocol is designed to multiplex several protocols over a single
+connection.  As a result, working with SMlib requires a little
+knowledge of how the ICE library works.
+  </para>
+
+  <para>
+The ICE library utilizes callbacks to process messages.  When a client
+detects that there is data to read on an ICE connection, it should
+call the <function>IceProcessMessages</function> function.
+<function>IceProcessMessages</function> will read the message header
+and look at the major opcode in order to determine which protocol the
+message was intended for.  The appropriate protocol library will then
+be triggered to unpack the message and hand it off to the client via a
+callback.
+  </para>
+
+  <para>
+The main point to be aware of is that an application using SMlib must
+have some code that detects when there is data to read on an ICE
+connection.  This can be done via a <function>select</function> call
+on the file descriptor for the ICE connection, but more
+typically, <function>XtAppAddInput</function> will be used to register
+a callback that will invoke <function>IceProcessMessages</function>
+each time there is data to read on the ICE connection.
+  </para>
+
+  <para>
+To further complicate things, knowing which file descriptors to
+call <function>select</function> on requires an understanding of how
+ICE connections are created.  On the client side, a call must be made
+to <xref linkend='SmcOpenConnection' xrefstyle='select: title'/> in order to open a connection
+with a session manager.  <xref linkend='SmcOpenConnection' xrefstyle='select: title'/> will
+internally makea call into <function>IceOpenConnection</function>
+which will, in turn, determine if an ICE connection already exists
+between the client and session manager.  Most likely, a connection
+will not already exist and a new ICE connection will be created.  The
+main point to be aware of is that, on the client side, it is not
+obvious when ICE connections get created or destroyed, because
+connections are shared when possible.  To deal with this, the ICE
+library lets the application register watch procedures that will be
+invoked each time an ICE connection is opened or closed.  These watch
+procedures could be used to add or remove ICE file descriptors from
+the list of descriptors to call <function>select</function> on.
+  </para>
+
+  <para>
+On the session manager side, things work a bit differently.  The
+session manager has complete control over the creation of ICE
+connections.  The session manager has to first
+call <function>IceListenForConnections</function> in order to start
+listening for connections from clients.  Once a connection attempt is
+detected, <function>IceAcceptConnection</function> must be called, and
+the session manager can simply add the new ICE file descriptor to the
+list of descriptors to call <function>select</function> on.
+
+  </para>
+
+  <para>
+For further information on the library functions related to ICE connections,
+see the <citetitle pubwork='article'>Inter-Client Exchange Library</citetitle>
+standard.
+  </para>
+</chapter>
+
+<chapter id='Header_Files_and_Library_Name'>
+<title>Header Files and Library Name</title>
+
+  <para>
+Applications (both session managers and clients) should include the
+header file &lt;<filename class='headerfile'>X11/SM/SMlib.h</filename>&gt;.
+This header file defines all of the SMlib data structures and function
+prototypes.  <filename class='headerfile'>SMlib.h</filename> includes the
+header file &lt;<filename class='headerfile'>X11/SM/SM.h</filename>&gt;,
+which defines all of the SMlib constants.
+  </para>
+
+  <para>
+Because SMlib is dependent on ICE, applications should link against
+SMlib and ICElib by using
+<quote><option>-lSM</option> <option>-lICE</option></quote>.
+  </para>
+</chapter>
+
+<chapter id='Session_Management_Client_Smc_Functions'>
+  <title>Session Management Client (<acronym>Smc</acronym>) Functions</title>
+
+  <para>
+    This section discusses how Session Management clients:
+    <itemizedlist mark='bullet'>
+      <listitem><para>Connect to the Session Manager</para></listitem>
+      <listitem><para>Close the connection</para></listitem>
+      <listitem><para>Modify callbacks</para></listitem>
+      <listitem><para>Set, delete, and retrieve Session Manager properties</para></listitem>
+      <listitem><para>Interact with the user</para></listitem>
+      <listitem><para>Request a &ldquo;Save Yourself&rdquo;</para></listitem>
+      <listitem><para>Request a &ldquo;Save Yourself Phase 2&rdquo;</para></listitem>
+      <listitem><para>Complete a &ldquo;Save Yourself&rdquo;</para></listitem>
+      <listitem><para>Use Smc informational functions</para></listitem>
+      <listitem><para>Handle Errors</para></listitem>
+    </itemizedlist>
+  </para>
+
+  <sect1 id='Connecting_to_the_Session_Manager'>
+<title>Connecting to the Session Manager</title>
+
+    <para>
+To open a connection with a session manager,
+use <xref linkend='SmcOpenConnection' xrefstyle='select: title'/>
+    </para>
+
+    <funcsynopsis id='SmcOpenConnection'>
+      <funcprototype>
+	<funcdef>SmcConn <function>SmcOpenConnection</function></funcdef>
+	<paramdef>char *<parameter>network_ids_list</parameter></paramdef>
+	<paramdef>SmPointer <parameter>context</parameter></paramdef>
+	<paramdef>int <parameter>xsmp_major_rev</parameter></paramdef>
+	<paramdef>int <parameter>xsmp_minor_rev</parameter></paramdef>
+	<paramdef>unsigned long <parameter>mask</parameter></paramdef>
+	<paramdef>SmcCallbacks *<parameter>callbacks</parameter></paramdef>
+	<paramdef>char *<parameter>previous_id</parameter></paramdef>
+	<paramdef>char **<parameter>client_id_ret</parameter></paramdef>
+	<paramdef>int <parameter>error_length</parameter></paramdef>
+	<paramdef>char *<parameter>error_string_ret</parameter></paramdef>
+      </funcprototype>
+    </funcsynopsis>
+
+    <variablelist remap='IP'>
+      <varlistentry>
+	<term><parameter>network_ids_list</parameter></term>
+	<listitem><para>Specifies the network ID(s) of the session manager.</para></listitem>
+      </varlistentry>
+      <varlistentry>
+	<term><parameter>context</parameter></term>
+	<listitem><para>
+A pointer to an opaque object or <constant>NULL</constant>.  Used to determine
+if an ICE connection can be shared
+(see <link linkend='context_sharing'>below</link>).
+     </para></listitem>
+      </varlistentry>
+      <varlistentry>
+	<term><parameter>xsmp_major_rev</parameter></term>
+	<listitem><para>
+The highest major version of the XSMP the application supports.
+	</para></listitem>
+      </varlistentry>
+      <varlistentry>
+	<term><parameter>xsmp_minor_rev</parameter></term>
+	<listitem><para>
+The highest minor version of the XSMP the application supports (for
+the specified <parameter>xsmp_major_rev</parameter>).
+	</para></listitem>
+      </varlistentry>
+      <varlistentry>
+	<term><parameter>mask</parameter></term>
+	<listitem><para>A mask indicating which callbacks to register.</para></listitem>
+      </varlistentry>
+      <varlistentry>
+	<term><parameter>callbacks</parameter></term>
+	<listitem><para>
+The callbacks to register.  These callbacks are used to respond to
+messages from the session manager.
+	</para></listitem>
+      </varlistentry>
+      <varlistentry>
+	<term><parameter>previous_id</parameter></term>
+	<listitem><para>The client ID from the previous session.</para></listitem>
+      </varlistentry>
+      <varlistentry>
+	<term><parameter>client_id_ret</parameter></term>
+	<listitem><para>The client ID for the current session is returned.</para></listitem>
+      </varlistentry>
+      <varlistentry>
+	<term><parameter>error_length</parameter></term>
+	<listitem><para>Length of the <parameter>error_string_ret</parameter> argument passed in.</para></listitem>
+      </varlistentry>
+      <varlistentry>
+	<term><parameter>error_string_ret</parameter></term>
+	<listitem><para>
+Returns a null-terminated error message, if any.
+The <parameter>error_string_ret</parameter> argument points to user supplied
+memory.  No more than <parameter>error_length</parameter> bytes are used.
+	</para></listitem>
+      </varlistentry>
+    </variablelist>
+
+    <para>
+The <parameter>network_ids_list</parameter> argument is a
+null-terminated string containing a list of network IDs for the session
+manager, separated by commas. If <parameter>network_ids_list</parameter>
+is <constant>NULL</constant>, the value of
+the <envar>SESSION_MANAGER</envar> environment variable will be used.
+Each network ID has the following format:
+
+<informaltable frame='none'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+    <colspec colname='c1' colwidth='1.0*'/>
+    <colspec colname='c2' colwidth='1.5*'/>
+    <tbody>
+      <row>
+        <entry><literal>tcp/</literal><parameter>&lt;hostname&gt;</parameter><literal>:</literal><parameter>&lt;portnumber&gt;</parameter></entry>
+        <entry>or</entry>
+      </row>
+      <row>
+        <entry><literal>decnet/</literal><parameter>&lt;hostname&gt;</parameter><literal>::</literal><parameter>&lt;objname&gt;</parameter></entry>
+        <entry>or</entry>
+      </row>
+      <row>
+        <entry><literal>local/</literal><parameter>&lt;hostname&gt;</parameter><literal>:</literal><parameter>&lt;path&gt;</parameter></entry>
+        <entry></entry>
+      </row>
+    </tbody>
+  </tgroup>
+</informaltable>
+    </para>
+
+    <para>
+An attempt will be made to use the first network ID.  If that fails,
+an attempt will be made using the second network ID, and so on.
+    </para>
+
+    <para>
+After the connection is established, <xref linkend='SmcOpenConnection' xrefstyle='select: title'/>
+registers the client with the session manager.  If the client is being
+restarted from a previous session, <parameter>previous_id</parameter>
+should contain a null terminated string representing the client ID from the
+previous session.  If the client is first joining the session,
+<parameter>previous_id</parameter> should be set to <constant>NULL</constant>.
+If <parameter>previous_id</parameter> is specified but is determined
+to be invalid by the session manager, SMlib will re-register the
+client with <parameter>previous_id</parameter> set to <constant>NULL</constant>.
+    </para>
+
+    <para>
+If <xref linkend='SmcOpenConnection' xrefstyle='select: title'/> succeeds, it returns an
+opaque connection pointer of type <function>SmcConn</function> and the
+<parameter>client_id_ret</parameter> argument contains the client ID to be
+used for this session.  The <parameter>client_id_ret</parameter> should be
+freed with a call to <function>free</function> when no longer needed.  On
+failure, <xref linkend='SmcOpenConnection' xrefstyle='select: title'/> returns
+<constant>NULL</constant>, and the reason for failure is returned in
+<parameter>error_string_ret</parameter>.
+    </para>
+
+    <para>
+Note that SMlib uses the ICE protocol to establish a connection with
+the session manager.  If an ICE connection already exists between the
+client and session manager, it might be possible for the same ICE
+connection to be used for session management.
+    </para>
+
+    <para id='context_sharing'>
+The context argument indicates how willing the client is to share the
+ICE connection with other protocols.  If context is <constant>NULL</constant>,
+then the caller is always willing to share the connection.  If context is not
+<constant>NULL</constant>, then the caller is not willing to use a previously
+opened ICE connection that has a different non-<constant>NULL</constant>
+context associated with it.
+    </para>
+
+    <para>
+As previously discussed
+(<link linkend='Understanding_SMlibs_Dependence_on_ICE'>section 3,
+&ldquo;Understanding SMlib's Dependence on ICE&rdquo;</link>), the
+client will have to keep track of when ICE connections are created or
+destroyed (using <function>IceAddConnectionWatch</function>
+and <function>IceRemoveConnectionWatch</function> and will have to
+call <function>IceProcessMessages</function> each time
+a <function>select</function> shows that there is data to read on an
+ICE connection.  For further information, see the
+<citetitle pubwork='article'>Inter-Client Exchange Library</citetitle>
+standard.
+    </para>
+
+    <para>
+The callbacks argument contains a set of callbacks used to respond to
+session manager events.  The mask argument specifies which callbacks
+are set.  All of the callbacks specified in this version of SMlib are
+mandatory.  The mask argument is necessary in order to maintain
+backwards compatibility in future versions of the library.
+    </para>
+
+    <para>
+The following values may be ORed together to obtain a
+<parameter>mask</parameter> value:
+
+      <simplelist type='vert'>
+	<member><constant>SmcSaveYourselfProcMask</constant></member>
+	<member><constant>SmcDieProcMask</constant></member>
+	<member><constant>SmcSaveCompleteProcMask</constant></member>
+	<member><constant>SmcShutdownCancelledProcMask</constant></member>
+      </simplelist>
+    </para>
+
+    <para>
+For each callback, the client can register a pointer to client data.
+When SMlib invokes the callback, it will pass the client data pointer.
+    </para>
+
+<!-- .ne 4  IGNORED -->
+
+<synopsis>
+typedef struct {
+
+	struct {
+		SmcSaveYourselfProc callback;
+		SmPointer client_data;
+	} save_yourself;
+
+	struct {
+		SmcDieProc callback;
+		SmPointer client_data;
+	} die;
+
+	struct {
+		SmcSaveCompleteProc callback;
+		SmPointer client_data;
+	} save_complete;
+
+	struct {
+		SmcShutdownCancelledProc callback;
+		SmPointer client_data;
+	} shutdown_cancelled;
+
+} SmcCallbacks;
+</synopsis>
+
+    <sect2 id='The_Save_Yourself_Callback'>
+<title>The Save Yourself Callback</title>
+
+      <para>
+The Save Yourself callback is of type <function>SmcSaveYourselfProc</function>
+      </para>
+
+<funcsynopsis id='SaveYourselfProc'>
+<funcprototype>
+  <funcdef>typedef void (*<function>SaveYourselfProc</function>)</funcdef>
+    <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+    <paramdef>SmPointer <parameter>client_data</parameter></paramdef>
+    <paramdef>int <parameter>save_type</parameter></paramdef>
+    <paramdef>Bool <parameter>shutdown</parameter></paramdef>
+    <paramdef>int <parameter>interact_style</parameter></paramdef>
+    <paramdef>Bool <parameter>fast</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>smc_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>client_data</parameter></term>
+    <listitem><para>Client data specified when the callback was registered.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>save_type</parameter></term>
+    <listitem><para>Specifies the type of information that should be saved.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>shut_down</parameter></term>
+    <listitem><para>Specifies if a shutdown is taking place.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>interact_style</parameter></term>
+    <listitem><para>The type of interaction allowed with the user.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>fast</parameter></term>
+    <listitem><para>if <symbol>True</symbol>, then client should save its state as quickly as possible.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+      <para>
+The session manager sends a &ldquo;Save Yourself&rdquo; message to a
+client either to checkpoint it or just before termination so that it
+can save its state.  The client responds with zero or more calls
+to <xref linkend='SmcSetProperties' xrefstyle='select: title'/> to update the properties
+indicating how to restart the client.  When all the properties have
+been set, the client calls <xref linkend='SmcSaveYourselfDone' xrefstyle='select: title'/>
+      </para>
+
+      <para>
+If <parameter>interact_style</parameter> is
+<constant>SmInteractStyleNone</constant> the
+client must not interact with the user while saving state.
+If <parameter>interact_style</parameter> is
+<constant>SmInteractStyleErrors</constant> the
+client may interact with the user only if an error condition arises.
+If <parameter>interact_style</parameter> is
+<constant>SmInteractStyleAny</constant> then the
+client may interact with the user for any purpose.  Because only one
+client can interact with the user at a time, the client must
+call <xref linkend='SmcInteractRequest' xrefstyle='select: title'/> and wait for an
+&ldquo;Interact&rdquo; message from the session manager.  When the
+client is done interacting with the user, it
+calls <xref linkend='SmcInteractDone' xrefstyle='select: title'/> The client may only
+call <xref linkend='SmcInteractRequest' xrefstyle='select: title'/> after it receives a
+&ldquo;Save Yourself&rdquo; message and before it
+calls <xref linkend='SmcSaveYourselfDone' xrefstyle='select: title'/>
+      </para>
+
+      <para>
+If <parameter>save_type</parameter> is <constant>SmSaveLocal</constant> the
+client must update the properties to reflect its current state.  Specifically,
+it should save enough information to restore the state as seen by the
+user of this client.  It should not affect the state as seen by other users.
+If <parameter>save_type</parameter> is <constant>SmSaveGlobal</constant>
+the user wants the client to commit all of its data to permanent, globally
+accessible storage.
+If <parameter>save_type</parameter> is <constant>SmSaveBoth</constant>
+the client should do both of these (it should first commit the data to
+permanent storage before updating its properties).
+      </para>
+
+      <para>
+Some examples are as follows:
+
+        <itemizedlist mark='bullet'>
+	  <listitem><para>
+If a word processor were sent a &ldquo;Save Yourself&rdquo; with a
+type of <constant>SmSaveLocal</constant> it could create a temporary
+file that included the current contents of the file, the location of
+the cursor, and other aspects of the current editing session.  It
+would then update its <property>SmRestartCommand</property> property with
+enough information to find this temporary file.
+	  </para></listitem>
+	  <listitem><para>
+If a word processor were sent a &ldquo;Save Yourself&rdquo; with a
+type of <constant>SmSaveGlobal</constant> it would simply save the
+currently edited file.
+	  </para></listitem>
+	  <listitem><para>
+If a word processor were sent a &ldquo;Save Yourself&rdquo; with a
+type of <constant>SmSaveBoth</constant> it would first save the
+currently edited file.  It would then create a temporary file with
+information such as the current position of the cursor and what file
+is being edited.  Finally, it would update its
+<property>SmRestartCommand</property> property with enough information
+to find the temporary file.
+	  </para></listitem>
+	</itemizedlist>
+      </para>
+
+      <para>
+The <parameter>shutdown</parameter> argument specifies whether the
+system is being shut down.
+The interaction is different depending on whether or not shutdown is
+set.  If not shutting down, the client should save its state and wait
+for a &ldquo;Save Complete&rdquo; message.  If shutting down, the
+client must save state and then prevent interaction until it receives
+either a &ldquo;Die&rdquo; or a &ldquo;Shutdown Cancelled.&rdquo;
+      </para>
+
+      <para>
+The <parameter>fast</parameter> argument specifies that the client
+should save its state as quickly as possible.  For example, if the
+session manager knows that power is about to fail, it would
+set <parameter>fast</parameter> to <constant>True</constant>.
+      </para>
+    </sect2>
+
+    <sect2 id='The_Die_Callback'>
+<title>The Die Callback</title>
+
+      <para>
+The Die callback is of type <xref linkend='SmcDieProc' xrefstyle='select: title'/>
+      </para>
+
+<funcsynopsis id='SmcDieProc'>
+<funcprototype>
+  <funcdef>typedef void (*<function>SmcDieProc</function>)</funcdef>
+    <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+    <paramdef>SmPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>smc_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>client_data</parameter></term>
+    <listitem><para>Client data specified when the callback was registered.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+
+      <para>
+The session manager sends a &ldquo;Die&rdquo; message to a client when
+it wants it to die.  The client should respond by calling
+<xref linkend='SmcCloseConnection' xrefstyle='select: title'/>.  A session manager that
+behaves properly will send a &ldquo;Save Yourself&rdquo; message
+before the &ldquo;Die&rdquo; message.
+      </para>
+    </sect2>
+
+    <sect2 id='The_Save_Complete_Callback'>
+<title>The Save Complete Callback</title>
+
+      <para>
+The Save Complete callback is of type <xref linkend='SmcSaveCompleteProc' xrefstyle='select: title'/>
+      </para>
+
+<funcsynopsis id='SmcSaveCompleteProc'>
+   <funcprototype>
+      <funcdef>typedef void (*<function>SmcSaveCompleteProc</function>)</funcdef>
+      <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+      <paramdef>SmPointer <parameter>client_data</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>smc_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>client_data</parameter></term>
+    <listitem><para>Client data specified when the callback was registered.</para></listitem>
+  </varlistentry>
+</variablelist>
+    </sect2>
+
+
+    <sect2 id='The_Shutdown_Cancelled_Callback'>
+<title>The Shutdown Cancelled Callback</title>
+
+      <para>
+The Shutdown Cancelled callback is of type
+<xref linkend='SmcShutdownCancelledProc' xrefstyle='select: title'/>
+      </para>
+
+<funcsynopsis id='SmcShutdownCancelledProc'>
+   <funcprototype>
+      <funcdef>typedef void (*<function>SmcShutdownCancelledProc</function>)</funcdef>
+      <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+      <paramdef>SmPointer <parameter>client_data</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>smc_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>client_data</parameter></term>
+    <listitem><para>Client data specified when the callback was registered.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+      <para>
+The session manager sends a &ldquo;Shutdown Cancelled&rdquo; message
+when the user cancelled the shutdown during an interaction
+(see <link linkend='Interacting_With_the_User'>section 5.5,
+&ldquo;Interacting With the User&rdquo;</link>).  The client can now
+continue as if the shutdown had never happened.  If the client has not
+called <xref linkend='SmcSaveYourselfDone' xrefstyle='select: title'/> yet, it can either
+abort the save and then call <xref linkend='SmcSaveYourselfDone' xrefstyle='select: title'/>
+with the success argument set to <constant>False</constant> or it can
+continue with the save and then call <xref linkend='SmcSaveYourselfDone' xrefstyle='select: title'/>
+with the <parameter>success</parameter> argument set to reflect the outcome
+of the save.
+      </para>
+    </sect2>
+  </sect1>
+
+  <sect1 id='Closing_the_Connection'>
+<title>Closing the Connection</title>
+
+    <para>
+To close a connection with a session manager,
+use <xref linkend='SmcCloseConnection' xrefstyle='select: title'/>
+    </para>
+
+<funcsynopsis id='SmcCloseConnection'>
+   <funcprototype>
+      <funcdef>SmcCloseStatus <function>SmcCloseConnection</function></funcdef>
+      <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+      <paramdef>int <parameter>count</parameter></paramdef>
+      <paramdef>char **<parameter>reason_msgs</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>smc_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>count</parameter></term>
+    <listitem><para>The number of reasons for closing the connection.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>reason_msgs</parameter></term>
+    <listitem><para>The reasons for closing the connection.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+    <para>
+The <parameter>reason_msgs</parameter> argument will most likely be
+<constant>NULL</constant> if resignation is expected by the client.
+Otherwise, it contains a list of null-terminated Compound Text strings
+representing the reason for termination.  The session manager should
+display these reason messages to the user.
+    </para>
+
+    <para>
+Note that SMlib used the ICE protocol to establish a connection with
+the session manager, and various protocols other than session
+management may be active on the ICE connection.
+When <xref linkend='SmcCloseConnection' xrefstyle='select: title'/> is called, the ICE
+connection will be closed only if all protocols have been shutdown on
+the connection.  Check the ICElib standard
+for <function>IceAddConnectionWatch</function>
+and <function>IceRemoveConnectionWatch</function> to learn how to set
+up a callback to be invoked each time an ICE connection is opened or
+closed.  Typically this callback adds/removes the ICE file descriptor
+from the list of active descriptors to call <function>select</function> on
+(or calls <function>XtAppAddInput</function> or
+<function>XtRemoveInput</function>).
+    </para>
+
+
+    <para>
+<xref linkend='SmcCloseConnection' xrefstyle='select: title'/> returns one of the following values:
+
+      <itemizedlist mark='bullet'>
+	<listitem><para>
+<constant>SmcClosedNow</constant> - the ICE connection was closed at
+this time, the watch procedures were invoked, and the connection was freed.
+	</para></listitem>
+	<listitem><para>
+<constant>SmcClosedASAP</constant> - an IO error had occurred on the
+connection, but <xref linkend='SmcCloseConnection' xrefstyle='select: title'/> is being
+called within a nested <function>IceProcessMessages</function> The
+watch procedures have been invoked at this time, but the connection
+will be freed as soon as possible (when the nesting level reaches zero
+and <function>IceProcessMessages</function> returns a status
+of <function>IceProcessMessagesConnectionClosed</function>
+	</para> </listitem>
+	<listitem><para>
+<constant>SmcConnectionInUse</constant> - the connection was not closed at
+this time, because it is being used by other active protocols.
+	</para> </listitem>
+      </itemizedlist>
+    </para>
+  </sect1>
+
+
+  <sect1 id='Modifying_Callbacks'>
+<title>Modifying Callbacks</title>
+
+    <para>
+To modify callbacks set up in <xref linkend='SmcOpenConnection' xrefstyle='select: title'/>
+use <xref linkend='SmcModifyCallbacks' xrefstyle='select: title'/>
+    </para>
+
+<funcsynopsis id='SmcModifyCallbacks'>
+   <funcprototype>
+      <funcdef>void <function>SmcModifyCallbacks</function></funcdef>
+      <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+      <paramdef>unsigned long <parameter>mask</parameter></paramdef>
+      <paramdef>SmcCallbacks *<parameter>callbacks</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>smc_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>mask</parameter></term>
+    <listitem><para>A mask indicating which callbacks to modify.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>callbacks</parameter></term>
+    <listitem><para>The new callbacks.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+    <para>
+When specifying a value for the <parameter>mask</parameter> argument,
+the following values may be ORed together:
+
+      <simplelist type='vert'>
+	<member><constant>SmcSaveYourselfProcMask</constant></member>
+	<member><constant>SmcDieProcMask</constant></member>
+	<member><constant>SmcSaveCompleteProcMask</constant></member>
+	<member><constant>SmcShutdownCancelledProcMask</constant></member>
+      </simplelist>
+    </para>
+  </sect1>
+
+  <sect1 id='Setting_Deleting_and_Retrieving_Session_Management_Properties'>
+<title>Setting, Deleting, and Retrieving Session Management Properties</title>
+
+    <para>
+To set session management properties for this client,
+use <xref linkend='SmcSetProperties' xrefstyle='select: title'/>
+    </para>
+
+<funcsynopsis id='SmcSetProperties'>
+   <funcprototype>
+      <funcdef>void <function>SmcSetProperties</function></funcdef>
+      <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+      <paramdef>int <parameter>num_props</parameter></paramdef>
+      <paramdef>SmProp **<parameter>props</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>smc_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>num_props</parameter></term>
+    <listitem><para>The number of properties.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>props</parameter></term>
+    <listitem><para>The list of properties to set.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+
+    <para>
+The properties are specified as an array of property pointers.
+Previously set property values may be over-written using
+the <xref linkend='SmcSetProperties' xrefstyle='select: title'/> function.  Note that the
+session manager is not expected to restore property values when the
+session is restarted.  Because of this, clients should not try to use
+the session manager as a database for storing application specific state.
+    </para>
+
+    <para>
+For a description of session management properties and
+the <structname>SmProp</structname> structure,
+see <link linkend='Session_Management_Properties'>section 7,
+&ldquo;Session Management Properties.&rdquo;</link>
+    </para>
+
+
+    <para>
+To delete properties previously set by the client,
+use <xref linkend='SmcDeleteProperties' xrefstyle='select: title'/>
+    </para>
+
+<funcsynopsis id='SmcDeleteProperties'>
+   <funcprototype>
+      <funcdef>void <function>SmcDeleteProperties</function></funcdef>
+      <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+      <paramdef>int <parameter>num_props</parameter></paramdef>
+      <paramdef>char **<parameter>prop_names</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>smc_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>num_props</parameter></term>
+    <listitem><para>The number of properties.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>prop_names</parameter></term>
+    <listitem><para>The list of properties to set.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+    <para>
+To get properties previously stored by the client,
+use <xref linkend='SmcGetProperties' xrefstyle='select: title'/>
+    </para>
+
+<funcsynopsis id='SmcGetProperties'>
+   <funcprototype>
+      <funcdef>Status <function>SmcGetProperties</function></funcdef>
+      <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+      <paramdef>SmcPropReplyProc <parameter>prop_reply_proc</parameter></paramdef>
+      <paramdef>SmPointer <parameter>client_data</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>smc_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>prop_reply_proc</parameter></term>
+    <listitem><para>The callback to be invoked when the properties reply comes back.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>client_data</parameter></term>
+    <listitem><para>This pointer to client data will be passed to the <xref linkend='SmcPropReplyProc' xrefstyle='select: title'/> callback.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+    <para>
+The return value of <xref linkend='SmcGetProperties' xrefstyle='select: title'/> is zero for
+failure and a positive value for success.
+    </para>
+
+    <para>
+Note that the library does not block until the properties reply comes
+back.  Rather, a callback of type <xref linkend='SmcPropReplyProc' xrefstyle='select: title'/>
+is invoked when the data is ready.
+    </para>
+
+<funcsynopsis id='SmcPropReplyProc'>
+   <funcprototype>
+      <funcdef>typedef void (*<function>SmcPropReplyProc</function>)</funcdef>
+      <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+      <paramdef>SmPointer <parameter>client_data</parameter></paramdef>
+      <paramdef>int <parameter>num_props</parameter></paramdef>
+      <paramdef>SmProp **<parameter>props</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>smc_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>client_data</parameter></term>
+    <listitem><para>This pointer to client data will be passed to the <xref linkend='SmcPropReplyProc' xrefstyle='select: title'/> callback.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>num_props</parameter></term>
+    <listitem><para>The number of properties returned.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>props</parameter></term>
+    <listitem><para>The list of properties returned.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+    <para>
+To free each property, use <xref linkend='SmFreeProperty' xrefstyle='select: title'/>
+(see <link linkend='Freeing_Data'>section 8, &ldquo;Freeing
+Data&rdquo;</link>).  To free the actual array of pointers,
+use <function>free</function>
+    </para>
+  </sect1>
+
+  <sect1 id='Interacting_With_the_User'>
+<title>Interacting With the User</title>
+
+    <para>
+After receiving a &ldquo;Save Yourself&rdquo; message with an
+<parameter>interact_style</parameter> of
+<constant>SmInteractStyleErrors</constant>
+or <constant>SmInteractStyleAny</constant> the client may choose to
+interact with the user.  Because only one client can interact with the
+user at a time, the client must call <xref linkend='SmcInteractRequest' xrefstyle='select: title'/>
+and wait for an &ldquo;Interact&rdquo; message from the session manager.
+    </para>
+
+<funcsynopsis id='SmcInteractRequest'>
+   <funcprototype>
+      <funcdef>Status <function>SmcInteractRequest</function></funcdef>
+      <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+      <paramdef>int <parameter>dialog_type</parameter></paramdef>
+      <paramdef>SmcInteractProc <parameter>interact_proc</parameter></paramdef>
+      <paramdef>SmPointer <parameter>client_data</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>smc_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>dialog_type</parameter></term>
+    <listitem><para>The type of dialog the client wishes to present to the user.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>interact_proc</parameter></term>
+    <listitem><para>The callback to be invoked when the &ldquo;Interact&rdquo; message arrives from the session manager.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>client_data</parameter></term>
+    <listitem><para>
+This pointer to client data will be passed to
+the <xref linkend='SmcInteractProc' xrefstyle='select: title'/> callback when the
+&ldquo;Interact&rdquo; message arrives.
+    </para></listitem>
+  </varlistentry>
+</variablelist>
+
+    <para>
+The return value of <xref linkend='SmcInteractRequest' xrefstyle='select: title'/> is zero
+for failure and a positive value for success.
+    </para>
+
+    <para>
+The <parameter>dialog_type</parameter> argument specifies
+either <constant>SmDialogError</constant> indicating that the client
+wants to start an error dialog, or <constant>SmDialogNormal</constant>
+meaning that the client wishes to start a nonerror dialog.
+    </para>
+
+    <para>
+Note that if a shutdown is in progress, the user may have the option
+of cancelling the shutdown.  If the shutdown is cancelled, the clients
+that have not interacted yet with the user will receive a
+&ldquo;Shutdown Cancelled&rdquo; message instead of the
+&ldquo;Interact&rdquo; message.
+    </para>
+
+    <para>
+The <xref linkend='SmcInteractProc' xrefstyle='select: title'/> callback will be invoked when
+the &ldquo;Interact&rdquo; message arrives from the session manager.
+    </para>
+
+<funcsynopsis id='SmcInteractProc'>
+   <funcprototype>
+      <funcdef>typedef void (*<function>SmcInteractProc</function>)</funcdef>
+      <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+      <paramdef>SmPointer <parameter>client_data</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>smc_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>client_data</parameter></term>
+    <listitem><para>Client data specified when the callback was registered.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+    <para>
+After interacting with the user (in response to an &ldquo;Interact&rdquo;
+message), you should call <xref linkend='SmcInteractDone' xrefstyle='select: title'/>
+    </para>
+
+<funcsynopsis id='SmcInteractDone'>
+   <funcprototype>
+      <funcdef>void <function>SmcInteractDone</function></funcdef>
+      <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+      <paramdef>Bool <parameter>cancel_shutdown</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>smc_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>cancel_shutdown</parameter></term>
+    <listitem><para>If <constant>True</constant>, indicates that the user requests that the entire shutdown be cancelled.</para></listitem>
+  </varlistentry>
+</variablelist>
+    <para>
+The <parameter>cancel_shutdown</parameter> argument may only be
+<constant>True</constant> if the corresponding &ldquo;Save Yourself&rdquo;
+specified <constant>True</constant> for shutdown
+and <constant>SmInteractStyleErrors</constant>
+or <constant>SmInteractStyleAny</constant> for
+the <parameter>interact_style</parameter>.
+    </para>
+  </sect1>
+
+  <sect1 id='Requesting_a_Save_Yourself'>
+<title>Requesting a Save Yourself</title>
+
+    <para>
+To request a checkpoint from the session manager,
+use <xref linkend='SmcRequestSaveYourself' xrefstyle='select: title'/>
+    </para>
+
+<funcsynopsis id='SmcRequestSaveYourself'>
+   <funcprototype>
+      <funcdef>void <function>SmcRequestSaveYourself</function></funcdef>
+      <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+      <paramdef>int <parameter>save_type</parameter></paramdef>
+      <paramdef>Bool <parameter>shutdown</parameter></paramdef>
+      <paramdef>int <parameter>interact_style</parameter></paramdef>
+      <paramdef>Bool <parameter>fast</parameter></paramdef>
+      <paramdef>Bool <parameter>global</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>smc_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>save_type</parameter></term>
+    <listitem><para>Specifies the type of information that should be saved.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>shutdown</parameter></term>
+    <listitem><para>Specifies if a shutdown is taking place.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>interact_style</parameter></term>
+    <listitem><para>The type of interaction allowed with the user.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>fast</parameter></term>
+    <listitem><para>If <constant>True</constant> the client should save its state as quickly as possible.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>global</parameter></term>
+    <listitem><para>Controls who gets the &ldquo;Save Yourself.&rdquo;</para></listitem>
+  </varlistentry>
+</variablelist>
+
+    <para>
+The <parameter>save_type</parameter>, <parameter>shutdown</parameter>,
+<parameter>interact_style</parameter>, and <parameter>fast</parameter>
+arguments are discussed in more detail in
+<link linkend='The_Save_Yourself_Callback'>section 5.1.1,
+&ldquo;The Save Yourself Callback.&rdquo;</link>
+    </para>
+
+    <para>
+If <parameter>global</parameter> is set to <constant>True</constant> then
+the resulting &ldquo;Save Yourself&rdquo; should be sent to all clients in the
+session.  For example, a vendor of a Uninterruptible Power Supply
+(<acronym>UPS</acronym>) might include a Session Management client
+that would monitor the status of the UPS and generate a fast shutdown
+if the power is about to be lost.
+    </para>
+
+    <para>
+If global is set to <constant>False</constant> then the &ldquo;Save
+Yourself&rdquo; should only be sent to the client that requested it.
+    </para>
+  </sect1>
+
+  <sect1 id='Requesting_a_Save_Yourself_Phase_2_2'>
+<title>Requesting a Save Yourself Phase 2</title>
+
+    <para>
+In response to a &ldquo;Save Yourself&rdquo;, the client may request to be
+informed when all the other clients are quiescent so that it can save their
+state.  To do so, use <xref linkend='SmcRequestSaveYourselfPhase2' xrefstyle='select: title'/>
+    </para>
+
+<funcsynopsis id='SmcRequestSaveYourselfPhase2'>
+   <funcprototype>
+      <funcdef>Status <function>SmcRequestSaveYourselfPhase2</function></funcdef>
+      <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+      <paramdef>SmcSaveYourselfPhase2Proc <parameter>save_yourself_phase2_proc</parameter></paramdef>
+      <paramdef>SmPointer <parameter>client_data</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>smc_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>save_type_phase2_proc</parameter></term>
+    <listitem><para>The callback to be invoked when the &ldquo;Save Yourself Phase 2&rdquo; message arrives from the session manager.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>client_data</parameter></term>
+    <listitem><para>This pointer to client data will be passed to the <function>SmcSaveYourselfPhase2Proc</function> callback when the &ldquo;Save Yourself Phase 2&rdquo; message arrives.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+    <para>
+The return value of <xref linkend='SmcRequestSaveYourselfPhase2' xrefstyle='select: title'/>
+is zero for failure and a positive value for success.
+    </para>
+
+    <para>
+This request is needed by clients that manage other clients (for
+example, window managers, workspace managers, and so on).  The manager
+must make sure that all of the clients that are being managed are in
+an idle state so that their state can be saved.
+    </para>
+  </sect1>
+
+  <sect1 id='Completing_a_Save_Yourself'>
+<title>Completing a Save Yourself</title>
+
+    <para>
+After saving state in response to a &ldquo;Save Yourself&rdquo;
+message, you should call <xref linkend='SmcSaveYourselfDone' xrefstyle='select: title'/>
+    </para>
+
+<funcsynopsis id='SmcSaveYourselfDone'>
+   <funcprototype>
+      <funcdef>void <function>SmcSaveYourselfDone</function></funcdef>
+      <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+      <paramdef>Bool <parameter>success</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>smc_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>success</parameter></term>
+    <listitem><para>If <constant>True</constant> the &ldquo;Save Yourself&rdquo; operation was completed successfully.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+    <para>
+Before calling <xref linkend='SmcSaveYourselfDone' xrefstyle='select: title'/> the client
+must have set each required property at least once since the client
+registered with the session manager.
+    </para>
+  </sect1>
+
+  <sect1 id='Using_Smc_Informational_Functions'>
+<title>Using Smc Informational Functions</title>
+
+<funcsynopsis id='SmcProtocolVersion'>
+   <funcprototype>
+      <funcdef>int <function>SmcProtocolVersion</function></funcdef>
+      <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+    <para>
+<xref linkend='SmcProtocolVersion' xrefstyle='select: title'/> returns the major version of
+the session management protocol associated with this session.
+    </para>
+
+
+<funcsynopsis id='SmcProtocolRevision'>
+   <funcprototype>
+      <funcdef>int <function>SmcProtocolRevision</function></funcdef>
+      <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+    <para>
+<xref linkend='SmcProtocolRevision' xrefstyle='select: title'/> returns the minor version of
+the session management protocol associated with this session.
+    </para>
+
+<funcsynopsis id='SmcVendor'>
+   <funcprototype>
+      <funcdef>char *<function>SmcVendor</function></funcdef>
+      <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+    <para>
+<xref linkend='SmcVendor' xrefstyle='select: title'/> returns a string that provides some
+identification of the owner of the session manager.  The string should
+be freed with a call to <function>free</function>
+    </para>
+
+<funcsynopsis id='SmcRelease'>
+   <funcprototype>
+      <funcdef>char *<function>SmcRelease</function></funcdef>
+      <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+    <para>
+<xref linkend='SmcRelease' xrefstyle='select: title'/> returns a string that provides the
+release number of the session manager.  The string should be freed
+with a call to <function>free</function>
+    </para>
+
+<funcsynopsis id='SmcClientID'>
+   <funcprototype>
+      <funcdef>char *<function>SmcClientID</function></funcdef>
+      <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+    <para>
+<xref linkend='SmcClientID' xrefstyle='select: title'/> returns a null-terminated string for
+the client ID associated with this connection.  This information was
+also returned in <xref linkend='SmcOpenConnection' xrefstyle='select: title'/> (it is
+provided here for convenience).  Call <function>free</function> on
+this pointer when the client ID is no longer needed.
+    </para>
+
+<funcsynopsis id='SmcGetIceConnection'>
+   <funcprototype>
+      <funcdef>IceConn <function>SmcGetIceConnection</function></funcdef>
+      <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+    <para>
+<xref linkend='SmcGetIceConnection' xrefstyle='select: title'/> returns the ICE connection
+object associated with this session management connection object.  The
+ICE connection object can be used to get some additional information
+about the connection.  Some of the more useful functions which can be
+used on the IceConn are <function>IceConnectionNumber</function>,
+<function>IceConnectionString</function>,
+<function>IceLastSentSequenceNumber</function>,
+<function>IceLastReceivedSequenceNumber</function>,
+and <function>IcePing</function>. For further information, see
+the <citetitle pubwork='article'>Inter-Client Exchange Library</citetitle>
+standard.
+    </para>
+  </sect1>
+
+  <sect1 id='Error_Handling'>
+<title>Error Handling</title>
+
+    <para>
+If the client receives an unexpected protocol error from the session
+manager, an error handler is invoked by SMlib.  A default error
+handler exists that simply prints the error message
+to <varname>stderr</varname> and exits if the severity of the error
+is fatal.  The client can change this error handler by calling
+the <xref linkend='SmcSetErrorHandler' xrefstyle='select: title'/> function.
+    </para>
+
+<funcsynopsis id='SmcSetErrorHandler'>
+  <funcprototype>
+      <funcdef>SmcErrorHandler <function>SmcSetErrorHandler</function></funcdef>
+      <paramdef>SmcErrorHandler <parameter>handler</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+    <para>
+The error handler.  You should pass <constant>NULL</constant> to
+restore the default handler.
+    </para>
+
+
+    <para>
+<xref linkend='SmcSetErrorHandler' xrefstyle='select: title'/> returns the previous error handler.
+    </para>
+
+    <para>
+The <xref linkend='SmcErrorHandler' xrefstyle='select: title'/> has the following type:
+    </para>
+
+<funcsynopsis id='SmcErrorHandler'>
+   <funcprototype>
+      <funcdef>typedef void (*<function>SmcErrorHandler</function>)</funcdef>
+      <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
+      <paramdef>Bool <parameter>swap</parameter></paramdef>
+      <paramdef>int <parameter>offending_minor_opcode</parameter></paramdef>
+      <paramdef>unsigned long <parameter>offending_sequence_num</parameter></paramdef>
+      <paramdef>int <parameter>error_class</parameter></paramdef>
+      <paramdef>int <parameter>severity</parameter></paramdef>
+      <paramdef>IcePointer <parameter>values</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>smc_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+     <term><parameter>swap</parameter></term>
+     <listitem><para>A flag that indicates if the specified values need byte swapping.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+     <term><parameter>offending_minor_opcode</parameter></term>
+     <listitem><para>The minor opcode of the offending message.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+     <term><parameter>offending_sequence_num</parameter></term>
+     <listitem><para>The sequence number of the offending message.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+     <term><parameter>error_class</parameter></term>
+     <listitem><para>The error class of the offending message.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+     <term><parameter>severity</parameter></term>
+     <listitem><para><constant>IceCanContinue</constant>,
+	 <constant>IceFatalToProtocol</constant>, or
+	 <constant>IceFatalToConnection</constant>
+     </para></listitem>
+  </varlistentry>
+  <varlistentry>
+     <term><parameter>values</parameter></term>
+     <listitem><para>Any additional error values specific to the minor opcode and class.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+    <para>
+Note that this error handler is invoked for protocol related errors.
+To install an error handler to be invoked when an IO error occurs, use
+<function>IceSetIOErrorHandler</function> For further information, see
+the <citetitle pubwork='article'>Inter-Client Exchange Library</citetitle>
+standard.
+    </para>
+  </sect1>
+</chapter>
+
+<chapter id='Session_Management_Server_Sms_Functions'>
+  <title>Session Management Server (<acronym>Sms</acronym>) Functions</title>
+
+  <para>
+This section discusses how Session Management servers:
+
+    <itemizedlist mark='bullet'>
+      <listitem><para>Initialize the library</para></listitem>
+      <listitem><para>Register the client</para></listitem>
+      <listitem><para>Send a &ldquo;Save Yourself&rdquo; message</para></listitem>
+      <listitem><para>Send a &ldquo;Save Yourself Phase 2&rdquo; message</para></listitem>
+      <listitem><para>Send an &ldquo;Interact&rdquo; message</para></listitem>
+      <listitem><para>Send a &ldquo;Save Complete&rdquo; message</para></listitem>
+      <listitem><para>Send a &ldquo;Die&rdquo; message</para></listitem>
+      <listitem><para>Cancel a shutdown</para></listitem>
+      <listitem><para>Return properties</para></listitem>
+      <listitem><para>Ping a client</para></listitem>
+      <listitem><para>Clean up after a client disconnects</para></listitem>
+      <listitem><para>Use Sms informational functions</para></listitem>
+      <listitem><para>Handle errors</para></listitem>
+    </itemizedlist>
+  </para>
+
+  <sect1 id='Initializing_the_Library'>
+<title>Initializing the Library</title>
+
+    <para>
+<xref linkend='SmsInitialize' xrefstyle='select: title'/> is the first SMlib function that
+should be called by a session manager.  It provides information about
+the session manager and registers a callback that will be invoked each
+time a new client connects to the session manager.
+    </para>
+
+<funcsynopsis id='SmsInitialize'>
+   <funcprototype>
+      <funcdef>Status <function>SmsInitialize</function></funcdef>
+      <paramdef>const char *<parameter>vendor</parameter></paramdef>
+      <paramdef>const char *<parameter>release</parameter></paramdef>
+      <paramdef>SmsNewClientProc <parameter>new_client_proc</parameter></paramdef>
+      <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
+      <paramdef>IceHostBasedAuthProc <parameter>host_based_auth_proc</parameter></paramdef>
+      <paramdef>int <parameter>error_length</parameter></paramdef>
+      <paramdef>char *<parameter>error_string_ret</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>vendor</parameter></term>
+    <listitem><para>A string specifying the session manager vendor.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>release</parameter></term>
+    <listitem><para>A string specifying the session manager release number.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>new_client_proc</parameter></term>
+    <listitem><para>Callback to be invoked each time a new client connects to the session manager.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>manager_data</parameter></term>
+    <listitem><para>When the <xref linkend='SmsNewClientProc' xrefstyle='select: title'/> callback is invoked, this pointer to manager data will be passed.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>host_based_auth_proc</parameter></term>
+    <listitem><para>Host based authentication callback.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>error_length</parameter></term>
+    <listitem><para>Length of the <parameter>error_string_ret</parameter> argument passed in.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>error_string_ret</parameter></term>
+    <listitem><para>
+Returns a null-terminated error message, if any.
+The <parameter>error_string_ret</parameter> points to user supplied memory.
+No more than <parameter>error_length</parameter> bytes are used.
+    </para></listitem>
+  </varlistentry>
+</variablelist>
+
+    <para>
+After the <xref linkend='SmsInitialize' xrefstyle='select: title'/> function is called, the
+session manager should call the <function>IceListenForConnections</function>
+function to listen for new connections.  Afterwards, each time a
+client connects, the session manager should
+call <function>IceAcceptConnection</function>
+    </para>
+
+    <para>
+See <link linkend='Authentication_of_Clients'>section 9,
+&ldquo;Authentication of Clients,&rdquo;</link> for more details on
+authentication (including host based authentication).  Also see
+the <citetitle pubwork='article'>Inter-Client Exchange
+Library</citetitle> standard for further details on listening for and
+accepting ICE connections.
+    </para>
+
+    <para>
+Each time a new client connects to the session manager,
+the <xref linkend='SmsNewClientProc' xrefstyle='select: title'/> callback is invoked.  The
+session manager obtains a new opaque connection object that it should
+use for all future interaction with the client.  At this time, the
+session manager must also register a set of callbacks to respond to
+the different messages that the client might send.
+    </para>
+
+<funcsynopsis id='SmsNewClientProc'>
+   <funcprototype>
+      <funcdef>typedef Status (*<function>SmsNewClientProc</function>)</funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+      <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
+      <paramdef>unsigned long *<parameter>mask_ret</parameter></paramdef>
+      <paramdef>SmsCallbacks *<parameter>callbacks_ret</parameter></paramdef>
+      <paramdef>char **<parameter>failure_reason_ret</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>sms_conn</parameter></term>
+    <listitem><para>A new opaque connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>manager_data</parameter></term>
+    <listitem><para>Manager data specified when the callback was registered.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>mask_ret</parameter></term>
+    <listitem><para>On return, indicates which callbacks were set by the session manager.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>callbacks_ret</parameter></term>
+    <listitem><para>On return, contains the callbacks registered by the session manager.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>failure_reason_ret</parameter></term>
+    <listitem><para>Failure reason returned.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+    <para>
+If a failure occurs, the <xref linkend='SmsNewClientProc' xrefstyle='select: title'/> should
+return a zero status as well as allocate and return a failure reason
+string in <parameter>failure_reason_ret</parameter>.
+SMlib will be responsible for freeing this memory.
+    </para>
+
+    <para>
+The session manager must register a set of callbacks to respond to
+client events.  The <parameter>mask_ret</parameter> argument specifies
+which callbacks are set.  All of the callbacks specified in this version of
+SMlib are mandatory.  The <parameter>mask_ret</parameter> argument is
+necessary in order to maintain backwards compatibility in future versions
+of the library.
+    </para>
+
+    <para>
+The following values may be ORed together to obtain a mask value:
+
+      <simplelist type='vert'>
+	<member><constant>SmsRegisterClientProcMask</constant></member>
+	<member><constant>SmsInteractRequestProcMask</constant></member>
+	<member><constant>SmsInteractDoneProcMask</constant></member>
+	<member><constant>SmsSaveYourselfRequestProcMask</constant></member>
+	<member><constant>SmsSaveYourselfP2RequestProcMask</constant></member>
+	<member><constant>SmsSaveYourselfDoneProcMask</constant></member>
+	<member><constant>SmsCloseConnectionProcMask</constant></member>
+	<member><constant>SmsSetPropertiesProcMask</constant></member>
+	<member><constant>SmsDeletePropertiesProcMask</constant></member>
+	<member><constant>SmsGetPropertiesProcMask</constant></member>
+      </simplelist>
+    </para>
+
+    <para>
+For each callback, the session manager can register a pointer to
+manager data specific to that callback.  This pointer will be passed
+to the callback when it is invoked by SMlib.
+    </para>
+
+<synopsis>
+typedef struct {
+	struct {
+		SmsRegisterClientProc callback;
+		SmPointer manager_data;
+	} register_client;
+
+	struct {
+		SmsInteractRequestProc callback;
+		SmPointer manager_data;
+	} interact_request;
+
+	struct {
+		SmsInteractDoneProc callback;
+		SmPointer manager_data;
+	} interact_done;
+
+	struct {
+		SmsSaveYourselfRequestProc callback;
+		SmPointer manager_data;
+	} save_yourself_request;
+
+	struct {
+		SmsSaveYourselfPhase2RequestProc callback;
+		SmPointer manager_data;
+	} save_yourself_phase2_request;
+
+	struct {
+		SmsSaveYourselfDoneProc callback;
+		SmPointer manager_data;
+	} save_yourself_done;
+
+	struct {
+		SmsCloseConnectionProc callback;
+		SmPointer manager_data;
+	} close_connection;
+
+	struct {
+		SmsSetPropertiesProc callback;
+		SmPointer manager_data;
+	} set_properties;
+
+	struct {
+		SmsDeletePropertiesProc callback;
+		SmPointer manager_data;
+	} delete_properties;
+
+	struct {
+		SmsGetPropertiesProc callback;
+		SmPointer manager_data;
+	} get_properties;
+
+} SmsCallbacks;
+</synopsis>
+
+    <sect2 id='The_Register_Client_Callback'>
+<title>The Register Client Callback</title>
+
+      <para>
+The Register Client callback is the first callback that will be
+invoked after the client connects to the session manager.  Its type
+is <xref linkend='SmsRegisterClientProc' xrefstyle='select: title'/>
+      </para>
+
+<funcsynopsis id='SmsRegisterClientProc'>
+   <funcprototype>
+      <funcdef>typedef Status (*<function>SmsRegisterClientProc</function>)</funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+      <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
+      <paramdef>char *<parameter>previous_id</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>sms_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>manager_data</parameter></term>
+    <listitem><para>Manager data specified when the callback was registered.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>previous_id</parameter></term>
+    <listitem><para>The client ID from the previous session.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+      <para>
+Before any further interaction takes place with the client, the client
+must be registered with the session manager.
+      </para>
+
+      <para>
+If the client is being restarted from a previous session,
+<parameter>previous_id</parameter> will contain a null-terminated string
+representing the client ID from the previous session.
+Call <function>free</function> on the <parameter>previous_id</parameter>
+pointer when it is no longer needed.  If the client is first joining the
+session, <parameter>previous_id</parameter> will be <constant>NULL</constant>.
+      </para>
+
+      <para>
+If <parameter>previous_id</parameter> is invalid, the session manager should
+not register the client at this time.  This callback should return a status
+of zero, which will cause an error message to be sent to the client.  The
+client should re-register with previous_id set to <constant>NULL</constant>.
+      </para>
+
+      <para>
+Otherwise, the session manager should register the client with a unique
+client ID by calling the <xref linkend='SmsRegisterClientReply' xrefstyle='select: title'/>
+function (to be discussed shortly), and the
+<xref linkend='SmsRegisterClientProc' xrefstyle='select: title'/> callback should return a
+status of one.
+      </para>
+    </sect2>
+
+    <sect2 id='The_Interact_Request_Callback'>
+<title>The Interact Request Callback</title>
+
+      <para>
+The Interact Request callback is of
+type <xref linkend='SmsInteractRequestProc' xrefstyle='select: title'/>
+      </para>
+
+<funcsynopsis id='SmsInteractRequestProc'>
+   <funcprototype>
+      <funcdef>typedef void (*<function>SmsInteractRequestProc</function>)</funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+      <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
+      <paramdef>int <parameter>dialog_type</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>sms_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>manager_data</parameter></term>
+    <listitem><para>Manager data specified when the callback was registered.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>dialog_type</parameter></term>
+    <listitem><para>The type of dialog the client wishes to present to the user.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+      <para>
+When a client receives a &ldquo;Save Yourself&rdquo; message with an
+<parameter>interact_style</parameter> of
+<constant>SmInteractStyleErrors</constant>
+or <constant>SmInteractStyleAny</constant> the client may choose to
+interact with the user.  Because only one client can interact with the
+user at a time, the client must request to interact with the user.
+The session manager should keep a queue of all clients wishing to
+interact.  It should send an &ldquo;Interact&rdquo; message to one
+client at a time and wait for an &ldquo;Interact Done&rdquo; message
+before continuing with the next client.
+      </para>
+
+      <para>
+The <parameter>dialog_type</parameter> argument specifies
+either <constant>SmDialogError</constant> indicating that the client
+wants to start an error dialog, or <constant>SmDialogNormal</constant>
+meaning that the client wishes to start a nonerror dialog.
+      </para>
+
+      <para>
+If a shutdown is in progress, the user may have the option of
+cancelling the shutdown.  If the shutdown is cancelled (specified in
+the &ldquo;Interact Done&rdquo; message), the session manager should
+send a &ldquo;Shutdown Cancelled&rdquo; message to each client that
+requested to interact.
+      </para>
+    </sect2>
+
+    <sect2 id='The_Interact_Done_Callback'>
+<title>The Interact Done Callback</title>
+
+      <para>
+When the client is done interacting with the user,
+the <xref linkend='SmsInteractDoneProc' xrefstyle='select: title'/> callback will be invoked.
+      </para>
+
+<funcsynopsis id='SmsInteractDoneProc'>
+   <funcprototype>
+      <funcdef>typedef void (*<function>SmsInteractDoneProc</function>)</funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+      <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
+      <paramdef>Bool <parameter>cancel_shutdown</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>sms_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>manager_data</parameter></term>
+    <listitem><para>Manager data specified when the callback was registered.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>cancel_shutdown</parameter></term>
+    <listitem><para>Specifies if the user requests that the entire shutdown be cancelled.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+      <para>
+Note that the shutdown can be cancelled only if the corresponding
+&ldquo;Save Yourself&rdquo; specified <constant>True</constant> for
+shutdown and <constant>SmInteractStyleErrors</constant>
+or <constant>SmInteractStyleAny</constant> for the
+<parameter>interact_style</parameter>.
+      </para>
+    </sect2>
+
+
+    <sect2 id='The_Save_Yourself_Request_Callback'>
+<title>The Save Yourself Request Callback</title>
+
+      <para>
+The Save Yourself Request callback is of
+type <function>SmsSaveYourselfRequestProc</function>
+      </para>
+
+<funcsynopsis id='SaveYourselfRequestProc'>
+   <funcprototype>
+      <funcdef>typedef void (*<function>SaveYourselfRequestProc</function>)</funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+      <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
+      <paramdef>int <parameter>save_type</parameter></paramdef>
+      <paramdef>Bool <parameter>shutdown</parameter></paramdef>
+      <paramdef>int <parameter>interact_style</parameter></paramdef>
+      <paramdef>Bool <parameter>fast</parameter></paramdef>
+      <paramdef>Bool <parameter>global</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>sms_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>manager_data</parameter></term>
+    <listitem><para>Manager data specified when the callback was registered.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>save_type</parameter></term>
+    <listitem><para>Specifies the type of information that should be saved.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>shutdown</parameter></term>
+    <listitem><para>Specifies if a shutdown is taking place.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>interact_style</parameter></term>
+    <listitem><para>The type of interaction allowed with the user.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>fast</parameter></term>
+    <listitem><para>If <constant>True</constant> the client should save its state as quickly as possible.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>global</parameter></term>
+    <listitem><para>Controls who gets the &ldquo;Save Yourself.&rdquo;</para></listitem>
+  </varlistentry>
+</variablelist>
+
+      <para>
+The Save Yourself Request prompts the session manager to initiate a
+checkpoint or shutdown.  For information on the
+<parameter>save_type</parameter>, <parameter>shutdown</parameter>,
+<parameter>interact_style</parameter>, and <parameter>fast</parameter>
+arguments, see <link linkend='Sending_a_Save_Yourself_Message'>section 6.3,
+&ldquo;Sending a Save Yourself Message.&rdquo;</link>
+      </para>
+
+      <para>
+If <parameter>global</parameter> is set to <constant>True</constant> then the
+resulting &ldquo;Save Yourself&rdquo; should be sent to all applications.
+If <parameter>global</parameter> is set to <constant>False</constant> then the
+&ldquo;Save Yourself&rdquo; should only be sent to the client that requested it.
+      </para>
+    </sect2>
+
+    <sect2 id='The_Save_Yourself_Phase_2_Request_Callback'>
+<title>The Save Yourself Phase 2 Request Callback</title>
+
+      <para>
+The Save Yourself Phase 2 Request callback is of
+type <xref linkend='SmsSaveYourselfPhase2RequestProc' xrefstyle='select: title'/>
+      </para>
+
+<funcsynopsis id='SmsSaveYourselfPhase2RequestProc'>
+   <funcprototype>
+      <funcdef>typedef void (*<function>SmsSaveYourselfPhase2RequestProc</function>)</funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+      <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>sms_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>manager_data</parameter></term>
+    <listitem><para>Manager data specified when the callback was registered.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+      <para>
+This request is sent by clients that manage other clients (for
+example, window managers, workspace managers, and so on).  Such
+managers must make sure that all of the clients that are being managed
+are in an idle state so that their state can be saved.
+      </para>
+    </sect2>
+
+    <sect2 id='The_Save_Yourself_Done_Callback'>
+<title>The Save Yourself Done Callback</title>
+
+      <para>
+When the client is done saving its state in response to a
+&ldquo;Save Yourself&rdquo; message,
+the <function>SmsSaveYourselfDoneProc</function> will be invoked.
+      </para>
+
+<funcsynopsis id='SaveYourselfDoneProc'>
+   <funcprototype>
+      <funcdef>typedef void (*<function>SaveYourselfDoneProc</function>)</funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+      <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
+      <paramdef>Bool <parameter>success</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>sms_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>manager_data</parameter></term>
+    <listitem><para>Manager data specified when the callback was registered.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>success</parameter></term>
+    <listitem><para>If <constant>True</constant> the Save Yourself operation was completed successfully.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+      <para>
+Before the &ldquo;Save Yourself Done&rdquo; was sent, the client must
+have set each required property at least once since it registered with
+the session manager.
+      </para>
+    </sect2>
+
+    <sect2 id='The_Connection_Closed_Callback'>
+<title>The Connection Closed Callback</title>
+
+      <para>
+If the client properly terminates (that is, it
+calls <xref linkend='SmcCloseConnection' xrefstyle='select: title'/>,
+the <xref linkend='SmsCloseConnectionProc' xrefstyle='select: title'/> callback is invoked.
+      </para>
+
+<funcsynopsis id='SmsCloseConnectionProc'>
+   <funcprototype>
+      <funcdef>typedef void (*<function>SmsCloseConnectionProc</function>)</funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+      <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
+      <paramdef>int <parameter>count</parameter></paramdef>
+      <paramdef>char **<parameter>reason_msgs</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>sms_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+<varlistentry>
+  <term><parameter>manager_data</parameter></term>
+  <listitem><para>Manager data specified when the callback was registered.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>count</parameter></term>
+    <listitem><para>The number of reason messages.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>reason_msgs</parameter></term>
+    <listitem><para>The reasons for closing the connection.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+      <para>
+The <parameter>reason_msgs</parameter> argument will most likely
+be <constant>NULL</constant> and the <parameter>count</parameter>
+argument zero (0) if resignation is expected by the user.  Otherwise,
+it contains a list of null-terminated Compound Text strings
+representing the reason for termination.  The session manager should
+display these reason messages to the user.
+      </para>
+
+      <para>
+Call <xref linkend='SmFreeReasons' xrefstyle='select: title'/> to free the reason messages.
+For further information, see
+<link linkend='Freeing_Data'>section 8, &ldquo;Freeing Data&rdquo;</link>
+      </para>
+    </sect2>
+
+    <sect2 id='The_Set_Properties_Callback'>
+<title>The Set Properties Callback</title>
+
+      <para>
+When the client sets session management properties,
+the <xref linkend='SmsSetPropertiesProc' xrefstyle='select: title'/> callback will be invoked.
+      </para>
+
+<funcsynopsis id='SmsSetPropertiesProc'>
+   <funcprototype>
+      <funcdef>typedef void (*<function>SmsSetPropertiesProc</function>)</funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+      <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
+      <paramdef>int <parameter>num_props</parameter></paramdef>
+      <paramdef>SmProp **<parameter>props</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>sms_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>manager_data</parameter></term>
+    <listitem><para>Manager data specified when the callback was registered.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>num_props</parameter></term>
+    <listitem><para>The number of properties.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>props</parameter></term>
+    <listitem><para>The list of properties to set.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+      <para>
+The properties are specified as an array of property pointers.  For a
+description of session management properties and
+the <structname>SmProp</structname> structure,
+see <link linkend='Session_Management_Properties'>section 7,
+&ldquo;Session Management Properties.&rdquo;</link>
+      </para>
+
+      <para>
+Previously set property values may be over-written.  Some properties
+have predefined semantics.  The session manager is required to store
+nonpredefined properties.
+      </para>
+
+      <para>
+To free each property, use <xref linkend='SmFreeProperty' xrefstyle='select: title'/>.
+For further information, see <link linkend='Freeing_Data'>section 8,
+&ldquo;Freeing Data&rdquo;</link> You should free the actual array of
+pointers with a call to <function>free</function>
+      </para>
+    </sect2>
+
+    <sect2 id='The_Delete_Properties_Callback'>
+<title>The Delete Properties Callback</title>
+
+      <para>
+When the client deletes session management properties,
+the <xref linkend='SmsDeletePropertiesProc' xrefstyle='select: title'/> callback will be invoked.
+      </para>
+
+<funcsynopsis id='SmsDeletePropertiesProc'>
+   <funcprototype>
+      <funcdef>typedef void (*<function>SmsDeletePropertiesProc</function>)</funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+      <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
+      <paramdef>int <parameter>num_props</parameter></paramdef>
+      <paramdef>char **<parameter>prop_names</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>sms_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>manager_data</parameter></term>
+    <listitem><para>Manager data specified when the callback was registered.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>num_props</parameter></term>
+    <listitem><para>The number of properties.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>prop_names</parameter></term>
+    <listitem><para>The list of properties to delete.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+      <para>
+The properties are specified as an array of strings.  For a
+description of session management properties and
+the <structname>SmProp</structname> structure,
+see <link linkend='Session_Management_Properties'>section 7,
+&ldquo;Session Management Properties.&rdquo;</link>
+      </para>
+    </sect2>
+
+    <sect2 id='The_Get_Properties_Callback'>
+<title>The Get Properties Callback</title>
+
+      <para>
+The <xref linkend='SmsGetPropertiesProc' xrefstyle='select: title'/> callback is invoked when
+the client wants to retrieve properties it set.
+      </para>
+
+<funcsynopsis id='SmsGetPropertiesProc'>
+   <funcprototype>
+      <funcdef>typedef void (*<function>SmsGetPropertiesProc</function>)</funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+      <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>sms_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>manager_data</parameter></term>
+    <listitem><para>Manager data specified when the callback was registered.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+      <para>
+The session manager should respond by
+calling <xref linkend='SmsReturnProperties' xrefstyle='select: title'/>.
+All of the properties set for this client should be returned.
+      </para>
+    </sect2>
+  </sect1>
+
+  <sect1 id='Registering_the_Client'>
+<title>Registering the Client</title>
+
+    <para>
+To register a client (in response to
+a <xref linkend='SmsRegisterClientProc' xrefstyle='select: title'/> callback),
+use <xref linkend='SmsRegisterClientReply' xrefstyle='select: title'/>.
+    </para>
+
+<funcsynopsis id='SmsRegisterClientReply'>
+   <funcprototype>
+      <funcdef>Status <function>SmsRegisterClientReply</function></funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+      <paramdef>char *<parameter>client_id</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>sms_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>client_id</parameter></term>
+    <listitem><para>A null-terminated string representing a unique client ID.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+    <para>
+The return value of <xref linkend='SmsRegisterClientReply' xrefstyle='select: title'/> is
+zero for failure and a positive value for success.  Failure will occur
+if SMlib can not allocate memory to hold a copy of the client ID for
+it's own internal needs.
+    </para>
+
+    <para>
+If a non-<constant>NULL</constant> <parameter>previous_id</parameter> was
+specified when the client registered itself, <parameter>client_id</parameter>
+should be identical to <parameter>previous_id</parameter>.
+    </para>
+
+    <para>
+Otherwise, <parameter>client_id</parameter> should be a unique ID freshly
+generated by the session manager.  In addition, the session manager should
+send a &ldquo;Save Yourself&rdquo; message with
+<parameter>type</parameter> = <constant>Local</constant>,
+<parameter>shutdown</parameter> = <constant>False</constant>,
+<parameter>interact-style</parameter> = <constant>None</constant>,
+and <parameter>fast</parameter> = <constant>False</constant>
+immediately after registering the client.
+    </para>
+
+    <para>
+Note that once a client ID has been assigned to the client, the client
+keeps this ID indefinitely.  If the client is terminated and
+restarted, it will be reassigned the same ID.  It is desirable to be
+able to pass client IDs around from machine to machine, from user to
+user, and from session manager to session manager, while retaining the
+identity of the client.  This, combined with the indefinite
+persistence of client IDs, means that client IDs need to be globally
+unique.
+    </para>
+
+    <para>
+You should call the <xref linkend='SmsGenerateClientID' xrefstyle='select: title'/> function
+to generate a globally unique client ID.
+    </para>
+
+<funcsynopsis id='SmsGenerateClientID'>
+   <funcprototype>
+      <funcdef>char *<function>SmsGenerateClientID</function></funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>sms_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+
+    <para>
+<constant>NULL</constant> will be returned if the ID could not be generated.
+Otherwise, the return value of the function is the client ID.
+It should be freed with a call to <function>free</function> when
+no longer needed.
+    </para>
+  </sect1>
+
+  <sect1 id='Sending_a_Save_Yourself_Message'>
+<title>Sending a Save Yourself Message</title>
+
+    <para>
+To send a &ldquo;Save Yourself&rdquo; to a client,
+use <xref linkend='SmsSaveYourself' xrefstyle='select: title'/>.
+    </para>
+
+<funcsynopsis id='SmsSaveYourself'>
+   <funcprototype>
+      <funcdef>void <function>SmsSaveYourself</function></funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+      <paramdef>int <parameter>save_type</parameter></paramdef>
+      <paramdef>Bool <parameter>shutdown</parameter></paramdef>
+      <paramdef>int <parameter>interact_style</parameter></paramdef>
+      <paramdef>Bool <parameter>fast</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>sms_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>save_type</parameter></term>
+    <listitem><para>Specifies the type of information that should be saved.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>shutdown</parameter></term>
+    <listitem><para>Specifies if a shutdown is taking place.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>interact_style</parameter></term>
+    <listitem><para>The type of interaction allowed with the user.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>fast</parameter></term>
+    <listitem><para>If <constant>True</constant> the client should save its state as quickly as possible.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+
+    <para>
+The session manager sends a &ldquo;Save Yourself&rdquo; message to a
+client either to checkpoint it or just before termination so that it
+can save its state.  The client responds with zero or more &ldquo;Set
+Properties&rdquo; messages to update the properties indicating how to
+restart the client.  When all the properties have been set, the client
+sends a &ldquo;Save Yourself Done&rdquo; message.
+    </para>
+
+    <para>
+If <parameter>interact_style</parameter>
+is <constant>SmInteractStyleNone</constant> the
+client must not interact with the user while saving state.
+If <parameter>interact_style</parameter>
+is <constant>SmInteractStyleErrors</constant> the
+client may interact with the user only if an error condition arises.
+If <parameter>interact_style</parameter>
+is <constant>SmInteractStyleAny</constant> then the
+client may interact with the user for any purpose.  The client must
+send an &ldquo;Interact Request&rdquo; message and wait for an
+&ldquo;Interact&rdquo; message from the session manager before it can
+interact with the user.  When the client is done interacting with the
+user, it should send an &ldquo;Interact Done&rdquo; message.  The
+&ldquo;Interact Request&rdquo; message can be sent any time after a
+&ldquo;Save Yourself&rdquo; and before a &ldquo;Save Yourself
+Done.&rdquo;
+    </para>
+
+    <para>
+If <parameter>save_type</parameter> is <constant>SmSaveLocal</constant>
+the client must update the properties to reflect its current state.
+Specifically, it should save enough information to restore the state as
+seen by the user of this client.  It should not affect the state as seen
+by other users.
+If <parameter>save_type</parameter> is <constant>SmSaveGlobal</constant>
+the user wants the client to commit all of its data to permanent, globally
+accessible storage.
+If <parameter>save_type</parameter> is <constant>SmSaveBoth</constant>
+the client should do both of these (it should first commit the data to
+permanent storage before updating its properties).
+    </para>
+
+    <para>
+The <parameter>shutdown</parameter> argument specifies whether the session
+is being shut down.  The interaction is different depending on whether or not
+shutdown is set.  If not shutting down, then the client can save and
+resume normal operation.  If shutting down, the client must save and
+then must prevent interaction until it receives either a
+&ldquo;Die&rdquo; or a &ldquo;Shutdown Cancelled,&rdquo; because
+anything the user does after the save will be lost.
+    </para>
+
+    <para>
+The <parameter>fast</parameter> argument specifies that the client should
+save its state as quickly as possible.  For example, if the session manager
+knows that power is about to fail, it should set <parameter>fast</parameter>
+to <constant>True</constant>.
+    </para>
+  </sect1>
+
+  <sect1 id='Sending_a_Save_Yourself_Phase_2_Message'>
+<title>Sending a Save Yourself Phase 2 Message</title>
+
+    <para>
+In order to send a &ldquo;Save Yourself Phase 2&rdquo; message to a
+client, use <xref linkend='SmsSaveYourselfPhase2' xrefstyle='select: title'/>
+    </para>
+
+<funcsynopsis id='SmsSaveYourselfPhase2'>
+   <funcprototype>
+      <funcdef>void <function>SmsSaveYourselfPhase2</function></funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>sms_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+    <para>
+The session manager sends this message to a client that has previously
+sent a &ldquo;Save Yourself Phase 2 Request&rdquo; message.  This
+message informs the client that all other clients are in a fixed state
+and this client can save state that is associated with other clients.
+    </para>
+  </sect1>
+
+  <sect1 id='Sending_an_Interact_Message'>
+<title>Sending an Interact Message</title>
+
+    <para>
+To send an &ldquo;Interact&rdquo; message to a client,
+use <xref linkend='SmsInteract' xrefstyle='select: title'/>.
+    </para>
+
+<funcsynopsis id='SmsInteract'>
+   <funcprototype>
+      <funcdef>void <function>SmsInteract</function></funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>sms_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+    <para>
+The &ldquo;Interact&rdquo; message grants the client the privilege of
+interacting with the user.  When the client is done interacting with
+the user, it must send an &ldquo;Interact Done&rdquo; message to the
+session manager.
+    </para>
+  </sect1>
+
+  <sect1 id='Sending_a_Save_Complete_Message'>
+<title>Sending a Save Complete Message</title>
+
+    <para>
+To send a &ldquo;Save Complete&rdquo; message to a client,
+use <xref linkend='SmsSaveComplete' xrefstyle='select: title'/>.
+    </para>
+
+<funcsynopsis id='SmsSaveComplete'>
+   <funcprototype>
+      <funcdef>void <function>SmsSaveComplete</function></funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>sms_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+    <para>
+The session manager sends this message when it is done with a
+checkpoint.  The client is then free to change its state.
+    </para>
+  </sect1>
+
+  <sect1 id='Sending_a_Die_Message'>
+<title>Sending a Die Message</title>
+
+    <para>
+To send a &ldquo;Die&rdquo; message to a client,
+use <xref linkend='SmsDie' xrefstyle='select: title'/>.
+    </para>
+
+<funcsynopsis id='SmsDie'>
+   <funcprototype>
+      <funcdef>void <function>SmsDie</function></funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>sms_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+    <para>
+Before the session manager terminates, it should wait for a
+&ldquo;Connection Closed&rdquo; message from each client that it sent
+a &ldquo;Die&rdquo; message to, timing out appropriately.
+    </para>
+  </sect1>
+
+  <sect1 id='Cancelling_a_Shutdown'>
+<title>Cancelling a Shutdown</title>
+
+    <para>
+To cancel a shutdown, use <xref linkend='SmsShutdownCancelled' xrefstyle='select: title'/>.
+    </para>
+
+<funcsynopsis id='SmsShutdownCancelled'>
+   <funcprototype>
+      <funcdef>void <function>SmsShutdownCancelled</function></funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>sms_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+    <para>
+The client can now continue as if the shutdown had never happened.  If
+the client has not sent a &ldquo;Save Yourself Done&rdquo; message
+yet, it can either abort the save and send a &ldquo;Save Yourself
+Done&rdquo; with the success argument set to <constant>False</constant>
+or it can continue with the save and send a &ldquo;Save Yourself Done&rdquo;
+with the <parameter>success</parameter> argument set to reflect the outcome
+of the save.
+    </para>
+  </sect1>
+<!-- aaaaaaaaaaaaaaaaa -->
+
+  <sect1 id='Returning_Properties'>
+<title>Returning Properties</title>
+
+    <para>
+In response to a &ldquo;Get Properties&rdquo; message, the session
+manager should call <xref linkend='SmsReturnProperties' xrefstyle='select: title'/>.
+    </para>
+
+<funcsynopsis id='SmsReturnProperties'>
+   <funcprototype>
+      <funcdef>void <function>SmsReturnProperties</function></funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+      <paramdef>int <parameter>num_props</parameter></paramdef>
+      <paramdef>SmProp **<parameter>props</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>sms_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>num_props</parameter></term>
+    <listitem><para>The number of properties.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>props</parameter></term>
+    <listitem><para>The list of properties to return to the client.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+    <para>
+The properties are returned as an array of property pointers.  For a
+description of session management properties and
+the <structname>SmProp</structname> structure,
+see <link linkend='Session_Management_Properties'>section 7,
+&ldquo;Session Management Properties.&rdquo;</link>
+    </para>
+  </sect1>
+
+  <sect1 id='Pinging_a_Client'>
+<title>Pinging a Client</title>
+
+    <para>
+To check that a client is still alive, you should use
+the <function>IcePing</function> function provided by the ICE library.
+To do so, the ICE connection must be obtained using
+the <xref linkend='SmsGetIceConnection' xrefstyle='select: title'/>
+(see <link linkend='Using_Sms_Informational_Functions'>section 6.12,
+&ldquo;Using Sms Informational Functions&rdquo;</link>).
+    </para>
+
+
+<funcsynopsis id='IcePing'>
+   <funcprototype>
+      <funcdef>void <function>IcePing</function></funcdef>
+      <paramdef>IceConn <parameter>ice_conn</parameter></paramdef>
+      <paramdef>IcePingReplyProc <parameter>ping_reply_proc</parameter></paramdef>
+      <paramdef>IcePointer <parameter>client_data</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>ice_conn</parameter></term>
+    <listitem><para>A valid ICE connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>ping_reply_proc</parameter></term>
+    <listitem><para>The callback to invoke when the Ping reply arrives.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>client_data</parameter></term>
+    <listitem><para>This pointer will be passed to the <xref linkend='IcePingReplyProc' xrefstyle='select: title'/> callback.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+
+    <para>
+When the Ping reply is ready (if ever),
+the <xref linkend='IcePingReplyProc' xrefstyle='select: title'/> callback will be invoked.  A
+session manager should have some sort of timeout period, after which
+it assumes the client has unexpectedly died.
+    </para>
+
+<funcsynopsis id='IcePingReplyProc'>
+   <funcprototype>
+      <funcdef>typedef void (*<function>IcePingReplyProc</function>)</funcdef>
+      <paramdef>IceConn <parameter>ice_conn</parameter></paramdef>
+      <paramdef>IcePointer <parameter>client_data</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>ice_conn</parameter></term>
+    <listitem><para>A valid ICE connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>client_data</parameter></term>
+    <listitem><para>The client data specified in the call to <function>IcePing</function></para></listitem>
+  </varlistentry>
+</variablelist>
+
+  </sect1>
+
+  <sect1 id='Cleaning_Up_After_a_Client_Disconnects'>
+<title>Cleaning Up After a Client Disconnects</title>
+
+    <para>
+When the session manager receives a &ldquo;Connection Closed&rdquo;
+message or otherwise detects that the client aborted the connection,
+it should call the <xref linkend='SmsCleanUp' xrefstyle='select: title'/> function in order
+to free up the connection object.
+    </para>
+
+<funcsynopsis id='SmsCleanUp'>
+   <funcprototype>
+      <funcdef>void <function>SmsCleanUp</function></funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>sms_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+  </sect1>
+
+  <sect1 id='Using_Sms_Informational_Functions'>
+<title>Using Sms Informational Functions</title>
+
+<funcsynopsis id='SmsProtocolVersion'>
+   <funcprototype>
+      <funcdef>int <function>SmsProtocolVersion</function></funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+    <para>
+<xref linkend='SmsProtocolVersion' xrefstyle='select: title'/> returns the major version of
+the session management protocol associated with this session.
+    </para>
+
+<funcsynopsis id='SmsProtocolRevision'>
+   <funcprototype>
+      <funcdef>int <function>SmsProtocolRevision</function></funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+    <para>
+<xref linkend='SmsProtocolRevision' xrefstyle='select: title'/> returns the minor version of
+the session management protocol associated with this session.
+    </para>
+
+<funcsynopsis id='SmsClientID'>
+   <funcprototype>
+      <funcdef>char *<function>SmsClientID</function></funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+    <para>
+<xref linkend='SmsClientID' xrefstyle='select: title'/> returns a null-terminated string for
+the client ID associated with this connection.  You should
+call <function>free</function> on this pointer when the client ID is
+no longer needed.
+    </para>
+
+
+    <para>
+To obtain the host name of a client,
+use <xref linkend='SmsClientHostName' xrefstyle='select: title'/>.
+This host name will be needed to restart the client.
+    </para>
+
+<funcsynopsis id='SmsClientHostName'>
+   <funcprototype>
+      <funcdef>char *<function>SmsClientHostName</function></funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+    <para>
+The string returned is of the form
+<parameter>protocol</parameter><literal>/</literal><parameter>hostname</parameter>,
+where <parameter>protocol</parameter> is one of
+{<literal>tcp</literal>, <literal>decnet</literal>, <literal>local</literal>}.
+You should call <function>free</function> on the string returned when
+it is no longer needed.
+    </para>
+
+<funcsynopsis id='SmsGetIceConnection'>
+   <funcprototype>
+      <funcdef>IceConn <function>SmsGetIceConnection</function></funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+    <para>
+<xref linkend='SmsGetIceConnection' xrefstyle='select: title'/> returns the ICE connection
+object associated with this session management connection object.  The
+ICE connection object can be used to get some additional information
+about the connection.  Some of the more useful functions which can be
+used on the IceConn are <function>IceConnectionNumber</function>
+and <function>IceLastSequenceNumber</function>.
+For further information, see the
+<citetitle pubwork='article'>Inter-Client Exchange Library</citetitle>
+standard.
+    </para>
+  </sect1>
+
+  <sect1 id='Error_Handling_2'>
+<title>Error Handling</title>
+
+    <para>
+If the session manager receives an unexpected protocol error from a
+client, an error handler is invoked by SMlib.  A default error handler
+exists which simply prints the error message (it does not exit).  The
+session manager can change this error handler by
+calling <xref linkend='SmsSetErrorHandler' xrefstyle='select: title'/>.
+    </para>
+
+<funcsynopsis id='SmsSetErrorHandler'>
+   <funcprototype>
+      <funcdef>SmsErrorHandler <function>SmsSetErrorHandler</function></funcdef>
+      <paramdef>SmsErrorHandler <parameter>handler</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+    <para>
+The error handler.  You should pass <constant>NULL</constant>
+to restore the default handler.
+    </para>
+
+    <para>
+<xref linkend='SmsSetErrorHandler' xrefstyle='select: title'/> returns the previous error handler.
+The <xref linkend='SmsErrorHandler' xrefstyle='select: title'/> has the following type:
+    </para>
+
+<funcsynopsis id='SmsErrorHandler'>
+   <funcprototype>
+      <funcdef>typedef void (*<function>SmsErrorHandler</function>)</funcdef>
+      <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
+      <paramdef>Bool <parameter>swap</parameter></paramdef>
+      <paramdef>int <parameter>offending_minor_opcode</parameter></paramdef>
+      <paramdef>unsigned long <parameter>offending_sequence_num</parameter></paramdef>
+      <paramdef>int <parameter>error_class</parameter></paramdef>
+      <paramdef>int <parameter>severity</parameter></paramdef>
+      <paramdef>IcePointer <parameter>values</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>sms_conn</parameter></term>
+    <listitem><para>The session management connection object.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>swap</parameter></term>
+    <listitem><para>A flag which indicates if the specified values need byte swapping.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>offending_minor_opcode</parameter></term>
+    <listitem><para>The minor opcode of the offending message.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>offending_sequence_num</parameter></term>
+    <listitem><para>The sequence number of the offending message.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>error_class</parameter></term>
+    <listitem><para>The error class of the offending message.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>severity</parameter></term>
+    <listitem><para>
+	<constant>IceCanContinue</constant>,
+	<constant>IceFatalToProtocol</constant>, or
+	<constant>IceFatalToConnection</constant>
+    </para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>values</parameter></term>
+    <listitem><para>Any additional error values specific to the minor opcode and class.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+    <para>
+Note that this error handler is invoked for protocol related errors.
+To install an error handler to be invoked when an IO error occurs,
+use <function>IceSetIOErrorHandler</function>.
+For further information, see the
+<citetitle pubwork='article'>Inter-Client Exchange Library</citetitle>
+standard.
+    </para>
+  </sect1>
+</chapter>
+
+<chapter id='Session_Management_Properties'>
+  <title>Session Management Properties</title>
+
+  <para>
+Each property is defined by the <structname>SmProp</structname> structure:
+
+<synopsis>
+typedef struct {
+	char *name;	/* name of property */
+	char *type;	/* type of property */
+	int num_vals;	/* number of values */
+	SmPropValue *vals;	/* the list of values */
+} SmProp;
+
+typedef struct {
+	int length;	/* the length of the value */
+	SmPointer value;	/* the value */
+} SmPropValue;
+</synopsis>
+  </para>
+
+  <para>
+The X Session Management Protocol defines a list of predefined
+properties, several of which are required to be set by the client.
+The following table specifies the predefined properties and indicates
+which ones are required.  Each property has a type associated with it.
+  </para>
+
+  <para>
+A type of <type>SmCARD8</type> indicates that there is a single 1-byte value.
+A type of <type>SmARRAY8</type> indicates that there is a single array of bytes.
+A type of <type>SmLISTofARRAY8</type> indicates that there is a list of array of
+bytes.
+  </para>
+
+<informaltable pgwide='0' frame='topbot'>
+  <tgroup cols='4' align='left' colsep='0' rowsep='0'>
+    <colspec colname='c1' colwidth='2.0*'/>
+    <colspec colname='c2' colwidth='2.0*'/>
+    <colspec colname='c3' colwidth='2.0*'/>
+    <colspec colname='c4' colwidth='1.0*'/>
+    <thead>
+      <row rowsep='1'>
+        <entry>Name</entry>
+        <entry>Type</entry>
+        <entry><acronym>POSIX</acronym> Type</entry>
+        <entry>Required</entry>
+      </row>
+    </thead>
+    <tbody>
+      <row>
+        <entry><property>SmCloneCommand</property></entry>
+        <entry>OS-specific</entry>
+        <entry><type>SmLISTofARRAY8</type></entry>
+        <entry>Yes</entry>
+      </row>
+      <row>
+        <entry><property>SmCurrentDirectory</property></entry>
+        <entry>OS-specific</entry>
+        <entry><type>SmARRAY8</type></entry>
+        <entry>No</entry>
+      </row>
+      <row>
+        <entry><property>SmDiscardCommand</property></entry>
+        <entry>OS-specific</entry>
+        <entry><type>SmLISTofARRAY8</type></entry>
+        <entry>No*</entry>
+      </row>
+      <row>
+        <entry><property>SmEnvironment</property></entry>
+        <entry>OS-specific</entry>
+        <entry><type>SmLISTofARRAY8</type></entry>
+        <entry>No</entry>
+      </row>
+      <row>
+        <entry><property>SmProcessID</property></entry>
+        <entry>OS-specific</entry>
+        <entry><type>SmARRAY8</type></entry>
+        <entry>No</entry>
+      </row>
+      <row>
+        <entry><property>SmProgram</property></entry>
+        <entry>OS-specific</entry>
+        <entry><type>SmARRAY8</type></entry>
+        <entry>Yes</entry>
+      </row>
+      <row>
+        <entry><property>SmRestartCommand</property></entry>
+        <entry>OS-specific</entry>
+        <entry><type>SmLISTofARRAY8</type></entry>
+        <entry>Yes</entry>
+      </row>
+      <row>
+        <entry><property>SmResignCommand</property></entry>
+        <entry>OS-specific</entry>
+        <entry><type>SmLISTofARRAY8</type></entry>
+        <entry>No</entry>
+      </row>
+      <row>
+        <entry><property>SmRestartStyleHint</property></entry>
+        <entry><type>SmCARD8</type></entry>
+        <entry><type>SmCARD8</type></entry>
+        <entry>No</entry>
+      </row>
+      <row>
+        <entry><property>SmShutdownCommand</property></entry>
+        <entry>OS-specific</entry>
+        <entry><type>SmLISTofARRAY8</type></entry>
+        <entry>No</entry>
+      </row>
+      <row>
+        <entry><property>SmUserID</property></entry>
+        <entry><type>SmARRAY8</type></entry>
+        <entry><type>SmARRAY8</type></entry>
+        <entry>Yes</entry>
+      </row>
+    </tbody>
+  </tgroup>
+</informaltable>
+
+  <para>
+* Required if any state is stored in an external repository (for
+example, state file).
+  </para>
+
+  <itemizedlist mark='bullet'>
+    <listitem><para><property>SmCloneCommand</property></para>
+      <para>
+This is like the <property>SmRestartCommand</property>, except it restarts a
+copy of the application.  The only difference is that the application does not
+supply its client ID at register time.  On <acronym>POSIX</acronym> systems,
+this should be of type <type>SmLISTofARRAY8</type>.
+    </para></listitem>
+    <listitem><para><property>SmCurrentDirectory</property></para>
+      <para>
+On <acronym>POSIX</acronym>-based systems, this specifies the value of the
+current directory that needs to be set up prior to starting the
+<property>SmProgram</property> and should of type <type>SmARRAY8</type>.
+    </para></listitem>
+    <listitem><para><property>SmDiscardCommand</property></para>
+      <para>
+The discard command contains a command that when delivered to the host
+that the client is running on (determined from the connection), will
+cause it to discard any information about the current state.  If this
+command is not specified, the Session Manager will assume that all of
+the client's state is encoded in the <property>SmRestartCommand</property>.
+On <acronym>POSIX</acronym> systems, the type should be
+<type>SmLISTofARRAY8</type>.
+    </para></listitem>
+    <listitem><para><property>SmEnvironment</property></para>
+      <para>
+On <acronym>POSIX</acronym> based systems, this will be of type
+<type>SmLISTofARRAY8</type>, where the <type>ARRAY8</type>s alternate between
+environment variable name and environment variable value.
+    </para></listitem>
+    <listitem><para><property>SmProcessID</property></para>
+      <para>
+This specifies an OS-specific identifier for the process.
+On <acronym>POSIX</acronym> systems, this should contain the return value
+of <function>getpid</function> turned into a Latin-1 (decimal) string.
+    </para></listitem>
+    <listitem><para><property>SmProgram</property></para>
+      <para>
+This is the name of the program that is running.  On <acronym>POSIX</acronym>
+systems, this should be first parameter passed to <function>execve</function>
+and should be of type <type>SmARRAY8</type>.
+    </para></listitem>
+    <listitem><para><property>SmRestartCommand</property></para>
+      <para>
+The restart command contains a command that, when delivered to the
+host that the client is running on (determined from the connection),
+will cause the client to restart in its current state.
+On <acronym>POSIX</acronym>-based systems, this is of
+type <type>SmLISTofARRAY8</type>, and each of the elements in
+the array represents an element in the <varname>argv</varname>
+array.  This restart command should ensure that the client restarts
+with the specified client-ID.
+    </para></listitem>
+    <listitem><para><property>SmResignCommand</property></para>
+      <para>
+A client that sets the <property>SmRestartStyleHint</property>
+to <constant>SmRestartAnyway</constant> uses this property to specify a
+command that undoes the effect of the client and removes any saved state.
+As an example, consider a user that runs <command>xmodmap</command> which
+registers with the Session Manager,
+sets <property>SmRestartStyleHint</property>
+to <constant>SmRestartAnyway</constant>, and then
+terminates.  To allow the Session Manager (at the user's request) to
+undo this, <command>xmodmap</command> would register a
+<property>SmResignCommand</property> that undoes the effects of
+the <command>xmodmap</command>.
+    </para></listitem>
+    <listitem><para><property>SmRestartStyleHint</property></para>
+      <para>
+If the <property>SmRestartStyleHint</property> is present, it will contain the
+style of restarting the client prefers.  If this style is not specified,
+<constant>SmRestartIfRunning</constant> is assumed.
+The possible values are as follows:
+
+<informaltable frame='topbot'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+    <colspec colname='c1' colwidth='1.0*'/>
+    <colspec colname='c2' colwidth='1.5*'/>
+    <thead>
+      <row rowsep='1'>
+        <entry>Name</entry>
+        <entry>Value</entry>
+      </row>
+    </thead>
+    <tbody>
+      <row>
+        <entry><constant>SmRestartIfRunning</constant></entry>
+        <entry>0</entry>
+      </row>
+      <row>
+        <entry><constant>SmRestartAnyway</constant></entry>
+        <entry>1</entry>
+      </row>
+      <row>
+        <entry><constant>SmRestartImmediately</constant></entry>
+        <entry>2</entry>
+      </row>
+      <row>
+        <entry><constant>SmRestartNever</constant></entry>
+        <entry>3</entry>
+      </row>
+    </tbody>
+  </tgroup>
+</informaltable>
+      </para>
+
+      <para>
+The <constant>SmRestartIfRunning</constant> style is used in the usual case.
+The client should be restarted in the next session if it was running at
+the end of the current session.
+      </para>
+
+      <para>
+The <constant>SmRestartAnyway</constant> style is used to tell the Session
+Manager that the application should be restarted in the next session even if
+it exits before the current session is terminated.  It should be noted that
+this is only a hint and the Session Manager will follow the policies
+specified by its users in determining what applications to restart.
+      </para>
+
+      <para>
+A client that uses <constant>SmRestartAnyway</constant> should also set the
+<property>SmResignCommand</property> and <property>SmShutdownCommand</property>
+properties to commands that undo the state of the client after it exits.
+      </para>
+
+      <para>
+The SmRestartImmediately style is like SmRestartAnyway, but, in addition, the client is meant to run continuously.  If the client exits, the Session Manager should try to restart it in the current session.
+      </para>
+
+      <para>
+<constant>SmRestartNever</constant> style specifies that the client does not
+wish to be restarted in the next session.
+      </para>
+    </listitem>
+    <listitem><para><property>SmShutdownCommand</property></para>
+      <para>
+This command is executed at shutdown time to clean up after a client
+that is no longer running but retained its state by setting
+<property>SmRestartStyleHint</property> to
+<constant>SmRestartAnyway</constant>.  The client must not remove any saved
+state as the client is still part of the session.  As an
+example, consider a client that turns on a camera at start up time.
+This client then exits.  At session shutdown, the user wants the
+camera turned off.  This client would set the
+<property>SmRestartStyleHint</property> to
+<constant>SmRestartAnyway</constant> and would register
+a <property>SmShutdownCommand</property> that would turn off the camera.
+    </para></listitem>
+    <listitem><para><property>SmUserID</property></para>
+      <para>
+Specifies the user ID.  On <acronym>POSIX</acronym>-based systems, this will
+contain the user's name (the <structfield>pw_name</structfield> member of
+<structname>struct passwd</structname>).
+    </para></listitem>
+  </itemizedlist>
+</chapter>
+
+<chapter id='Freeing_Data'>
+  <title>Freeing Data</title>
+
+  <para>
+To free an individual property, use <xref linkend='SmFreeProperty' xrefstyle='select: title'/>
+  </para>
+
+<funcsynopsis id='SmFreeProperty'>
+   <funcprototype>
+      <funcdef>void <function>SmFreeProperty</function></funcdef>
+      <paramdef>SmProp *<parameter>prop</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>prop</parameter></term>
+    <listitem><para>The property to free.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+  <para>
+To free the reason strings from
+the <xref linkend='SmsCloseConnectionProc' xrefstyle='select: title'/> callback,
+use <xref linkend='SmFreeReasons' xrefstyle='select: title'/>
+  </para>
+
+<funcsynopsis id='SmFreeReasons'>
+   <funcprototype>
+      <funcdef>void <function>SmFreeReasons</function></funcdef>
+      <paramdef>int <parameter>count</parameter></paramdef>
+      <paramdef>char **<parameter>reasons</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><parameter>count</parameter></term>
+    <listitem><para>The number of reason strings.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><parameter>reasons</parameter></term>
+    <listitem><para>The list of reason strings to free.</para></listitem>
+  </varlistentry>
+</variablelist>
+</chapter>
+
+<chapter id='Authentication_of_Clients'>
+  <title>Authentication of Clients</title>
+
+  <para>
+As stated earlier, the session management protocol is layered on top
+of ICE.  Authentication occurs at two levels in the ICE protocol:
+
+<itemizedlist mark='bullet'>
+    <listitem><para>The first is when an ICE connection is opened.</para></listitem>
+    <listitem><para>The second is when a Protocol Setup occurs on an ICE connection.</para></listitem>
+</itemizedlist>
+  </para>
+
+  <para>
+The authentication methods that are available are
+implementation-dependent (that is., dependent on the ICElib and SMlib
+implementations in use).  For further information, see the
+<citetitle pubwork='article'>Inter-Client Exchange Library</citetitle>
+standard.
+  </para>
+</chapter>
+
+<chapter id='Working_in_a_Multi_Threaded_Environment'>
+  <title>Working in a Multi-Threaded Environment</title>
+
+  <para>
+To declare that multiple threads in an application will be using SMlib
+(or any other library layered on top of ICElib), you should
+call <function>IceInitThreads</function>.
+For further information, see the
+<citetitle pubwork='article'>Inter-Client Exchange Library</citetitle>
+standard.
+  </para>
+</chapter>
+
+<chapter id='Acknowledgements'>
+  <title>Acknowledgements</title>
+
+  <para>
+Thanks to the following people for their participation in the
+X Session Management design: Jordan Brown, Ellis Cohen, Donna Converse,
+Stephen Gildea, Vania Joloboff, Stuart Marks, Bob Scheifler, Ralph Swick,
+and Mike Wexler.
+  </para>
+
+</chapter>
+</book>
Index: lib/libSM/create-1.2.4-docbook-patch/libSM-1.2.4-new/doc
===================================================================
--- lib/libSM/create-1.2.4-docbook-patch/libSM-1.2.4-new/doc	(nonexistent)
+++ lib/libSM/create-1.2.4-docbook-patch/libSM-1.2.4-new/doc	(revision 5)

Property changes on: lib/libSM/create-1.2.4-docbook-patch/libSM-1.2.4-new/doc
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libSM/create-1.2.4-docbook-patch/libSM-1.2.4-new
===================================================================
--- lib/libSM/create-1.2.4-docbook-patch/libSM-1.2.4-new	(nonexistent)
+++ lib/libSM/create-1.2.4-docbook-patch/libSM-1.2.4-new	(revision 5)

Property changes on: lib/libSM/create-1.2.4-docbook-patch/libSM-1.2.4-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libSM/create-1.2.4-docbook-patch
===================================================================
--- lib/libSM/create-1.2.4-docbook-patch	(nonexistent)
+++ lib/libSM/create-1.2.4-docbook-patch	(revision 5)

Property changes on: lib/libSM/create-1.2.4-docbook-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libSM/patches/README
===================================================================
--- lib/libSM/patches/README	(nonexistent)
+++ lib/libSM/patches/README	(revision 5)
@@ -0,0 +1,6 @@
+
+/* begin *
+
+   TODO: Leave some comment here.
+
+ * end */
Index: lib/libSM/patches
===================================================================
--- lib/libSM/patches	(nonexistent)
+++ lib/libSM/patches	(revision 5)

Property changes on: lib/libSM/patches
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libSM
===================================================================
--- lib/libSM	(nonexistent)
+++ lib/libSM	(revision 5)

Property changes on: lib/libSM
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libWindowsWM/Makefile
===================================================================
--- lib/libWindowsWM/Makefile	(nonexistent)
+++ lib/libWindowsWM/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libWindowsWM
+
+versions    = 1.0.1
+pkgname     = libWindowsWM
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libWindowsWM
===================================================================
--- lib/libWindowsWM	(nonexistent)
+++ lib/libWindowsWM	(revision 5)

Property changes on: lib/libWindowsWM
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libX11/Makefile
===================================================================
--- lib/libX11/Makefile	(nonexistent)
+++ lib/libX11/Makefile	(revision 5)
@@ -0,0 +1,56 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libX11
+
+versions    = 1.8.3
+pkgname     = libX11
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+patches     = $(CURDIR)/patches/libX11-1.8.3-docbook.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-1.8.3-docbook-patch ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s) $(patches)
Index: lib/libX11/create-1.8.3-docbook-patch/create.patch.sh
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/create.patch.sh	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=1.8.3
+
+tar --files-from=file.list -xJvf ../libX11-$VERSION.tar.xz
+mv libX11-$VERSION libX11-$VERSION-orig
+
+cp -rf ./libX11-$VERSION-new ./libX11-$VERSION
+
+diff --unified -Nr  libX11-$VERSION-orig  libX11-$VERSION > libX11-$VERSION-docbook.patch
+
+mv libX11-$VERSION-docbook.patch ../patches
+
+rm -rf ./libX11-$VERSION
+rm -rf ./libX11-$VERSION-orig

Property changes on: lib/libX11/create-1.8.3-docbook-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: lib/libX11/create-1.8.3-docbook-patch/file.list
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/file.list	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/file.list	(revision 5)
@@ -0,0 +1,18 @@
+libX11-1.8.3/specs/XIM/xim.xml
+libX11-1.8.3/specs/XKB/ch09.xml
+libX11-1.8.3/specs/XKB/ch10.xml
+libX11-1.8.3/specs/XKB/ch12.xml
+libX11-1.8.3/specs/i18n/localedb/localedb.xml
+libX11-1.8.3/specs/i18n/trans/trans.xml
+libX11-1.8.3/specs/libX11/AppC.xml
+libX11-1.8.3/specs/libX11/CH01.xml
+libX11-1.8.3/specs/libX11/CH02.xml
+libX11-1.8.3/specs/libX11/CH03.xml
+libX11-1.8.3/specs/libX11/CH04.xml
+libX11-1.8.3/specs/libX11/CH06.xml
+libX11-1.8.3/specs/libX11/CH08.xml
+libX11-1.8.3/specs/libX11/CH09.xml
+libX11-1.8.3/specs/libX11/CH10.xml
+libX11-1.8.3/specs/libX11/CH12.xml
+libX11-1.8.3/specs/libX11/CH14.xml
+libX11-1.8.3/specs/libX11/glossary.xml
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/XIM/xim.xml
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/XIM/xim.xml	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/XIM/xim.xml	(revision 5)
@@ -0,0 +1,3940 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+                   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
+[
+<!ENTITY % defs SYSTEM "defs.ent"> %defs;
+]>
+
+
+<!-- lifted from troff+ms+XMan by doclifter -->
+<article class="specification" id="xim">
+
+<articleinfo>
+   <title>The Input Method Protocol</title>
+   <subtitle>X Consortium Standard</subtitle>
+   <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
+   <releaseinfo>Version 1.0</releaseinfo>
+   <authorgroup>
+      <author>
+         <firstname>Masahiko</firstname><surname>Narita</surname>
+         <affiliation><orgname>FUJITSU Limited.</orgname></affiliation>
+      </author>
+      <author>
+         <firstname>Hideki</firstname><surname>Hiura</surname>
+         <affiliation><orgname>SunSoft, Inc.</orgname></affiliation>
+      </author>
+   </authorgroup>
+   <copyright><year>1993</year><year>1994</year>
+      <holder>FUJITSU LIMITED</holder>
+      <holder>Oracle and/or its affiliates</holder>
+   </copyright>
+
+<abstract>
+<para>
+This specifies a protocol between IM library and IM (Input Method) Server for internationalized text input, which is independent from any specific language, any specific input method and the transport layer used in communication between the IM library and the IM Server, and uses a client-server model.  This protocol allows user to use his/her favorite method for all applications within the stand-along distributed environment.
+</para>
+</abstract>
+
+<legalnotice>
+<para>Permission to use, copy 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.  Fujitsu and Sun Microsystems
+make no representation about the suitability for any purpose of the information in this document.
+This documentation is provided as is without express implied warranty.
+</para>
+</legalnotice>
+
+<legalnotice>
+<para role="multiLicensing">Copyright © 1993, 1994 X Consortium</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>
+<para>X Window System is a trademark of The Open Group.</para>
+</legalnotice>
+
+</articleinfo>
+
+<sect1 id="Introduction">
+<title>Introduction</title>
+<sect2 id="Scope">
+<title>Scope</title>
+<!-- .XS -->
+<!-- (SN Scope -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The internationalization in the
+X Window System
+Version 11, Release 5 (X11R5) provides a common API which application
+developers can use to create portable internationalized programs and to
+adapt them to the requirements of different native languages, local customs,
+and character string encodings (this is called "localization").
+As one of its internationalization mechanisms X11R5 has defined a functional
+interface for internationalized text input, called XIM (X Input Method).
+</para>
+<para>
+<!-- .LP -->
+When a client-server model is used with an IM (Input Method) implementation,
+a protocol must be established between the client and the server.
+However, the protocol used to interface Input Method Servers (IM Servers)
+with the Input Method libraries (IM libraries) to which applications are
+linked was not addressed in X11R5.
+This led application developers to depend on vendor-specific input methods,
+decreased the user's choice of available input methods, and made it more
+difficult for developers to create portable applications. This paper describes
+the Input Method Protocol developed for X11R6 to resolve the above problems
+and to address the requirements of existing and future input methods.
+</para>
+<para>
+<!-- .LP -->
+The Input Method Protocol is independent from the transport layer used in
+communication between the IM library and the IM Server.
+Thus, the input method protocol can be built on any inter-process
+communication mechanism, such as TCP/IP or the X protocol.
+</para>
+<para>
+In addition, the protocol provides for future extensions such as differing
+input model types.
+</para>
+</sect2>
+
+<sect2 id="Background">
+<title>Background</title>
+<!-- .XS -->
+<!-- (SN Background -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Text input is much more simple for some languages than
+others.  English, for instance, uses an alphabet of a manageable size,
+and input consists of pressing the corresponding key on a keyboard,
+perhaps in combination with a shift key for capital letters or special
+characters.
+</para>
+<para>
+<!-- .LP -->
+Some languages have larger alphabets, or modifiers such as accents,
+which require the addition of special key combinations in order to enter
+text.  These input methods may require "dead-keys" or "compose-keys"
+which, when followed by different combinations of key strokes,
+generate different characters.
+</para>
+<para>
+<!-- .LP -->
+Text input for ideographic languages is much less simple.  In these
+languages, characters represent actual objects rather than phonetic
+sounds used in pronouncing a word, and the number of characters
+in these languages may continue to grow.  In Japanese, for instance, most
+text input methods involve entering characters in a phonetic alphabet,
+after which the input method searches a dictionary for possible
+ideographic equivalents (of which there may be many).  The input method then
+presents the candidate characters for the user to choose from.
+</para>
+<para>
+<!-- .LP -->
+In Japanese, either Kana (phonetic symbols) or Roman letters are
+typed and then a region is selected for conversion to Kanji. Several
+Kanji characters may have the same phonetic representation. If that
+is the case with the string entered, a menu of characters is presented
+and the user must choose the appropriate one. If no choice is necessary
+or a preference has been established, the input method does the
+substitution directly.
+</para>
+<para>
+<!-- .LP -->
+These complicated input methods must present state information (Status Area),
+text entry and edit space (Preedit Area), and menu/choice presentations
+(Auxiliary Area).  Much of the protocol between the IM library and the IM
+Server involves managing these IM areas.
+Because of the size and complexity of these input methods, and because
+of how widely they vary from one language or locale to another, they are
+usually implemented as separate processes which can serve many client
+processes on the same computer or network.
+</para>
+<para>
+<!-- .LP -->
+</para>
+</sect2>
+<sect2 id="Input_Method_Styles">
+<title>Input Method Styles</title>
+<!-- .XS -->
+<!-- (SN Input Method Styles -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+X11 internationalization support includes the following four types of
+input method:
+<!-- .RS -->
+</para>
+
+<variablelist>
+  <varlistentry>
+    <term>- on-the-spot:</term>
+    <listitem>
+      <para>
+The client application is directed by the IM Server to display all
+pre-edit data at the site of text insertion.  The client registers
+callbacks invoked by the input method during pre-editing.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>- off-the-spot:</term>
+    <listitem>
+      <para>
+The client application provides display windows for the pre-edit data
+to the input method which displays into them directly.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>- over-the-spot:</term>
+    <listitem>
+      <para>
+The input method displays pre-edit data in a window which it brings up
+directly over the text insertion position.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>- root-window:</term>
+    <listitem>
+      <para>
+The input method displays all pre-edit data in a separate area of the
+screen in a window specific to the input method.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+Client applications must choose from the available input methods
+supported by the IM Server and provide the display areas and callbacks
+required by the input method.
+</para>
+</sect2>
+
+</sect1>
+<sect1 id="Architecture">
+<title>Architecture</title>
+<!-- .XS -->
+<!-- (SN Architecture -->
+<!-- .XE -->
+<sect2 id="Implementation_Model">
+<title>Implementation Model</title>
+<!-- .XS -->
+<!-- (SN Implementation Model -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Within the X Window System environment, the following two typical
+architectural models can be used as an input method's implementation
+model.
+</para>
+
+<variablelist>
+  <varlistentry>
+    <term>- Client/Server model:</term>
+    <listitem>
+      <para>
+A separate process, the IM Server, processes input and handles preediting,
+converting, and committing.  The IM library within the application, acting
+as client to the IM Server, simply receives the committed string from the
+IM Server.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>- Library model:</term>
+    <listitem>
+      <para>
+All input is handled by the IM library within the application.  The
+event process is closed within the IM library and a separate IM Server
+process may not be required.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+Most languages which need complex preediting, such as Asian languages,
+are implemented using the Client/Server IM model.  Other languages
+which need only dead key or compose key processing, such as European
+languages, are implemented using the Library model.
+</para>
+<para>
+<!-- .LP -->
+In this paper, we discuss mainly the Client/Server IM model and the
+protocol used in communication between the IM library (client) and the IM
+Server.
+</para>
+</sect2>
+
+<sect2 id="Structure_of_IM">
+<title>Structure of IM</title>
+<!-- .XS -->
+<!-- (SN Structure of IM -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+When the client connects or disconnects to the IM Server, an open or close
+operation occurs between the client and the IM Server.
+</para>
+<para>
+<!-- .LP -->
+The IM can be specified at the time of XOpenIM() by setting the locale
+of the client and a locale modifier. Since the IM remembers
+the locale at the time of creation XOpenIM() can be called
+multiple times (with the
+setting for the locale and the locale modifier changed) to support
+multiple languages.
+</para>
+<para>
+<!-- .LP -->
+In addition, the supported IM type can be obtained using XGetIMValues().
+</para>
+<para>
+<!-- .LP -->
+The client usually holds multiple input (text) fields. Xlib provides a
+value type called the "Input Context" (IC) to manage each individual
+input field.  An IC can be created by specifying XIM using XCreateIC(),
+and it can be destroyed using XDestroyIC().
+</para>
+<para>
+<!-- .LP -->
+The IC can specify the type of IM which is supported by XIM for each
+input field, so each input field can handle a different type of IM.
+</para>
+<para>
+<!-- .LP -->
+Most importantly information such as the committed string sent from
+the IM Server to the client, is exchanged based on each IC.
+</para>
+<para>
+<!-- .LP -->
+Since each IC corresponds to an input field, the focused input field
+should be announced to the IM Server using XSetICFocus(). (XUnsetICFocus()
+can also be used to change the focus.)
+</para>
+<para>
+<!-- .LP -->
+</para>
+</sect2>
+<sect2 id="Event_Handling_Model">
+<title>Event Handling Model</title>
+<!-- .XS -->
+<!-- (SN Event Handling Model -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Existing input methods support either the FrontEnd method, the BackEnd method,
+or both.  This protocol specifically supports the BackEnd method as
+the default method, but also supports the FrontEnd method as an optional
+IM Server extension.
+</para>
+<para>
+<!-- .LP -->
+The difference between the FrontEnd and BackEnd methods is in how
+events are delivered to the IM Server.  (Fig. 1) <!-- xref -->
+</para>
+
+<sect3 id="BackEnd_Method">
+<title>BackEnd Method</title>
+<!-- .XS -->
+<!-- (SN BackEnd Method -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+In the BackEnd method, client window input events are always delivered
+to the IM library, which then passes them to the IM Server.  Events are
+handled serially in the order delivered, and therefore there is no
+synchronization problem between the IM library and the IM Server.
+</para>
+<para>
+<!-- .LP -->
+Using this method, the IM library forwards all KeyPress and KeyRelease
+events to the IM Server (as required by the Event Flow Control model
+described in
+<xref linkend='Event_Flow_Control' xrefstyle='select: title'/>)
+and synchronizes with the IM Server (as described in
+<xref linkend='Filtering_Events' xrefstyle='select: title'/>).
+
+</para>
+</sect3>
+
+<sect3 id="FrontEnd_Method">
+<title>FrontEnd Method</title>
+<!-- .XS -->
+<!-- (SN FrontEnd Method -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+In the FrontEnd method, client window input events are delivered by the
+X server directly to both the IM Server and the IM library.  Therefore this
+method provides much better interactive performance while preediting
+(particularly in cases such as when the IM Server is running locally on
+the user's workstation and the client application is running on another
+workstation over a relatively slow network).
+</para>
+<para>
+<!-- .LP -->
+However, the FrontEnd model may have synchronization problems between
+the key events handled in the IM Server and other events handled in the
+client, and these problems could possibly cause the loss or duplication
+of key events.  For this reason, the BackEnd method is the core method
+supported, and the FrontEnd method is made available as an extension for
+performance purposes. (Refer to
+<xref linkend="common_extensions" xrefstyle='select: title'/>
+for more information.)
+</para>
+
+<mediaobject  id="flow_of_events">
+  <imageobject>
+    <imagedata  format="SVG"  fileref="eventflow.svg"/>
+  </imageobject>
+  <caption>The flow of events</caption>
+</mediaobject>
+
+<!--
+<para>
+Fig.1 The Flow of Events
+</para>
+-->
+
+</sect3>
+</sect2>
+
+<sect2 id='Event_Flow_Control'>
+<title>Event Flow Control</title>
+<!-- .XS -->
+<!-- (SN Event Flow Control -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+This protocol supports two event flow models for communication between the
+IM library and the IM Server (Static and Dynamic).
+</para>
+<para>
+<!-- .LP -->
+Static Event Flow requires that input events always be sent to the IM
+Server from the client.
+</para>
+<para>
+<!-- .LP -->
+Dynamic Event Flow, however, requires only that those input events which
+need to be processed (converted) be sent to the IM Server from the client.
+</para>
+<para>
+<!-- .LP -->
+For instance, in the case of inputing a combination of ASCII characters
+and Chinese characters, ASCII characters do not need to be processed in
+the IM Server, so their key events do not have to be sent to the IM
+Server.  On the other hand, key events necessary for composing Chinese
+characters must be sent to the IM Server.
+</para>
+<para>
+<!-- .LP -->
+Thus, by adopting the Dynamic Event Flow, the number of requests among the
+X Server, the client, and the IM Server is significantly reduced, and the
+number of context switches is also reduced, resulting in improved performance.
+The IM Server can send
+<function>XIM_REGISTER_TRIGGERKEYS </function>
+message in order to switch the event flow in the Dynamic Event Flow.
+</para>
+<para>
+<!-- .LP -->
+The protocol for this process is described in
+<xref linkend='Event_Flow_Control_2' xrefstyle='select: title'/>.
+</para>
+</sect2>
+</sect1>
+
+<sect1 id="Default_Preconnection_Convention">
+<title>Default Preconnection Convention</title>
+<!-- .XS -->
+<!-- (SN Default Preconnection Convention  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+IM Servers are strongly encouraged to register their symbolic
+names as the ATOM names into the IM Server directory property,
+<function>XIM_SERVERS,</function>
+on the root window of the screen_number 0.
+This property can contain a list of ATOMs, and the each ATOM represents
+each possible IM Server.
+IM Server names are restricted to POSIX Portable Filename Character Set.
+To discover if the IM Server is active, see if there is an owner for
+the selection with that atom name.  To learn the address of that IM Server,
+convert the selection target
+<function>TRANSPORT,</function>
+which will return a string form of the transport address(es).
+To learn the supported locales of that IM Server, convert the selection target
+<function>LOCALES,</function>
+which will return a set of names of the supported locales in the syntax
+X/Open defines.
+</para>
+<para>
+<!-- .LP -->
+The basic semantics to determine the IM Server if there are
+multiple ATOMs are found in
+<function>XIM_SERVERS</function>
+property, is first fit if the IM Server name is not given as
+a X modifier's category
+<function>im.</function>
+</para>
+<para>
+<!-- .LP -->
+The address information retrievable from the
+<function>TRANSPORT</function>
+target is a transport-specific name.
+The preregistered formats for transport-specific names are listed in
+<xref linkend="transport_list" xrefstyle='select: title'/>.
+Additional transport-specific names may be registered with X Consortium.
+</para>
+
+<para>
+For environments that lack X connections, or for IM Servers which
+do not use the X Window System, the preconnection convention with IM Server
+may be given outside the X Window system (e.g. using a Name Service).
+</para>
+</sect1>
+
+<sect1 id="Protocol">
+<title>Protocol</title>
+<!-- .XS -->
+<!-- (SN Protocol -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The protocol described below uses the bi-directional
+synchronous/asynchronous request/reply/error model and is specified
+using the same conventions outlined in Section 2 of the core X Window
+System protocol [1]:
+</para>
+
+<sect2 id="Basic_Requests_Packet_Format">
+<title>Basic Requests Packet Format</title>
+<!-- .XS -->
+<!-- (SN Basic Requests Packet Format -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+This section describes the requests that may be exchanged between the client
+and the IM Server.
+</para>
+<para>
+<!-- .LP -->
+The basic request packet header format is as follows.
+</para>
+<literallayout class="monospaced">
+          major-opcode:               CARD8
+          minor-opcode:               CARD8
+          length:                     CARD16
+</literallayout>
+
+<para>
+The MAJOR-OPCODE specifies which core request or extension package this
+packet represents.  If the MAJOR-OPCODE corresponds to a core request,
+the MINOR-OPCODE contains 8 bits of request-specific data.
+(If the MINOR-OPCODE is not used, it is 0.)
+Otherwise, the MAJOR-OPCODE and the MINOR-OPCODE are specified by
+<function>XIM_QUERY_EXTENSION</function>
+message.  (Refer to 4.7. Query the supported extension protocol list.)
+The LENGTH field specifies the number of 4 bytes elements following the
+header.  If no additional data is followed by the header, the LENGTH field
+will be 0.
+</para>
+</sect2>
+
+<sect2 id="Data_Types">
+<title>Data Types</title>
+<!-- .XS -->
+<!-- (SN Data Types -->
+<!-- .XE -->
+<para>
+The following data types are used in the core X IM Server protocol:
+</para>
+
+<literallayout class="monospaced">
+BITMASK16
+     CARD16
+BITMASK32
+     CARD32
+PADDING FORMAT
+     Where N is some expression, and Pad(N) is the number of bytes needed to round N up to a
+
+          Pad(N) = (4 - (N mod 4)) mod 4
+
+LPCE
+  1          A character from the4 X Portable Character Set in Latin Portable
+             Character Encoding
+
+STRING
+     2     n              length of string in bytes
+     n     LISTofLPCE     string
+     p                    unused, p=Pad(2+n)
+
+STR
+     1     n              length of name in bytes
+     n     STRING8        name
+
+XIMATTR
+     2     CARD16         attribute ID (*1)
+     2     CARD16         type of the value (*2)
+     2     n              length of im-attribute
+     n     STRING8        im-attribute
+     p                    unused, p = Pad(2+n)
+
+The im-attribute argument specifies XIM values such as XNQueryInputStyle.
+
+XICATTR
+     2     CARD16         attribute ID (*1)
+     2     CARD16         type of the value (*2)
+     2     n              length of ic-attribute
+     n     STRING8        ic-attribute
+     p                    unused, p = Pad(2+n)
+
+(*1) XIMATTR and XICATTR are used during the setup stage and XIMATTRIBUTE and
+     XICATTRIBUTE are used after each attribute ID has been recognized by
+     the IM Server and the IM library.
+
+(*2) The value types are defined as follows:
+</literallayout>
+<informaltable id="valuetypes" frame="topbot">
+  <?dbfo keep-together="auto" ?>
+  <tgroup cols="5" align='left' colsep='0' rowsep='0'>
+  <colspec colname="col1" colwidth="0.9*"/>
+  <colspec colname="col2" colwidth="3.0*"/>
+  <colspec colname="col3" colwidth="3.2*"/>
+  <colspec colname="col4" colwidth="2.9*"/>
+  <colspec colname="col5" colwidth="2.9*"/>
+  <spanspec namest="col3" nameend="col5" spanname="span-horiz" align="center"/>
+  <thead>
+    <row rowsep='1'>
+      <entry>values</entry>
+      <entry>data</entry>
+      <entry>format</entry>
+      <!-- <entry spanname="span-horiz">format</entry> -->
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>#0</entry>
+      <entry>Separator of NestedList</entry>
+      <entry>-----(*3)</entry>
+    </row>
+    <row>
+      <entry>#1</entry>
+      <entry>byte data</entry>
+      <entry>CARD8</entry>
+    </row>
+    <row>
+      <entry>#2</entry>
+      <entry>word data</entry>
+      <entry>CARD16</entry>
+    </row>
+    <row>
+      <entry>#3</entry>
+      <entry>long data</entry>
+      <entry>CARD32</entry>
+    </row>
+    <row>
+      <entry>#4</entry>
+      <entry>char data</entry>
+      <entry>STRING8</entry>
+    </row>
+    <row>
+      <entry>#5</entry>
+      <entry>Window</entry>
+      <entry>CARD32</entry>
+    </row>
+    <row>
+      <entry>#10</entry>
+      <entry>XIMStyles</entry>
+      <entry>2</entry>
+      <entry>n</entry>
+      <entry>number of XIMStyle list</entry>
+    </row>
+    <row>
+      <entry></entry>
+      <entry></entry>
+      <entry>2</entry>
+      <entry></entry>
+      <entry>unused</entry>
+    </row>
+    <row>
+      <entry></entry>
+      <entry></entry>
+      <entry>n</entry>
+      <entry>CARD32</entry>
+      <entry>XIMStyle list</entry>
+    </row>
+    <row>
+      <entry>#11</entry>
+      <entry>XRectangle</entry>
+      <entry>2</entry>
+      <entry>INT16</entry>
+      <entry>X</entry>
+    </row>
+    <row>
+      <entry></entry>
+      <entry></entry>
+      <entry>2</entry>
+      <entry>INT16</entry>
+      <entry>Y</entry>
+    </row>
+    <row>
+      <entry></entry>
+      <entry></entry>
+      <entry>2</entry>
+      <entry>CARD16</entry>
+      <entry>width</entry>
+    </row>
+    <row>
+      <entry></entry>
+      <entry></entry>
+      <entry>2</entry>
+      <entry>CARD16</entry>
+      <entry>height</entry>
+    </row>
+    <row>
+      <entry>#12</entry>
+      <entry>XPoint</entry>
+      <entry>2</entry>
+      <entry>INT16</entry>
+      <entry>X</entry>
+    </row>
+    <row>
+      <entry></entry>
+      <entry></entry>
+      <entry>2</entry>
+      <entry>INT16</entry>
+      <entry>Y</entry>
+    </row>
+    <row>
+      <entry>#13</entry>
+      <entry>XFontSet</entry>
+      <entry>2</entry>
+      <entry>n</entry>
+      <entry>length of Base font name</entry>
+    </row>
+    <row>
+      <entry></entry>
+      <entry></entry>
+      <entry>n</entry>
+      <entry>STRING8</entry>
+      <entry>Base font name list</entry>
+    </row>
+    <row>
+      <entry></entry>
+      <entry></entry>
+      <entry>p</entry>
+      <entry></entry>
+      <entry>unused, p = Pad(2+n)</entry>
+    </row>
+    <row>
+      <entry>#15</entry>
+      <entry>XIMHotKeyTriggers</entry>
+      <entry>4</entry>
+      <entry>n</entry>
+      <entry>number of XIMTRIGGERKEY list (*4)</entry>
+    </row>
+    <row>
+      <entry></entry>
+      <entry></entry>
+      <entry>n</entry>
+      <entry>XIMTRIGGERKEY</entry>
+      <entry>XIMHotkeyTrigger list</entry>
+    </row>
+    <row>
+      <entry></entry>
+      <entry></entry>
+      <entry>n</entry>
+      <entry>XIMHOTKEYSTATE</entry>
+      <entry>HotKey processing state</entry>
+    </row>
+    <row>
+      <entry>#17</entry>
+      <entry>XIMStringConversion</entry>
+      <entry>XIMSTRCONVTEXT</entry>
+      <entry></entry>
+      <entry></entry>
+    </row>
+    <row>
+      <entry>#18</entry>
+      <entry>XIMPreeditState</entry>
+      <entry>XIMPREEDITSTATE</entry>
+    </row>
+    <row>
+      <entry>#19</entry>
+      <entry>XIMResetState</entry>
+      <entry>XIMRESETSTATE</entry>
+    </row>
+    <row>
+      <entry>#x7fff</entry>
+      <entry>NestedList</entry>
+      <entry>-----</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<literallayout class="monospaced">
+(*3)  The IC value for the separator of NestedList is defined as follows,
+            #define   XNSeparatorofNestedList   "separatorofNestedList"
+      , which is registered in X Consortium and cannot be used for any other purpose.
+
+(*4) LISTofFOO
+            A Type name of the form LISTof FOO means a counted list of elements of type FOO.
+            The size of the length field may vary (it is not necessarily the same
+            size as a FOO), and in some cases, it may be implicit.
+XIMTRIGGERKEY
+     4     CARD32       keysym
+     4     CARD32       modifier
+     4     CARD32       modifier mask
+
+ENCODINGINFO
+     2     n            length of encoding info
+     n     STRING8      encoding info
+     p                  unused, p=Pad(2+n)
+
+EXT
+     1     CARD8        extension major-opcode
+     1     CARD8        extension minor-opcode
+     2     n            length of extension name
+     n     STRING8      extension name
+     p                  unused, p = Pad(n)
+
+XIMATTRIBUTE
+     2     CARD16       attribute ID
+     2     n            value length
+     n                  value
+     p                  unused, p = Pad(n)
+
+XICATTRIBUTE
+     2     CARD16       attribute ID
+     2     n            value length
+     n                  value
+     p                  unused, p = Pad(n)
+
+
+
+XIMSTRCONVTEXT
+     2    CARD16                      XIMStringConversionFeedback
+          #x0000001                   XIMStringConversionLeftEdge
+          #x0000002                   XIMStringConversionRightEdge
+          #x0000004                   XIMStringConversionTopEdge
+          #x0000008                   XIMStringConversionBottomEdge
+          #x0000010                   XIMStringConversionConvealed
+          #x0000020                   XIMStringConversionWrapped
+     2     n                          byte length of the retrieved string
+     n     STRING8                    retrieved string
+     p                                unused, p = Pad(n)
+     2     m                          byte length of feedback array
+     2                                unused
+     m     LISTofXIMSTRCONVFEEDBACK   feedback array(*1)
+
+(*1)   This field is reserved for future use.
+
+XIMFEEDBACK
+     4    CARD32       XIMFeedback
+          #x000001     XIMReverse
+          #x000002     XIMUnderline
+          #x000004     XIMHighlight
+          #x000008     XIMPrimary
+          #x000010     XIMSecondary
+          #x000020     XIMTertiary
+          #x000040     XIMVisibleToForward
+          #x000080     XIMVisibleToBackward
+          #x000100     XIMVisibleCenter
+
+XIMHOTKEYSTATE
+     4    CARD32       XIMHotKeyState
+          #x0000001    XIMHotKeyStateON
+          #x0000002    XIMHotKeyStateOFF
+
+XIMPREEDITSTATE
+     4    CARD32       XIMPreeditState
+          #x0000001    XIMPreeditEnable
+          #x0000002    XIMPreeditDisable
+
+XIMRESETSTATE
+     4    CARD32       XIMResetState
+          #x0000001    XIMInitialState
+          #x0000002    XIMPreserveState
+</literallayout>
+</sect2>
+
+<sect2 id="Error_Notification">
+<title>Error Notification</title>
+<!-- .XS -->
+<!-- (SN Error Notification -->
+<!-- .XE -->
+<para>
+Both the IM Server and the IM library return
+<function>XIM_ERROR</function>
+messages instead of the corresponding reply messages if any errors occur
+during data processing.
+</para>
+
+<para>
+At most one error is generated per request. If more than one error condition
+is encountered in processing a request, the choice of which error is returned
+is implementation-dependent.
+</para>
+
+<literallayout class="monospaced">
+XIM_ERROR (IM Server &lt;--&gt; IM library)
+<!-- .sp 6p -->
+          2     CARD16          input-method-ID
+          2     CARD16          input-context-ID
+          2     BITMASK16       flag (*1)
+                #0000           Both Input-Method-ID and Input-Context-ID are invalid
+                #0001           Input-Method-ID is valid
+                #0002           Input-Context-ID is valid
+          2     CARD16          Error Code
+                #1              BadAlloc
+                #2              BadStyle
+                #3              BadClientWindow
+                #4              BadFocusWindow
+                #5              BadArea
+                #6              BadSpotLocation
+                #7              BadColormap
+                #8              BadAtom
+                #9              BadPixel
+                #10             BadPixmap
+                #11             BadName
+                #12             BadCursor
+                #13             BadProtocol
+                #14             BadForeground
+                #15             BadBackground
+                #16             LocaleNotSupported
+                #999            BadSomething (*2)
+          2     n               byte length of error detail.
+          2     CARD16          type of error detail (*3)
+          n     STRING8         error detail (*4)
+          p                     unused, p = Pad(n)
+
+(*1)  Before an IM is created, both Input-Method-ID and
+      Input-Context-ID are invalid.
+      Before an IC is created, only Input-Method-ID is valid.
+      After that, both of Input-Method-ID and Input-Context-ID are valid.
+
+(*2) Unspecific error, for example "language engine died"
+
+(*3) This field is reserved for future use.
+
+(*4) Vendor defined detail error message
+</literallayout>
+</sect2>
+
+<sect2 id="Connection_Establishment">
+<title>Connection Establishment</title>
+<!-- .XS -->
+<!-- (SN Connection Establishment -->
+<!-- .XE -->
+<para>
+<function>XIM_CONNECT</function>
+message requests to establish a connection over a mutually-understood virtual
+stream.
+</para>
+
+<literallayout class="monospaced">
+XIM_CONNECT (IM library -&gt; IM Server)
+     1                      byte order
+           #x42             MSB first
+           #x6c             LSB first
+     1                      unused
+     2     CARD16           client-major-protocol-version (*1)
+     2     CARD16           client-minor-protocol-version (*1)
+     2     CARD16           number of client-auth-protocol-names
+     n     LISTofSTRING     client-auth-protocol-names
+
+(*1) Specify the version of IM Protocol that the client supports.
+</literallayout>
+
+<para>
+A client must send
+<function>XIM_CONNECT</function>
+message as the first message on the connection.
+The list specifies the names of authentication protocols the sending
+IM Server is willing to perform.
+(If the client need not authenticate, the list may be omitted.)
+</para>
+
+<para>
+<function>XIM_AUTH_REQUIRED </function>
+message is used to send the authentication protocol name and protocol-specific
+data.
+</para>
+
+<literallayout class="monospaced">
+XIM_AUTH_REQUIRED (IM library &lt;--&gt; IM Server)
+
+     1     CARD8              auth-protocol-index
+     3                        unused
+     2     n                  length of authentication data
+     2                        unused
+     n     &lt;varies&gt;     data
+     p                        unused, p = Pad(n)
+</literallayout>
+
+<para>
+The auth-protocol is specified by an index into the list of names
+given in the
+<function>XIM_CONNECT</function>
+or
+<function>XIM_AUTH_SETUP</function>
+message. Any protocol-specific data that might be required is also sent.
+</para>
+
+<para>
+The IM library sends
+<function>XIM_AUTH_REPLY</function>
+message as the reply to
+<function>XIM_AUTH_REQUIRED</function>
+message, if the IM Server is authenticated.
+</para>
+
+<literallayout class="monospaced">
+XIM_AUTH_REPLY (IM library -&gt; IM Server)
+     2     n                 length of authentication data
+     2                       unused
+     2     n                 length of authentication data
+     2                       unused
+     n     &lt;varies&gt;      data
+     p                       unused, p = Pad(n)
+</literallayout>
+
+<para>
+The auth data is specific to the authentication protocol in use.
+</para>
+<para>
+<!-- .LP -->
+<function>XIM_AUTH_NEXT </function>
+message requests to send more auth data.
+</para>
+
+<literallayout class="monospaced">
+XIM_AUTH_NEXT (IM library &lt;--&gt; IM Server)
+     2     n                 length of authentication data
+     2                       unused
+     n     &lt;varies&gt;      data
+     p                       unused, p = Pad(n)
+</literallayout>
+<para>
+The auth data is specific to the authentication protocol in use.
+</para>
+
+<para>
+<!-- .LP -->
+The IM Server sends
+<function>XIM_AUTH_SETUP</function>
+message to authenticate the client.
+</para>
+
+<literallayout class="monospaced">
+XIM_AUTH_SETUP (IM Server -&gt; IM library)
+     2     CARD16           number of client-auth-protocol-names
+     2                      unused
+     n     LISTofSTRING     server-auth-protocol-names
+</literallayout>
+
+<para>
+The list specifies the names of authentication protocols the
+client is willing to perform.
+</para>
+
+<para>
+<function>XIM_AUTH_NG</function>
+message requests to give up the connection.
+</para>
+
+<para>
+XIM_AUTH_NG (IM library &lt;--&gt; IM Server)
+</para>
+
+<para>
+The IM Server sends
+<function>XIM_CONNECT_REPLY</function>
+message as the reply to
+<function>XIM_CONNECT</function>
+or
+<function>XIM_AUTH_REQUIRED</function>
+message.
+</para>
+
+<literallayout class="monospaced">
+XIM_CONNECT_REPLY (IM Server -&gt; IM library)
+     2     CARD16     server-major-protocol-version (*1)
+     2     CARD16     server-minor-protocol-version (*1)
+
+(*1) Specify the version of IM Protocol that the IM Server supports.
+This document specifies major version one, minor version zero.
+</literallayout>
+
+<para>
+Here are the state diagrams for the client and the IM Server.
+</para>
+
+<para>
+State transitions for the client
+</para>
+
+<variablelist>
+  <varlistentry>
+    <term><emphasis remap='I'>init_status</emphasis>:</term>
+    <listitem>
+      <para>
+Use authorization function -&gt; <emphasis remap='I'>client_ask</emphasis>
+      </para>
+      <para>
+Not use authorization function -&gt; <emphasis remap='I'>client_no_check</emphasis>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>start</emphasis>:</term>
+    <listitem>
+      <para>
+Send <function>XIM_CONNECT</function>
+      </para>
+      <para>
+If <emphasis remap='I'>client_ask</emphasis> -&gt; <emphasis remap='I'>client_wait1</emphasis>
+      </para>
+      <para>
+If <emphasis remap='I'>client_no_check</emphasis>,
+client-auth-protocol-names may be omitted -&gt; <emphasis remap='I'>client_wait2</emphasis>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>client_wait1</emphasis>:</term>
+    <listitem>
+      <para>
+Receive <function>XIM_AUTH_REQUIRED</function>
+-&gt; <emphasis remap='I'>client_check</emphasis>
+      </para>
+      <para>
+Receive &lt;other&gt; -&gt; <emphasis remap='I'>client_NG</emphasis>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>client_check</emphasis>:</term>
+    <listitem>
+      <para>
+If no more auth needed, send <function>XIM_AUTH_REPLY</function>
+-&gt; <emphasis remap='I'>client_wait2</emphasis>
+      </para>
+      <para>
+If good auth data, send <function>XIM_AUTH_NEXT</function>
+-&gt; <emphasis remap='I'>client_wait1</emphasis>
+      </para>
+      <para>
+If bad auth data, send <function>XIM_AUTH_NG</function>
+-&gt; give up on this protocol
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>client_wait2</emphasis>:</term>
+    <listitem>
+      <para>
+Receive <function>XIM_CONNECT_REPLY</function>
+-&gt; connect Receive
+<function>XIM_AUTH_SETUP </function>
+-&gt; <emphasis remap='I'>client_more</emphasis>
+      </para>
+      <para>
+Receive <function>XIM_AUTH_NEXT</function>
+-&gt; <emphasis remap='I'>client_more</emphasis>
+      </para>
+      <para>
+Receive <function>XIM_AUTH_NG</function>
+-&gt; give up on this protocol
+      </para>
+      <para>
+Receive &lt;other&gt; -&gt; <emphasis remap='I'>client_NG</emphasis>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>client_more</emphasis>:</term>
+    <listitem>
+      <para>
+Send <function>XIM_AUTH_REQUIRED</function>
+-&gt; <emphasis remap='I'>client_wait2</emphasis>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>client_NG</emphasis>:</term>
+    <listitem>
+      <para>
+Send <function>XIM_AUTH_NG</function>
+-&gt; give up on this protocol
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+State transitions for the IM Server
+</para>
+
+<variablelist>
+  <varlistentry>
+    <term><emphasis remap='I'>init_status</emphasis>:</term>
+    <listitem>
+      <para>
+Use authorization function -&gt; <emphasis remap='I'>server_ask</emphasis>
+      </para>
+      <para>
+Not use authorization function -&gt; <emphasis remap='I'>server_no_check</emphasis>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>start</emphasis>:</term>
+    <listitem>
+      <para>
+Receive <function>XIM_CONNECT</function>
+      </para>
+      <para>
+-&gt; <emphasis remap='I'>start2</emphasis>
+Receive &lt;other&gt; -&gt; <emphasis remap='I'>server_NG</emphasis>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>start2</emphasis>:</term>
+    <listitem>
+      <para>
+If <emphasis remap='I'>client_ask</emphasis>, send
+<function>XIM_AUTH_REQUIRED</function>
+-&gt; <emphasis remap='I'>server_wait1</emphasis>
+      </para>
+      <para>
+If <emphasis remap='I'>client_no_check</emphasis> and
+<emphasis remap='I'>server_ask</emphasis>, send
+<function>XIM_AUTH_SETUP</function>
+-&gt; <emphasis remap='I'>server_wait2</emphasis>
+      </para>
+      <para>
+If <emphasis remap='I'>client_no_check</emphasis> and
+<emphasis remap='I'>server_no_check</emphasis>, send
+<function>XIM_CONNECT_REPLY</function>
+-&gt; connect
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>server_wait1</emphasis>:</term>
+    <listitem>
+      <para>
+Receive
+<function>XIM_AUTH_REPLY</function>
+-&gt; <emphasis remap='I'>server2</emphasis>
+      </para>
+      <para>
+Receive
+<function>XIM_AUTH_NEXT</function>
+-&gt; <emphasis remap='I'>server_more</emphasis>
+      </para>
+      <para>
+Receive &lt;other&gt; -&gt; <emphasis remap='I'>server_NG</emphasis>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>server_more</emphasis></term>
+    <listitem>
+      <para>
+Send
+<function>XIM_AUTH_REQUIRED</function>
+-&gt; <emphasis remap='I'>server_wait1</emphasis>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>server2</emphasis></term>
+    <listitem>
+      <para>
+If <emphasis remap='I'>server_ask</emphasis>, send
+<function>XIM_AUTH_SETUP</function>
+-&gt; <emphasis remap='I'>server_wait2</emphasis>
+      </para>
+      <para>
+If <emphasis remap='I'>server_no_check</emphasis>, send
+<function>XIM_CONNECT_REPLY </function>
+-&gt; connect
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>server_wait2</emphasis></term>
+    <listitem>
+      <para>
+Receive
+<function>XIM_AUTH_REQUIRED</function>
+-&gt; <emphasis remap='I'>server_check</emphasis>
+      </para>
+      <para>
+Receive &lt;other&gt; -&gt; <emphasis remap='I'>server_NG</emphasis>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>server_check</emphasis></term>
+    <listitem>
+      <para>
+If no more auth data, send
+<function>XIM_CONNECT_REPLY</function>
+-&gt; connect
+      </para>
+      <para>
+If bad auth data, send
+<function>XIM_AUTH_NG</function>
+-&gt; give up on this protocol
+      </para>
+      <para>
+If good auth data, send
+<function>XIM_AUTH_NEXT</function>
+-&gt; <emphasis remap='I'>server_wait2</emphasis>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>server_NG</emphasis></term>
+    <listitem>
+      <para>
+Send
+<function>XIM_AUTH_NG</function>
+-&gt; give up on this protocol
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XIM_DISCONNECT </function>
+message requests to shutdown the connection over a mutually-understood
+virtual stream.
+</para>
+
+<para>
+XIM_DISCONNECT (IM library -&gt; IM Server)
+</para>
+
+<para>
+<function>XIM_DISCONNECT</function>
+is a synchronous request.  The IM library should wait until it receives
+either an
+<function>XIM_DISCONNECT_REPLY</function>
+packet or an <function>XIM_ERROR</function> packet.
+</para>
+
+<para>
+XIM_DISCONNECT_REPLY (IM Server -&gt; IM library)
+</para>
+
+<para>
+<function>XIM_OPEN</function>
+requests to establish a logical connection between the IM library and the IM
+Server.
+</para>
+
+<literallayout class="monospaced">
+XIM_OPEN (IM library -&gt; IM Server)
+     n     STR     locale name
+     p             unused, p = Pad(n)
+</literallayout>
+
+<para>
+<function>XIM_OPEN</function>
+is a synchronous request.  The IM library should wait until receiving
+either an <function>XIM_OPEN_REPLY</function>
+packet or an <function>XIM_ERROR </function> packet.
+</para>
+
+<literallayout class="monospaced">
+XIM_OPEN_REPLY (IM Server -&gt; IM library)
+     2     CARD16             input-method-ID
+     2     n                  byte length of IM attributes supported
+     n     LISTofXIMATTR      IM attributes supported
+     2     m                  byte length of IC attributes supported
+     2     CARD16             unused
+     m     LISTofXICATTR      IC attributes supported
+</literallayout>
+
+<para>
+<function>XIM_OPEN_REPLY</function>
+message returns all supported IM and IC attributes in LISTofXIMATTR and
+LISTofXICATTR.  These IM and IC attribute IDs are used to reduce the amount
+of data which must be transferred via the network. In addition, this
+indicates to the IM library what kinds of IM/IC attributes can be used
+in this session, and what types of data will be exchanged. This allows
+the IM Server provider and application writer to support IM system
+enhancements with new IM/IC attributes, without modifying Xlib.
+The IC value for the separator of NestedList must be included in the
+LISTofXICATTR.
+</para>
+
+<para>
+<function>XIM_CLOSE </function>
+message requests to shutdown the logical connection between the IM library
+and the IM Server.
+</para>
+
+<literallayout class="monospaced">
+XIM_CLOSE (IM library -&gt; IM Server)
+     2     CARD16     input-method-ID
+     2                unused
+</literallayout>
+
+<para>
+<function>XIM_CLOSE</function>
+is a synchronous request.  The IM library should wait until receiving
+either an <function>XIM_CLOSE_REPLY</function>
+packet or an <function>XIM_ERROR</function> packet.
+</para>
+
+<literallayout class="monospaced">
+XIM_CLOSE_REPLY (IM Server -&gt; IM library)
+     2     CARD16     input-method-ID
+     2                unused
+</literallayout>
+
+</sect2>
+
+<sect2 id='Event_Flow_Control_2'>
+<title>Event Flow Control</title>
+<!-- .XS -->
+<!-- (SN Event Flow Control -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+An IM Server must send
+<function>XIM_SET_EVENT_MASK </function>
+message to the IM library in order for events to be forwarded to the IM
+Server, since the IM library initially doesn't forward any events to the
+IM Server. In the protocol, the IM Server will specify masks of X events
+to be forwarded and which need to be synchronized by the IM library.
+</para>
+
+<literallayout class="monospaced">
+XIM_SET_EVENT_MASK (IM Server -&gt; IM library)
+     2     CARD16        input-method-ID
+     2     CARD16        input-context-ID
+     4     EVENTMASK     forward-event-mask (*1)
+     4     EVENTMASK     synchronous-event-mask (*2)
+
+(*1)  Specify all the events to be forwarded to the IM Server by the IM library.
+(*2)  Specify the events to be forwarded with synchronous flag on by the IM library.
+</literallayout>
+
+<para>
+<function>XIM_SET_EVENT_MASK </function>
+is an asynchronous request.  The event masks are valid immediately after
+they are set until changed by another
+<function>XIM_SET_EVENT_MASK</function>
+message.  If input-context-ID is set to zero, the default value of the
+input-method-ID will be changed to the event masks specified in the request.
+That value will be used for the IC's which have no individual values.
+</para>
+
+<para>
+Using the Dynamic Event Flow model, an IM Server sends
+<function>XIM_REGISTER_TRIGGERKEYS </function>
+message to the IM library before sending
+<function>XIM_OPEN_REPLY</function>
+message.
+Or the IM library may suppose that the IM Server uses the Static Event Flow
+model.
+</para>
+
+<literallayout class="monospaced">
+XIM_REGISTER_TRIGGERKEYS (IM Server -&gt; IM library)
+<!-- .sp 6p -->
+     2     CARD16                  input-method-ID
+     2                             unused
+     4     n                       byte length of on-keys
+     n     LISTofXIMTRIGGERKEY     on-keys list
+     4     m                       byte length of off-keys
+     m     LISTofXIMTRIGGERKEY     off-keys list
+</literallayout>
+
+<para>
+<function>XIM_REGISTER_TRIGGERKEYS</function>
+is an asynchronous request.
+The IM Server notifys the IM library of on-keys and off-keys lists with
+this message.
+</para>
+
+<para>
+The IM library notifys the IM Server with
+<function>XIM_TRIGGER_NOTIFY </function>
+message that a key event matching either on-keys or off-keys has been occurred.
+</para>
+
+<literallayout class="monospaced">
+XIM_TRIGGER_NOTIFY (IM library -&gt; IM Server)
+     2     CARD16           input-method-ID
+     2     CARD16           input-context-ID
+     4     CARD32           flag
+           #0               on-keys list
+           #1               off-keys list
+     4     CARD32           index of keys list
+     4     EVENTMASK        client-select-event-mask (*1)
+
+(*1)  Specify the events currently selected by the IM library with XSelectInput.
+
+</literallayout>
+
+<para>
+<function>XIM_TRIGGER_NOTIFY </function>
+is a synchronous request.  The IM library should wait until receiving
+either an <function>XIM_TRIGGER_NOTIFY_REPLY</function>
+packet or an <function>XIM_ERROR</function> packet.
+</para>
+
+<literallayout class="monospaced">
+XIM_TRIGGER_NOTIFY_REPLY (IM Server -&gt; IM library)
+     2     CARD16     input-method-ID
+     2     CARD16     input-context-ID
+</literallayout>
+
+</sect2>
+
+<sect2 id="Encoding_Negotiation">
+<title>Encoding Negotiation</title>
+<para>
+<function>XIM_ENCODING_NEGOTIATION</function>
+message requests to decide which encoding to be sent across the wire.
+When the negotiation fails, the fallback default encoding is Portable
+Character Encoding.
+</para>
+
+<literallayout class="monospaced">
+XIM_ENCODING_NEGOTIATION (IM library -&gt; IM Server).sp 6p
+     2     CARD16                 input-method-ID
+     2     n                      byte length of encodings listed by name
+     n     LISTofSTR              list of encodings supported in the IM library.
+     p                            unused, p = Pad(n)
+     2     m                      byte length of encodings listed by detailed data
+     2                            unused
+     m     LISTofENCODINGINFO     list of encodings supported in the IM library
+</literallayout>
+
+<para>
+The IM Server must choose one encoding from the list sent by the IM library.
+If index of the encoding determined is -1 to indicate that the negotiation
+is failed, the fallback default encoding is used.
+The message must be issued after sending
+<function>XIM_OPEN</function> message via XOpenIM().
+The name of encoding may be registered with X Consortium.
+</para>
+
+<para>
+<function>XIM_ENCODING_NEGOTIATION</function>
+is a synchronous request.  The IM library should wait until receiving
+either an <function>XIM_ENCODING_NEGOTIATION_REPLY</function>
+packet or an <function>XIM_ERROR</function> packet.
+</para>
+
+
+<literallayout class="monospaced">
+XIM_ENCODING_NEGOTIATION_REPLY (IM Server -&gt; IM library)
+     2     CARD16     input-method-ID
+     2     CARD16     category of the encoding determined.
+           #0         name
+           #1         detailed data
+     2     INT16      index of the encoding determined.
+     2                unused
+</literallayout>
+
+</sect2>
+
+<sect2 id="Query_the_supported_extension_protocol_list">
+<title>Query the supported extension protocol list</title>
+<para>
+<function>XIM_QUERY_EXTENSION</function>
+message requests to query the IM extensions supported by the IM Server to
+which the client is being connected.
+</para>
+
+<literallayout class="monospaced">
+XIM_QUERY_EXTENSION (IM library -&gt; IM Server)
+     2     CARD16        input-method-ID
+     2     n             byte length of extensions supported by the IM library
+     n     LISTofSTR     extensions supported by the IM library
+     p                   unused, p = Pad(n)
+</literallayout>
+
+<para>
+An example of a supported extension is FrontEnd.
+The message must be issued after sending
+<function>XIM_OPEN </function> message via XOpenIM().
+</para>
+
+<para>
+If n is 0, the IM library queries the IM Server for all extensions.
+</para>
+
+<para>
+If n is not 0, the IM library queries whether the IM Server supports the
+contents specified in the list.
+</para>
+
+<para>
+If a client uses an extension request without previously having issued a
+<function>XIM_QUERY_EXTENSION</function>
+message for that extension, the IM Server responds with a
+<function>BadProtocol</function>
+error.  If the IM Server encounters a request with an unknown MAJOR-OPCODE
+or MINOR-OPCODE, it responds with a
+<function>BadProtocol</function> error.
+</para>
+
+<para>
+<function>XIM_QUERY_EXTENSION</function>
+is a synchronous request.  The IM library should wait until receiving
+either an <function>XIM_QUERY_EXTENSION_REPLY</function>
+packet or an <function>XIM_ERROR</function> packet.
+</para>
+
+<literallayout class="monospaced">
+XIM_QUERY_EXTENSION_REPLY (IM Server -&gt; IM library)
+     2     CARD16      input-method-ID
+     2     n           byte length of extensions supported by both the IM library and the IM Server
+     n     LISTofEXT   list of extensions supported by both the IM library and the IM Server
+
+</literallayout>
+
+<para>
+<function>XIM_QUERY_EXTENSION_REPLY</function>
+message returns the list of extensions supported by both the IM library and
+the IM Server. If the list passed in
+<function>XIM_QUERY_EXTENSION</function>
+message is NULL, the IM Server returns the full list of extensions supported
+by the IM Server.  If the list is not NULL, the IM Server returns the
+extensions in the list that are supported by the IM Server.
+</para>
+
+<para>
+<!-- .LP -->
+A zero-length string is not a valid extension name.  The IM library should
+disregard any zero-length strings that are returned in the extension list.
+The IM library does not use the requests which are not supported by the IM
+Server.
+</para>
+
+</sect2>
+
+<sect2 id="Setting_IM_Values">
+<title>Setting IM Values</title>
+<para>
+<function>XIM_SET_IM_VALUES </function>
+requests to set attributes to the IM.
+</para>
+
+<literallayout class="monospaced">
+XIM_SET_IM_VALUES (IM library -&gt; IM Server)
+     2     CARD16                 input-method-ID
+     2     n                      byte length of im-attribute
+     n     LISTofXIMATTRIBUTE     im-attributes
+</literallayout>
+
+<para>
+The im-attributes in
+<function>XIM_SET_IM_VALUES</function>
+message are specified as a LISTofXIMATTRIBUTE, specifying the attributes
+to be set. Attributes other than the ones returned by
+<function>XIM_OPEN_REPLY</function>
+message should not be specified.
+</para>
+
+<para>
+<function>XIM_SET_IM_VALUES </function>
+is a synchronous request. The IM library should wait until receiving
+either an
+<function>XIM_SET_IM_VALUES_REPLY</function>
+packet or an
+<function>XIM_ERROR</function>
+packet, because it must receive the error attribute if
+<function>XIM_ERROR</function> message is returned.
+</para>
+
+<literallayout class="monospaced">
+XIM_SET_IM_VALUES_REPLY (IM Server -&gt; IM library)
+     2     CARD16     input-method-ID
+     2                unused
+</literallayout>
+
+<para>
+<function>XIM_SET_IM_VALUES_REPLY</function>
+message returns the input-method-ID to distinguish replies from multiple IMs.
+</para>
+
+</sect2>
+<sect2 id="Getting_IM_Values">
+<title>Getting IM Values</title>
+<para>
+<function>XIM_GET_IM_VALUES </function>
+requests to query IM values supported by the IM Server currently being
+connected.
+</para>
+
+<literallayout class="monospaced">
+XIM_GET_IM_VALUES (IM library -&gt; IM Server)
+     2     CARD16           input-method-ID
+     2     n                byte length of im-attribute-id
+     n     LISTofCARD16     im-attribute-id
+     p                      unused, p=Pad(n)
+</literallayout>
+
+<para>
+<function>XIM_GET_IM_VALUES</function>
+is a synchronous request.  The IM library should wait until it receives
+either an
+<function>XIM_GET_IM_VALUES_REPLY</function>
+packet or an <function>XIM_ERROR</function> packet.
+</para>
+
+<literallayout class="monospaced">
+XIM_GET_IM_VALUES_REPLY (IM Server -&gt; IM library)
+     2     CARD16                 input-method-ID
+     2     n                      byte length of im-attributes returned
+     n     LISTofXIMATTRIBUTE     im-attributes returned
+</literallayout>
+
+<para>
+The IM Server returns IM values with
+<function>XIM_GET_IM_VALUES_REPLY</function>
+message.  The order of the returned im-attribute values corresponds directly
+to that of the list passed with the
+<function>XIM_GET_IM_VALUES</function> message.
+</para>
+
+</sect2>
+<sect2 id="Creating_an_IC">
+<title>Creating an IC</title>
+<para>
+<function>XIM_CREATE_IC</function> message requests to create an IC.
+</para>
+
+<literallayout class="monospaced">
+XIM_CREATE_IC (IM library -&gt; IM Server)
+     2     CARD16                 input-method-ID
+     2     n                      byte length of ic-attributes
+     n     LISTofXICATTRIBUTE     ic-attributes
+</literallayout>
+
+<para>
+The input-context-id is specified by the IM Server to identify the client
+(IC).  (It is not specified by the client in
+<function>XIM_CREATE_IC</function>
+message.), and it should not be set to zero.
+</para>
+
+<para>
+<function>XIM_CREATE_IC</function>
+is a synchronous request which returns the input-context-ID.
+The IM library should wait until it receives either an
+<function>XIM_CREATE_IC_REPLY</function>
+packet or an
+<function>XIM_ERROR</function>
+packet.
+</para>
+
+<literallayout class="monospaced">
+XIM_CREATE_IC_REPLY (IM Server -&gt; IM library)
+     2     CARD16     input-method-ID
+     2     CARD16     input-context-ID
+</literallayout>
+
+</sect2>
+<sect2 id="Destroying_the_IC">
+<title>Destroying the IC</title>
+<para>
+<function>XIM_DESTROY_IC</function>
+message requests to destroy the IC.
+</para>
+
+<literallayout class="monospaced">
+XIM_DESTROY_IC (IM library -&gt; IM Server)
+     2     CARD16     input-method-ID
+     2     CARD16     input-context-ID
+</literallayout>
+
+<para>
+<function>XIM_DESTROY_IC </function>
+is a synchronous request. The IM library should not free its resources
+until it receives an
+<function>XIM_DESTROY_IC_REPLY</function>
+message because <function>XIM_DESTROY_IC</function>
+message may result in Callback packets such as
+<function>XIM_PREEDIT_DRAW</function>
+and <function>XIM_PREEDIT_DONE.</function>
+</para>
+
+<literallayout class="monospaced">
+XIM_DESTROY_IC_REPLY (IM Server -&gt; IM library)
+     2     CARD16     input-method-ID
+     2     CARD16     input-context-ID
+</literallayout>
+
+</sect2>
+
+<sect2 id="Setting_IC_Values">
+<title>Setting IC Values</title>
+<para>
+<function>XIM_SET_IC_VALUES</function>
+messages requests to set attributes to the IC.
+</para>
+
+
+<literallayout class="monospaced">
+XIM_SET_IC_VALUES (IM library -&gt; IM Server)
+     2     CARD16                 input-method-ID
+     2     CARD16                 input-context-ID
+     2     n                      byte length of ic-attributes
+     2                            unused
+     n     LISTofXICATTRIBUTE     ic-attributes
+</literallayout>
+
+<para>
+The ic-attributes in
+<function>XIM_SET_IC_VALUES</function>
+message are specified as a LISTofXICATTRIBUTE, specifying the attributes
+to be set. Attributes other than the ones returned by
+<function>XIM_OPEN_REPLY</function> message should not be specified.
+</para>
+
+<para>
+<function>XIM_SET_IC_VALUES </function>
+is a synchronous request. The IM library should wait until receiving
+either an <function>XIM_SET_IC_VALUES_REPLY </function>
+packet or an <function>XIM_ERROR</function>
+packet, because it must receive the error attribute if
+<function>XIM_ERROR</function> message is returned.
+</para>
+
+
+<literallayout class="monospaced">
+XIM_SET_IC_VALUES_REPLY (IM Server -&gt; IM library)
+<!-- .sp 6p -->
+     2     CARD16     input-method-ID
+     2     CARD16     input-context-ID
+</literallayout>
+
+</sect2>
+<sect2 id="Getting_IC_Values">
+<title>Getting IC Values</title>
+<para>
+<function>XIM_GET_IC_VALUES</function>
+message requests to query IC values supported by the IM Server currently
+being connected.
+</para>
+
+
+<literallayout class="monospaced">
+XIM_GET_IC_VALUES (IM library -&gt; IM Server)
+<!-- .sp 6p -->
+     2     CARD16           input-method-ID
+     2     CARD16           input-context-ID
+     2     n                byte length of ic-attribute-id
+     n     LISTofCARD16     ic-attribute-id
+     p                      unused, p=Pad(2+n)
+</literallayout>
+
+<para>
+In LISTofCARD16, the appearance of the ic-attribute-id for the separator
+of NestedList shows the end of the heading nested list.
+</para>
+
+<para>
+<function>XIM_GET_IC_VALUES</function>
+is a synchronous request and returns each attribute with its values to
+show the correspondence.  The IM library should wait until receiving
+either an <function>XIM_GET_IC_VALUES_REPLY</function>
+packet or an <function>XIM_ERROR</function> packet.
+</para>
+
+<literallayout class="monospaced">
+XIM_GET_IC_VALUES_REPLY (IM Server -&gt; IM library)
+     2     CARD16                 input-method-ID
+     2     CARD16                 input-context-ID
+     2     n                      byte length of ic-attribute
+     2                            unused
+     n     LISTofXICATTRIBUTE     ic-attribute
+</literallayout>
+
+</sect2>
+<sect2 id="Setting_IC_Focus">
+<title>Setting IC Focus</title>
+<para>
+<function>XIM_SET_IC_FOCUS</function>
+message requests to set the focus to the IC.
+</para>
+
+<literallayout class="monospaced">
+XIM_SET_IC_FOCUS (IM library -&gt; IM Server)
+     2     CARD16     input-method-ID
+     2     CARD16     input-context-ID
+</literallayout>
+
+<para>
+<function>XIM_SET_IC_FOCUS</function> is an asynchronous request.
+</para>
+
+</sect2>
+<sect2 id="Unsetting_IC_Focus">
+<title>Unsetting IC Focus</title>
+<para>
+<function>XIM_UNSET_IC_FOCUS</function>
+message requests to unset the focus to the focused IC.
+</para>
+
+<literallayout class="monospaced">
+XIM_UNSET_IC_FOCUS (IM library -&gt; IM Server)
+     2     CARD16     input-method-ID
+     2     CARD16     input-context-ID
+</literallayout>
+
+<para>
+<function>XIM_UNSET_IC_FOCUS</function>
+is an asynchronous request.
+</para>
+
+</sect2>
+
+<sect2 id='Filtering_Events'>
+<title>Filtering Events</title>
+<para>
+Event filtering is mainly provided for BackEnd method to allow input method
+to capture X events transparently to clients.
+</para>
+
+<para>
+X Events are forwarded by
+<function>XIM_FORWARD_EVENT</function> message.
+This message can be operated both synchronously and asynchronously.
+If the requester sets the synchronous flag, the receiver must send
+<function>XIM_SYNC_REPLY</function>
+message back to the requester when all the data processing is done.
+</para>
+<para>
+Protocol flow of BackEnd model
+</para>
+
+<para>
+With BackEnd method, the protocol flow can be classified into two
+methods in terms of synchronization, depending on the synchronous-eventmask
+of <function>XIM_SET_EVENT_MASK</function>
+message.  One can be called on-demand-synchronous method and another
+can be called as full-synchronous method.
+</para>
+
+<para>
+In on-demand-synchronous method, the IM library always receives
+<function>XIM_FORWARD_EVENT</function>
+or
+<function>XIM_COMMIT</function>
+message as a synchronous request. Also, the IM Server needs to synchronously
+process the correspondent reply from the IM library and the following
+<function>XIM_FORWARD_EVENT</function>
+message sent from the IM library when any of the event causes the IM Server
+to send
+<function>XIM_FORWARD_EVENT</function>
+or
+<function>XIM_COMMIT</function>
+message to the IM library, so that the input service is consistent.  If the
+IM library gets the control back from the application after receiving the
+synchronous request, the IM library replies for the synchronous request before
+processing any of the events. In this time, the IM Server blocks
+<function>XIM_FORWARD_EVENT</function>
+message which is sent by the IM library, and handles it after receiving the
+reply. However, the IM Server handles the other protocols at any time.
+</para>
+
+<para>
+In full-synchronous method, the IM library always sends
+<function>XIM_FORWARD_EVENT</function>
+message to the IM Server as a synchronous request. Therefore, the reply to it
+from the IM Server will be put between the
+<function>XIM_FORWARD_EVENT</function> message and its
+<function>XIM_SYNC_REPLY</function> message.  In case of sending
+<function>XIM_FORWARD_EVENT</function> or
+<function>XIM_COMMIT</function>
+message, the IM Server should set the synchronous flag off. Because the
+synchronization can be done by the following
+<function>XIM_SYNC_REPLY</function> message.
+</para>
+
+<para>
+Following chart shows one of the simplest protocol flow which only
+deals with keyevents for preediting operation.
+</para>
+
+<mediaobject  id="sampleprotocolflow">
+  <imageobject>
+    <imagedata  format="SVG"  fileref="sampleprotocolflow1.svg"/>
+  </imageobject>
+  <caption>Sample Protocol Flow</caption>
+</mediaobject>
+
+
+<para>
+Following chart shows one of the complex protocol flow, which deals
+with multiple focus windows and button press event as well as keyevent,
+and the focus is moved by the application triggered by both of keyevent
+and button press event.
+</para>
+<mediaobject  id="sampleprotocolflow2">
+  <imageobject>
+    <imagedata  format="SVG"  fileref="sampleprotocolflow2.svg"/>
+  </imageobject>
+  <caption>Sample Protocol Flow 2</caption>
+</mediaobject>
+
+<literallayout class="monospaced">
+XIM_FORWARD_EVENT (IM library &lt;--&gt; IM Server)
+     2     CARD16         input-method-ID
+     2     CARD16         input-context-ID
+     2     BITMASK16      flag
+           #0001          synchronous
+           #0002          request filtering (*1)
+           #0004          request lookupstring (*2)
+     2     CARD16         serial number
+           XEVENT         X event
+
+(*1)  Indicate the receiver should filter events and possible preedit may be invoked.
+
+(*2)  Indicate the receiver should only do lookup string. The IM Server is expected
+to just do a conversion of the key event to the best candidate. This bit may
+affect the state of the preedit state (e.g. compose of dead key sequences).
+</literallayout>
+
+<para>
+XEVENT format is same as the X Protocol event format(xEvent).
+As the value of xEvent's sequenceNumber is the bottom of 16 bit of XEvent's
+xany.serial, the top of 16 bit is sent by serial number(INT16).
+</para>
+
+<para>
+<function>XIM_FORWARD_EVENT</function>
+message is used for forwarding the events from the IM library to the IM Server
+in order for IM to be able to filter the event. On the other hand, this
+message is also used for forwarding the events from the IM Server to the IM
+library if the event forwarded from the IM library is not filtered.
+The IM Server, which receives
+<function>XIM_FORWARD_EVENT</function>
+message without synchronous bit, should set synchronous bit.
+If both "request event filtering" and "request lookupstring" flag are
+set, then both filtering and lookup should be done for the same event.
+</para>
+
+</sect2>
+
+<sect2 id="Synchronizing_with_the_IM_Server">
+<title>Synchronizing with the IM Server</title>
+
+<para>
+<function>XIM_SYNC</function>
+message requests to synchronize the IM library and the IM Server.
+</para>
+
+<literallayout class="monospaced">
+XIM_SYNC (IM library &lt;--&gt; IM Server)
+     2     CARD16     input-method-ID
+     2     CARD16     input-context-ID
+</literallayout>
+
+<para>
+This synchronization can be started either on the IM library side or on the
+IM Server side.  The side which receives
+<function>XIM_SYNC</function>
+message should process all XIM requests before replying. The input-context-ID
+is necessary to distinguish the IC with which the IM library and the IM
+Server are synchronized.
+</para>
+
+<literallayout class="monospaced">
+XIM_SYNC_REPLY (IM Server &lt;--&gt; IM library)
+     2     CARD16     input-method-ID
+     2     CARD16     input-context-ID
+</literallayout>
+
+
+
+<para>
+The side which receives
+<function>XIM_FORWARD_EVENT, </function>
+<function>XIM_COMMIT</function>
+or any other message with synchronous bit, should process all XIM request
+before replying, and send
+<function>XIM_SYNC_REPLY</function>
+message as the reply to the previous message.
+</para>
+
+</sect2>
+
+<sect2 id="Sending_a_committed_string">
+<title>Sending a committed string</title>
+<para>
+When the IM Server commits a string, the IM Server sends either the committed
+string or list of KeySym, or both, by
+<function>XIM_COMMIT</function>
+message.
+</para>
+
+<literallayout class="monospaced">
+XIM_COMMIT (IM Server -&gt; IM library)
+
+     2     CARD16          input-method-ID
+     2     CARD16          input-context-ID
+     2     BITMASK16       flag
+           #0001           synchronous
+           #0002           XLookupChars
+           #0004           XLookupKeySym
+           #0006           XLookupBoth = XLookupChars | XLookupKeySym
+</literallayout>
+
+<para>
+If flag is XLookupKeySym, the arguments continue as follows:
+</para>
+
+<literallayout class="monospaced">
+     2                unused
+     4     KEYSYM     KeySym
+</literallayout>
+
+<para>
+If flag is XLookupChars, the arguments continue as follows
+</para>
+
+<literallayout class="monospaced">
+     2     m              byte length of committed string
+     m     LISTofBYTE     committed string
+     p                    unused, p = Pad(m)
+</literallayout>
+
+<para>
+If flag is XLookupBoth, the arguments continue as follows
+</para>
+
+<literallayout class="monospaced">
+     2                    unused
+     4     KEYSYM         KeySym
+     2     n              byte length of committed string
+     n     LISTofBYTE     committed string
+     p                    unused, p = Pad(2+n)
+</literallayout>
+
+<para>
+The IM Server which receives
+<function>XIM_COMMIT</function>
+message without synchronous bit should set synchronous bit.
+</para>
+
+</sect2>
+
+<sect2 id="Reset_IC">
+<title>Reset IC</title>
+<para>
+<function>XIM_RESET_IC</function>
+message requests to reset the status of IC in the IM Server.
+</para>
+
+<literallayout class="monospaced">
+XIM_RESET_IC (IM library -&gt; IM Server)
+     2     CARD16     input-method-ID
+     2     CARD16     input-context-ID
+</literallayout>
+
+
+<para>
+<function>XIM_RESET_IC</function>
+is a synchronous request. The IM library should wait until receiving either an
+<function>XIM_RESET_IC_REPLY</function> packet or an
+<function>XIM_ERROR</function> packet.
+</para>
+
+<literallayout class="monospaced">
+XIM_RESET_IC_REPLY (IM Server -&gt; IM library)
+
+     2     CARD16         input-method-ID
+     2     CARD16         input-context-ID
+     2     n              byte length of preedit string
+     n     LISTofBYTE     preedit string
+     p                    unused, p = Pad(2+n)
+</literallayout>
+
+<para>
+<function>XIM_RESET_IC_REPLY </function>
+message returns the input-context-ID to distinguish replies from multiple ICs.
+</para>
+
+</sect2>
+<sect2 id="Callbacks">
+<title>Callbacks</title>
+<para>
+If XIMStyle has XIMPreeditArea or XIMStatusArea set, XIMGeometryCallback
+may be used, and if XIMPreeditCallback and/or XIMStatusCallback are set,
+corresponding callbacks may be used.
+</para>
+
+<para>
+Any callback request may be sent from an IM Server to an IM client
+asynchronously in response to any request previously sent by the IM client
+to the IM Server.
+</para>
+
+<para>
+When an IM Server needs to send a callback request synchronously with
+the request previously sent by an IM client, the IM Server sends it
+before replying to the previous request.
+</para>
+
+<sect3 id="Negotiating_geometry">
+<title>Negotiating geometry</title>
+<para>
+The IM Server sends
+<function>XIM_GEOMETRY </function>
+message to start geometry negotiation, if XIMStyle has XIMPreeditArea or
+XIMStatusArea set.
+</para>
+
+
+<literallayout class="monospaced">
+XIM_GEOMETRY (IM Server -&gt; IM library)
+
+     2     CARD16     input-method-ID
+     2     CARD16     input-context-ID
+</literallayout>
+
+<para>
+There is always a single Focus Window, even if some input fields have only
+one IC.
+</para>
+
+</sect3>
+
+<sect3 id="Converting_a_string">
+<title>Converting a string</title>
+
+<literallayout class="monospaced">
+XIM_STR_CONVERSION (IM Server -&gt; IM library)
+
+     2     CARD16     input-method-ID
+     2     CARD16     input-context-ID
+     2     CARD16     XIMStringConversionPosition
+     2                unused
+     4     CARD32     XIMCaretDirection
+           #0         XIMForwardChar
+           #1         XIMBackwardChar
+           #2         XIMForwardWord
+           #3         XIMBackwardWord
+           #4         XIMCaretUp
+           #5         XIMCaretDown
+           #6         XIMNextLine
+           #7         XIMCPreviousLine
+           #8         XIMLineStart
+           #9         XIMLineEnd
+           #10        XIMAbsolutePosition
+           #11        XIMDontChange
+     2     CARD16     factor
+     2     CARD16     XIMStringConversionOperation
+           #0001      XIMStringConversionSubstitution
+           #0002      XIMStringConversionRetrieval
+     2     INT16      byte length to multiply the XIMStringConversionType
+</literallayout>
+
+<para>
+<function>XIM_STR_CONVERSION </function>
+message may be used to start the string conversion from the IM Server.
+</para>
+
+<literallayout class="monospaced">
+XIM_STR_CONVERSION_REPLY (IM library -&gt; IM Server)
+
+     2     CARD16             input-method-ID
+     2     CARD16             input-context-ID
+     4     CARD32             XIMStringConversionFeedback
+           XIMSTRCONVTEXT     XIMStringConversionText
+</literallayout>
+
+<para>
+<function>XIM_STR_CONVERSION_REPLY </function>
+message returns the string to be converted and the feedback information array.
+</para>
+</sect3>
+
+<sect3 id="Preedit_Callbacks">
+<title>Preedit Callbacks</title>
+
+<para>
+The IM Server sends
+<function>XIM_PREEDIT_START </function>
+message to call the XIMPreeditStartCallback function.
+</para>
+
+<literallayout class="monospaced">
+XIM_PREEDIT_START (IM Server -&gt; IM library)
+
+     2     CARD16     input-method-ID
+     2     CARD16     input-context-ID
+</literallayout>
+
+<para>
+The reply to this message must be sent synchronously. The reply forwards
+the return value from the callback function to the IM Server.
+</para>
+
+<literallayout class="monospaced">
+XIM_PREEDIT_START_REPLY (IM library -&gt; IM Server)
+
+     2     CARD16     input-method-ID
+     2     CARD16     input-context-ID
+     4     INT32     return value
+</literallayout>
+
+<para>
+<function>XIM_PREEDIT_START_REPLY</function>
+message returns the input-context-ID to distinguish replies from multiple
+IC's.  The return value contains the return value of the function
+XIMPreeditStartCallback.
+</para>
+
+<para>
+The IM Server sends
+<function>XIM_PREEDIT_DRAW </function>
+message to call the XIMPreeditDrawCallback function.
+</para>
+
+<literallayout class="monospaced">
+XIM_PREEDIT_DRAW (IM Server -&gt; IM library)
+
+     2     CARD16                input-method-ID
+     2     CARD16                input-context-ID
+     4     INT32                 caret
+     4     INT32                 chg_first
+     4     INT32                 chg_length
+     4     BITMASK32             status
+           #x0000001             no string
+           #x0000002             no feedback
+     2     n                     length of preedit string
+     n     STRING8               preedit string
+     p                           unused, p = Pad(2+n)
+     2     m                     byte length of feedback array
+     2                           unused
+     m     LISTofXIMFEEDBACK     feedback array
+</literallayout>
+
+<para>
+The fields "caret", "chg_first" and "chg_length" correspond to the
+fields of XIMPreeditDrawCallbackStruct.
+When the "no string" bit of the status field is set, the text field of
+XIMPreeditDrawCallbackStruct is NULL.
+When the "no feedback" bit of the status field is set, the text feedback
+field of XIMPreeditDrawCallbackStruct is NULL.
+When the above bits are not set, "preedit string" contains the preedit
+string to be displayed, and the feedback array contains feedback information.
+</para>
+
+<para>
+The IM Server sends
+<function>XIM_PREEDIT_CARET</function>
+message to call the PreeditCaretCallback function.
+</para>
+
+<literallayout class="monospaced">
+XIM_PREEDIT_CARET (IM Server -&gt; IM library)
+
+     2     CARD16     input-method-ID
+     2     CARD16     input-context-ID
+     4     INT32      position
+     4     CARD32     direction
+           #0         XIMForwardChar
+           #1         XIMBackwardChar
+           #2         XIMForwardWord
+           #3         XIMBackwardWord
+           #4         XIMCaretUp
+           #5         XIMCaretDown
+           #6         XIMNextLine
+           #7         XIMCPreviousLine
+           #8         XIMLineStart
+           #9         XIMLineEnd
+           #10        XIMAbsolutePosition
+           #11        XIMDontChange
+     4     CARD32     style
+           #0         XIMInvisible
+           #1         XIMCPrimary
+           #2         XIMSecondary
+</literallayout>
+
+<para>
+Each entry corresponds to a field of XIMPreeditCaretCallbackStruct.
+Since this callback sets the caret position, its reply must be sent
+synchronously.
+</para>
+
+<literallayout class="monospaced">
+XIM_PREEDIT_CARET_REPLY (IM library -&gt; IM Server)
+
+     2     CARD16     input-method-ID
+     2     CARD16     input-context-ID
+     4     CARD32     position
+</literallayout>
+
+<para>
+The position is the value returned by the callback function after it
+has been called.
+</para>
+
+<para>
+The IM Server sends
+<function>XIM_PREEDIT_DONE </function>
+message to call the XIMPreeditDoneCallback function.
+</para>
+
+<literallayout class="monospaced">
+XIM_PREEDIT_DONE (IM Server -&gt; IM library)
+
+     2     CARD16     input-method-ID
+     2     CARD16     input-context-ID
+</literallayout>
+
+</sect3>
+
+<sect3 id="Preedit_state_notify">
+<title>Preedit state notify</title>
+
+<literallayout class="monospaced">
+XIM_PREEDITSTATE (IM Server -&gt; IM Library)
+     2     CARD16        input-method-ID
+     2     CARD16        input-context-ID
+     4     BITMASK32     XIMPreeditState
+           #x0000000     XIMPreeditUnknown
+           #x0000001     XIMPreeditEnable
+           #x0000002     XIMPreeditDisable
+</literallayout>
+
+<para>
+<function>XIM_PREEDITSTATE</function>
+message is used to call the XIMPreeditStateNotifyCallback function.
+</para>
+
+</sect3>
+
+<sect3 id="Status_Callbacks">
+<title>Status Callbacks</title>
+
+<para>
+The IM Server sends
+<function>XIM_STATUS_START </function>
+message to call the XIMStatusStartCallback function.
+</para>
+
+<literallayout class="monospaced">
+XIM_STATUS_START (IM Server -&gt; IM library)
+
+     2     CARD16     input-method-ID
+     2     CARD16     input-context-ID
+</literallayout>
+
+<para>
+The IM Server sends
+<function>XIM_STATUS_DRAW </function>
+message to call the XIMStatusDrawCallback function.
+</para>
+
+<literallayout class="monospaced">
+XIM_STATUS_DRAW (IM Server -&gt; IM library)
+
+     2     CARD16     input-method-ID
+     2     CARD16     input-context-ID
+     4     CARD32     type
+           #0         XIMTextType
+           #1         XIMBitmapType
+</literallayout>
+
+<para>
+If type is XIMTextType, the arguments continue as follows.
+</para>
+
+<literallayout class="monospaced">
+     4     BITMASK32            status
+           #x0000001            no string
+           #x0000002            no feedback
+     2     n                    length of status string
+     n     STRING8              status string
+     p                          unused, p = Pad(2+n)
+     2     m                    byte length of feedback array
+     2                          unused
+     m     LISTofXIMFEEDBACK    feedback array
+</literallayout>
+
+<para>
+If type is XIMBitmapType, the arguments continue as follows.
+</para>
+
+<literallayout class="monospaced">
+     4     PIXMAP     pixmap data
+</literallayout>
+
+<para>
+The field "type" corresponds to the field in XIMStatusDrawCallbackStruct.
+</para>
+
+<para>
+The IM Server sends
+<function>XIM_STATUS_DONE </function>
+message to call the XIMStatusDoneCallback function.
+</para>
+
+<literallayout class="monospaced">
+XIM_STATUS_DONE (IM Server -&gt; IM library)
+
+     2     CARD16     input-method-ID
+     2     CARD16     input-context-ID
+</literallayout>
+
+</sect3>
+</sect2>
+</sect1>
+
+<sect1 id="Acknowledgements">
+<title>Acknowledgements</title>
+<para>
+This document represents the culmination of several years of debate and
+experiments done under the auspices of the MIT X Consortium i18n working
+group.  Although this was a group effort, the author remains responsible
+for any errors or omissions.
+</para>
+
+<para>
+We would like to thank to all members of this group.
+And we would like to make special thanks to the following people
+(in alphabetical order) for their participation in the IM Protocol
+design,
+Hector Chan, Takashi Fujiwara, Yoshio Horiuchi, Makoto Inada,
+Hiromu Inukai, Mickael Kung, Seiji Kuwari, Franky Ling, Hiroyuki Machida,
+Hiroyuki Miyamoto, Frank Rojas, Bob Scheifler, Makiko Shimamura,
+Shoji Sugiyama, Hidetoshi Tajima, Masaki Takeuchi, Makoto Wakamatsu,
+Masaki Wakao, Nobuyuki Tanaka, Shigeru Yamada, Katsuhisa Yano, Jinsoo Yoon.
+</para>
+
+</sect1>
+
+<bibliography>
+<title>References</title>
+<biblioentry>
+  <title>X Window System Protocol Version 11</title>
+  <author><firstname>Robert W.</firstname><surname>Scheifler</surname></author>
+</biblioentry>
+
+<biblioentry>
+  <title>Xlib - C Language X Interface"</title>
+  <author><firstname>Robert W.</firstname><surname>Scheifler</surname></author>
+</biblioentry>
+</bibliography>
+
+<appendix id="common_extensions">
+<title>Common Extensions</title>
+<para>
+Extension opcodes and packet names (e.g.
+<function>XIM_EXT_SET_EVENT_MASK</function>
+) for additional extensions may be registered with X Consortium.
+The following is a commonly well-known extended packet.
+</para>
+
+<para>
+(1) Extension to manipulate the event handling\fP
+</para>
+
+<para>
+<!-- .LP -->
+<function>XIM_EXT_SET_EVENT_MASK </function>
+message specifies the set of event masks that the IM library should manipulate.
+</para>
+
+<literallayout class="monospaced">
+XIM_EXT_SET_EVENT_MASK (IM Server -&gt; IM library)
+
+     2     CARD16        input-method-ID
+     2     CARD16        input-context-ID
+     4     EVENTMASK     filter-event-mask (*1)
+     4     EVENTMASK     intercept-event-mask (*2)
+     4     EVENTMASK     select-event-mask (*3)
+     4     EVENTMASK     forward-event-mask (*4)
+     4     EVENTMASK     synchronous-event-mask (*5)
+
+     (*1) Specify the events to be neglected by the IM library via XFilterEvent.
+     (*2) Specify the events to be deselected by the IM library with XSelectInput.
+     (*3) Specify the events to be selected by the IM library with XSelectInput.
+     (*4) Specify all the events to be forwarded to the IM Server by the IM library.
+     (*5) Specify the events to be forwarded with synchronous flag on by the IM library.
+</literallayout>
+
+<para>
+<!-- .LP -->
+The IM library must reply
+<function>XIM_SYNC_REPLY</function>
+message to the IM Server. This request is valid after the ic is created.
+</para>
+
+<para>
+(2) Extension for improvement of performance.
+</para>
+<para>
+The following requests may be used for improvement of performance.
+</para>
+
+<para>
+<function>XIM_EXT_FORWARD_KEYEVENT</function>
+message may be used instead of
+<function>XIM_FORWARD_EVENT</function>
+message.
+</para>
+
+<literallayout class="monospaced">
+XIM_EXT_FORWARD_KEYEVENT (IM Server &lt;--&gt; IM library)
+     2     CARD16     input-method-ID
+     2     CARD16     input-context-ID
+     2     BITMASK16     flag
+          #0001     synchronous
+     2     CARD16     sequence number
+     1     BYTE     xEvent.u.u.type
+     1     BYTE     keycode
+     2     CARD16     state
+     4     CARD32     time
+     4     CARD32     window
+</literallayout>
+
+<para>
+<function>XIM_EXT_MOVE</function>
+message may be used to change the spot location instead of
+<function></function>
+XIM_SET_IC_VALUES
+message.
+It is effective only if the client specified XIMPreeditPosition.
+</para>
+
+
+<literallayout class="monospaced">
+XIM_EXT_MOVE (IM library -&gt; IM Server)
+
+     2     CARD16     input-method-ID
+     2     CARD16     input-context-ID
+     2     INT16     X
+     2     INT16     Y
+</literallayout>
+
+<para>
+<function>XIM_EXT_MOVE</function>
+message is a asynchronous request.
+</para>
+
+</appendix>
+<appendix id="transport_list">
+<title>Transport List</title>
+
+<para>
+The list of transport specific IM Server address format registered
+</para>
+
+<para>
+The following format represents the ATOM contained in
+<function>XIM_SERVERS</function>
+property and the string returned from the request converting
+selection target LOCALES and TRANSPORT.
+</para>
+<literallayout class="monospaced">
+     "{<emphasis remap='I'>category</emphasis>=[<emphasis remap='I'>value</emphasis>,...]}..."
+</literallayout>
+<para>
+The following categories are currently registered.
+</para>
+
+<literallayout class="monospaced">
+<function>server</function>;: IM Server name (used for XIM_SERVERS)
+<function>locale</function>;: XPG4 locale name (LOCALES)
+<function>transport</function>;: transport-specific name (TRANSPORT)
+</literallayout>
+
+<para>
+The preregistered formats for transport-specific names are as follows:
+</para>
+
+<para>
+<function>TCP/IP Names</function>
+</para>
+
+<para>
+The following syntax should be used for system internal domain names:
+</para>
+<literallayout class="monospaced">
+&lt;<emphasis remap='I'>local name</emphasis>&gt;  ::= "local/"&lt;<emphasis remap='I'>hostname</emphasis>&gt;":"&lt;<emphasis remap='I'>pathname</emphasis>&gt;
+</literallayout>
+<para>
+Where &lt;<emphasis remap='I'>pathname</emphasis>&gt; is a path name of socket address.
+</para>
+
+<para>
+IM Server's name should be set to &lt;<emphasis remap='I'>pathname</emphasis>&gt; to run multiple IM Server
+at the same time
+</para>
+
+<para>
+The following syntax should be used for Internet domain names:
+</para>
+<literallayout class="monospaced">
+&lt;<emphasis remap='I'>TCP name</emphasis>&gt;  ::=  "tcp/"&lt;<emphasis remap='I'>hostname</emphasis>&gt;":"&lt;<emphasis remap='I'>ipportnumber</emphasis>&gt;
+</literallayout>
+<para>
+where &lt;<emphasis remap='I'>hostname</emphasis>&gt; is either symbolic (such as expo.lcs.mit.edu) or
+numeric decimal (such as 18.30.0.212).  The &lt;<emphasis remap='I'>ipportnumber</emphasis>&gt; is the
+port on which the IM Server is listening for connections.
+For example:
+</para>
+<literallayout class="monospaced">
+tcp/expo.lcs.mit.edu:8012
+tcp/18.30.0.212:7890
+</literallayout>
+
+<para>
+<function>DECnet Names</function>
+</para>
+
+<para>
+The following syntax should be used for DECnet names:
+</para>
+<literallayout class="monospaced">
+&lt;<emphasis remap='I'>DECnet name</emphasis>&gt;  ::=  "decnet/"&lt;<emphasis remap='I'>nodename</emphasis>&gt;"::IMSERVER$"&lt;<emphasis remap='I'>objname</emphasis>&gt;
+</literallayout>
+<para>
+where &lt;<emphasis remap='I'>nodename</emphasis>&gt; is either
+symbolic (such as SRVNOD) or the numeric
+decimal form of the DECnet address (such as 44.70).
+The &lt;<emphasis remap='I'>objname</emphasis>&gt;
+is normal, case-insensitive DECnet object name. For example:
+</para>
+
+<literallayout class="monospaced">
+DECNET/SRVNOD::IMSERVER$DEFAULT
+decnet/44.70::IMSERVER$other
+</literallayout>
+
+<para>
+<function>X Names</function>
+</para>
+
+<para>
+The following syntax should be used for X names:
+</para>
+<literallayout class="monospaced">
+&lt;<emphasis remap='I'>X name</emphasis>&gt;  ::=  "X/"
+</literallayout>
+
+<para>
+If a given category has multiple values, the value is evaluated in order of
+setting.
+</para>
+
+</appendix>
+<appendix id="protocol_number">
+<title>Protocol Number</title>
+
+<para>
+<function>Major Protocol number</function>
+</para>
+
+<literallayout class="monospaced">
+XIM_CONNECT                                  #001
+XIM_CONNECT_REPLY                            #002
+XIM_DISCONNECT                               #003
+XIM_DISCONNECT_REPLY                         #004
+
+XIM_AUTH_REQUIRED                            #010
+XIM_AUTH_REPLY                               #011
+XIM_AUTH_NEXT                                #012
+XIM_AUTH_SETUP                               #013
+XIM_AUTH_NG                                  #014
+
+XIM_ERROR                                    #020
+
+XIM_OPEN                                     #030
+XIM_OPEN_REPLY                               #031
+XIM_CLOSE                                    #032
+XIM_CLOSE_REPLY                              #033
+XIM_REGISTER_TRIGGERKEYS                     #034
+XIM_TRIGGER_NOTIFY                           #035
+XIM_TRIGGER_NOTIFY_REPLY                     #036
+XIM_SET_EVENT_MASK                           #037
+XIM_ENCODING_NEGOTIATION                     #038
+XIM_ENCODING_NEGOTIATION_REPLY               #039
+XIM_QUERY_EXTENSION                          #040
+XIM_QUERY_EXTENSION_REPLY                    #041
+XIM_SET_IM_VALUES                            #042
+XIM_SET_IM_VALUES_REPLY                      #043
+XIM_GET_IM_VALUES                            #044
+XIM_GET_IM_VALUES_REPLY                      #045
+
+XIM_CREATE_IC                                #050
+XIM_CREATE_IC_REPLY                          #051
+XIM_DESTROY_IC                               #052
+XIM_DESTROY_IC_REPLY                         #053
+XIM_SET_IC_VALUES                            #054
+XIM_SET_IC_VALUES_REPLY                      #055
+XIM_GET_IC_VALUES                            #056
+XIM_GET_IC_VALUES_REPLY                      #057
+XIM_SET_IC_FOCUS                             #058
+XIM_UNSET_IC_FOCUS                           #059
+XIM_FORWARD_EVENT                            #060
+XIM_SYNC                                     #061
+XIM_SYNC_REPLY                               #062
+XIM_COMMIT                                   #063
+XIM_RESET_IC                                 #064
+XIM_RESET_IC_REPLY                           #065
+
+XIM_GEOMETRY                                 #070
+XIM_STR_CONVERSION                           #071
+XIM_STR_CONVERSION_REPLY                     #072
+XIM_PREEDIT_START                            #073
+XIM_PREEDIT_START_REPLY                      #074
+XIM_PREEDIT_DRAW                             #075
+XIM_PREEDIT_CARET                            #076
+XIM_PREEDIT_CARET_REPLY                      #077
+XIM_PREEDIT_DONE                             #078
+XIM_STATUS_START                             #079
+XIM_STATUS_DRAW                              #080
+XIM_STATUS_DONE                              #081
+XIM_PREEDITSTATE                             #082
+
+(*) The IM Server's extension protocol number should be more than #128.
+</literallayout>
+</appendix>
+
+<appendix id="implementation_tips">
+
+<title>Implementation Tips</title>
+<para>
+(1) FrontEnd Method
+</para>
+
+<para>
+FrontEnd method is recognized as a performance acceleration by the
+trade off of the variety of the reliability.
+</para>
+
+<para>
+In order to use the FrontEnd method, the IM library must query the IM
+Server to see if the FrontEnd extension is available.  The query is
+made by using the
+<function>XIM_QUERY_EXTENSION</function>
+message. The IM Server may send
+<function>XIM_EXT_SET_EVENT_MASK</function>
+message with intercept-event-mask, forward-event-mask, and
+synchronous-event-mask values set after replying
+<function>XIM_QUERY_EXTENSION_REPLY</function>
+message.
+</para>
+
+<para>
+FrontEnd method can be implemented in a couple of ways depending on
+how the IM Server utilize
+<function>XIM_EXT_SET_EVENT_MASK</function>
+message.
+</para>
+
+<para>
+One approach is to update both of the input mask and the filter-event-mask
+depending on the preeidting state. The sample protocol sequence using the
+static event flow is as follows:
+</para>
+
+<mediaobject  id="staticflow">
+  <imageobject>
+    <imagedata  scale="75" format="SVG"  fileref="staticflow.svg"/>
+  </imageobject>
+  <caption>The flow of events</caption>
+</mediaobject>
+
+<para>
+To pursuit a maximum performance regardless of the preediting mode,
+the IM Server may use the dynamic event flow with the following
+sample protocol sequence.
+</para>
+
+<mediaobject  id="dynamicflow">
+  <imageobject>
+    <imagedata  scale="75" format="SVG"  fileref="dynamicflow.svg"/>
+  </imageobject>
+  <caption>The flow of events</caption>
+</mediaobject>
+
+<para>
+This method can reduce the XIM protocol traffic dramatically
+by updating intercept-event-mask and select-event-mask accordingly.
+The tradeoff of this performance improvement is that the key
+events may be lost or disordered in some particular situation, such as
+when the user types the keyboard in following sequence really fast:
+</para>
+
+<para>
+&lt;preediting on key&gt;"some strings"&lt;preediting off
+key&gt;"another string"
+</para>
+
+<para>
+Since this method requires the input mask updates to the both the IM Server
+and Xlib when turning on and off the preediting, and there is a time lag
+till the requests take effect when two client issues the input mask updates
+simultaneously.
+</para>
+
+<para>
+Another approach of the FrontEnd method is to update the filter-event-mask
+depending on the preediting state and not to update the input mask.
+The IM Server must register both of the preediting on key list and off key
+list by
+<function>XIM_REGISTER_TRIGGERKEYS</function>
+message.
+In this method, Both the IM Server and the IM client select the same
+events on the same client's window, so that the events are delivered
+to both of the IM Server and the client. The preediting on and off
+states are expressed by whether the key events are filtered or not.
+The sample protocol sequence are as follows:
+</para>
+
+<para>
+&lt;&lt;Using static event flow&gt;&gt;
+</para>
+
+<mediaobject  id="staticflowsampleseq">
+  <imageobject>
+    <imagedata  scale="75" format="SVG"  fileref="staticflowsampleseq.svg"/>
+  </imageobject>
+  <caption>The flow of events</caption>
+</mediaobject>
+
+<para>
+&lt;&lt;Using the dynamic event flow&gt;&gt;
+</para>
+
+<mediaobject  id="dynamicflowsampleseq">
+  <imageobject>
+    <imagedata  scale="75" format="SVG"  fileref="dynamicflowsampleseq.svg"/>
+  </imageobject>
+  <caption>The flow of events</caption>
+</mediaobject>
+
+<para>
+This method does not have the problem of the time lag when going across
+the preediting on and off mode, however, the amount of the performance
+acceleration is not as good as the method described above.
+</para>
+
+<para>
+In general, the FrontEnd method requires some synchronization to some
+of the X protocols, such as the ChangeWindowAttribute protocol for the
+event mask change or the GrabKey protocol, since it relies on the X's
+principal event dispatching mechanism. Any X protocol bindings do not
+consider the synchronization might cause some mis-synchronization
+between the IM clients and the IM Server.
+</para>
+
+<para>
+(2) Transport Layer
+</para>
+
+<para>
+The Xlib XIM implementation is layered into three functions, a protocol
+layer, an interface layer and a transport layer. The purpose of this
+layering is to make the protocol independent of transport implementation.
+Each function of these layers are:
+</para>
+
+<variablelist>
+  <varlistentry>
+    <term>The protocol layer</term>
+    <listitem>
+      <para>
+implements overall function of XIM and calls the interface layer
+functions when it needs to communicate to IM Server.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>The interface layer</term>
+    <listitem>
+      <para>
+separates the implementation of the transport layer from the protocol
+layer, in other words, it provides implementation independent hook for
+the transport layer functions.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>The transport layer</term>
+    <listitem>
+      <para>
+handles actual data communication with IM Server. It is done by a set
+of several functions named transporters.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The interface layer and the transport layer make various communication
+channels usable such as X Protocol, TCP/IP, DECnet or STREAM.
+The following is a sample implementation for the transporter using
+the X connection.
+Refer to "xtrans" for the transporter using Socket Transport. <!-- xref ?-->
+</para>
+
+<para>
+At the beginning of the X Transport connection for the XIM transport
+mechanism, two different windows must be created either in an Xlib XIM
+or in an IM Server, with which the Xlib and the IM Server exchange the
+XIM transports by using the ClientMessage events and Window Properties.
+In the following, the window created by the Xlib is referred as the
+"client communication window", and on the other hand, the window created
+by the IM Server is referred as the "IMS communication window".
+</para>
+
+<para>
+Connection
+</para>
+
+<para>
+In order to establish a connection, a communication window is created.
+A ClientMessage in the following event's format is sent to the owner
+window of XIM_SERVER selection, which the IM Server has created.
+</para>
+
+<para>
+Refer to "The Input Method Protocol" for the XIM_SERVER atom. <!-- xref -->
+</para>
+
+<table frame="topbot" id="clientmessage_sent_to_the_ims_window">
+  <?dbfo keep-together="always" ?>
+  <title>The ClientMessage sent to the IMS window.</title>
+  <tgroup cols="3" align='left' colsep='0' rowsep='0'>
+  <colspec colname="col1" colwidth="1.0*"/>
+  <colspec colname="col2" colwidth="1.0*" colsep="1"/>
+  <colspec colname="col3" colwidth="3.5*"/>
+  <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="center"/>
+  <thead>
+    <row rowsep='1'>
+      <entry spanname="span-horiz" colsep='1'>Structure Member</entry>
+      <entry>Contents</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>int</entry>
+      <entry>type</entry>
+      <entry>ClientMessage</entry>
+    </row>
+    <row>
+      <entry>u_long</entry>
+      <entry>serial</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Bool</entry>
+      <entry>send_event</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Display</entry>
+      <entry>*display</entry>
+      <entry>The display to which connects</entry>
+    </row>
+    <row>
+      <entry>Window</entry>
+      <entry>window</entry>
+      <entry>IMS Window ID</entry>
+    </row>
+    <row>
+      <entry>Atom</entry>
+      <entry>message_type</entry>
+      <entry>XInternAtom(display, "_XIM_XCONNECT", False)</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>format</entry>
+      <entry>32</entry>
+    </row>
+    <row>
+      <entry>long</entry>
+      <entry>data.l[0]</entry>
+      <entry>client communication window ID</entry>
+    </row>
+    <row>
+      <entry>long</entry>
+      <entry>data.l[1]</entry>
+      <entry>client-major-transport-version (*1)</entry>
+    </row>
+    <row>
+      <entry>long</entry>
+      <entry>data.l[2]</entry>
+      <entry>client-major-transport-version (*1)</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+
+<para>
+In order to establish the connection (to notify the IM Server communication
+window), the IM Server sends a ClientMessage in the following event's
+format to the client communication window.
+</para>
+
+<table frame="topbot" id="clientmessage_sent_by_the_im_server">
+  <?dbfo keep-together="always" ?>
+  <title>The ClientMessage sent by the IM Server.</title>
+  <tgroup cols="3" align='left' colsep='0' rowsep='0'>
+  <colspec colname="col1" colwidth="1.0*"/>
+  <colspec colname="col2" colwidth="1.0*" colsep="1"/>
+  <colspec colname="col3" colwidth="3.5*"/>
+  <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="center"/>
+  <thead>
+    <row rowsep='1'>
+      <entry spanname="span-horiz" colsep='1'>Structure Member</entry>
+      <entry>Contents</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>int</entry>
+      <entry>type</entry>
+      <entry>ClientMessage</entry>
+    </row>
+    <row>
+      <entry>u_long</entry>
+      <entry>serial</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Bool</entry>
+      <entry>send_event</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Display</entry>
+      <entry>*display</entry>
+      <entry>The display to which connects</entry>
+    </row>
+    <row>
+      <entry>Window</entry>
+      <entry>window</entry>
+      <entry>client communication window ID</entry>
+    </row>
+    <row>
+      <entry>Atom</entry>
+      <entry>message_type</entry>
+      <entry>XInternAtom(display, "_XIM_XCONNECT", False)</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>format</entry>
+      <entry>32</entry>
+    </row>
+    <row>
+      <entry>long</entry>
+      <entry>data.l[0]</entry>
+      <entry>IMS communication window ID</entry>
+    </row>
+    <row>
+      <entry>long</entry>
+      <entry>data.l[1]</entry>
+      <entry>server-major-transport-version (*1)</entry>
+    </row>
+    <row>
+      <entry>long</entry>
+      <entry>data.l[2]</entry>
+      <entry>server-minor-transport-version (*1)</entry>
+    </row>
+    <row>
+      <entry>long</entry>
+      <entry>data.l[3]</entry>
+      <entry>dividing size between ClientMessage and Property (*2)</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+
+<para>
+(*1) major/minor-transport-version
+</para>
+<para>
+The read/write method is decided by the combination of
+major/minor-transport-version, as follows:
+</para>
+
+
+<table frame="all" id="readwrite_method_and_the_majorminor_transport_version">
+  <?dbfo keep-together="always" ?>
+  <title>The read/write method and the major/minor-transport-version</title>
+  <tgroup cols="3" align='left' colsep='1' rowsep='1'>
+  <colspec colname="col1" colwidth="1.0*"/>
+  <colspec colname="col2" colwidth="1.0*"/>
+  <colspec colname="col3" colwidth="3.0*"/>
+  <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="center"/>
+  <thead>
+    <row>
+      <entry spanname="span-horiz" colsep='1'>Transport-version</entry>
+      <entry>read/write</entry>
+    </row>
+    <row>
+      <entry>major</entry>
+      <entry>minor</entry>
+      <entry></entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry morerows="2">0</entry>
+      <entry>0</entry>
+      <entry>only-CM &amp; Property-with-CM</entry>
+    </row>
+    <row>
+      <entry>1</entry>
+      <entry>only-CM &amp; multi-CM</entry>
+    </row>
+    <row rowsep="1">
+      <entry>2</entry>
+      <entry>only-CM &amp; multi-CM &amp; Property-with-CM</entry>
+    </row>
+    <row rowsep="1">
+      <entry>1</entry>
+      <entry>0</entry>
+      <entry>PropertyNotify</entry>
+    </row>
+    <row>
+      <entry morerows="1">2</entry>
+      <entry>0</entry>
+      <entry>only-CM &amp; PropertyNotify</entry>
+    </row>
+    <row>
+      <entry>1</entry>
+      <entry>only-CM &amp; multi-CM &amp; PropertyNotify</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+
+<literallayout class="monospaced">
+only-CM            :    data is sent via a ClientMessage
+multi-CM           :    data is sent via multiple ClientMessages
+Property-with-CM   :    data is written in Property, and its Atom
+                        is send via ClientMessage
+PropertyNotify     :    data is written in Property, and its Atom
+                        is send via PropertyNotify
+
+</literallayout>
+
+<para>
+The method to decide major/minor-transport-version is as follows:
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+The client sends 0 as major/minor-transport-version to the IM Server.
+The client must support all methods in Table D-3.
+The client may send another number as major/minor-transport-version to
+use other method than the above in the future.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The IM Server sends its major/minor-transport-version number to
+the client. The client sends data using the method specified by the
+IM Server.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If major/minor-transport-version number is not available, it is regarded
+as 0.
+<!-- .RE -->
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+(*2) dividing size between ClientMessage and Property
+</para>
+
+<para>
+If data is sent via both of multi-CM and Property, specify the dividing
+size between ClientMessage and Property. The data, which is smaller than
+this size, is sent via multi-CM (or only-CM), and the data, which is
+lager than this size, is sent via Property.
+</para>
+
+<para>
+<emphasis role="bold">read/write</emphasis>
+</para>
+
+<para>
+The data is transferred via either ClientMessage or Window Property in
+the X Window System.
+</para>
+
+<para>
+Format for the data from the Client to the IM Server
+</para>
+
+<para>
+ClientMessage
+</para>
+
+<para>
+If data is sent via ClientMessage event, the format is as follows:
+</para>
+
+
+<table frame="topbot" id="clientmessage_events_format_first_or_middle">
+  <?dbfo keep-together="always" ?>
+<title>The ClientMessage event's format (first or middle)</title>
+  <tgroup cols="3" align='left' colsep='0' rowsep='0'>
+  <colspec colname="col1" colwidth="1.0*"/>
+  <colspec colname="col2" colwidth="1.0*" colsep="1"/>
+  <colspec colname="col3" colwidth="3.5*"/>
+  <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="center"/>
+  <thead>
+    <row rowsep='1'>
+      <entry spanname="span-horiz" colsep='1'>Structure Member</entry>
+      <entry>Contents</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>int</entry>
+      <entry>type</entry>
+      <entry>ClientMessage</entry>
+    </row>
+    <row>
+      <entry>u_long</entry>
+      <entry>serial</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Bool</entry>
+      <entry>send_event</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Display</entry>
+      <entry>*display</entry>
+      <entry>The display to which connects</entry>
+    </row>
+    <row>
+      <entry>Window</entry>
+      <entry>window</entry>
+      <entry>IMS communication window ID</entry>
+    </row>
+    <row>
+      <entry>Atom</entry>
+      <entry>message_type</entry>
+      <entry>XInternAtom(display, "_XIM_MOREDATA", False)</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>format</entry>
+      <entry>8</entry>
+    </row>
+    <row>
+      <entry>char</entry>
+      <entry>data.b[20]</entry>
+      <entry>(read/write DATA : 20 byte)</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+
+<table frame="topbot" id="clientmessage_events_format_only_or_last">
+  <?dbfo keep-together="always" ?>
+<title>The ClientMessage event's format (only or last)</title>
+  <tgroup cols="3" align='left' colsep='0' rowsep='0'>
+  <colspec colname="col1" colwidth="1.0*"/>
+  <colspec colname="col2" colwidth="1.0*" colsep="1"/>
+  <colspec colname="col3" colwidth="3.5*"/>
+  <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="center"/>
+  <thead>
+    <row rowsep='1'>
+      <entry spanname="span-horiz" colsep='1'>Structure Member</entry>
+      <entry>Contents</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>int</entry>
+      <entry>type</entry>
+      <entry>ClientMessage</entry>
+    </row>
+    <row>
+      <entry>u_long</entry>
+      <entry>serial</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Bool</entry>
+      <entry>send_event</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Display</entry>
+      <entry>*display</entry>
+      <entry>The display to which connects</entry>
+    </row>
+    <row>
+      <entry>Window</entry>
+      <entry>window</entry>
+      <entry>IMS communication window ID</entry>
+    </row>
+    <row>
+      <entry>Atom</entry>
+      <entry>message_type</entry>
+      <entry>XInternAtom(display, "_XIM_PROTOCOL", False)</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>format</entry>
+      <entry>8</entry>
+    </row>
+    <row>
+      <entry>char</entry>
+      <entry>data.b[20]</entry>
+      <entry>(read/write DATA : MAX 20 byte)  (*1)</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+
+<para>
+(*1) If the data is smaller than 20 byte, all data other than available data
+must be 0.
+</para>
+
+<para>
+Property
+</para>
+
+<para>
+In the case of large data, data will be sent via the Window Property
+for the efficiency.  There are the following two methods to notify
+Property, and transport-version is decided which method is used.
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+The XChangeProperty function is used to store data in the client
+communication window, and Atom of the stored data is notified to the
+IM Server via ClientMessage event.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The XChangeProperty function is used to store data in the client
+communication window, and Atom of the stored data is notified to the
+IM Server via PropertyNotify event.
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+The arguments of the XChangeProperty are as follows:
+</para>
+
+<table frame="topbot" id="xchangeproperty_events_format">
+  <?dbfo keep-together="always" ?>
+<title>The XChangeProperty event's format</title>
+  <tgroup cols="3" align='left' colsep='0' rowsep='0'>
+  <colspec colname="col1" colwidth="1.0*"/>
+  <colspec colname="col2" colwidth="1.0*" colsep="1"/>
+  <colspec colname="col3" colwidth="3.5*"/>
+  <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="center"/>
+  <thead>
+    <row rowsep='1'>
+      <entry spanname="span-horiz" colsep='1'>Argument</entry>
+      <entry>Contents</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>Display</entry>
+      <entry>*display</entry>
+      <entry>The display to which connects</entry>
+    </row>
+    <row>
+      <entry>Window</entry>
+      <entry>window</entry>
+      <entry>IMS communication window ID</entry>
+    </row>
+    <row>
+      <entry>Atom</entry>
+      <entry>property</entry>
+      <entry>read/write property Atom (*1)</entry>
+    </row>
+    <row>
+      <entry>Atom</entry>
+      <entry>type</entry>
+      <entry>XA_STRING  </entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>format</entry>
+      <entry>8</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>mode</entry>
+      <entry>PropModeAppend</entry>
+    </row>
+    <row>
+      <entry>u_char</entry>
+      <entry>*data</entry>
+      <entry>read/write DATA</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>nelements</entry>
+      <entry>length of DATA</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+
+<para>
+The read/write property ATOM allocates the following strings by
+<function>XInternAtom</function>.
+</para>
+
+<para>
+"_clientXXX"
+</para>
+
+<para>
+The client changes the property with the mode of PropModeAppend and
+the IM Server will read it with the delete mode i.e. (delete = True).
+</para>
+
+<para>
+If Atom is notified via ClientMessage event, the format of the ClientMessage
+is as follows:
+</para>
+
+<table frame="topbot" id="clientmessage_events_format_to_send_atom_of_property">
+  <?dbfo keep-together="always" ?>
+<title>The ClientMessage event's format to send Atom of property</title>
+  <tgroup cols="3" align='left' colsep='0' rowsep='0'>
+  <colspec colname="col1" colwidth="1.0*"/>
+  <colspec colname="col2" colwidth="1.0*" colsep="1"/>
+  <colspec colname="col3" colwidth="3.5*"/>
+  <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="center"/>
+  <thead>
+    <row rowsep='1'>
+      <entry spanname="span-horiz" colsep='1'>Structure Members</entry>
+      <entry>Contents</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>int</entry>
+      <entry>type</entry>
+      <entry>ClientMessage</entry>
+    </row>
+    <row>
+      <entry>u_long</entry>
+      <entry>serial</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Bool</entry>
+      <entry>send_event</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Display</entry>
+      <entry>*display</entry>
+      <entry>The display to which connects</entry>
+    </row>
+    <row>
+      <entry>Window</entry>
+      <entry>window</entry>
+      <entry>IMS communication window ID</entry>
+    </row>
+    <row>
+      <entry>Atom</entry>
+      <entry>message_type</entry>
+      <entry>XInternAtom(display, "_XIM_PROTOCOL", False)</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>format</entry>
+      <entry>32</entry>
+    </row>
+    <row>
+      <entry>long</entry>
+      <entry>data.l[0]</entry>
+      <entry>length of read/write property Atom</entry>
+    </row>
+    <row>
+      <entry>long</entry>
+      <entry>data.l[1]</entry>
+      <entry>read/write property Atom</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+
+<para>
+Format for the data from the IM Server to the Client
+</para>
+
+<para>
+<!-- .LP -->
+<!-- .RS -->
+<!-- .B -->
+ClientMessage
+</para>
+<para>
+<!-- .LP -->
+The format of the ClientMessage is as follows:
+</para>
+
+
+
+<table frame="topbot" id="clientmessage_events_format_for_first_or_middle">
+  <?dbfo keep-together="always" ?>
+<title>The ClientMessage event's format (first or middle)</title>
+  <tgroup cols="3" align='left' colsep='0' rowsep='0'>
+  <colspec colname="col1" colwidth="1.0*"/>
+  <colspec colname="col2" colwidth="1.0*" colsep="1"/>
+  <colspec colname="col3" colwidth="3.5*"/>
+  <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="center"/>
+  <thead>
+    <row rowsep='1'>
+      <entry spanname="span-horiz" colsep='1'>Structure Members</entry>
+      <entry>Contents</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>int</entry>
+      <entry>type</entry>
+      <entry>ClientMessage</entry>
+    </row>
+    <row>
+      <entry>u_long</entry>
+      <entry>serial</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Bool</entry>
+      <entry>send_event </entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Display</entry>
+      <entry>*display</entry>
+      <entry>The display to which connects</entry>
+    </row>
+    <row>
+      <entry>Window</entry>
+      <entry>window</entry>
+      <entry>client communication window ID</entry>
+    </row>
+    <row>
+      <entry>Atom</entry>
+      <entry>message_type</entry>
+      <entry>XInternAtom(display, "_XIM_MOREDATA", False)</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>format</entry>
+      <entry>8</entry>
+    </row>
+    <row>
+      <entry>char</entry>
+      <entry>data.b[20]</entry>
+      <entry>(read/write DATA : 20 byte)</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+
+
+<table frame="topbot" id="clientmessage_events_format_for_only_or_last">
+  <?dbfo keep-together="always" ?>
+<title>The ClientMessage event's format (only or last)</title>
+  <tgroup cols="3" align='left' colsep='0' rowsep='0'>
+  <colspec colname="col1" colwidth="1.0*"/>
+  <colspec colname="col2" colwidth="1.0*" colsep="1"/>
+  <colspec colname="col3" colwidth="3.5*"/>
+  <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="center"/>
+  <thead>
+    <row rowsep='1'>
+      <entry spanname="span-horiz" colsep='1'>Structure Members</entry>
+      <entry>Contents</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>int</entry>
+      <entry>type</entry>
+      <entry>ClientMessage</entry>
+    </row>
+    <row>
+      <entry>u_long</entry>
+      <entry>serial</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Bool</entry>
+      <entry>send_event </entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Display</entry>
+      <entry>*display</entry>
+      <entry>The display to which connects</entry>
+    </row>
+    <row>
+      <entry>Window</entry>
+      <entry>window</entry>
+      <entry>client communication window ID</entry>
+    </row>
+    <row>
+      <entry>Atom</entry>
+      <entry>message_type</entry>
+      <entry>XInternAtom(display, "_XIM_PROTOCOL", False)</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>format</entry>
+      <entry>8</entry>
+    </row>
+    <row>
+      <entry>char</entry>
+      <entry>data.b[20]</entry>
+      <entry>(read/write DATA : MAX 20 byte) (*1)</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+
+<para>
+(*1) If the data size is smaller than 20 bytes, all data other than available
+data must be 0.
+</para>
+
+<para>
+Property
+</para>
+
+<para>
+In the case of large data, data will be sent via the Window Property
+for the efficiency. There are the following two methods to notify
+Property, and transport-version is decided which method is used.
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+The XChangeProperty function is used to store data in the IMS
+communication window, and Atom of the property is sent via the
+ClientMessage event.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The XChangeProperty function is used to store data in the IMS
+communication window, and Atom of the property is sent via
+PropertyNotify event.
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+The arguments of the XChangeProperty are as follows:
+</para>
+
+<table frame="topbot" id="xchangeproperty_events_format_2">
+  <?dbfo keep-together="always" ?>
+<title>The XChangeProperty event's format</title>
+  <tgroup cols="3" align='left' colsep='0' rowsep='0'>
+  <colspec colname="col1" colwidth="1.0*"/>
+  <colspec colname="col2" colwidth="1.0*" colsep="1"/>
+  <colspec colname="col3" colwidth="3.5*"/>
+  <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="center"/>
+  <thead>
+    <row rowsep='1'>
+      <entry spanname="span-horiz" colsep='1'>Argument</entry>
+      <entry>Contents</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>Display</entry>
+      <entry>*display</entry>
+      <entry>The display which to connects</entry>
+    </row>
+    <row>
+      <entry>Window</entry>
+      <entry>window</entry>
+      <entry>client communication window ID</entry>
+    </row>
+    <row>
+      <entry>Atom</entry>
+      <entry>property</entry>
+      <entry>read/write property Atom (*1)</entry>
+    </row>
+    <row>
+      <entry>Atom</entry>
+      <entry>type</entry>
+      <entry>XA_STRING</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>format</entry>
+      <entry>8</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>mode</entry>
+      <entry>PropModeAppend</entry>
+    </row>
+    <row>
+      <entry>u_char</entry>
+      <entry>*data</entry>
+      <entry>read/write DATA</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>nelements</entry>
+      <entry>length of DATA</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+
+<para>
+(*1)  The read/write property ATOM allocates some strings, which are not
+allocated by the client, by <function>XInternAtom</function>.
+</para>
+
+<para>
+The IM Server changes the property with the mode of PropModeAppend and
+the client reads it with the delete mode, i.e. (delete = True).
+</para>
+
+<para>
+If Atom is notified via ClientMessage event, the format of the ClientMessage
+is as follows:
+</para>
+
+
+<table frame="topbot" id="clientmessage_events_format_to_send_atom_of_property_2">
+  <?dbfo keep-together="always" ?>
+<title>The ClientMessage event's format to send Atom of property</title>
+  <tgroup cols="3" align='left' colsep='0' rowsep='0'>
+  <colspec colname="col1" colwidth="1.0*"/>
+  <colspec colname="col2" colwidth="1.0*" colsep='1'/>
+  <colspec colname="col3" colwidth="3.5*"/>
+  <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="center"/>
+  <thead>
+    <row rowsep='1'>
+      <entry spanname="span-horiz" colsep='1'>Structure Member</entry>
+      <entry>Contents</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>int</entry>
+      <entry>type</entry>
+      <entry>ClientMessage  </entry>
+    </row>
+    <row>
+      <entry>u_long</entry>
+      <entry>serial</entry>
+      <entry>Set by the X Window System  </entry>
+    </row>
+    <row>
+      <entry>Bool</entry>
+      <entry>send_event</entry>
+      <entry>Set by the X Window System  </entry>
+    </row>
+    <row>
+      <entry>Display</entry>
+      <entry>*display</entry>
+      <entry>The display to which connects  </entry>
+    </row>
+    <row>
+      <entry>Window</entry>
+      <entry>window</entry>
+      <entry>client communication window ID  </entry>
+    </row>
+    <row>
+      <entry>Atom</entry>
+      <entry>message_type</entry>
+      <entry>XInternAtom(display, "_XIM_PROTOCOL", False)</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>format</entry>
+      <entry>32  </entry>
+    </row>
+    <row>
+      <entry>long</entry>
+      <entry>data.l[0]</entry>
+      <entry>length of read/write property ATOM  </entry>
+    </row>
+    <row>
+      <entry>long</entry>
+      <entry>data.l[1]</entry>
+      <entry>read/write property ATOM  </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+
+<para>
+Closing Connection
+</para>
+
+<para>
+If the client disconnect with the IM Server, shutdown function should
+free the communication window properties and etc..
+</para>
+</appendix>
+</article>
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/XIM
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/XIM	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/XIM	(revision 5)

Property changes on: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/XIM
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/XKB/ch09.xml
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/XKB/ch09.xml	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/XKB/ch09.xml	(revision 5)
@@ -0,0 +1,1145 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+	  "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+<chapter id='Bells'>
+<title>Bells</title>
+<indexterm zone="Bells"><primary>bell</primary></indexterm>
+
+<para>
+The core X protocol allows only applications to explicitly sound the system
+bell with a given duration, pitch, and volume. Xkb extends this capability by
+allowing clients to attach symbolic names to bells, disable audible bells, and
+receive an event whenever the keyboard bell is rung. For the purposes of this
+document, the
+<firstterm>audible</firstterm>
+<indexterm significance="preferred" zone="Bells">
+<primary>audible bell</primary></indexterm>
+<indexterm significance="preferred" zone="Bells">
+<primary>bell</primary><secondary>audible</secondary></indexterm>
+bell is defined to be the system bell, or the default keyboard bell, as
+opposed to any other audible sound generated elsewhere in the system.
+</para>
+
+
+<para>
+You can ask to receive
+<symbol>XkbBellNotify</symbol>
+events (see <link linkend="Detecting_Bells">section 9.4</link>) when any client rings any one of the following:
+</para>
+
+<itemizedlist>
+<listitem>
+  <para>
+The default bell
+  </para>
+</listitem>
+<listitem>
+  <para>
+Any bell on an input device that can be specified by a
+<structfield>bell_class</structfield>
+and
+<structfield>bell_id</structfield>
+pair
+  </para>
+</listitem>
+<listitem>
+  <para>
+Any bell specified only by an arbitrary name. (This is, from the server’s
+point of view, merely a name, and not connected with any physical
+sound-generating device. Some client application must generate the sound, or
+visual feedback, if any, that is associated with the name.)
+  </para>
+</listitem>
+</itemizedlist>
+
+<para>
+You can also ask to receive
+<symbol>XkbBellNotify</symbol>
+events when the server rings the default bell or if any client has requested
+events only (without the bell sounding) for any of the bell types previously
+listed.
+</para>
+
+<para>
+You can disable audible bells on a global basis (to set the
+<emphasis>AudibleBell</emphasis>
+control, see <xref linkend="Keyboard_Controls" />). For example, a client that replaces the keyboard
+bell with some other audible cue might want to turn off the
+<emphasis>AudibleBell</emphasis>
+control to prevent the server from also generating a sound and avoid
+cacophony. If you disable audible bells and request to receive
+<symbol>XkbBellNotify</symbol>
+events, you can generate feedback different from the default bell.
+</para>
+
+
+<para>
+You can, however, override the
+<emphasis>AudibleBell</emphasis>
+control by calling one of the functions that force the ringing of a bell in
+spite of the setting of the
+<emphasis>AudibleBell</emphasis>
+control —
+<function>XkbForceDeviceBell</function>
+or
+<function>XkbForceBell</function>
+(see <link linkend="Forcing_a_Server_Generated_Bell">section 9.3.3</link>). In this case the server does not generate a bell event.
+</para>
+
+
+<para>
+Just as some keyboards can produce keyclicks to indicate when a key is pressed
+or repeating, Xkb can provide feedback for the controls by using special beep
+codes. The
+<emphasis>AccessXFeedback</emphasis>
+control is used to configure the specific types of operations that generate
+feedback. See <link linkend="The_AccessXFeedback_Control">section 10.6.3</link> for a discussion on
+<emphasis>AccessXFeedback</emphasis>
+control.
+</para>
+
+<para>
+This chapter describes bell names, the functions used to generate named bells,
+and the events the server generates for bells.
+</para>
+
+<sect1 id='Bell_Names'>
+<title>Bell Names</title>
+
+<para>
+You can associate a name to an act of ringing a bell by converting the name to
+an Atom and then using this name when you call the functions listed in this
+chapter. If an event is generated as a result, the name is then passed to all
+other clients interested in receiving
+<symbol>XkbBellNotify</symbol>
+events. Note that these are arbitrary names and that there is no binding to
+any sounds. Any sounds or other effects (such as visual bells on the screen)
+must be generated by a client application upon receipt of the bell event
+containing the name. There is no default name for the default keyboard bell.
+The server does generate some predefined bells for the AccessX controls (see
+<link linkend="The_AccessXFeedback_Control">section 10.6.3</link>).
+These named bells are shown in <link linkend="table9.1">Table 9.1</link>;
+the name is included
+in any bell event sent to clients that have requested to receive
+<symbol>XkbBellNotify</symbol>
+events.
+</para>
+
+<table id='table9.1' frame='topbot'>
+<title>Predefined Bells</title>
+<?dbfo keep-together="always" ?>
+<tgroup cols='2' align='left' colsep='0' rowsep='0'>
+<colspec colname='c1' colwidth='1.0*'/>
+<colspec colname='c2' colwidth='1.0*'/>
+<thead>
+<row rowsep='1'>
+  <entry>Action</entry>
+  <entry>Named Bell</entry>
+</row>
+</thead>
+<tbody>
+<row>
+    <entry>Indicator turned on</entry>
+    <entry>AX_IndicatorOn</entry>
+</row>
+<row>
+    <entry>Indicator turned off</entry>
+    <entry>AX_IndicatorOff</entry>
+</row>
+<row>
+    <entry>More than one indicator changed state</entry>
+    <entry>AX_IndicatorChange</entry>
+</row>
+<row>
+    <entry>Control turned on</entry>
+    <entry>AX_FeatureOn</entry>
+</row>
+<row>
+    <entry>Control turned off</entry>
+    <entry>AX_FeatureOff</entry>
+</row>
+<row>
+    <entry>More than one control changed state</entry>
+    <entry>AX_FeatureChange</entry>
+</row>
+<row>
+    <entry>SlowKeys and BounceKeys about to be turned on or off</entry>
+    <entry>AX_SlowKeysWarning</entry>
+</row>
+<row>
+    <entry>SlowKeys key pressed</entry>
+    <entry>AX_SlowKeyPress</entry>
+</row>
+<row>
+    <entry>SlowKeys key accepted</entry>
+    <entry>AX_SlowKeyAccept</entry>
+</row>
+<row>
+    <entry>SlowKeys key rejected</entry>
+    <entry>AX_SlowKeyReject</entry>
+</row>
+<row>
+    <entry>Accepted SlowKeys key released</entry>
+    <entry>AX_SlowKeyRelease</entry>
+</row>
+<row>
+    <entry>BounceKeys key rejected</entry>
+    <entry>AX_BounceKeyReject</entry>
+</row>
+<row>
+    <entry>StickyKeys key latched</entry>
+    <entry>AX_StickyLatch</entry>
+</row>
+<row>
+    <entry>StickyKeys key locked</entry>
+    <entry>AX_StickyLock</entry>
+</row>
+<row>
+    <entry>StickyKeys key unlocked</entry>
+    <entry>AX_StickyUnlock</entry>
+  </row>
+</tbody>
+</tgroup>
+</table>
+
+</sect1>
+<sect1 id='Audible_Bells'>
+<title>Audible Bells</title>
+
+<para>
+Using Xkb you can generate bell events that do not necessarily ring the system
+bell. This is useful if you need to use an audio server instead of the system
+beep. For example, when an audio client starts, it could disable the audible
+bell (the system bell) and then listen for
+<symbol>XkbBellNotify</symbol>
+events (see <link linkend="Detecting_Bells">section 9.4</link>). When it receives a
+<symbol>XkbBellNotify</symbol>
+event, the audio client could then send a request to an audio server to play a
+sound.
+</para>
+
+
+<para>
+You can control the audible bells feature by passing the
+<symbol>XkbAudibleBellMask</symbol>
+to
+<function>XkbChangeEnabledControls</function>
+(see <link linkend="The_EnabledControls_Control">section 10.1.1</link>). If you set
+<symbol>XkbAudibleBellMask</symbol>
+on, the server rings the system bell when a bell event occurs. This is the
+default. If you set
+<symbol>XkbAudibleBellMask</symbol>
+off and a bell event occurs, the server does not ring the system bell unless
+you call
+<function>XkbForceDeviceBell</function>
+or
+<function>XkbForceBell</function>
+(see <link linkend="Forcing_a_Server_Generated_Bell">section 9.3.3</link>).
+</para>
+
+<para>
+Audible bells are also part of the per-client auto-reset controls. For more
+information on auto-reset controls, see <link linkend="The_AutoReset_Control">section 10.1.2</link>.
+</para>
+
+</sect1>
+<sect1 id='Bell_Functions'>
+<title>Bell Functions</title>
+
+<para>
+Use the functions described in this section to ring bells and to generate bell
+events.
+</para>
+
+<para>
+The input extension has two types of feedbacks that can generate bells — bell
+feedback and keyboard feedback. Some of the functions in this section have
+<structfield>bell_class</structfield>
+and
+<structfield>bell_id</structfield>
+parameters; set them as follows: Set
+<structfield>bell_class</structfield>
+to
+<symbol>BellFeedbackClass</symbol>
+or
+<symbol>KbdFeedbackClass</symbol>.
+A device can have more than one feedback of each type; set
+<structfield>bell_id</structfield>
+to the particular bell feedback of
+<structfield>bell_class</structfield>
+type.
+</para>
+
+<para>
+<link linkend="table9.2">Table 9.2</link> shows the conditions that cause
+a bell to sound or an <structname>XkbBellNotifyEvent</structname>
+to be generated when a bell function is called.
+</para>
+
+<table id='table9.2' frame='topbot'>
+<title>Bell Sounding and Bell Event Generating</title>
+<?dbfo keep-together="always" ?>
+<tgroup cols='4' align='left' colsep='0' rowsep='0'>
+<colspec colname='c1' colwidth='1.0*'/>
+<colspec colname='c2' colwidth='1.0*'/>
+<colspec colname='c3' colwidth='1.0*'/>
+<colspec colname='c4' colwidth='1.0*'/>
+<thead>
+  <row rowsep='1'>
+    <entry>Function called</entry>
+    <entry>AudibleBell</entry>
+    <entry>Server sounds a bell</entry>
+    <entry>Server sends an XkbBellNotifyEvent</entry>
+  </row>
+</thead>
+<tbody>
+<row>
+    <entry>XkbDeviceBell</entry>
+    <entry>On</entry>
+    <entry>Yes</entry>
+    <entry>Yes</entry>
+</row>
+<row>
+    <entry>XkbDeviceBell</entry>
+    <entry>Off</entry>
+    <entry>No</entry>
+    <entry>Yes</entry>
+</row>
+<row>
+    <entry>XkbBell</entry>
+    <entry>On</entry>
+    <entry>Yes</entry>
+    <entry>Yes</entry>
+</row>
+<row>
+    <entry>XkbBell</entry>
+    <entry>Off</entry>
+    <entry>No</entry>
+    <entry>Yes</entry>
+</row>
+<row>
+    <entry>XkbDeviceBellEvent</entry>
+    <entry>On or Off</entry>
+    <entry>No</entry>
+    <entry>Yes</entry>
+</row>
+<row>
+    <entry>XkbBellEvent</entry>
+    <entry>On or Off</entry>
+    <entry>No</entry>
+    <entry>Yes</entry>
+</row>
+<row>
+    <entry>XkbDeviceForceBell</entry>
+    <entry>On or Off</entry>
+    <entry>Yes</entry>
+    <entry>No</entry>
+</row>
+<row>
+    <entry>XkbForceBell</entry>
+    <entry>On or Off</entry>
+    <entry>Yes</entry>
+    <entry>No</entry>
+  </row>
+</tbody>
+</tgroup>
+</table>
+
+<sect2 id='Generating_Named_Bells'>
+<title>Generating Named Bells</title>
+
+<para>
+To ring the bell on an X input extension device or the default keyboard, use
+<function>XkbDeviceBell</function>.
+</para>
+
+<indexterm significance="preferred" zone="XkbDeviceBell"><primary><function>XkbDeviceBell</function></primary></indexterm>
+<funcsynopsis id="XkbDeviceBell">
+  <funcprototype>
+    <funcdef>Bool <function>XkbDeviceBell</function></funcdef>
+<!-- (
+<parameter>display, window, device_id, bell_class, bell_id, percent, name</parameter>
+) -->
+
+    <paramdef>Display *<parameter>display</parameter></paramdef>
+    <paramdef>Window <parameter>window</parameter></paramdef>
+    <paramdef>unsigned int <parameter>device_spec</parameter></paramdef>
+    <paramdef>unsigned int <parameter>bell_class</parameter></paramdef>
+    <paramdef>unsigned int <parameter>bell_id</parameter></paramdef>
+    <paramdef>int <parameter>percent</parameter></paramdef>
+    <paramdef>Atom <parameter>name</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>display</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to the X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>window</parameter>
+    </term>
+    <listitem>
+      <para>
+        window for which the bell is generated, or None
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>device_spec</parameter>
+    </term>
+    <listitem>
+      <para>
+        device ID, or <symbol>XkbUseCoreKbd</symbol>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>bell_class</parameter>
+    </term>
+    <listitem>
+      <para>
+        X input extension bell class of the bell to be rung
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>bell_id</parameter>
+    </term>
+    <listitem>
+      <para>
+        X input extension bell ID of the bell to be rung
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>percent</parameter>
+    </term>
+    <listitem>
+      <para>
+        bell volume, from &minus;100 to 100 inclusive
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>name</parameter>
+    </term>
+    <listitem>
+      <para>
+        a name for the bell, or <symbol>NULL</symbol>
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+Set
+<parameter>percent</parameter>
+to be the volume relative to the base volume for the keyboard as described for
+<function>XBell</function>.
+</para>
+
+<para>
+Note that
+<parameter>bell_class</parameter>
+and
+<parameter>bell_id</parameter>
+indicate the bell to physically ring.
+<parameter>name</parameter>
+is simply an arbitrary moniker for the client application’s use.
+</para>
+
+<para>
+To determine the current feedback settings of an extension input device, use
+<function>XGetFeedbackControl</function>.
+See the X input extension documentation for more information on
+<function>XGetFeedbackControl</function>
+and related data structures.
+</para>
+
+<para>
+If a compatible keyboard extension is not present in the X server,
+<function>XkbDeviceBell</function>
+immediately returns
+<symbol>False</symbol>.
+Otherwise,
+<function>XkbDeviceBell</function>
+rings the bell as specified for the display and keyboard device and returns
+<symbol>True</symbol>.
+If you have disabled the audible bell, the server does not ring the system
+bell, although it does generate a
+<symbol>XkbBellNotify</symbol>
+event.
+</para>
+
+<para>
+You can call
+<function>XkbDeviceBell</function>
+without first initializing the keyboard extension.
+</para>
+
+<para>
+As a convenience function, Xkb provides a function to ring the bell on the
+default keyboard:
+<function>XkbBell</function>.
+</para>
+
+<indexterm significance="preferred" zone="XkbBell"><primary><function>XkbBell</function></primary></indexterm>
+<funcsynopsis id="XkbBell">
+  <funcprototype>
+    <funcdef>Bool <function>XkbBell</function></funcdef>
+<!-- (
+<parameter>display, window, percent, name</parameter>
+) -->
+
+    <paramdef>Display *<parameter>display</parameter></paramdef>
+    <paramdef>Window <parameter>window</parameter></paramdef>
+    <paramdef>int <parameter>percent</parameter></paramdef>
+    <paramdef>Atom <parameter>name</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>display</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to the X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>window</parameter>
+    </term>
+    <listitem>
+      <para>
+        event window, or None
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>percent</parameter>
+    </term>
+    <listitem>
+      <para>
+        relative volume, which can range from &minus;100 to 100 inclusive
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>name</parameter>
+    </term>
+    <listitem>
+      <para>
+        a bell name, or <symbol>NULL</symbol>
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If a compatible keyboard extension isn’t present in the X server,
+<function>XkbBell</function>
+calls
+<function>XBell</function>
+with the specified
+<parameter>display</parameter>
+and
+<parameter>percent</parameter>,
+and returns
+<symbol>False</symbol>.
+Otherwise,
+<function>XkbBell</function>
+calls
+<function>XkbDeviceBell</function>
+with the specified
+<parameter>display</parameter>,
+<parameter>window</parameter>,
+<parameter>percent</parameter>,
+and
+<parameter>name</parameter>,
+a
+<structfield>device_spec</structfield>
+of
+<symbol>XkbUseCoreKbd</symbol>,
+a
+<structfield>bell_class</structfield>
+of
+<symbol>XkbDfltXIClass</symbol>,
+and a
+<structfield>bell_id</structfield>
+of
+<symbol>XkbDfltXIId</symbol>,
+and returns
+<symbol>True</symbol>.
+</para>
+
+<para>
+If you have disabled the audible bell, the server does not ring the system
+bell, although it does generate a
+<symbol>XkbBellNotify</symbol>
+event.
+</para>
+
+<para>
+You can call
+<function>XkbBell</function>
+without first initializing the keyboard extension.
+</para>
+
+</sect2>
+<sect2 id='Generating_Named_Bell_Events'>
+<title>Generating Named Bell Events</title>
+
+<para>
+Using Xkb, you can also generate a named bell event that does not ring any
+bell. This allows you to do things such as generate events when your
+application starts.
+</para>
+
+<para>
+For example, if an audio client listens for these types of bells, it can
+produce a <quote>whoosh</quote> sound when it receives a named bell event to indicate a
+client just started. In this manner, applications can generate start-up
+feedback and not worry about producing annoying beeps if an audio server is not
+running.
+</para>
+
+
+<para>
+To cause a bell event for an X input extension device or for the keyboard,
+without ringing the corresponding bell, use
+<function>XkbDeviceBellEvent</function>.
+</para>
+
+<indexterm significance="preferred" zone="XkbDeviceBellEvent"><primary><function>XkbDeviceBellEvent</function></primary></indexterm>
+<funcsynopsis id="XkbDeviceBellEvent">
+  <funcprototype>
+    <funcdef>Bool <function>XkbDeviceBellEvent</function></funcdef>
+<!-- (
+<parameter>display, window, device_spec, bell_class, bell_id, percent, name</parameter>
+) -->
+
+    <paramdef>Display *<parameter>display</parameter></paramdef>
+    <paramdef>Window <parameter>window</parameter></paramdef>
+    <paramdef>unsigned int <parameter>device_spec</parameter></paramdef>
+    <paramdef>unsigned int <parameter>bell_class</parameter></paramdef>
+    <paramdef>unsigned int <parameter>bell_id</parameter></paramdef>
+    <paramdef>int <parameter>percent</parameter></paramdef>
+    <paramdef>Atom <parameter>name</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>display</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to the X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>window</parameter>
+    </term>
+    <listitem>
+      <para>
+        event window, or None
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>device_spec</parameter>
+    </term>
+    <listitem>
+      <para>
+        device ID, or <symbol>XkbUseCoreKbd</symbol>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>bell_class</parameter>
+    </term>
+    <listitem>
+      <para>
+        input extension bell class for the event
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>bell_id</parameter>
+    </term>
+    <listitem>
+      <para>
+        input extension bell ID for the event
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>percent</parameter>
+    </term>
+    <listitem>
+      <para>
+        volume for the bell, which can range from &minus;100 to 100 inclusive
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>name</parameter>
+    </term>
+    <listitem>
+      <para>
+        a bell name, or <symbol>NULL</symbol>
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If a compatible keyboard extension isn’t present in the X server,
+<function>XkbDeviceBellEvent</function>
+immediately returns
+<symbol>False</symbol>.
+Otherwise,
+<function>XkbDeviceBellEvent</function>
+causes an
+<symbol>XkbBellNotify</symbol>
+event to be sent to all interested clients and returns
+<symbol>True</symbol>.
+Set
+<parameter>percent</parameter>
+to be the volume relative to the base volume for the keyboard as described for
+<function>XBell</function>.
+</para>
+
+
+<para>
+In addition,
+<function>XkbDeviceBellEvent</function>
+may generate
+<type>Atom</type>
+protocol errors as well as
+<symbol>XkbBellNotify</symbol>
+events. You can call
+<function>XkbBell</function>
+without first initializing the keyboard extension.
+</para>
+
+
+<para>
+As a convenience function, Xkb provides a function to cause a bell event for
+the keyboard without ringing the bell:
+<function>XkbBellEvent</function>.
+</para>
+
+
+<indexterm significance="preferred" zone="XkbBellEvent"><primary><function>XkbBellEvent</function></primary></indexterm>
+<funcsynopsis id="XkbBellEvent">
+  <funcprototype>
+    <funcdef>Bool <function>XkbBellEvent</function></funcdef>
+<!-- (
+<parameter>display, window, percent, name</parameter>
+) -->
+
+    <paramdef>Display *<parameter>display</parameter></paramdef>
+    <paramdef>Window <parameter>window</parameter></paramdef>
+    <paramdef>int <parameter>percent</parameter></paramdef>
+    <paramdef>Atom <parameter>name</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>display</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to the X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>window</parameter>
+    </term>
+    <listitem>
+      <para>
+        the event window, or None
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>percent</parameter>
+    </term>
+    <listitem>
+      <para>
+        relative volume, which can range from &minus;100 to 100 inclusive
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>name</parameter>
+    </term>
+    <listitem>
+      <para>
+        a bell name, or <symbol>NULL</symbol>
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If a compatible keyboard extension isn’t present in the X server,
+<function>XkbBellEvent</function>
+immediately returns
+<symbol>False</symbol>.
+Otherwise,
+<function>XkbBellEvent</function>
+calls
+<function>XkbDeviceBellEvent</function>
+with the specified
+<parameter>display</parameter>,
+<parameter>window</parameter>,
+<parameter>percent</parameter>,
+and
+<parameter>name</parameter>,
+a
+<structfield>device_spec</structfield>
+of
+<symbol>XkbUseCoreKbd</symbol>,
+a
+<structfield>bell_class</structfield>
+of
+<symbol>XkbDfltXIClass</symbol>,
+and a
+<structfield>bell_id</structfield>
+of
+<symbol>XkbDfltXIId</symbol>,
+and returns what
+<function>XkbDeviceBellEvent</function>
+returns.
+</para>
+
+<para>
+<function>XkbBellEvent</function>
+generates a <symbol>XkbBellNotify</symbol>
+event.
+</para>
+
+
+<para>
+You can call
+<function>XkbBellEvent</function>
+without first initializing the keyboard extension.
+</para>
+
+</sect2>
+<sect2 id='Forcing_a_Server_Generated_Bell'>
+<title>Forcing a Server-Generated Bell</title>
+
+<para>
+To ring the bell on any keyboard, overriding user preference settings for
+audible bells, use <function>XkbForceDeviceBell</function>.
+</para>
+
+<indexterm significance="preferred" zone="XkbForceDeviceBell"><primary><function>XkbForceDeviceBell</function></primary></indexterm>
+<funcsynopsis id="XkbForceDeviceBell">
+  <funcprototype>
+    <funcdef>Bool <function>XkbForceDeviceBell</function></funcdef>
+<!-- (
+<parameter>display, window, device_spec, bell_class, bell_id, percent</parameter>
+) -->
+
+    <paramdef>Display *<parameter>display</parameter></paramdef>
+    <paramdef>Window <parameter>window</parameter></paramdef>
+    <paramdef>unsigned int <parameter>device_spec</parameter></paramdef>
+    <paramdef>unsigned int <parameter>bell_class</parameter></paramdef>
+    <paramdef>unsigned int <parameter>bell_id</parameter></paramdef>
+    <paramdef>int <parameter>percent</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>display</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to the X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>window</parameter>
+    </term>
+    <listitem>
+      <para>
+        event window, or None
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>device_spec</parameter>
+    </term>
+    <listitem>
+      <para>
+        device ID, or <symbol>XkbUseCoreKbd</symbol>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>bell_class</parameter>
+    </term>
+    <listitem>
+      <para>
+        input extension class of the bell to be rung
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>bell_id</parameter>
+    </term>
+    <listitem>
+      <para>
+        input extension ID of the bell to be rung
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>percent</parameter>
+    </term>
+    <listitem>
+      <para>
+        relative volume, which can range from &minus;100 to 100 inclusive
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If a compatible keyboard extension isn’t present in the X server,
+<function>XkbForceDeviceBell</function>
+immediately returns
+<symbol>False</symbol>.
+Otherwise,
+<function>XkbForceDeviceBell</function>
+rings the bell as specified for the display and keyboard device and returns
+<symbol>True</symbol>.
+Set
+<parameter>percent</parameter>
+to be the volume relative to the base volume for the keyboard as described for
+<function>XBell</function>.
+There is no
+<structfield>name</structfield>
+parameter because
+<function>XkbForceDeviceBell</function>
+does not cause an
+<symbol>XkbBellNotify</symbol>
+event.
+</para>
+
+<para>
+You can call
+<function>XkbBell</function>
+without first initializing the keyboard extension.
+</para>
+
+<para>
+To ring the bell on the default keyboard, overriding user preference settings
+for audible bells, use
+<function>XkbForceBell</function>.
+</para>
+
+<indexterm significance="preferred" zone="XkbForceBell"><primary><function>XkbForceBell</function></primary></indexterm>
+<funcsynopsis id="XkbForceBell">
+  <funcprototype>
+    <funcdef>Bool <function>XkbForceBell</function></funcdef>
+<!-- (
+<parameter>display, percent)</parameter> -->
+
+    <paramdef>Display *<parameter>display</parameter></paramdef>
+    <paramdef>int <parameter>percent</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>display</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to the X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>percent</parameter>
+    </term>
+    <listitem>
+      <para>
+        volume for the bell, which can range from &minus;100 to 100 inclusive
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If a compatible keyboard extension isn’t present in the X server,
+<function>XkbForceBell</function>
+calls
+<function>XBell</function>
+with the specified
+<parameter>display</parameter>
+and
+<parameter>percent</parameter>
+and returns
+<symbol>False</symbol>.
+Otherwise,
+<function>XkbForceBell</function>
+calls
+<function>XkbForceDeviceBell</function>
+with the specified
+<parameter>display</parameter>
+and
+<parameter>percent</parameter>,
+<structfield>device_spec</structfield>
+=
+<symbol>XkbUseCoreKbd</symbol>,
+<structfield>bell_class</structfield>
+=
+<symbol>XkbDfltXIClass</symbol>,
+<structfield>bell_id</structfield>
+=
+<symbol>XkbDfltXIId</symbol>,
+<structfield>window</structfield>
+= None, and
+<structfield>name</structfield>
+=
+<symbol>NULL</symbol>,
+and returns what
+<function>XkbForceDeviceBell</function>
+returns.
+</para>
+
+<para>
+<function>XkbForceBell</function>
+does not cause an
+<symbol>XkbBellNotify</symbol>
+event.
+</para>
+
+<para>
+You can call
+<function>XkbBell</function>
+without first initializing the keyboard extension.
+</para>
+
+</sect2>
+</sect1>
+<sect1 id='Detecting_Bells'>
+<title>Detecting Bells</title>
+
+<para>
+Xkb generates
+<symbol>XkbBellNotify</symbol>
+events for all bells except for those resulting from calls to
+<function>XkbForceDeviceBell</function>
+and
+<function>XkbForceBell</function>.
+To receive
+<symbol>XkbBellNotify</symbol>
+events under all possible conditions, pass
+<symbol>XkbBellNotifyMask</symbol>
+in both the
+<parameter>bits_to_change</parameter>
+and
+<parameter>values_for_bits</parameter>
+parameters to
+<function>XkbSelectEvents</function>
+(see <link linkend="Selecting_Xkb_Events">section 4.3</link>).
+</para>
+
+<para>
+The
+<symbol>XkbBellNotify</symbol>
+event has no event details. It is either selected or it is not. However, you
+can call
+<function>XkbSelectEventDetails</function>
+using
+<symbol>XkbBellNotify</symbol>
+as the
+<structfield>event_type</structfield>
+and specifying
+<symbol>XkbAllBellEventsMask</symbol>
+in
+<parameter>bits_to_change</parameter>
+and
+<parameter>values_for_bits</parameter>.
+This has the same effect as a call to
+<function>XkbSelectEvents</function>.
+</para>
+
+<para>
+The structure for the
+<symbol>XkbBellNotify</symbol>
+event type contains:
+
+<programlisting>
+typedef struct _XkbBellNotify {
+    int             type;        /* Xkb extension base event code */
+    unsigned long   serial;      /* X server serial number for event */
+    Bool            send_event;  /* <symbol>True</symbol> &rArr; synthetically generated */
+    Display *       display;     /* server connection where event generated */
+    Time            time;        /* server time when event generated */
+    int             xkb_type;    /* <symbol>XkbBellNotify</symbol> */
+    unsigned int    device;      /* Xkb device ID, will not be <symbol>XkbUseCoreKbd</symbol> */
+    int             percent;     /* requested volume as % of max */
+    int             pitch;       /* requested pitch in Hz */
+    int             duration;    /* requested duration in microseconds */
+    unsigned int    bell_class;  /* X input extension feedback class */
+    unsigned int    bell_id;     /* X input extension feedback ID */
+    Atom            name;        /* "name" of requested bell */
+    Window          window;      /* window associated with event */
+    Bool            event_only;  /* <symbol>False</symbol> &rarr; the server did not produce a beep */
+} <structname>XkbBellNotifyEvent</structname>;
+</programlisting></para>
+
+<para>
+If your application needs to generate visual bell feedback on the screen when
+it receives a bell event, use the window ID in the
+<structname>XkbBellNotifyEvent</structname>,
+if present.
+</para>
+
+</sect1>
+</chapter>
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/XKB/ch10.xml
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/XKB/ch10.xml	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/XKB/ch10.xml	(revision 5)
@@ -0,0 +1,5383 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+	  "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+<chapter id='Keyboard_Controls'>
+<title>Keyboard Controls</title>
+
+<indexterm significance="preferred" zone="Keyboard_Controls">
+<primary>controls</primary></indexterm>
+<indexterm significance="preferred" zone="Keyboard_Controls">
+<primary>server controls</primary></indexterm>
+<indexterm significance="preferred" zone="Keyboard_Controls">
+<primary>controls</primary><secondary>server</secondary></indexterm>
+
+<para>
+The Xkb extension is composed of two parts: a server extension, and a
+client-side X library extension. This chapter discusses functions used to
+modify controls effecting the behavior of the server portion of the Xkb
+extension. <xref linkend="X_Library_Controls" /> discusses functions used to modify controls that affect
+only the behavior of the client portion of the extension; those controls are
+known as Library Controls.
+</para>
+
+
+<para>
+Xkb contains control features that affect the entire keyboard, known as global
+keyboard controls. Some of the controls may be selectively enabled and
+disabled; these controls are known as the
+<firstterm>Boolean Controls</firstterm>.
+<indexterm significance="preferred" zone="Keyboard_Controls">
+<primary>boolean controls</primary></indexterm>
+<indexterm significance="preferred" zone="Keyboard_Controls">
+<primary>controls</primary><secondary>boolean</secondary></indexterm>
+Boolean Controls can be turned on or off under program control and can also
+be automatically set to an on or off condition when a client program exits. The
+remaining controls, known as the
+<firstterm>Non-Boolean Controls</firstterm>,
+<indexterm significance="preferred" zone="Keyboard_Controls">
+<primary>non-boolean controls</primary></indexterm>
+<indexterm significance="preferred" zone="Keyboard_Controls">
+<primary>controls</primary><secondary>non-boolean</secondary></indexterm>
+are always active. The
+<structname>XkbControlsRec</structname>
+structure describes the current state of most of the global controls and the
+attributes effecting the behavior of each of these Xkb features. This chapter
+describes the Xkb controls and how to manipulate them.
+</para>
+
+
+<para>
+There are two possible components for each of the Boolean Controls: attributes
+describing how the control should work, and a state describing whether the
+behavior as a whole is enabled or disabled. The attributes and state for most
+of these controls are held in the
+<structname>XkbControlsRec</structname>
+structure (see <link linkend="The_XkbControlsRec_Structure">section 10.8</link>).
+</para>
+
+
+<para>
+You can manipulate the Xkb controls individually, via convenience functions, or
+as a whole. To treat them as a group, modify an
+<structname>XkbControlsRec</structname>
+structure to describe all of the changes to be made, and then pass that
+structure and appropriate flags to an Xkb library function, or use a
+<structname>XkbControlsChangesRec</structname>
+(see <link linkend="The_XkbControlsChangesRec_Structure">section 10.10.1</link>) to reduce network traffic. When using a convenience
+function to manipulate one control individually, you do not use an
+<structname>XkbControlsRec</structname>
+structure directly.
+</para>
+
+
+<para>
+The Xkb controls are grouped as shown in
+<link linkend="table10.1">Table 10.1</link>.
+</para>
+
+<table id='table10.1' frame='topbot'>
+<title>Xkb Keyboard Controls</title>
+<?dbfo keep-together="always" ?>
+<tgroup cols='3' align='left' colsep='0' rowsep='0'>
+<colspec colname='c1' colwidth='1.5*'/>
+<colspec colname='c2' colwidth='1.5*'/>
+<colspec colname='c3' colwidth='1.0*'/>
+<thead>
+<row rowsep='1'>
+  <entry>Type of Control</entry>
+  <entry>Control Name</entry>
+  <entry>Boolean Control?</entry>
+  </row>
+</thead>
+<tbody>
+  <row>
+    <entry>Controls for enabling and disabling other controls</entry>
+    <entry>EnabledControls</entry>
+    <entry>No</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry>AutoReset</entry>
+    <entry>No</entry>
+  </row>
+  <row>
+    <entry>Control for bell behavior</entry>
+    <entry>AudibleBell</entry>
+    <entry>Boolean</entry>
+  </row>
+  <row>
+    <entry>Controls for repeat key behavior</entry>
+    <entry>PerKeyRepeat</entry>
+    <entry>No</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry>RepeatKeys</entry>
+    <entry>Boolean</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry>DetectableAutorepeat</entry>
+    <entry>Boolean</entry>
+  </row>
+  <row>
+    <entry>Controls for keyboard overlays</entry>
+    <entry>Overlay1</entry>
+    <entry>Boolean</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry>Overlay2</entry>
+    <entry>Boolean</entry>
+  </row>
+  <row>
+    <entry>Controls for using the mouse from the keyboard</entry>
+    <entry>MouseKeys</entry>
+    <entry>Boolean</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry>MouseKeysAccel</entry>
+    <entry>Boolean</entry>
+  </row>
+  <row>
+    <entry>Controls for better keyboard access by </entry>
+    <entry>AccessXFeedback</entry>
+    <entry>Boolean</entry>
+  </row>
+  <row>
+    <entry>physically impaired persons</entry>
+    <entry>AccessXKeys</entry>
+    <entry>Boolean</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry>AccessXTimeout</entry>
+    <entry>Boolean</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry>BounceKeys</entry>
+    <entry>Boolean</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry>SlowKeys</entry>
+    <entry>Boolean</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry>StickyKeys</entry>
+    <entry>Boolean</entry>
+  </row>
+  <row>
+    <entry>Controls for general keyboard mapping</entry>
+    <entry>GroupsWrap</entry>
+    <entry>No</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry>IgnoreGroupLock</entry>
+    <entry>Boolean</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry>IgnoreLockMods</entry>
+    <entry>No</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry>InternalMods</entry>
+    <entry>No</entry>
+  </row>
+  <row>
+    <entry>Miscellaneous per-client controls</entry>
+    <entry>GrabsUseXKBState</entry>
+    <entry>Boolean</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry>LookupStateWhenGrabbed</entry>
+    <entry>Boolean</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry>SendEventUsesXKBState</entry>
+    <entry>Boolean</entry>
+  </row>
+</tbody>
+</tgroup>
+</table>
+
+<para>
+The individual categories and controls are described first, together with
+functions for manipulating them. A description of the
+<structname>XkbControlsRec</structname>
+structure and the general functions for dealing with all of the controls at
+once follow at the end of the chapter.
+</para>
+
+<sect1 id='Controls_that_Enable_and_Disable_Other_Controls'>
+<title>Controls that Enable and Disable Other Controls</title>
+
+<para>
+Enable and disable the boolean controls under program control by using the
+<emphasis>EnabledControls</emphasis>
+control; enable and disable them upon program exit by configuring the
+<emphasis>AutoReset</emphasis>
+control.
+</para>
+
+
+<sect2 id='The_EnabledControls_Control'>
+<title>The EnabledControls Control</title>
+
+<para>
+The
+<emphasis>EnabledControls</emphasis>
+control is a bit mask where each bit that is turned on means the corresponding
+control is enabled, and when turned off, disabled. It corresponds to the
+<structfield>enabled_ctrls</structfield>
+field of an
+<structname>XkbControlsRec</structname>
+structure (see <link linkend="The_XkbControlsRec_Structure">section 10.8</link>). The bits describing which controls are turned on
+or off are defined in <link linkend="table10.7">Table 10.7</link>.
+</para>
+
+
+<para>
+Use
+<function>XkbChangeEnabledControls</function>
+to manipulate the
+<emphasis>EnabledControls</emphasis>
+control.
+</para>
+
+<indexterm significance="preferred" zone="XkbChangeEnabledControls"><primary><function>XkbChangeEnabledControls</function></primary></indexterm>
+<funcsynopsis id="XkbChangeEnabledControls">
+  <funcprototype>
+    <funcdef>Bool <function>XkbChangeEnabledControls</function></funcdef>
+<!-- (
+<parameter>dpy</parameter>,
+<parameter>device_spec</parameter>,
+<parameter>mask</parameter>,
+<parameter>values</parameter>
+) -->
+
+    <paramdef>Display *<parameter>dpy</parameter></paramdef>
+    <paramdef>unsigned int <parameter>device_spec</parameter></paramdef>
+    <paramdef>unsigned int <parameter>mask</parameter></paramdef>
+    <paramdef>unsigned int <parameter>values</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>dpy</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>device_spec</parameter>
+    </term>
+    <listitem>
+      <para>
+        keyboard device to modify
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>mask</parameter>
+    </term>
+    <listitem>
+      <para>
+        1 bit &rarr; controls to enable / disable
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>values</parameter>
+    </term>
+    <listitem>
+      <para>
+        1 bit &rArr; enable, 0 bit &rArr; disable
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<parameter>mask</parameter>
+parameter specifies the boolean controls to be enabled or disabled, and the
+<parameter>values</parameter>
+mask specifies the new state for those controls. Valid values for both of
+these masks are composed of a bitwise inclusive OR of bits taken from the set
+of mask bits in <link linkend="table10.7">Table 10.7</link>,
+using only those masks with <quote>ok</quote> in the
+<structfield>enabled_ctrls</structfield>
+column.
+</para>
+
+
+<para>
+If the X server does not support a compatible version of Xkb or the Xkb
+extension has not been properly initialized,
+<function>XkbChangeEnabledControls</function>
+returns
+<symbol>False</symbol>;
+otherwise, it sends the request to the X server and returns
+<symbol>True</symbol>.
+</para>
+
+
+<para>
+Note that the
+<emphasis>EnabledControls</emphasis>
+control only enables and disables controls; it does not configure them. Some
+controls, such as the
+<emphasis>AudibleBell</emphasis>
+control, have no configuration attributes and are therefore manipulated solely
+by enabling and disabling them. Others, however, have additional attributes to
+configure their behavior. For example, the
+<emphasis>RepeatControl</emphasis>
+control uses
+<structfield>repeat_delay</structfield>
+and
+<structfield>repeat_interval</structfield>
+fields to describe the timing behavior of keys that repeat. The
+<emphasis>RepeatControl</emphasis>
+behavior is turned on or off depending on the value of the
+<symbol>XkbRepeatKeysMask</symbol>
+bit, but you must use other means, as described in this chapter, to configure
+its behavior in detail.
+</para>
+
+
+</sect2>
+<sect2 id='The_AutoReset_Control'>
+<title>The AutoReset Control</title>
+
+<para>
+You can configure the boolean controls to automatically be enabled or disabled
+when a program exits. This capability is controlled via two masks maintained in
+the X server on a per-client basis. There is no client-side Xkb data structure
+corresponding to these masks. Whenever the client exits for any reason, any
+boolean controls specified in the
+<firstterm>auto-reset mask</firstterm>
+<indexterm significance="preferred" zone="The_AutoReset_Control">
+<primary>auto-reset mask</primary></indexterm>
+<indexterm significance="preferred" zone="The_AutoReset_Control">
+<primary>mask</primary><secondary>auto-reset</secondary></indexterm>
+are set to the corresponding value from the
+<firstterm>auto-reset values</firstterm>
+mask. This makes it possible for clients to "clean up after themselves"
+automatically, even if abnormally terminated. The bits used in the masks
+correspond to the
+<emphasis>EnabledControls</emphasis>
+control bits.
+</para>
+
+
+<para>
+For example, a client that replaces the keyboard bell with some other audible
+cue might want to turn off the
+<emphasis>AudibleBell</emphasis>
+control to prevent the server from also generating a sound and avoid
+cacophony. If the client were to exit without resetting the
+<emphasis>AudibleBell</emphasis>
+control, the user would be left without any feedback at all. Setting
+<emphasis>AudibleBell</emphasis>
+in both the auto-reset mask and auto-reset values guarantees that the audible
+bell will be turned back on when the client exits.
+</para>
+
+
+<para>
+To get the current values of the auto-reset controls, use
+<function>XkbGetAutoResetControls</function>.
+</para>
+
+<indexterm significance="preferred" zone="XkbGetAutoResetControls"><primary><function>XkbGetAutoResetControls</function></primary></indexterm>
+<funcsynopsis id="XkbGetAutoResetControls">
+  <funcprototype>
+    <funcdef>Bool <function>XkbGetAutoResetControls</function></funcdef>
+<!-- (
+<parameter>dpy</parameter>,
+<parameter>auto_ctrls</parameter>,
+<parameter>auto_values</parameter>
+) -->
+
+    <paramdef>Display *<parameter>dpy</parameter></paramdef>
+    <paramdef>unsigned int *<parameter>auto_ctrls</parameter></paramdef>
+    <paramdef>unsigned int *<parameter>auto_values</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>dpy</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>auto_ctrls</parameter>
+    </term>
+    <listitem>
+      <para>
+        specifies which bits in <parameter>auto_values</parameter> are relevant
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>auto_values</parameter>
+    </term>
+    <listitem>
+      <para>
+        1 bit &rArr; corresponding control has auto-reset on
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbGetAutoResetControls</function>
+backfills
+<parameter>auto_ctrls</parameter>
+and
+<parameter>auto_values</parameter>
+with the
+<emphasis>AutoReset</emphasis>
+control attributes for this particular client. It returns
+<symbol>True</symbol>
+if successful, and
+<symbol>False</symbol>
+otherwise.
+</para>
+
+
+<para>
+To change the current values of the
+<emphasis>AutoReset</emphasis>
+control attributes, use
+<function>XkbSetAutoResetControls</function>.
+</para>
+
+
+<indexterm significance="preferred" zone="XkbSetAutoResetControls"><primary><function>XkbSetAutoResetControls</function></primary></indexterm>
+<funcsynopsis id="XkbSetAutoResetControls">
+  <funcprototype>
+    <funcdef>Bool <function>XkbSetAutoResetControls</function></funcdef>
+<!-- (
+<parameter>dpy</parameter>,
+<parameter>changes</parameter>,
+<parameter>auto_ctrls</parameter>,
+<parameter>auto_values</parameter>
+) -->
+
+    <paramdef>Display *<parameter>dpy</parameter></paramdef>
+    <paramdef>unsigned int <parameter>changes</parameter></paramdef>
+    <paramdef>unsigned int *<parameter>auto_ctrls</parameter></paramdef>
+    <paramdef>unsigned int *<parameter>auto_values</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>dpy</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>changes</parameter>
+    </term>
+    <listitem>
+      <para>
+        controls for which to change auto-reset values
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>auto_ctrls</parameter>
+    </term>
+    <listitem>
+      <para>
+        controls from changes that should auto reset
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>auto_values</parameter>
+    </term>
+    <listitem>
+      <para>
+        1 bit &rArr; auto-reset on
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbSetAutoResetControls</function>
+changes the auto-reset status and associated auto-reset
+values for the controls selected by
+<parameter>changes</parameter>.
+For any control selected by
+<parameter>changes</parameter>,
+if the corresponding bit is set in
+<parameter>auto_ctrls</parameter>,
+the control is configured to auto-reset when the client exits. If the
+corresponding bit in
+<parameter>auto_values</parameter>
+is on, the control is turned on when the client exits;
+if zero, the control is turned off when the client exits.
+For any control selected by
+<parameter>changes</parameter>,
+if the corresponding bit is not set in
+<parameter>auto_ctrls</parameter>,
+the control is configured to not reset when the client exits. For example:
+</para>
+
+
+<para>
+To leave the auto-reset controls for
+<emphasis>StickyKeys</emphasis>
+the way they are:
+
+<programlisting>
+    ok = XkbSetAutoResetControls(dpy, 0, 0, 0);
+</programlisting></para>
+
+<para>
+To change the auto-reset controls so that
+<emphasis>StickyKeys</emphasis>
+are unaffected when the client exits:
+
+<programlisting>
+    ok = XkbSetAutoResetControls(dpy, XkbStickyKeysMask, 0, 0);
+</programlisting></para>
+
+<para>
+To change the auto-reset controls so that
+<emphasis>StickyKeys</emphasis>
+are turned off when the client exits:
+
+<programlisting>
+    ok = XkbSetAutoResetControls(dpy, XkbStickyKeysMask, XkbStickyKeysMask, 0);
+</programlisting></para>
+
+<para>
+To change the auto-reset controls so that
+<emphasis>StickyKeys</emphasis>
+are turned on when the client exits:
+
+<programlisting>
+    ok = XkbSetAutoResetControls(dpy, XkbStickyKeysMask, XkbStickyKeysMask,
+                                 XkbStickyKeysMask);
+</programlisting></para>
+
+<para>
+<function>XkbSetAutoResetControls</function>
+backfills
+<parameter>auto_ctrls</parameter>
+and
+<parameter>auto_values</parameter>
+with the auto-reset controls for this particular client. Note that all of the
+bits are valid in the returned values, not just the ones selected in the
+<parameter>changes</parameter>
+mask.
+</para>
+
+
+</sect2>
+</sect1>
+<sect1 id='Control_for_Bell_Behavior'>
+<title>Control for Bell Behavior</title>
+
+<para>
+The X server’s generation of sounds is controlled by the
+<emphasis>AudibleBell</emphasis>
+control. Configuration of different bell sounds is discussed in <xref linkend="Bells" />.
+</para>
+
+
+<sect2 id='The_AudibleBell_Control'>
+<title>The AudibleBell Control</title>
+
+<para>
+The
+<emphasis>AudibleBell</emphasis>
+control is a boolean control that has no attributes. As such, you may enable
+and disable it using either the
+<emphasis>EnabledControls</emphasis>
+control or the
+<emphasis>AutoReset</emphasis>
+control discussed in <link linkend="The_EnabledControls_Control">section 10.1.1</link>. When enabled, protocol requests to
+generate a sound result in the X server actually producing a real sound; when
+disabled, requests to the server to generate a sound are ignored unless the
+sound is forced. See <link linkend="Audible_Bells">section 9.2</link>.
+</para>
+
+
+</sect2>
+</sect1>
+<sect1 id='Controls_for_Repeat_Key_Behavior'>
+<title>Controls for Repeat Key Behavior</title>
+
+<indexterm significance="preferred" zone="Controls_for_Repeat_Key_Behavior">
+<primary>auto-repeat</primary><secondary>controls</secondary></indexterm>
+
+<para>
+The repeating behavior of keyboard keys is governed by three controls, the
+<emphasis>PerKeyRepeat</emphasis>
+control, which is always active, and the
+<emphasis>RepeatKeys</emphasis>
+and
+<emphasis>DetectableAutorepeat</emphasis>
+controls, which are boolean controls that may be enabled and disabled.
+<emphasis>PerKeyRepeat</emphasis>
+determines which keys are allowed to repeat.
+<emphasis>RepeatKeys</emphasis>
+governs the behavior of an individual key when it is repeating.
+<emphasis>DetectableAutorepeat</emphasis>
+allows a client to detect when a key is repeating as a result of being held
+down.
+</para>
+
+
+<sect2 id='The_PerKeyRepeat_Control'>
+<title>The PerKeyRepeat Control</title>
+
+<para>
+The
+<emphasis>PerKeyRepeat</emphasis>
+control is a bitmask long enough to contain a bit for each key on the device;
+it determines which individual keys are allowed to repeat. The Xkb
+<emphasis>PerKeyRepeat</emphasis>
+control provides no functionality different from that available via the core X
+protocol. There are no convenience functions in Xkb for manipulating this
+control. The
+<emphasis>PerKeyRepeat</emphasis>
+control settings are carried in the
+<structfield>per_key_repeat</structfield>
+field of an
+<structname>XkbControlsRec</structname>
+structure, discussed in <link linkend="The_XkbControlsRec_Structure">section 10.8</link>.
+</para>
+
+
+</sect2>
+<sect2 id='The_RepeatKeys_Control'>
+<title>The RepeatKeys Control</title>
+
+<para>
+The core protocol allows only control over whether or not the entire keyboard
+or individual keys should auto-repeat when held down.
+<emphasis>RepeatKeys</emphasis>
+is a boolean control that extends this capability by adding control over the
+delay until a key begins to repeat and the rate at which it repeats.
+<emphasis>RepeatKeys</emphasis>
+is coupled with the core auto-repeat control: when
+<emphasis>RepeatKeys</emphasis>
+is enabled or disabled, the core auto-repeat is enabled or disabled and vice
+versa.
+</para>
+
+
+<para>
+Auto-repeating keys are controlled by two attributes. The first,
+<firstterm>timeout</firstterm>,
+is the delay after the initial press of an auto-repeating key and the first
+generated repeat event. The second,
+<firstterm>interval</firstterm>,
+is the delay between all subsequent generated repeat events. As with all
+boolean controls, configuring the attributes that determine how the control
+operates does not automatically enable the control as a whole; see <link linkend="Controls_that_Enable_and_Disable_Other_Controls">section 10.1</link>.
+</para>
+
+
+<para>
+To get the current attributes of the
+<emphasis>RepeatKeys</emphasis>
+control for a keyboard device, use
+<function>XkbGetAutoRepeatRate</function>.
+</para>
+
+<indexterm significance="preferred" zone="XkbGetAutoRepeatRate"><primary><function>XkbGetAutoRepeatRate</function></primary></indexterm>
+<funcsynopsis id="XkbGetAutoRepeatRate">
+  <funcprototype>
+    <funcdef>Bool <function>XkbGetAutoRepeatRate</function></funcdef>
+<!-- (
+<parameter>display, device_spec, timeout_rtrn, interval_rtrn</parameter>
+) -->
+
+    <paramdef>Display *<parameter>display</parameter></paramdef>
+    <paramdef>unsigned int <parameter>device_spec</parameter></paramdef>
+    <paramdef>unsigned int *<parameter>timeout_rtrn</parameter></paramdef>
+    <paramdef>unsigned int *<parameter>interval_rtrn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>display</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>device_spec</parameter>
+    </term>
+    <listitem>
+      <para>
+        desired device ID, or <symbol>XkbUseCoreKbd</symbol>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>timeout_rtrn</parameter>
+    </term>
+    <listitem>
+      <para>
+        backfilled with initial repeat delay, ms
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>interval_rtrn</parameter>
+    </term>
+    <listitem>
+      <para>
+        backfilled with subsequent repeat delay, ms
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbGetAutoRepeatRate</function>
+queries the server for the current values of the
+<emphasis>RepeatControls</emphasis>
+control attributes, backfills
+<parameter>timeout_rtrn</parameter>
+and
+<parameter>interval_rtrn</parameter>
+with them, and returns
+<symbol>True</symbol>.
+If a compatible version of the Xkb extension is not available in the server
+<function>XkbGetAutoRepeatRate</function>
+returns
+<symbol>False</symbol>.
+</para>
+
+
+<para>
+To set the attributes of the RepeatKeys control for a keyboard device, use
+<function>XkbSetAutoRepeatRate</function>.
+</para>
+
+
+<indexterm significance="preferred" zone="XkbSetAutoRepeatRate"><primary><function>XkbSetAutoRepeatRate</function></primary></indexterm>
+<funcsynopsis id="XkbSetAutoRepeatRate">
+  <funcprototype>
+    <funcdef>Bool <function>XkbSetAutoRepeatRate</function></funcdef>
+<!-- (
+<parameter>display, device_spec, timeout, interval</parameter>
+) -->
+
+    <paramdef>Display *<parameter>display</parameter></paramdef>
+    <paramdef>unsigned int <parameter>device_spec</parameter></paramdef>
+    <paramdef>unsigned int <parameter>timeout</parameter></paramdef>
+    <paramdef>unsigned int <parameter>interval</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>display</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>device_spec</parameter>
+    </term>
+    <listitem>
+      <para>
+        device to configure, or <symbol>XkbUseCoreKbd</symbol>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>timeout</parameter>
+    </term>
+    <listitem>
+      <para>
+        initial delay, ms
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>interval</parameter>
+    </term>
+    <listitem>
+      <para>
+        delay between repeats, ms
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbSetAutoRepeatRate</function>
+sends a request to the X server to configure the
+<emphasis>AutoRepeat</emphasis>
+control attributes to the values specified in
+<parameter>timeout</parameter>
+and
+<parameter>interval</parameter>.
+</para>
+
+
+<para>
+<function>XkbSetAutoRepeatRate</function>
+does not wait for a reply; it normally returns
+<symbol>True</symbol>.
+Specifying a zero value for either
+<parameter>timeout</parameter>
+or
+<parameter>interval</parameter>
+causes the server to generate a
+<errorname>BadValue</errorname>
+protocol error. If a compatible version of the Xkb extension is not available
+in the server,
+<function>XkbSetAutoRepeatRate</function>
+returns
+<symbol>False</symbol>.
+</para>
+
+
+</sect2>
+<sect2 id='The_DetectableAutorepeat_Control'>
+<title>The DetectableAutorepeat Control</title>
+
+<para>
+Auto-repeat is the generation of multiple key events by a keyboard when the
+user presses a key and holds it down. Keyboard hardware and device-dependent X
+server software often implement auto-repeat by generating multiple
+<symbol>KeyPress</symbol>
+events with no intervening
+<symbol>KeyRelease</symbol>
+event. The standard behavior of the X server is to generate a
+<symbol>KeyRelease</symbol>
+event for every
+<symbol>KeyPress</symbol>
+event. If the keyboard hardware and device-dependent software of the X server
+implement auto-repeat by generating multiple
+<symbol>KeyPress</symbol>
+events, the device-independent part of the X server by default synthetically
+generates a
+<symbol>KeyRelease</symbol>
+event after each
+<symbol>KeyPress</symbol>
+event. This provides predictable behavior for X clients, but does not allow
+those clients to detect the fact that a key is auto-repeating.
+</para>
+
+
+<para>
+Xkb allows clients to request
+<firstterm>detectable auto-repeat</firstterm>.
+<indexterm significance="preferred" zone="The_DetectableAutorepeat_Control">
+<primary>detectable auto-repeat</primary></indexterm>
+<indexterm significance="preferred" zone="The_DetectableAutorepeat_Control">
+<primary>auto-repeat</primary><secondary>detectable</secondary></indexterm>
+If a client requests and the server supports
+<emphasis>DetectableAutorepeat</emphasis>,
+Xkb generates
+<symbol>KeyRelease</symbol>
+events only when the key is physically released. If
+<emphasis>DetectableAutorepeat</emphasis>
+is not supported or has not been requested, the server synthesizes a
+<symbol>KeyRelease</symbol>
+event for each repeating
+<symbol>KeyPress</symbol>
+event it generates.
+</para>
+
+
+<para>
+<emphasis>DetectableAutorepeat</emphasis>,
+unlike the other controls in this chapter, is not contained in the
+<structname>XkbControlsRec</structname>
+structure, nor can it be enabled or disabled via the
+<emphasis>EnabledControls</emphasis>
+control. Instead, query and set
+<emphasis>DetectableAutorepeat</emphasis>
+using
+<function>XkbGetDetectableAutorepeat</function>
+and
+<function>XkbSetDetectableAutorepeat</function>.
+</para>
+
+
+<para>
+<emphasis>DetectableAutorepeat</emphasis>
+is a condition that applies to all keyboard devices for a client’s
+connection to a given X server; it cannot be selectively set for some devices
+and not for others. For this reason, none of the Xkb library functions
+involving
+<emphasis>DetectableAutorepeat</emphasis>
+involve a device specifier.
+</para>
+
+
+<para>
+To determine whether or not the server supports
+<emphasis>DetectableAutorepeat</emphasis>,
+use
+<function>XkbGetDetectableAutorepeat</function>.
+</para>
+
+<indexterm significance="preferred" zone="XkbGetDetectableAutorepeat"><primary><function>XkbGetDetectableAutorepeat</function></primary></indexterm>
+<funcsynopsis id="XkbGetDetectableAutorepeat">
+  <funcprototype>
+    <funcdef>Bool <function>XkbGetDetectableAutorepeat</function></funcdef>
+<!-- (
+<parameter>display, supported_rtrn</parameter>
+) -->
+
+    <paramdef>Display *<parameter>display</parameter></paramdef>
+    <paramdef>Bool *<parameter>supported_rtrn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>display</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>supported_rtrn</parameter>
+    </term>
+    <listitem>
+      <para>
+        backfilled <symbol>True</symbol> if
+<emphasis>DetectableAutorepeat</emphasis>
+         supported
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbGetDetectableAutorepeat</function>
+queries the server for the current state of
+<emphasis>DetectableAutorepeat</emphasis>
+and waits for a reply. If
+<parameter>supported_rtrn</parameter>
+is not
+<symbol>NULL</symbol>,
+it backfills supported_rtrn with
+<symbol>True</symbol>
+if the server supports
+<emphasis>DetectableAutorepeat</emphasis>,
+and
+<symbol>False</symbol>
+otherwise.
+<function>XkbGetDetectableAutorepeat</function>
+returns the current state of
+<emphasis>DetectableAutorepeat</emphasis>
+for the requesting client:
+<symbol>True</symbol>
+if
+<emphasis>DetectableAutorepeat</emphasis>
+is set, and
+<symbol>False</symbol>
+otherwise.
+</para>
+
+
+<para>
+To set
+<emphasis>DetectableAutorepeat</emphasis>,
+use
+<function>XkbSetDetectableAutorepeat</function>.
+This request affects all keyboard activity for the requesting client only;
+other clients still see the expected nondetectable auto-repeat behavior, unless
+they have requested otherwise.
+</para>
+
+
+<indexterm significance="preferred" zone="XkbSetDetectableAutorepeat"><primary><function>XkbSetDetectableAutorepeat</function></primary></indexterm>
+<funcsynopsis id="XkbSetDetectableAutorepeat">
+  <funcprototype>
+    <funcdef>Bool <function>XkbSetDetectableAutorepeat</function></funcdef>
+<!-- (
+<parameter>display, detectable, supported_rtrn</parameter>
+) -->
+
+    <paramdef>Display *<parameter>display</parameter></paramdef>
+    <paramdef>Bool <parameter>detectable</parameter></paramdef>
+    <paramdef>Bool *<parameter>supported_rtrn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>display</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>detectable</parameter>
+    </term>
+    <listitem>
+      <para>
+        <symbol>True</symbol> &rArr; set
+<emphasis>DetectableAutorepeat</emphasis>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>supported_rtrn</parameter>
+    </term>
+    <listitem>
+      <para>
+        backfilled <symbol>True</symbol> if
+<emphasis>DetectableAutorepeat</emphasis>
+         supported
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbSetDetectableAutorepeat</function>
+sends a request to the server to set
+<emphasis>DetectableAutorepeat</emphasis>
+on for the current client if
+<parameter>detectable</parameter>
+is
+<symbol>True</symbol>,
+and off it
+<parameter>detectable</parameter>
+is
+<symbol>False</symbol>;
+it then waits for a reply. If
+<parameter>supported_rtrn</parameter>
+is not
+<symbol>NULL</symbol>,
+<function>XkbSetDetectableAutorepeat</function>
+backfills
+<parameter>supported_rtrn</parameter>
+with
+<symbol>True</symbol>
+if the server supports
+<emphasis>DetectableAutorepeat</emphasis>,
+and
+<symbol>False</symbol>
+if it does not.
+<function>XkbSetDetectableAutorepeat</function>
+returns the current state of
+<emphasis>DetectableAutorepeat</emphasis>
+for the requesting client:
+<symbol>True</symbol>
+if
+<emphasis>DetectableAutorepeat</emphasis>
+is set, and
+<symbol>False</symbol>
+otherwise.
+</para>
+
+
+</sect2>
+</sect1>
+<sect1 id='Controls_for_Keyboard_Overlays_Overlay1_and_Overlay2_Controls'>
+<title>Controls for Keyboard Overlays (Overlay1 and Overlay2 Controls)</title>
+
+<para>
+A keyboard overlay allows some subset of the keyboard to report alternate
+keycodes when the overlay is enabled. For example, a keyboard overlay can be
+used to simulate a numeric or editing keypad on a keyboard that does not
+actually have one by reusing some portion of the keyboard as an overlay. This
+technique is very common on portable computers and embedded systems with small
+keyboards.
+</para>
+
+
+<para>
+Xkb includes direct support for two keyboard overlays, using the
+<emphasis>Overlay1</emphasis>
+and
+<emphasis>Overlay2</emphasis>
+controls. When
+<emphasis>Overlay1</emphasis>
+is enabled, all of the keys that are members of the first keyboard overlay
+generate an alternate keycode. When
+<emphasis>Overlay2</emphasis>
+is enabled, all of the keys that are members of the second keyboard overlay
+generate an alternate keycode. The two overlays are mutually exclusive; any
+particular key may be in at most one overlay.
+<emphasis>Overlay1</emphasis>
+and
+<emphasis>Overlay2</emphasis>
+are boolean controls. As such, you may enable and disable them using either
+the
+<emphasis>EnabledControls</emphasis>
+control or the
+<emphasis>AutoReset</emphasis>
+control discussed in <link linkend="The_EnabledControls_Control">section 10.1.1</link>.
+</para>
+
+
+<para>
+To specify the overlay to which a key belongs and the alternate keycode it
+should generate when that overlay is enabled, assign it either the
+<symbol>XkbKB_Overlay1</symbol>
+or
+<symbol>XkbKB_Overlay2</symbol>
+key behaviors, as described in <link linkend="Key_Behavior">section 16.2</link>.
+</para>
+
+
+</sect1>
+<sect1 id='Controls_for_Using_the_Mouse_from_the_Keyboard'>
+<title>Controls for Using the Mouse from the Keyboard</title>
+
+<para>
+Using Xkb, it is possible to configure the keyboard to allow simulation of the
+X pointer device. This simulation includes both movement of the pointer itself
+and press and release events associated with the buttons on the pointer. Two
+controls affect this behavior: the
+<emphasis>MouseKeys</emphasis>
+control determines whether or not simulation of the pointer device is active,
+as well as configuring the default button; the
+<emphasis>MouseKeysAccel</emphasis>
+control determines the movement characteristics of the pointer when simulated
+via the keyboard. Both of them are boolean controls; as such, you may enable
+and disable them using either the
+<emphasis>EnabledControls</emphasis>
+control or the
+<emphasis>AutoReset</emphasis>
+control discussed in <link linkend="The_EnabledControls_Control">section 10.1.1</link>. The individual keys that simulate
+different aspects of the pointer device are determined by the keyboard mapping,
+discussed in <xref linkend="Xkb_Server_Keyboard_Mapping" />.
+</para>
+
+
+<sect2 id='The_MouseKeys_Control'>
+<title>The MouseKeys Control</title>
+
+<para>
+The
+<emphasis>MouseKeys</emphasis>
+control allows a user to control all the mouse functions from the keyboard.
+When
+<emphasis>MouseKeys</emphasis>
+are enabled, all keys with
+<emphasis>MouseKeys</emphasis>
+actions bound to them generate core pointer events instead of normal
+<symbol>KeyPress</symbol>
+and
+<symbol>KeyRelease</symbol>
+events.
+</para>
+
+
+<para>
+The
+<emphasis>MouseKeys</emphasis>
+control has a single attribute,
+<structfield>mk_dflt_btn</structfield>
+that specifies the core button number to be used by mouse keys actions that do
+not explicitly specify a button. There is no convenience function for getting
+or setting the attribute; instead use
+<function>XkbGetControls</function>
+and
+<function>XkbSetControls</function>
+(see <link linkend="Querying_Controls">section 10.9</link> and <link linkend="Changing_Controls">section 10.10</link>).
+</para>
+
+<note><para>
+<emphasis>MouseKeys</emphasis>
+can also be turned on and off by pressing the key combination necessary to
+produce an
+<keysym>XK_Pointer_EnableKeys</keysym>
+keysym. The de facto default standard for this is
+<keycombo><keycap>Shift</keycap><keycap>Alt</keycap><keycap>NumLock</keycap></keycombo>,
+but this may vary depending on the keymap.</para></note>
+
+</sect2>
+<sect2 id='The_MouseKeysAccel_Control'>
+<title>The MouseKeysAccel Control</title>
+
+<para>
+When the
+<emphasis>MouseKeysAccel</emphasis>
+control is enabled, the effect of a key-activated pointer motion action
+changes as a key is held down. If the control is disabled, pressing a
+mouse-pointer key yields one mouse event. When
+<emphasis>MouseKeysAccel</emphasis>
+is enabled, mouse movement is defined by an initial distance specified in the
+<symbol>XkbSA_MovePtr</symbol>
+action and the following fields in the
+<structname>XkbControlsRec</structname>
+structure (see <link linkend="The_XkbControlsRec_Structure">section 10.8</link>).
+</para>
+
+<table id='table10.2' frame='topbot'>
+<title>MouseKeysAccel Fields</title>
+<?dbfo keep-together="always" ?>
+<tgroup cols='2' align='left' colsep='0' rowsep='0'>
+<colspec colname='c1' colwidth='1.0*'/>
+<colspec colname='c2' colwidth='2.0*'/>
+<thead>
+<row rowsep='1'>
+  <entry>Field</entry>
+  <entry>Function</entry>
+</row>
+</thead>
+<tbody>
+<row>
+    <entry>mk_delay</entry>
+    <entry>Time (ms) between the initial key press and the first repeated
+motion event</entry>
+</row>
+<row>
+    <entry>mk_interval</entry>
+    <entry>Time (ms) between repeated motion events</entry>
+</row>
+<row>
+    <entry>mk_time_to_max</entry>
+    <entry>Number of events (count) before the pointer reaches maximum
+speed</entry>
+</row>
+<row>
+    <entry>mk_max_speed</entry>
+    <entry>The maximum speed (in pixels per event) the pointer reaches</entry>
+</row>
+<row>
+    <entry>mk_curve</entry>
+    <entry>The ramp used to reach maximum pointer speed</entry>
+  </row>
+</tbody>
+</tgroup>
+</table>
+
+<para>
+There are no convenience functions to query or change the attributes of the
+<emphasis>MouseKeysAccel</emphasis>
+control; instead use
+<function>XkbGetControls</function>
+and
+<function>XkbSetControls</function>
+(see <link linkend="Querying_Controls">section 10.9</link> and <link linkend="Changing_Controls">section 10.10</link>).
+</para>
+
+
+<para>
+The effects of the attributes of the
+<emphasis>MouseKeysAccel</emphasis>
+control depend on whether the
+<symbol>XkbSA_MovePtr</symbol>
+action (see <link linkend="Key_Actions">section 16.1</link>) specifies relative or absolute pointer motion.
+</para>
+
+<sect3 id='Absolute_Pointer_Motion'>
+<title>Absolute Pointer Motion</title>
+
+<para>
+If an
+<symbol>XkbSA_MovePtr</symbol>
+action specifies an absolute position for one of the coordinates but still
+allows acceleration, all repeated events contain any absolute coordinates
+specified in the action. For example, if the
+<symbol>XkbSA_MovePtr</symbol>
+action specifies an absolute position for the X direction, but a relative
+motion for the Y direction, the pointer accelerates in the Y direction, but
+stays at the same X position.
+</para>
+
+
+</sect3>
+<sect3 id='Relative_Pointer_Motion'>
+<title>Relative Pointer Motion</title>
+
+<para>
+If the
+<symbol>XkbSA_MovePtr</symbol>
+action specifies relative motion, the initial event always moves the cursor
+the distance specified in the action. After
+<structfield>mk_delay</structfield>
+milliseconds, a second motion event is generated, and another occurs every
+<structfield>mk_interval</structfield>
+milliseconds until the user releases the key.
+</para>
+
+
+<para>
+Between the time of the second motion event and
+<structfield>mk_time_to_max</structfield>
+intervals, the change in pointer distance per interval increases with each
+interval. After
+<structfield>mk_time_to_max</structfield>
+intervals have elapsed, the change in pointer distance per interval remains
+the same and is calculated by multiplying the original distance specified in
+the action by
+<structfield>mk_max_speed</structfield>.
+</para>
+
+
+<para>
+For example, if the
+<symbol>XkbSA_MovePtr</symbol>
+action specifies a relative motion in the X direction of 5,
+<structfield>mk_delay</structfield>
+=160,
+<structfield>mk_interval</structfield>
+=40,
+<structfield>mk_time_to_max</structfield>
+=30, and
+<structfield>mk_max_speed</structfield>
+=30, the following happens when the user presses the key:
+</para>
+
+<itemizedlist>
+<listitem>
+  <para>
+The pointer immediately moves 5 pixels in the X direction when the key is
+pressed.
+  </para>
+</listitem>
+<listitem>
+  <para>
+After 160 milliseconds
+(<structfield>mk_delay</structfield>),
+and every 40 milliseconds thereafter
+(<structfield>mk_interval</structfield>),
+the pointer moves in the X direction.
+  </para>
+</listitem>
+<listitem>
+  <para>
+The distance in the X direction increases with each interval until 30 intervals
+(
+<structfield>mk_time_to_max</structfield>)
+have elapsed.
+  </para>
+</listitem>
+<listitem>
+  <para>
+After 30 intervals, the pointer stops accelerating, and moves 150 pixels
+(
+<structfield>mk_max_speed</structfield>
+* the original distance) every interval thereafter, until the key is released.
+  </para>
+</listitem>
+</itemizedlist>
+
+<para>
+The increase in pointer difference for each interval is a function of
+<structfield>mk_curve</structfield>.
+Events after the first but before maximum acceleration has been achieved are
+accelerated according to the formula:
+</para>
+
+<mediaobject>
+<imageobject> <imagedata format="SVG" fileref="XKBlib-3.svg"/>
+</imageobject>
+</mediaobject>
+
+
+<para>
+Where
+<emphasis>action_delta</emphasis>
+is the relative motion specified by the
+<symbol>XkbSA_MovePtr</symbol>
+action,
+<structfield>mk_max_speed</structfield>
+and
+<structfield>mk_time_to_max</structfield>
+are parameters to the
+<emphasis>MouseKeysAccel</emphasis>
+control, and the curveFactor is computed using the
+<emphasis>MouseKeysAccel</emphasis>
+<structfield>mk_curve</structfield>
+parameter as follows:
+</para>
+
+<mediaobject>
+<imageobject> <imagedata format="SVG" fileref="XKBlib-4.svg"/>
+</imageobject>
+</mediaobject>
+
+
+<para>
+With the result that a
+<structfield>mk_curve</structfield>
+of zero causes the distance moved to increase linearly from
+<emphasis>action_delta</emphasis>
+to <mediaobject>
+<imageobject> <imagedata format="SVG" fileref="XKBlib-5.svg"/>
+</imageobject>
+</mediaobject>.
+A negative
+<structfield>mk_curve</structfield>
+causes an initial sharp increase in acceleration that tapers off, and a
+positive curve yields a slower initial increase in acceleration followed by a
+sharp increase as the number of pointer events generated by the action
+approaches
+<structfield>mk_time_to_max</structfield>.
+The legal values for
+<structfield>mk_curve</structfield>
+are between &minus;1000 and 1000.
+</para>
+
+
+<para>
+A distance vs. time graph of the pointer motion is shown in
+<link linkend="figure10.1">Figure 10.1</link>.
+</para>
+
+<figure id='figure10.1'>
+  <title>MouseKeys Acceleration</title>
+  <mediaobject>
+   <imageobject> <imagedata format="SVG" fileref="XKBlib-6.svg"/>
+   </imageobject>
+   </mediaobject>
+</figure>
+
+<!--
+<H5 CLASS="Figure">
+MouseKeys Acceleration</H5>
+-->
+</sect3>
+</sect2>
+</sect1>
+<sect1 id='Controls_for_Better_Keyboard_Access_by_Physically_ImpairedPersons'>
+<title>Controls for Better Keyboard Access by Physically Impaired
+Persons</title>
+
+<para>
+The Xkb extension includes several controls specifically aimed at making
+keyboard use more effective for physically impaired people. All of these
+controls are boolean controls and may be individually enabled and disabled, as
+well as configured to tune their specific behavior. The behavior of these
+controls is based on the AccessDOS package
+<footnote><para>
+AccessDOS provides access to the DOS operating system for people with physical
+impairments and was developed by the Trace R&amp;D Center at the University of
+Wisconsin. For more information on AccessDOS, contact the Trace R&amp;D Center,
+Waisman Center and Department of Industrial Engineering, University of
+Wisconsin-Madison WI 53705-2280. Phone: 608-262-6966. e-mail: info@trace.wisc.edu.
+</para></footnote>.
+</para>
+
+<sect2 id='The_AccessXKeys_Control'>
+<title>The AccessXKeys Control</title>
+
+<para>
+Enabling or disabling the keyboard controls through a graphical user interface
+may be impossible for people who need to use the controls. For example, a user
+who needs
+<emphasis>SlowKeys</emphasis>
+(see <link linkend="The_SlowKeys_Control">section 10.6.6</link>) may not even be able to start the graphical application,
+let alone use it, if
+<emphasis>SlowKeys</emphasis>
+is not enabled. To allow easier access to some of the controls, the
+<emphasis>AccessXKeys</emphasis>
+control provides a set of special key sequences similar to those available in
+AccessDOS.
+</para>
+
+
+<para>
+When the
+<emphasis>AccessXKeys</emphasis>
+control is enabled, the user can turn controls on or off from the keyboard by
+entering the following standard key sequences:
+</para>
+
+<itemizedlist>
+<listitem>
+  <para>
+Holding down a <keycap>Shift</keycap> key by itself for eight seconds
+toggles the
+<emphasis>SlowKeys</emphasis>
+control.
+  </para>
+</listitem>
+<listitem>
+  <para>
+Pressing and releasing the left or right
+<keycap>Shift</keycap>
+key five times in a row, without any intervening key events and with less than
+30 seconds delay between consecutive presses, toggles the state of the
+<emphasis>StickyKeys</emphasis>
+control.
+  </para>
+</listitem>
+<listitem>
+  <para>
+Simultaneously operating two or more modifier keys deactivates the
+<emphasis>StickyKeys</emphasis>
+control.
+  </para>
+</listitem>
+</itemizedlist>
+
+<para>
+When the
+<emphasis>AccessXKeys</emphasis>
+control is disabled, Xkb does not look for the above special key sequences.
+</para>
+
+
+<para>
+Some of these key sequences optionally generate audible feedback of the change
+in state, as described in <link linkend="The_AccessXFeedback_Control">section 10.6.3</link>, or
+<symbol>XkbControlsNotify</symbol>
+events, described in <link linkend="Tracking_Changes_to_Keyboard_Controls">section 10.11</link>.
+</para>
+
+</sect2>
+<sect2 id='The_AccessXTimeout_Control'>
+<title>The AccessXTimeout Control</title>
+
+<para>
+In environments where computers are shared, features such as
+<emphasis>SlowKeys</emphasis>
+present a problem: if
+<emphasis>SlowKeys</emphasis>
+is on, the keyboard can appear to be unresponsive because keys are not
+accepted until they are held for a certain period of time. To help solve this
+problem, Xkb provides an
+<emphasis>AccessXTimeout</emphasis>
+control to automatically change the enabled/disabled state of any boolean
+controls and to change the value of the
+<emphasis>AccessXKeys</emphasis>
+and
+<emphasis>AccessXFeedback</emphasis>
+control attributes if the keyboard is idle for a specified period of time.
+</para>
+
+
+<para>
+When a timeout as specified by
+<emphasis>AccessXTimeout</emphasis>
+occurs and a control is consequently modified, Xkb generates an
+<symbol>XkbControlsNotify</symbol>
+event. For more information on
+<symbol>XkbControlsNotify</symbol>
+events, refer to <link linkend="Tracking_Changes_to_Keyboard_Controls">section 10.11</link>.
+</para>
+
+
+<para>
+Use
+<function>XkbGetAccessXTimeout</function>
+to query the current
+<emphasis>AccessXTimeout</emphasis>
+options for a keyboard device.
+</para>
+
+<indexterm significance="preferred" zone="XkbGetAccessXTimeout"><primary><function>XkbGetAccessXTimeout</function></primary></indexterm>
+<funcsynopsis id="XkbGetAccessXTimeout">
+  <funcprototype>
+    <funcdef>Bool <function>XkbGetAccessXTimeout</function></funcdef>
+<!-- (
+<parameter>display</parameter>,
+<parameter>device_spec</parameter>,
+<parameter>timeout_rtrn</parameter>,
+<parameter>ctrls_mask_rtrn</parameter>,
+<parameter>ctrls_values_rtrn</parameter>,
+<parameter>options_mask_rtrn, options_values_rtrn</parameter>
+) -->
+
+    <paramdef>Display *<parameter>display</parameter></paramdef>
+    <paramdef>unsigned int <parameter>device_spec</parameter></paramdef>
+    <paramdef>unsigned short *<parameter>timeout_rtrn</parameter></paramdef>
+    <paramdef>unsigned int *<parameter>ctrls_mask_rtrn</parameter></paramdef>
+    <paramdef>unsigned int *<parameter>ctrls_values_rtrn</parameter></paramdef>
+    <paramdef>unsigned short *<parameter>opts_mask_rtrn</parameter></paramdef>
+    <paramdef>unsigned short *<parameter>opts_values_rtrn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>display</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>device_spec</parameter>
+    </term>
+    <listitem>
+      <para>
+        device to query, or <symbol>XkbUseCoreKbd</symbol>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>timeout_rtrn</parameter>
+    </term>
+    <listitem>
+      <para>
+        delay until AccessXTimeout, seconds
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>ctrls_mask_rtrn</parameter>
+    </term>
+    <listitem>
+      <para>
+        backfilled with controls to modify
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>ctrls_values_rtrn</parameter>
+    </term>
+    <listitem>
+      <para>
+        backfilled with on/off status for controls
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>opts_mask_rtrn</parameter>
+    </term>
+    <listitem>
+      <para>
+        backfilled with <structfield>ax_options</structfield> to modify
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>opts_values_rtrn</parameter>
+    </term>
+    <listitem>
+      <para>
+        backfilled with values for <structfield>ax_options</structfield>
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbGetAccessXTimeout</function>
+sends a request to the X server to obtain the current values for the
+<emphasis>AccessXTimeout</emphasis>
+attributes, waits for a reply, and backfills the values into the appropriate
+arguments.
+The parameters
+<parameter>opts_mask_rtrn</parameter>
+and
+<parameter>opts_values_rtrn</parameter>
+are backfilled with the options to modify and the values for
+<structfield>ax_options</structfield>,
+which is a field in the
+<structname>XkbControlsRec</structname>
+structure (see <link linkend="The_XkbControlsRec_Structure">section 10.8</link>).
+<function>XkbGetAccessXTimeout</function>
+returns
+<symbol>True</symbol>
+if successful; if a compatible version of the Xkb extension is not available
+in the server,
+<function>XkbGetAccessXTimeout</function>
+returns
+<symbol>False</symbol>.
+</para>
+
+
+<para>
+To configure the
+<emphasis>AccessXTimeout</emphasis>
+options for a keyboard device, use
+<function>XkbSetAccessXTimeout</function>.
+</para>
+
+
+<indexterm significance="preferred" zone="XkbSetAccessXTimeout"><primary><function>XkbSetAccessXTimeout</function></primary></indexterm>
+<funcsynopsis id="XkbSetAccessXTimeout">
+  <funcprototype>
+    <funcdef>Bool <function>XkbSetAccessXTimeout</function></funcdef>
+<!-- (
+<parameter>display</parameter>,
+<parameter>device_spec, timeout, ctrls_mask, ctrls_values, opts_mask,
+opts_values</parameter>
+) -->
+
+    <paramdef>Display *<parameter>display</parameter></paramdef>
+    <paramdef>unsigned int <parameter>device_spec</parameter></paramdef>
+    <paramdef>unsigned short <parameter>timeout</parameter></paramdef>
+    <paramdef>unsigned int <parameter>ctrls_mask</parameter></paramdef>
+    <paramdef>unsigned int <parameter>ctrls_values</parameter></paramdef>
+    <paramdef>unsigned short <parameter>opts_mask</parameter></paramdef>
+    <paramdef>unsigned short <parameter>opts_values</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>display</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>device_spec</parameter>
+    </term>
+    <listitem>
+      <para>
+        device to configure, or <symbol>XkbUseCoreKbd</symbol>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>timeout</parameter>
+    </term>
+    <listitem>
+      <para>
+        seconds idle until AccessXTimeout occurs
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>ctrls_mask</parameter>
+    </term>
+    <listitem>
+      <para>
+        boolean controls to modify
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>ctrls_values</parameter>
+    </term>
+    <listitem>
+      <para>
+        new bits for controls selected by <parameter>ctrls_mask</parameter>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>opts_mask</parameter>
+    </term>
+    <listitem>
+      <para>
+        <structfield>ax_options</structfield> to change
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>opts_values</parameter>
+    </term>
+    <listitem>
+      <para>
+        new bits for <structfield>ax_options</structfield> selected by <parameter>opts_mask</parameter>
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<parameter>timeout</parameter>
+specifies the number of seconds the keyboard must be idle before the controls
+are modified.
+<parameter>ctrls_mask</parameter>
+specifies what controls are to be enabled or disabled, and
+<parameter>ctrls_values</parameter>
+specifies whether those controls are to be enabled or disabled. The bit values
+correspond to those for enabling and disabling boolean controls
+(see <link linkend="The_EnabledControls_Control">section 10.1.1</link>). The
+<parameter>opts_mask</parameter>
+field specifies which attributes of the
+<emphasis>AccessXKeys</emphasis>
+and
+<emphasis>AccessXFeedback</emphasis>
+controls are to be changed, and
+<parameter>opts_values</parameter>
+specifies the new values for those options. The bit values correspond to those
+for the
+<structfield>ax_options</structfield>
+field of an
+<structname>XkbDescRec</structname>
+(see <link linkend="The_XkbControlsRec_Structure">section 10.8</link>).
+</para>
+
+
+<para>
+<function>XkbSetAccessXTimeout</function>
+sends a request to configure the
+<emphasis>AccessXTimeout</emphasis>
+control to the server.
+It does not wait for a reply, and normally returns
+<symbol>True</symbol>.
+If a compatible version of the Xkb extension is not available in the server,
+<function>XkbSetAccessXTimeout</function>
+returns
+<symbol>False</symbol>.
+</para>
+
+
+</sect2>
+<sect2 id='The_AccessXFeedback_Control'>
+<title>The AccessXFeedback Control</title>
+
+<para>
+Just as some keyboards can produce keyclicks to indicate when a key is pressed
+or repeating, Xkb can provide feedback for the controls by using special beep
+codes. Use the
+<emphasis>AccessXFeedback</emphasis>
+control to configure the specific types of operations that generate feedback.
+</para>
+
+
+<para>
+There is no convenience function for modifying the
+<emphasis>AccessXFeedback</emphasis>
+control, although the feedback as a whole can be enabled or disabled just as
+other boolean controls are (see <link linkend="Controls_that_Enable_and_Disable_Other_Controls">section 10.1</link>). Individual beep codes are turned
+on or off by modifying the following bits in the
+<structfield>ax_options</structfield>
+field of an
+<structname>XkbControlsRec</structname>
+structure and using
+<function>XkbSetControls</function>
+(see <link linkend="Changing_Controls">section 10.10</link>):
+</para>
+
+<table id='table10.3' frame='topbot'>
+<title>AccessXFeedback Masks</title>
+<?dbfo keep-together="always" ?>
+<tgroup cols='3' align='left' colsep='0' rowsep='0'>
+<colspec colname='c1' colwidth='1.0*'/>
+<colspec colname='c2' colwidth='1.0*'/>
+<colspec colname='c3' colwidth='1.0*'/>
+<thead>
+<row rowsep='1'>
+  <entry>Action</entry>
+  <entry>Beep Code</entry>
+  <entry>ax_options bit</entry>
+  </row>
+</thead>
+<tbody>
+<row>
+    <entry>LED turned on</entry>
+    <entry>High-pitched beep</entry>
+    <entry><symbol>XkbAX_IndicatorFBMask</symbol></entry>
+</row>
+<row>
+    <entry>LED turned off</entry>
+    <entry>Low-pitched beep</entry>
+    <entry><symbol>XkbAX_IndicatorFBMask</symbol></entry>
+</row>
+<row>
+    <entry>More than one LED changed state</entry>
+    <entry>Two high-pitched beeps</entry>
+    <entry><symbol>XkbAX_IndicatorFBMask</symbol></entry>
+</row>
+<row>
+    <entry>Control turned on</entry>
+    <entry>Rising tone</entry>
+    <entry><symbol>XkbAX_FeatureFBMask</symbol></entry>
+</row>
+<row>
+    <entry>Control turned off</entry>
+    <entry>Falling tone</entry>
+    <entry><symbol>XkbAX_FeatureFBMask</symbol></entry>
+</row>
+<row>
+    <entry>More than one control changed state</entry>
+    <entry>Two high-pitched beeps</entry>
+    <entry><symbol>XkbAX_FeatureFBMask</symbol></entry>
+</row>
+<row>
+    <entry>SlowKeys and BounceKeys about to be turned on or off</entry>
+    <entry>Three high-pitched beeps</entry>
+    <entry><symbol>XkbAX_SlowWarnFBMask</symbol></entry>
+</row>
+<row>
+    <entry>SlowKeys key pressed</entry>
+    <entry>Medium-pitched beep</entry>
+    <entry><symbol>XkbAX_SKPressFBMask</symbol></entry>
+</row>
+<row>
+    <entry>SlowKeys key accepted</entry>
+    <entry>Medium-pitched beep</entry>
+    <entry><symbol>XkbAX_SKAcceptFBMask</symbol></entry>
+</row>
+<row>
+    <entry>SlowKeys key rejected</entry>
+    <entry>Low-pitched beep</entry>
+    <entry><symbol>XkbAX_SKRejectFBMask</symbol></entry>
+</row>
+<row>
+    <entry>Accepted SlowKeys key released</entry>
+    <entry>Medium-pitched beep</entry>
+    <entry><symbol>XkbAX_SKReleaseFBMask</symbol></entry>
+</row>
+<row>
+    <entry>BounceKeys key rejected</entry>
+    <entry>Low-pitched beep</entry>
+    <entry><symbol>XkbAX_BKRejectFBMask</symbol></entry>
+</row>
+<row>
+    <entry>StickyKeys key latched</entry>
+    <entry>Low-pitched beep followed by high-pitched beep</entry>
+    <entry><symbol>XkbAX_StickyKeysFBMask</symbol></entry>
+</row>
+<row>
+    <entry>StickyKeys key locked</entry>
+    <entry>High-pitched beep</entry>
+    <entry><symbol>XkbAX_StickyKeysFBMask</symbol></entry>
+</row>
+<row>
+    <entry>StickyKeys key unlocked</entry>
+    <entry>Low-pitched beep</entry>
+    <entry><symbol>XkbAX_StickyKeysFBMask</symbol></entry>
+  </row>
+</tbody>
+</tgroup>
+</table>
+
+<para>
+Implementations that cannot generate continuous tones may generate multiple
+beeps instead of falling and rising tones; for example, they can generate a
+high-pitched beep followed by a low-pitched beep instead of a continuous
+falling tone. Other implementations can only ring the bell with one fixed
+pitch. In these cases, use the
+<symbol>XkbAX_DumbBellFBMask</symbol>
+bit of
+<structfield>ax_options</structfield>
+to indicate that the bell can only ring with a fixed pitch.
+</para>
+
+
+<para>
+When any of the above feedbacks occur, Xkb may generate a
+<symbol>XkbBellNotify</symbol>
+event (see <link linkend="Detecting_Bells">section 9.4</link>).
+</para>
+
+
+</sect2>
+<sect2 id='AccessXNotify_Events'>
+<title>AccessXNotify Events</title>
+
+<indexterm significance="preferred" zone="AccessXNotify_Events">
+<primary>events</primary><secondary><symbol>XkbAccessXNotify</symbol></secondary></indexterm>
+<indexterm significance="preferred" zone="AccessXNotify_Events">
+<primary><structname>XkbAccessXNotifyEvent</structname></primary></indexterm>
+
+<para>
+The server can generate
+<symbol>XkbAccessXNotify</symbol>
+events for some of the global keyboard controls. The structure for the
+<symbol>XkbAccessXNotify</symbol>
+event type is as follows:
+
+<programlisting>
+typedef struct {
+    int             type;            /* Xkb extension base event code */
+    unsigned long   serial;          /* X server serial number for event */
+    Bool            send_event;      /* <symbol>True</symbol> &rArr; synthetically generated */
+    Display *       display;         /* server connection where event generated */
+    Time            time;            /* server time when event generated */
+    int             xkb_type;        /* <symbol>XkbAccessXNotify</symbol> */
+    int             device;          /* Xkb device ID, will not be <symbol>XkbUseCoreKbd</symbol> */
+    int             detail;          /* XkbAXN_* */
+    KeyCode         keycode;         /* key of event */
+    int             slowKeysDelay;   /* current SlowKeys delay */
+    int             debounceDelay;   /* current debounce delay */
+} <structname>XkbAccessXNotifyEvent</structname>;
+</programlisting></para>
+
+<para>
+The
+<structfield>detail</structfield>
+field describes what AccessX event just occurred and can be any of the values
+in <link linkend="table10.4">Table 10.4</link>.
+</para>
+
+<table id='table10.4' frame='topbot'>
+<title>AccessXNotify Events</title>
+<?dbfo keep-together="always" ?>
+<tgroup cols='2' align='left' colsep='0' rowsep='0'>
+<colspec colname='c1' colwidth='1.0*'/>
+<colspec colname='c2' colwidth='2.0*'/>
+<thead>
+<row rowsep='1'>
+  <entry>detail</entry>
+  <entry>Reason</entry>
+</row>
+</thead>
+<tbody>
+<row>
+    <entry><symbol>XkbAXN_SKPress</symbol></entry>
+    <entry>A key was pressed when SlowKeys was enabled.</entry>
+</row>
+<row>
+    <entry><symbol>XkbAXN_SKAccept</symbol></entry>
+    <entry>A key was accepted (held longer than the SlowKeys delay).</entry>
+</row>
+<row>
+    <entry><symbol>XkbAXN_SKRelease</symbol></entry>
+    <entry>An accepted SlowKeys key was released.</entry>
+</row>
+<row>
+    <entry><symbol>XkbAXN_SKReject</symbol></entry>
+    <entry>A key was rejected (released before the SlowKeys delay
+expired).</entry>
+</row>
+<row>
+    <entry><symbol>XkbAXN_BKAccept</symbol></entry>
+    <entry>A key was accepted by BounceKeys.</entry>
+</row>
+<row>
+    <entry><symbol>XkbAXN_BKReject</symbol></entry>
+    <entry>A key was rejected (pressed before the BounceKeys delay
+expired).</entry>
+</row>
+<row>
+    <entry><symbol>XkbAXN_AXKWarning</symbol></entry>
+    <entry>AccessXKeys is about to turn on/off StickyKeys or BounceKeys.</entry>
+  </row>
+</tbody>
+</tgroup>
+</table>
+
+<para>
+The
+<structfield>keycode</structfield>
+field reports the keycode of the key for which the event occurred. If the
+action is related to
+<emphasis>SlowKeys</emphasis>,
+the
+<structfield>slowKeysDelay</structfield>
+field contains the current
+<emphasis>SlowKeys</emphasis>
+acceptance delay. If the action is related to
+<emphasis>BounceKeys</emphasis>,
+the
+<structfield>debounceDelay</structfield>
+field contains the current
+<emphasis>BounceKeys</emphasis>
+debounce delay.
+</para>
+
+<sect3 id='Selecting_for_AccessX_Events'>
+<title>Selecting for AccessX Events</title>
+
+<para>
+To receive
+<symbol>XkbAccessXNotify</symbol>
+events under all possible conditions, use
+<function>XkbSelectEvents</function>
+(see <link linkend="Selecting_Xkb_Events">section 4.3</link>) and pass
+<symbol>XkbAccessXNotifyMask</symbol>
+in both
+<parameter>bits_to_change</parameter>
+and
+<parameter>values_for_bits</parameter>.
+</para>
+
+
+<para>
+To receive
+<symbol>XkbStateNotify</symbol>
+events only under certain conditions, use
+<function>XkbSelectEventDetails</function>
+using
+<symbol>XkbAccessXNotify</symbol>
+as the
+<structfield>event_type</structfield>
+and specifying the desired state changes in
+<parameter>bits_to_change</parameter>
+and
+<parameter>values_for_bits</parameter>
+using mask bits from <link linkend="table10.5">Table 10.5</link>.
+</para>
+
+<table id='table10.5' frame='topbot'>
+<title>AccessXNotify Event Details</title>
+<?dbfo keep-together="always" ?>
+<tgroup cols='3' align='left' colsep='0' rowsep='0'>
+<colspec colname='c1' colwidth='1.5*'/>
+<colspec colname='c2' colwidth='1.0*'/>
+<colspec colname='c3' colwidth='2.0*'/>
+<thead>
+<row rowsep='1'>
+  <entry>XkbAccessXNotify Event Details</entry>
+  <entry>Value</entry>
+  <entry>Circumstances</entry>
+  </row>
+</thead>
+<tbody>
+  <row>
+    <entry><symbol>XkbAXN_SKPressMask</symbol></entry>
+    <entry>(1&lt;&lt;0)</entry>
+    <entry>Slow key press notification wanted</entry>
+  </row>
+  <row>
+    <entry><symbol>XkbAXN_SKAcceptMask</symbol></entry>
+    <entry>(1&lt;&lt;1)</entry>
+    <entry>Slow key accept notification wanted</entry>
+  </row>
+  <row>
+    <entry><symbol>XkbAXN_SKRejectMask</symbol></entry>
+    <entry>(1&lt;&lt;2)</entry>
+    <entry>Slow key reject notification wanted</entry>
+  </row>
+  <row>
+    <entry><symbol>XkbAXN_SKReleaseMask</symbol></entry>
+    <entry>(1&lt;&lt;3)</entry>
+    <entry>Slow key release notification wanted</entry>
+  </row>
+  <row>
+    <entry><symbol>XkbAXN_BKAcceptMask</symbol></entry>
+    <entry>(1&lt;&lt;4)</entry>
+    <entry>Bounce key accept notification wanted</entry>
+  </row>
+  <row>
+    <entry><symbol>XkbAXN_BKRejectMask</symbol></entry>
+    <entry>(1&lt;&lt;5)</entry>
+    <entry>Bounce key reject notification wanted</entry>
+  </row>
+  <row>
+    <entry><symbol>XkbAXN_AXKWarningMask</symbol></entry>
+    <entry>(1&lt;&lt;6)</entry>
+    <entry>AccessX warning notification wanted</entry>
+  </row>
+  <row>
+    <entry>XkbAXN_AllEventsMask</entry>
+    <entry>(0x7f)</entry>
+    <entry>All AccessX features notifications wanted</entry>
+  </row>
+</tbody>
+</tgroup>
+</table>
+
+</sect3>
+</sect2>
+<sect2 id='StickyKeys_RepeatKeys_and_MouseKeys_Events'>
+<title>StickyKeys, RepeatKeys, and MouseKeys Events</title>
+
+<para>
+The
+<emphasis>StickyKeys</emphasis>,
+<emphasis>RepeatKeys</emphasis>,
+and
+<emphasis>MouseKeys</emphasis>
+controls do not generate specific events. Instead, the latching, unlatching,
+locking, or unlocking of modifiers using
+<emphasis>StickyKeys</emphasis>
+generates
+<symbol>XkbStateNotify</symbol>
+events as described in <link linkend="Tracking_Keyboard_State">section 5.4</link>. Repeating keys generate normal
+<symbol>KeyPress</symbol>
+and
+<symbol>KeyRelease</symbol>
+events, though the auto-repeat can be detected using
+<emphasis>DetectableAutorepeat</emphasis>
+(see <link linkend="The_DetectableAutorepeat_Control">section 10.3.3</link>). Finally,
+<emphasis>MouseKeys</emphasis>
+generates pointer events identical to those of the core pointer device.
+</para>
+
+
+</sect2>
+<sect2 id='The_SlowKeys_Control'>
+<title>The SlowKeys Control</title>
+
+<para>
+Some users may accidentally bump keys while moving a hand or typing stick
+toward the key they want. Usually, the keys that are accidentally bumped are
+just hit for a very short period of time. The
+<emphasis>SlowKeys</emphasis>
+control helps filter these accidental bumps by telling the server to wait a
+specified period, called the
+<firstterm>SlowKeys acceptance delay</firstterm>,
+before delivering key events. If the key is released before this period
+elapses, no key events are generated. Users can then bump any number of keys on
+their way to the one they want without accidentally getting those characters.
+Once they have reached the key they want, they can then hold the desired key
+long enough for the computer to accept it.
+<emphasis>SlowKeys</emphasis>
+is a boolean control with one configurable attribute.
+</para>
+
+<para>
+When the
+<emphasis>SlowKeys</emphasis>
+control is active, the server reports the initial key press, subsequent
+acceptance or rejection, and release of any key to interested clients by
+sending an appropriate
+<emphasis>AccessXNotify</emphasis>
+event (see <link linkend="AccessXNotify_Events">section 10.6.4</link>).
+</para>
+
+<para>
+To get the
+<emphasis>SlowKeys</emphasis>
+acceptance delay for a keyboard device, use
+<function>XkbGetSlowKeysDelay</function>.
+</para>
+
+<indexterm significance="preferred" zone="XkbGetSlowKeysDelay"><primary><function>XkbGetSlowKeysDelay</function></primary></indexterm>
+<funcsynopsis id="XkbGetSlowKeysDelay">
+  <funcprototype>
+    <funcdef>Bool <function>XkbGetSlowKeysDelay</function></funcdef>
+<!-- (
+<parameter>display</parameter>,
+<parameter>device_spec</parameter>,
+<parameter>delay_rtrn</parameter>
+) -->
+
+    <paramdef>Display *<parameter>display</parameter></paramdef>
+    <paramdef>unsigned int <parameter>device_spec</parameter></paramdef>
+    <paramdef>unsigned int *<parameter>delay_rtrn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>display</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>device_spec</parameter>
+    </term>
+    <listitem>
+      <para>
+        device ID, or <symbol>XkbUseCoreKbd</symbol>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>delay_rtrn</parameter>
+    </term>
+    <listitem>
+      <para>
+        backfilled with <emphasis>SlowKeys</emphasis> delay, ms
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbGetSlowKeysDelay</function>
+requests the attributes of the
+<emphasis>SlowKeys</emphasis>
+control from the server, waits for a reply and backfills
+<parameter>delay_rtrn</parameter>
+with the
+<emphasis>SlowKeys</emphasis>
+delay attribute.
+<function>XkbGetSlowKeysDelay</function>
+returns
+<symbol>True</symbol>
+if successful; if a compatible version of the Xkb extension is not available
+in the server,
+<function>XkbGetSlowKeysDelay</function>
+returns
+<symbol>False</symbol>.
+</para>
+
+
+<para>
+To set the
+<emphasis>SlowKeys</emphasis>
+acceptance delay for a keyboard device, use
+<function>XkbSetSlowKeysDelay</function>.
+</para>
+
+
+<indexterm significance="preferred" zone="XkbSetSlowKeysDelay"><primary><function>XkbSetSlowKeysDelay</function></primary></indexterm>
+<funcsynopsis id="XkbSetSlowKeysDelay">
+  <funcprototype>
+    <funcdef>Bool <function>XkbSetSlowKeysDelay</function></funcdef>
+<!-- (
+<parameter>display</parameter>,
+<parameter>device_spec</parameter>,
+<parameter>delay</parameter>
+) -->
+
+    <paramdef>Display *<parameter>display</parameter></paramdef>
+    <paramdef>unsigned int <parameter>device_spec</parameter></paramdef>
+    <paramdef>unsigned int <parameter>delay</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>display</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>device_spec</parameter>
+    </term>
+    <listitem>
+      <para>
+        device to configure, or <symbol>XkbUseCoreKbd</symbol>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>delay</parameter>
+    </term>
+    <listitem>
+      <para>
+        <emphasis>SlowKeys</emphasis> delay, ms
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbSetSlowKeysDelay</function>
+sends a request to configure the
+<emphasis>SlowKeys</emphasis>
+control to the server.
+It does not wait for a reply, and normally returns
+<symbol>True</symbol>.
+Specifying a value of
+<literal>0</literal>
+for the
+<parameter>delay</parameter>
+parameter causes
+<function>XkbSetSlowKeysDelay</function>
+to generate a
+<errorname>BadValue</errorname>
+protocol error. If a compatible version of the Xkb extension is not available
+in the server
+<function>XkbSetSlowKeysDelay</function>
+returns
+<symbol>False</symbol>.
+</para>
+
+
+</sect2>
+<sect2 id='The_BounceKeys_Control'>
+<title>The BounceKeys Control</title>
+
+<para>
+Some users may accidentally <quote>bounce</quote> on a key when they release it.
+They press it once, then accidentally press it again after they release it. The
+<emphasis>BounceKeys</emphasis>
+control temporarily disables a key after it has been pressed, effectively
+<quote>debouncing</quote> the keyboard. The period of time the key is disabled
+after it is released is known as the
+<firstterm>BounceKeys delay</firstterm>.
+<emphasis>BounceKeys</emphasis>
+is a boolean control.
+</para>
+
+
+<para>
+When the
+<emphasis>BounceKeys</emphasis>
+control is active, the server reports acceptance or rejection of any key to
+interested clients by sending an appropriate
+<emphasis>AccessXNotify</emphasis>
+event (see <link linkend="AccessXNotify_Events">section 10.6.4</link>).
+</para>
+
+
+<para>
+Use
+<function>XkbGetBounceKeysDelay</function>
+to query the current
+<emphasis>BounceKeys</emphasis>
+delay for a keyboard device.
+</para>
+
+<indexterm significance="preferred" zone="XkbGetBounceKeysDelay"><primary><function>XkbGetBounceKeysDelay</function></primary></indexterm>
+<funcsynopsis id="XkbGetBounceKeysDelay">
+  <funcprototype>
+    <funcdef>Bool <function>XkbGetBounceKeysDelay</function></funcdef>
+<!-- (
+<parameter>display</parameter>,
+<parameter>device_spec</parameter>,
+<parameter>delay_rtrn</parameter>
+) -->
+
+    <paramdef>Display *<parameter>display</parameter></paramdef>
+    <paramdef>unsigned int <parameter>device_spec</parameter></paramdef>
+    <paramdef>unsigned int *<parameter>delay_rtrn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>display</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>device_spec</parameter>
+    </term>
+    <listitem>
+      <para>
+        device ID, or <symbol>XkbUseCoreKbd</symbol>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>delay_rtrn</parameter>
+    </term>
+    <listitem>
+      <para>
+        backfilled with bounce keys delay, ms
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbGetBounceKeysDelay</function>
+requests the attributes of the
+<emphasis>BounceKeys</emphasis>
+control from the server, waits for a reply, and backfills
+<parameter>delay_rtrn</parameter>
+with the
+<emphasis>BounceKeys</emphasis>
+delay attribute.
+<function>XkbGetBounceKeysDelay</function>
+returns
+<symbol>True</symbol>
+if successful; if a compatible version of the Xkb extension is not available
+in the server
+<function>XkbGetSlowKeysDelay</function>
+returns
+<symbol>False</symbol>.
+</para>
+
+
+<para>
+To set the
+<emphasis>BounceKeys</emphasis>
+delay for a keyboard device, use
+<function>XkbSetBounceKeysDelay</function>.
+</para>
+
+
+<indexterm significance="preferred" zone="XkbSetBounceKeysDelay"><primary><function>XkbSetBounceKeysDelay</function></primary></indexterm>
+<funcsynopsis id="XkbSetBounceKeysDelay">
+  <funcprototype>
+    <funcdef>Bool <function>XkbSetBounceKeysDelay</function></funcdef>
+<!-- (
+<parameter>display</parameter>,
+<parameter>device_spec</parameter>,
+<parameter>delay</parameter>
+) -->
+
+    <paramdef>Display *<parameter>display</parameter></paramdef>
+    <paramdef>unsigned int <parameter>device_spec</parameter></paramdef>
+    <paramdef>unsigned int <parameter>delay</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>display</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>device_spec</parameter>
+    </term>
+    <listitem>
+      <para>
+        device to configure, or <symbol>XkbUseCoreKbd</symbol>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>delay</parameter>
+    </term>
+    <listitem>
+      <para>
+        bounce keys delay, ms
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbSetBounceKeysDelay</function>
+sends a request to configure the
+<emphasis>BounceKeys</emphasis>
+control to the server.
+It does not wait for a reply and normally returns
+<symbol>True</symbol>.
+Specifying a value of
+<emphasis>zero</emphasis>
+for the
+<parameter>delay</parameter>
+parameter causes
+<function>XkbSetBounceKeysDelay</function>
+to generate a
+<errorname>BadValue</errorname>
+protocol error. If a compatible version of the Xkb extension is not available
+in the server,
+<function>XkbSetBounceKeysDelay</function>
+returns
+<symbol>False</symbol>.
+</para>
+
+</sect2>
+<sect2 id='The_StickyKeys_Control'>
+<title>The StickyKeys Control</title>
+
+<para>
+Some people find it difficult or even impossible to press two keys at once. For
+example, a one-fingered typist or someone using a mouth stick cannot press the
+<keycap>Shift</keycap>
+and
+<keycap>1</keycap>
+keys at the same time. The
+<emphasis>StickyKeys</emphasis>
+control solves this problem by changing the behavior of the modifier keys.
+With
+<emphasis>StickyKeys</emphasis>,
+the user can first press a modifier, release it, then press another key. For
+example, to get an exclamation point on a PC-style keyboard, the user can press
+the
+<keycap>Shift</keycap>
+key, release it, and then press the
+<keycap>1</keycap>
+key.
+</para>
+
+
+<para>
+<emphasis>StickyKeys</emphasis>
+also allows users to lock modifier keys without requiring special locking
+keys. When
+<emphasis>StickyKeys</emphasis>
+is enabled, a modifier is latched when the user presses it just once. The user
+can press a modifier twice in a row to lock it, and then unlock it by pressing
+it one more time.
+</para>
+
+
+<para>
+When a modifier is latched, it becomes unlatched when the user presses a
+nonmodifier key or a pointer button. For instance, to enter the sequence
+<keycombo>
+<keycap>Shift</keycap>
+<keycap>Control</keycap>
+<keycap>Z</keycap>
+</keycombo>
+the user could press and release the
+<keycap>Shift</keycap>
+key to latch it, then press and release the
+<keycap>Control</keycap>
+key to latch it, and finally press and release the
+<keycap>Z</keycap> key. Because the
+<keycap>Control</keycap>
+key is a modifier key, pressing it does not unlatch the
+<keycap>Shift</keycap>
+key. Thus, after the user presses the
+<keycap>Control</keycap>
+key, both the
+<symbol>Shift</symbol>
+and
+<symbol>Control</symbol>
+modifiers are latched. When the user presses the
+<keycap>Z</keycap>
+key, the effect is as though the user had pressed
+<keycombo>
+<keycap>Shift</keycap>
+<keycap>Control</keycap>
+<keycap>Z</keycap>
+</keycombo>.
+In addition, because the
+<keycap>Z</keycap>
+key is not a modifier key, the
+<symbol>Shift</symbol>
+and
+<symbol>Control</symbol>
+modifiers are unlatched.
+</para>
+
+
+<para>
+Locking a modifier key means that the modifier affects any key or pointer
+button the user presses until the user unlocks it or it is unlocked
+programmatically. For example, to enter the sequence ("XKB") on a keyboard
+where ‘(’ is a shifted ‘9’, ‘)’ is a shifted ‘0’, and ‘"’
+is a shifted single quote, the user could press and release the
+<keycap>Shift</keycap>
+key twice to lock the
+<symbol>Shift</symbol>
+modifier. Then, when the user presses the
+<keycap>9</keycap>,
+<keycap>'</keycap>,
+<keycap>x</keycap>,
+<keycap>k</keycap>,
+<keycap>b</keycap>,
+<keycap>'</keycap>,
+and
+<keycap>0</keycap>
+keys in sequence, it generates ("XKB"). To unlock the
+<symbol>Shift</symbol>
+modifier, the user can press and release the
+<keycap>Shift</keycap>
+key.
+</para>
+
+
+<para>
+<emphasis>StickyKeys</emphasis>
+is a boolean control with two separate attributes that may be individually
+configured: one to automatically disable it, and one to control the latching
+behavior of modifier keys.
+</para>
+
+<sect3 id='StickyKeys_Options'>
+<title>StickyKeys Options</title>
+
+<para>
+The
+<emphasis>StickyKeys</emphasis>
+control has two options that can be accessed via the
+<structfield>ax_options</structfield>
+of an
+<structname>XkbControlsRec</structname>
+structure (see <link linkend="The_XkbControlsRec_Structure">section 10.8</link>). The first option,
+<emphasis>TwoKeys</emphasis>,
+specifies whether
+<emphasis>StickyKeys</emphasis>
+should automatically turn off when two keys are pressed at the same time. This
+feature is useful for shared computers so people who do not want them do not
+need to turn
+<emphasis>StickyKeys</emphasis>
+off if a previous user left
+<emphasis>StickyKeys</emphasis>
+on. The second option,
+<emphasis>LatchToLock</emphasis>,
+specifies whether or not
+<emphasis>StickyKeys</emphasis>
+locks a modifier when pressed twice in a row.
+</para>
+
+
+<para>
+Use
+<function>XkbGetStickyKeysOptions</function>
+to query the current
+<emphasis>StickyKeys</emphasis>
+attributes for a keyboard device.
+</para>
+
+<indexterm significance="preferred" zone="XkbGetStickyKeysOptions"><primary><function>XkbGetStickyKeysOptions</function></primary></indexterm>
+<funcsynopsis id="XkbGetStickyKeysOptions">
+  <funcprototype>
+    <funcdef>Bool <function>XkbGetStickyKeysOptions</function></funcdef>
+<!-- (
+<parameter>display</parameter>,
+<parameter>device_spec</parameter>,
+<parameter>options_rtrn</parameter>
+) -->
+
+    <paramdef>Display *<parameter>display</parameter></paramdef>
+    <paramdef>unsigned int <parameter>device_spec</parameter></paramdef>
+    <paramdef>unsigned int *<parameter>options_rtrn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>display</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>device_spec</parameter>
+    </term>
+    <listitem>
+      <para>
+        device ID, or <symbol>XkbUseCoreKbd</symbol>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>options_rtrn</parameter>
+    </term>
+    <listitem>
+      <para>
+        backfilled with StickyKeys option mask
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbGetStickyKeysOptions</function>
+requests the attributes of the
+<emphasis>StickyKeys</emphasis>
+control from the server, waits for a reply, and backfills
+<parameter>options_rtrn</parameter>
+with a mask indicating whether the individual
+<emphasis>StickyKeys</emphasis>
+options are on or off. Valid bits in
+<parameter>options_rtrn</parameter>
+are:
+
+  <simplelist type='vert' columns='1'>
+    <member><symbol>XkbAX_TwoKeysMask</symbol></member>
+    <member><symbol>XkbAX_LatchToLockMask</symbol></member>
+  </simplelist>
+</para>
+
+<para>
+<function>XkbGetStickyKeysOptions</function>
+returns
+<symbol>True</symbol>
+if successful; if a compatible version of the Xkb extension is not available
+in the server
+<function>XkbGetStickyKeysOptions</function>
+returns
+<symbol>False</symbol>.
+</para>
+
+
+<para>
+To set the
+<emphasis>StickyKeys</emphasis>
+attributes for a keyboard device, use
+<function>XkbSetStickyKeysOptions</function>.
+</para>
+
+
+<indexterm significance="preferred" zone="XkbSetStickyKeysOptions"><primary><function>XkbSetStickyKeysOptions</function></primary></indexterm>
+<funcsynopsis id="XkbSetStickyKeysOptions">
+  <funcprototype>
+    <funcdef>Bool <function>XkbSetStickyKeysOptions</function></funcdef>
+<!-- (
+<parameter>display</parameter>,
+<parameter>device_spec, mask, values</parameter>
+) -->
+
+    <paramdef>Display *<parameter>display</parameter></paramdef>
+    <paramdef>unsigned int <parameter>device_spec</parameter></paramdef>
+    <paramdef>unsigned int <parameter>mask</parameter></paramdef>
+    <paramdef>unsigned int <parameter>values</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>display</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>device_spec</parameter>
+    </term>
+    <listitem>
+      <para>
+        device to configure, or XkbUseCoreKbd
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>mask</parameter>
+    </term>
+    <listitem>
+      <para>
+        selects StickyKeys attributes to modify
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>values</parameter>
+    </term>
+    <listitem>
+      <para>
+        values for selected attributes
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbSetStickyKeysOptions</function>
+sends a request to configure the
+<emphasis>StickyKeys</emphasis>
+control to the server.
+It does not wait for a reply and normally returns
+<symbol>True</symbol>.
+The valid bits to use for both the
+<parameter>mask</parameter>
+and
+<parameter>values</parameter>
+parameters are:
+
+  <simplelist type='vert' columns='1'>
+    <member><symbol>XkbAX_TwoKeysMask</symbol></member>
+    <member><symbol>XkbAX_LatchToLockMask</symbol></member>
+  </simplelist>
+</para>
+
+<para>
+If a compatible version of the Xkb extension is not available in the server,
+<function>XkbSetStickyKeysOptions</function>
+returns
+<symbol>False</symbol>.
+</para>
+
+</sect3>
+</sect2>
+</sect1>
+<sect1 id='Controls_for_General_Keyboard_Mapping'>
+<title>Controls for General Keyboard Mapping</title>
+
+<para>
+There are several controls that apply to the keyboard mapping in general. They
+control handling of out-of-range group indices and how modifiers are processed
+and consumed in the server. These are:
+
+  <simplelist type='vert' columns='1'>
+    <member><emphasis>GroupsWrap</emphasis></member>
+    <member><emphasis>IgnoreGroupLock</emphasis></member>
+    <member><emphasis>IgnoreLockMods</emphasis></member>
+    <member><emphasis>InternalMods</emphasis></member>
+  </simplelist>
+</para>
+
+<para>
+<emphasis>IgnoreGroupLock</emphasis>
+is a boolean control; the rest are always active.
+</para>
+
+
+<para>
+Without the modifier processing options provided by Xkb, passive grabs set via
+translations in a client (for example,
+<emphasis>Alt&lt;KeyPress&gt;space</emphasis>)
+do not trigger if any modifiers other than those specified by the translation
+are set. This results in problems in the user interface when either
+<emphasis>NumLock</emphasis>
+or a secondary keyboard group is active. The
+<emphasis>IgnoreLockMods</emphasis>
+and
+<emphasis>IgnoreGroupLock</emphasis>
+controls make it possible to avoid this behavior without exhaustively
+specifying a grab for every possible modifier combination.
+</para>
+
+<sect2 id='The_GroupsWrap_Control'>
+<title>The GroupsWrap Control</title>
+
+<para>
+The
+<emphasis>GroupsWrap</emphasis>
+control determines how illegal groups are handled on a global basis. There are
+a number of valid keyboard sequences that can cause the effective group number
+to go out of range. When this happens, the group must be normalized back to a
+valid number. The
+<emphasis>GroupsWrap</emphasis>
+control specifies how this is done.
+</para>
+
+
+<para>
+When dealing with group numbers, all computations are done using the group
+index, which is the group number minus one. There are three different
+algorithms; the
+<emphasis>GroupsWrap</emphasis>
+control specifies which one is used:
+</para>
+
+<itemizedlist>
+<listitem>
+  <para>XkbRedirectIntoRange</para>
+  <para>
+All invalid group numbers are converted to a valid group number by taking the
+last four bits of the
+<emphasis>GroupsWrap</emphasis>
+control and using them as the group index. If the result is still out of
+range, Group one is used.
+  </para>
+</listitem>
+<listitem>
+  <para>
+XkbClampIntoRange
+  </para>
+  <para>
+All invalid group numbers are converted to the nearest valid group number.
+Group numbers larger than the highest supported group number are mapped to the
+highest supported group; those less than one are mapped to group one.
+  </para>
+</listitem>
+<listitem>
+  <para>XkbWrapIntoRange</para>
+  <para>
+All invalid group numbers are converted to a valid group number using integer
+modulus applied to the group index.
+  </para>
+</listitem>
+</itemizedlist>
+
+<para>
+There are no convenience functions for manipulating the
+<emphasis>GroupsWrap</emphasis>
+control. Manipulate the
+<emphasis>GroupsWrap</emphasis>
+control via the
+<structfield>groups_wrap</structfield>
+field in the
+<structname>XkbControlsRec</structname>
+structure, then use
+<function>XkbSetControls</function>
+and
+<function>XkbGetControls</function>
+(see <link linkend="Querying_Controls">section 10.9</link> and <link linkend="Changing_Controls">section 10.10</link>) to query and change this control.
+</para>
+
+<note><para>See also <link linkend="Per_Key_Group_Information">section 15.3.2</link> or a discussion of the related field,
+<structfield>group_info</structfield>,
+which also normalizes a group under certain circumstances.</para></note>
+
+</sect2>
+<sect2 id='The_IgnoreLockMods_Control'>
+<title>The IgnoreLockMods Control</title>
+
+<para>
+The core protocol does not provide a way to exclude specific modifiers from
+grab calculations, with the result that locking modifiers sometimes have
+unanticipated side effects.
+</para>
+
+
+<para>
+The
+<emphasis>IgnoreLockMods</emphasis>
+control specifies modifiers that should be excluded from grab calculations.
+These modifiers are also not reported in any core events except
+<symbol>KeyPress</symbol>
+and
+<symbol>KeyRelease</symbol>
+events that do not activate a passive grab and that do not occur while a grab
+is active.
+</para>
+
+
+<para>
+Manipulate the
+<emphasis>IgnoreLockMods</emphasis>
+control via the
+<structfield>ignore_lock</structfield>
+field in the
+<structname>XkbControlsRec</structname>
+structure, then use
+<function>XkbSetControls</function>
+and
+<function>XkbGetControls</function>
+(see <link linkend="Querying_Controls">section 10.9</link> and <link linkend="Changing_Controls">section 10.10</link>) to query and change this control. Alternatively,
+use
+<function>XkbSetIgnoreLockMods</function>.
+</para>
+
+
+<para>
+To set the modifiers that, if locked, are not to be reported in matching events
+to passive grabs, use
+<function>XkbSetIgnoreLockMods</function>.
+</para>
+
+<indexterm significance="preferred" zone="XkbSetIgnoreLockMods"><primary><function>XkbSetIgnoreLockMods</function></primary></indexterm>
+<funcsynopsis id="XkbSetIgnoreLockMods">
+  <funcprototype>
+    <funcdef>Bool <function>XkbSetIgnoreLockMods</function></funcdef>
+<!-- (
+<parameter>display, device_spec, affect_real, real_values, affect_virtual,
+virtual_values</parameter>
+) -->
+
+    <paramdef>Display *<parameter>display</parameter></paramdef>
+    <paramdef>unsigned int <parameter>device_spec</parameter></paramdef>
+    <paramdef>unsigned int <parameter>affect_real</parameter></paramdef>
+    <paramdef>unsigned int <parameter>real_values</parameter></paramdef>
+    <paramdef>unsigned int <parameter>affect_virtual</parameter></paramdef>
+    <paramdef>unsigned int <parameter>virtual_values</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>display</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to the X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>device_spec</parameter>
+    </term>
+    <listitem>
+      <para>
+        device ID, or <symbol>XkbUseCoreKbd</symbol>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>affect_real</parameter>
+    </term>
+    <listitem>
+      <para>
+        mask of real modifiers affected by this call
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>real_values</parameter>
+    </term>
+    <listitem>
+      <para>
+        values for affected real modifiers (1&rArr;set, 0&rArr;unset)
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>affect_virtual</parameter>
+    </term>
+    <listitem>
+      <para>
+        mask of virtual modifiers affected by this call
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>virtual_values</parameter>
+    </term>
+    <listitem>
+      <para>
+        values for affected virtual modifiers (1&rArr;set, 0&rArr;unset)
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbSetIgnoreLockMods</function>
+sends a request to the server to change the server’s
+<emphasis>IgnoreLockMods</emphasis>
+control.
+<parameter>affect_real</parameter>
+and
+<parameter>real_values</parameter>
+are masks of real modifier bits indicating which real modifiers are to be
+added and removed from the server’s
+<emphasis>IgnoreLockMods</emphasis>
+control. Modifiers selected by both
+<parameter>affect_real</parameter>
+and
+<parameter>real_values</parameter>
+are added to the server’s
+<emphasis>IgnoreLockMods</emphasis>
+control; those selected by
+<parameter>affect_real</parameter>
+but not by
+<parameter>real_values</parameter>
+are removed from the server’s
+<emphasis>IgnoreLockMods</emphasis>
+control. Valid values for
+<parameter>affect_real</parameter>
+and
+<parameter>real_values</parameter>
+consist of any combination of the eight core modifier bits:
+<symbol>ShiftMask</symbol>,
+<symbol>LockMask</symbol>,
+<symbol>ControlMask</symbol>,
+<symbol>Mod1Mask</symbol>
+&ndash;
+<symbol>Mod5Mask</symbol>.
+<parameter>affect_virtual</parameter>
+and
+<parameter>virtual_values</parameter>
+are masks of virtual modifier bits indicating which virtual modifiers are to
+be added and removed from the server’s
+<emphasis>IgnoreLockMods</emphasis>
+control. Modifiers selected by both
+<parameter>affect_virtual</parameter>
+and
+<parameter>virtual_values</parameter>
+are added to the server’s
+<emphasis>IgnoreLockMods</emphasis>
+control; those selected by
+<parameter>affect_virtual</parameter>
+but not by
+<parameter>virtual_values</parameter>
+are removed from the server’s
+<emphasis>IgnoreLockMods</emphasis>
+control.
+See <link linkend="Virtual_Modifier_Names_and_Masks">section 7.1</link> for a discussion of virtual modifier masks to use in
+<parameter>affect_virtual</parameter>
+and
+<parameter>virtual_values</parameter>.
+<function>XkbSetIgnoreLockMods</function>
+does not wait for a reply from the server. It returns
+<symbol>True</symbol>
+if the request was sent, and
+<symbol>False</symbol>
+otherwise.
+</para>
+
+</sect2>
+<sect2 id='The_IgnoreGroupLock_Control'>
+<title>The IgnoreGroupLock Control</title>
+
+<para>
+The
+<emphasis>IgnoreGroupLock</emphasis>
+control is a boolean control with no attributes. If enabled, it specifies that
+the locked state of the keyboard group should not be considered when activating
+passive grabs.
+</para>
+
+<para>
+Because
+<emphasis>IgnoreGroupLock</emphasis>
+is a boolean control with no attributes, use the general boolean controls
+functions (see <link linkend="Controls_that_Enable_and_Disable_Other_Controls">section 10.1</link>) to change its state.
+</para>
+
+
+</sect2>
+<sect2 id='The_InternalMods_Control'>
+<title>The InternalMods Control</title>
+
+<para>
+The core protocol does not provide any means to prevent a modifier from being
+reported in events sent to clients; Xkb, however makes this possible via the
+<emphasis>InternalMods</emphasis>
+control. It specifies modifiers that should be consumed by the server and not
+reported to clients. When a key is pressed and a modifier that has its bit set
+in the
+<emphasis>InternalMods</emphasis>
+control is reported to the server, the server uses the modifier when
+determining the actions to apply for the key. The server then clears the bit,
+so it is not actually reported to the client. In addition, modifiers specified
+in the
+<emphasis>InternalMods</emphasis>
+control are not used to determine grabs and are not used to calculate core
+protocol compatibility state.
+</para>
+
+
+<para>
+Manipulate the
+<emphasis>InternalMods</emphasis>
+control via the
+<structfield>internal</structfield>
+field in the
+<structname>XkbControlsRec</structname>
+structure, using
+<function>XkbSetControls</function>
+and
+<function>XkbGetControls</function>
+(see <link linkend="Querying_Controls">section 10.9</link>
+and <link linkend="Changing_Controls">section 10.10</link>). Alternatively, use
+<function>XkbSetServerInternalMods</function>.
+</para>
+
+
+<para>
+To set the modifiers that are consumed by the server before events are
+delivered to the client, use
+<function>XkbSetServerInternalMods</function>.
+</para>
+
+<indexterm significance="preferred" zone="XkbSetServerInternalMods"><primary><function>XkbSetServerInternalMods</function></primary></indexterm>
+<funcsynopsis id="XkbSetServerInternalMods">
+  <funcprototype>
+    <funcdef>Bool <function>XkbSetServerInternalMods</function></funcdef>
+<!-- (
+<parameter>display, device_spec, affect_real, real_values, affect_virtual,
+virtual_values</parameter>
+) -->
+
+    <paramdef>Display *<parameter>display</parameter></paramdef>
+    <paramdef>unsigned int <parameter>device_spec</parameter></paramdef>
+    <paramdef>unsigned int <parameter>affect_real</parameter></paramdef>
+    <paramdef>unsigned int <parameter>real_values</parameter></paramdef>
+    <paramdef>unsigned int <parameter>affect_virtual</parameter></paramdef>
+    <paramdef>unsigned int <parameter>virtual_values</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>display</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to the X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>device_spec</parameter>
+    </term>
+    <listitem>
+      <para>
+        ‘device ID, or <symbol>XkbUseCoreKbd</symbol>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>affect_real</parameter>
+    </term>
+    <listitem>
+      <para>
+        mask of real modifiers affected by this call
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>real_values</parameter>
+    </term>
+    <listitem>
+      <para>
+        values for affected real modifiers (1&rArr;set, 0&rArr;unset)
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>affect_virtual</parameter>
+    </term>
+    <listitem>
+      <para>
+        mask of virtual modifiers affected by this call
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>virtual_values</parameter>
+    </term>
+    <listitem>
+      <para>
+        values for affected virtual modifiers (1&rArr;set, 0&rArr;unset)
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbSetServerInternalMods</function>
+sends a request to the server to change the internal modifiers consumed by the
+server.
+<parameter>affect_real</parameter>
+and
+<parameter>real_values</parameter>
+are masks of real modifier bits indicating which real modifiers are to be
+added and removed from the server’s internal modifiers control. Modifiers
+selected by both
+<parameter>affect_real</parameter>
+and
+<parameter>real_values</parameter>
+are added to the server’s internal modifiers control; those selected by
+<parameter>affect_real</parameter>
+but not by
+<parameter>real_values</parameter>
+are removed from the server’s internal modifiers mask. Valid values for
+<parameter>affect_real</parameter>
+and
+<parameter>real_values</parameter>
+consist of any combination of the eight core modifier bits:
+<symbol>ShiftMask</symbol>,
+<symbol>LockMask</symbol>,
+<symbol>ControlMask</symbol>,
+<symbol>Mod1Mask</symbol>
+&ndash;
+<symbol>Mod5Mask</symbol>.
+<parameter>affect_virtual</parameter>
+and
+<parameter>virtual_values</parameter>
+are masks of virtual modifier bits indicating which virtual modifiers are to
+be added and removed from the server’s internal modifiers control. Modifiers
+selected by both
+<parameter>affect_virtual</parameter>
+and
+<parameter>virtual_values</parameter>
+are added to the server’s internal modifiers control; those selected by
+<parameter>affect_virtual</parameter>
+but not by
+<parameter>virtual_values</parameter>
+are removed from the server’s internal modifiers control.
+See <link linkend="Virtual_Modifier_Names_and_Masks">section 7.1</link> for a discussion of virtual modifier masks to use in
+<parameter>affect_virtual</parameter>
+and
+<parameter>virtual_values</parameter>.
+<function>XkbSetServerInternalMods</function>
+does not wait for a reply from the server. It returns
+<symbol>True</symbol>
+if the request was sent and
+<symbol>False</symbol>
+otherwise.
+</para>
+
+
+</sect2>
+</sect1>
+<sect1 id='The_XkbControlsRec_Structure'>
+<title>The XkbControlsRec Structure</title>
+
+<indexterm significance="preferred" zone="The_XkbControlsRec_Structure">
+<primary><structname>XkbControlsRec</structname></primary></indexterm>
+
+<para>
+Many of the individual controls described in sections 10.1 through 10.7 may be
+manipulated via convenience functions discussed in those sections. Some of
+them, however, have no convenience functions. The
+<structname>XkbControlsRec</structname>
+structure allows the manipulation of one or more of the controls in a single
+operation and to track changes to any of them in conjunction with the
+<function>XkbGetControls</function>
+and
+<function>XkbSetControls</function>
+functions. This is the only way to manipulate those controls that have no
+convenience functions.
+</para>
+
+
+<para>
+The
+<structname>XkbControlsRec</structname>
+structure is defined as follows:
+
+<programlisting>
+#define      XkbMaxLegalKeyCode       255
+#define      XkbPerKeyBitArraySize    ((XkbMaxLegalKeyCode+1)/8)
+
+typedef struct {
+    unsigned char     mk_dflt_btn;       /* default button for
+                                             keyboard driven mouse */
+    unsigned char     num_groups;        /* number of keyboard groups */
+    unsigned char     groups_wrap;       /* how to wrap out-of-bounds groups */
+    XkbModsRec        internal;          /* defines server internal modifiers */
+    XkbModsRec        ignore_lock;       /* modifiers to ignore when
+                                             checking for grab */
+    unsigned int      enabled_ctrls;     /* 1 bit &rArr; corresponding
+                                             boolean control enabled */
+    unsigned short    repeat_delay;      /* ms delay until first repeat */
+    unsigned short    repeat_interval;   /* ms delay between repeats */
+    unsigned short    slow_keys_delay;   /* ms minimum time key must be
+                                             down to be ok */
+    unsigned short    debounce_delay;    /* ms delay before key reactivated */
+    unsigned short    mk_delay;          /* ms delay to second mouse
+                                             motion event */
+    unsigned short    mk_interval;       /* ms delay between repeat mouse
+                                             events */
+    unsigned short    mk_time_to_max;    /* # intervals until constant
+                                             mouse move */
+    unsigned short    mk_max_speed;      /* multiplier for maximum mouse speed */
+    short             mk_curve;          /* determines mouse move curve type */
+    unsigned short    ax_options;        /* 1 bit &rArr; Access X option enabled */
+    unsigned short    ax_timeout;        /* seconds until Access X disabled */
+    unsigned short    axt_opts_mask;     /* 1 bit &rArr; options to reset
+                                             on Access X timeout */
+    unsigned short    axt_opts_values;   /* 1 bit &rArr; turn option on, 0&rArr; off */
+    unsigned int      axt_ctrls_mask;    /* which bits in <structfield>enabled_ctrls</structfield>
+                                             to modify */
+    unsigned int      axt_ctrls_values;  /* values for new bits in
+                                             <structfield>enabled_ctrls</structfield> */
+    unsigned char     per_key_repeat[XkbPerKeyBitArraySize];
+                                         /* per key auto repeat */
+} <structname>XkbControlsRec</structname>, *XkbControlsPtr;
+</programlisting>
+</para>
+
+<para>
+The general-purpose functions that work with the
+<structname>XkbControlsRec</structname>
+structure use a mask to specify which controls are to be manipulated.
+<link linkend="table10.6">Table 10.6</link>
+lists these controls, the masks used to select them in the general
+function calls
+(<structfield>which</structfield>
+parameter), and the data fields in the
+<structname>XkbControlsRec</structname>
+structure that comprise each of the individual controls. Also listed are the
+bit used to turn boolean controls on and off and the section where each control
+is described in more detail.
+</para>
+
+<table id='table10.6' frame='topbot'>
+<title>Xkb Controls</title>
+<?dbfo keep-together="auto" ?>
+<tgroup cols='5' align='left' colsep='0' rowsep='0'>
+<colspec colname='c1' colwidth='2.0*'/>
+<colspec colname='c2' colwidth='3.1*'/>
+<colspec colname='c3' colwidth='2.2*'/>
+<colspec colname='c4' colwidth='2.6*'/>
+<colspec colname='c5' colwidth='1.0*'/>
+<thead>
+<row rowsep='1'>
+  <entry>Control</entry>
+  <entry>Control Selection Mask (which parameter)</entry>
+  <entry>Relevant XkbControlsRec Data Fields</entry>
+  <entry>Boolean Control enabled_ctrls bit</entry>
+  <entry>Section</entry>
+  </row>
+</thead>
+<tbody>
+  <row>
+    <entry>AccessXFeedback</entry>
+    <entry><symbol>XkbAccessXFeedbackMask</symbol></entry>
+    <entry>ax_options:      XkbAX_*FBMask</entry>
+    <entry>XkbAccessXFeedback&#xAD;Mask</entry>
+    <entry><link linkend="The_AccessXFeedback_Control">10.6.3</link></entry>
+  </row>
+  <row>
+    <entry>AccessXKeys</entry>
+    <entry></entry>
+    <entry></entry>
+    <entry>XkbAccessXKeys&#xAD;Mask</entry>
+    <entry><link linkend="The_AccessXKeys_Control">10.6.1</link></entry>
+  </row>
+  <row>
+    <entry>AccessXTimeout</entry>
+    <entry><symbol>XkbAccessXTimeoutMask</symbol></entry>
+    <entry>
+      <para>ax_timeout</para>
+      <para>axt_opts_mask</para>
+      <para>axt_opts_values</para>
+      <para>axt_ctrls_mask</para>
+      <para>axt_ctrls_values</para>
+    </entry>
+    <entry>XkbAccessXTimeout&#xAD;Mask</entry>
+    <entry><link linkend="The_AccessXTimeout_Control">10.6.2</link></entry>
+  </row>
+  <row>
+    <entry>AudibleBell</entry>
+    <entry></entry>
+    <entry></entry>
+    <entry><symbol>XkbAudibleBellMask</symbol></entry>
+    <entry><link linkend="Audible_Bells">9.2</link></entry>
+  </row>
+  <row>
+    <entry>AutoReset</entry>
+    <entry></entry>
+    <entry></entry>
+    <entry></entry>
+    <entry><link linkend="The_AutoReset_Control">10.1.2</link></entry>
+  </row>
+  <row>
+    <entry>BounceKeys</entry>
+    <entry><symbol>XkbBounceKeysMask</symbol></entry>
+    <entry>debounce_delay</entry>
+    <entry><symbol>XkbBounceKeysMask</symbol></entry>
+    <entry><link linkend="The_BounceKeys_Control">10.6.7</link></entry>
+  </row>
+  <row>
+    <entry>Detectable-Autorepeat</entry>
+    <entry></entry>
+    <entry></entry>
+    <entry></entry>
+    <entry><link linkend="The_DetectableAutorepeat_Control">10.3.3</link></entry>
+  </row>
+  <row>
+    <entry>EnabledControls</entry>
+    <entry><symbol>XkbControlsEnabledMask</symbol></entry>
+    <entry>enabled_ctrls</entry>
+    <entry><emphasis>Non-Boolean Control</emphasis></entry>
+    <entry><link linkend="The_EnabledControls_Control">10.1.1</link></entry>
+  </row>
+  <row>
+    <entry>GroupsWrap</entry>
+    <entry><symbol>XkbGroupsWrapMask</symbol></entry>
+    <entry>groups_wrap</entry>
+    <entry><emphasis>Non-Boolean Control</emphasis></entry>
+    <entry><link linkend="The_GroupsWrap_Control">10.7.1</link></entry>
+  </row>
+  <row>
+    <entry>IgnoreGroupLock</entry>
+    <entry></entry>
+    <entry></entry>
+    <entry>XkbIgnoreGroupLock&#xAD;Mask</entry>
+    <entry><link linkend="The_IgnoreGroupLock_Control">10.7.3</link></entry>
+  </row>
+  <row>
+    <entry>IgnoreLockMods</entry>
+    <entry><symbol>XkbIgnoreLockModsMask</symbol></entry>
+    <entry>ignore_lock</entry>
+    <entry><emphasis>Non-Boolean Control</emphasis></entry>
+    <entry><link linkend="Keyboard_State_Description">5.1</link></entry>
+  </row>
+  <row>
+    <entry>InternalMods</entry>
+    <entry><symbol>XkbInternalModsMask</symbol></entry>
+    <entry>internal</entry>
+    <entry><emphasis>Non-Boolean Control</emphasis></entry>
+    <entry><link linkend="Keyboard_State_Description">5.1</link></entry>
+  </row>
+  <row>
+    <entry>MouseKeys</entry>
+    <entry><symbol>XkbMouseKeysMask</symbol></entry>
+    <entry>mk_dflt_btn</entry>
+    <entry><symbol>XkbMouseKeysMask</symbol></entry>
+    <entry><link linkend="The_MouseKeys_Control">10.5.1</link></entry>
+  </row>
+  <row>
+    <entry>MouseKeysAccel</entry>
+    <entry><symbol>XkbMouseKeysAccelMask</symbol></entry>
+    <entry>
+      <para>mk_delay</para>
+      <para>mk_interval</para>
+      <para>mk_time_to_max</para>
+      <para>mk_max_speed</para>
+      <para>mk_curve</para>
+    </entry>
+    <entry>XkbMouseKeysAccel&#xAD;Mask</entry>
+    <entry><link linkend="The_MouseKeysAccel_Control">10.5.2</link></entry>
+  </row>
+  <row>
+    <entry>Overlay1</entry>
+    <entry></entry>
+    <entry></entry>
+    <entry><symbol>XkbOverlay1Mask</symbol></entry>
+    <entry><link linkend="Controls_for_Keyboard_Overlays_Overlay1_and_Overlay2_Controls">10.4</link></entry>
+  </row>
+  <row>
+    <entry>Overlay2</entry>
+    <entry></entry>
+    <entry></entry>
+    <entry><symbol>XkbOverlay2Mask</symbol></entry>
+    <entry><link linkend="Controls_for_Keyboard_Overlays_Overlay1_and_Overlay2_Controls">10.4</link></entry>
+  </row>
+  <row>
+    <entry>PerKeyRepeat</entry>
+    <entry><symbol>XkbPerKeyRepeatMask</symbol></entry>
+    <entry>per_key_repeat</entry>
+    <entry><emphasis>Non-Boolean Control</emphasis></entry>
+    <entry><link linkend="The_PerKeyRepeat_Control">10.3.1</link></entry>
+  </row>
+  <row>
+    <entry>RepeatKeys</entry>
+    <entry><symbol>XkbRepeatKeysMask</symbol></entry>
+    <entry>
+      <para>repeat_delay</para>
+      <para>repeat_interval</para>
+    </entry>
+    <entry><symbol>XkbRepeatKeysMask</symbol></entry>
+    <entry><link linkend="Controls_for_Repeat_Key_Behavior">10.3</link></entry>
+  </row>
+  <row>
+    <entry>SlowKeys</entry>
+    <entry><symbol>XkbSlowKeysMask</symbol></entry>
+    <entry>slow_keys_delay</entry>
+    <entry><symbol>XkbSlowKeysMask</symbol></entry>
+    <entry><link linkend="The_SlowKeys_Control">10.6.6</link></entry>
+  </row>
+  <row>
+    <entry>StickyKeys</entry>
+    <entry><symbol>XkbStickyKeysMask</symbol></entry>
+    <entry>
+      <para>ax_options:</para>
+      <para>XkbAX_Two&#xAD;KeysMask</para>
+      <para>XkbAX_Latch&#xAD;ToLockMask</para>
+    </entry>
+    <entry><symbol>XkbStickyKeysMask</symbol></entry>
+    <entry><link linkend="The_StickyKeys_Control">10.6.8</link></entry>
+  </row>
+</tbody>
+</tgroup>
+</table>
+
+<para>
+<link linkend="table10.7">Table 10.7</link>
+shows the actual values for the individual mask bits used to select
+controls for modification and to enable and disable the control. Note that the
+same mask bit is used to specify general modifications to the parameters used
+to configure the control
+(<structfield>which</structfield>),
+and to enable and disable the control
+(<structfield>enabled_ctrls</structfield>).
+The anomalies in the table (no <quote>ok</quote> in column) are for controls that have no
+configurable attributes; and for controls that are not boolean controls and
+therefore cannot be enabled or disabled.
+</para>
+
+<table id='table10.7' frame='topbot'>
+<title>Controls Mask Bits</title>
+<?dbfo keep-together="always" ?>
+<tgroup cols='4' align='left' colsep='0' rowsep='0'>
+<colspec colname='c1' colwidth='2.6*'/>
+<colspec colname='c2' colwidth='2.0*'/>
+<colspec colname='c3' colwidth='1.3*'/>
+<colspec colname='c4' colwidth='2.0*'/>
+<thead>
+<row rowsep='1'>
+  <entry>Mask Bit</entry>
+  <entry>which or changed_ctrls</entry>
+  <entry>enabled_ctrls</entry>
+  <entry>Value</entry>
+</row>
+</thead>
+<tbody>
+<row>
+    <entry><symbol>XkbRepeatKeysMask</symbol></entry>
+    <entry>ok</entry>
+    <entry>ok</entry>
+    <entry>(1L&lt;&lt;0)</entry>
+  </row>
+  <row>
+    <entry><symbol>XkbSlowKeysMask</symbol></entry>
+    <entry>ok</entry>
+    <entry>ok</entry>
+    <entry>(1L&lt;&lt;1)</entry>
+  </row>
+  <row>
+    <entry><symbol>XkbBounceKeysMask</symbol></entry>
+    <entry>ok</entry>
+    <entry>ok</entry>
+    <entry>(1L&lt;&lt;2)</entry>
+  </row>
+  <row>
+    <entry><symbol>XkbStickyKeysMask</symbol></entry>
+    <entry>ok</entry>
+    <entry>ok</entry>
+    <entry>(1L&lt;&lt;3)</entry>
+  </row>
+  <row>
+    <entry><symbol>XkbMouseKeysMask</symbol></entry>
+    <entry>ok</entry>
+    <entry>ok</entry>
+    <entry>(1L&lt;&lt;4)</entry>
+  </row>
+  <row>
+    <entry><symbol>XkbMouseKeysAccelMask</symbol></entry>
+    <entry>ok</entry>
+    <entry>ok</entry>
+    <entry>(1L&lt;&lt;5)</entry>
+  </row>
+  <row>
+    <entry><symbol>XkbAccessXKeysMask</symbol></entry>
+    <entry>ok</entry>
+    <entry>ok</entry>
+    <entry>(1L&lt;&lt;6)</entry>
+  </row>
+  <row>
+    <entry><symbol>XkbAccessXTimeoutMask</symbol></entry>
+    <entry>ok</entry>
+    <entry>ok</entry>
+    <entry>(1L&lt;&lt;7)</entry>
+  </row>
+  <row>
+    <entry><symbol>XkbAccessXFeedbackMask</symbol></entry>
+    <entry>ok</entry>
+    <entry>ok</entry>
+    <entry>(1L&lt;&lt;8)</entry>
+  </row>
+  <row>
+    <entry><symbol>XkbAudibleBellMask</symbol></entry>
+    <entry></entry>
+    <entry>ok</entry>
+    <entry>(1L&lt;&lt;9)</entry>
+  </row>
+  <row>
+    <entry><symbol>XkbOverlay1Mask</symbol></entry>
+    <entry></entry>
+    <entry>ok</entry>
+    <entry>(1L&lt;&lt;10)</entry>
+  </row>
+  <row>
+    <entry><symbol>XkbOverlay2Mask</symbol></entry>
+    <entry></entry>
+    <entry>ok</entry>
+    <entry>(1L&lt;&lt;11)</entry>
+  </row>
+  <row>
+    <entry><symbol>XkbIgnoreGroupLockMask</symbol></entry>
+    <entry></entry>
+    <entry>ok</entry>
+    <entry>(1L&lt;&lt;12)</entry>
+</row>
+<row>
+    <entry><symbol>XkbGroupsWrapMask</symbol></entry>
+    <entry>ok</entry>
+    <entry></entry>
+    <entry>(1L&lt;&lt;27)</entry>
+</row>
+<row>
+    <entry><symbol>XkbInternalModsMask</symbol></entry>
+    <entry>ok</entry>
+    <entry></entry>
+    <entry>(1L&lt;&lt;28)</entry>
+</row>
+<row>
+    <entry><symbol>XkbIgnoreLockModsMask</symbol></entry>
+    <entry>ok</entry>
+    <entry></entry>
+    <entry>(1L&lt;&lt;29)</entry>
+</row>
+<row>
+    <entry><symbol>XkbPerKeyRepeatMask</symbol></entry>
+    <entry>ok</entry>
+    <entry></entry>
+    <entry>(1L&lt;&lt;30)</entry>
+</row>
+<row>
+    <entry><symbol>XkbControlsEnabledMask</symbol></entry>
+    <entry>ok</entry>
+    <entry></entry>
+    <entry>(1L&lt;&lt;31)</entry>
+</row>
+<row>
+    <entry><symbol>XkbAccessXOptionsMask</symbol></entry>
+    <entry>ok</entry>
+    <entry>ok</entry>
+    <entry>(XkbStickyKeysMask | XkbAccessXFeedbackMask)</entry>
+  </row>
+  <row>
+    <entry><symbol>XkbAllBooleanCtrlsMask</symbol></entry>
+    <entry></entry>
+    <entry>ok</entry>
+    <entry>(0x00001FFF) </entry>
+  </row>
+  <row>
+    <entry><symbol>XkbAllControlsMask</symbol></entry>
+    <entry>ok</entry>
+    <entry></entry>
+    <entry>(0xF8001FFF)</entry>
+  </row>
+</tbody>
+</tgroup>
+</table>
+
+<para>
+The individual fields of the
+<structname>XkbControlsRec</structname>
+structure are defined as follows.
+</para>
+
+<sect2>
+<title/>
+<sect3 id='mk_dflt_btn'>
+<title>mk_dflt_btn</title>
+
+<para>
+<structfield>mk_dflt_btn</structfield> is an attribute of the
+<emphasis>MouseKeys</emphasis>
+control
+(see <link linkend="Controls_for_Using_the_Mouse_from_the_Keyboard">section 10.5</link>). It
+specifies the mouse button number to use for keyboard simulated mouse button
+operations. Its value should be one of the core symbols
+<symbol>Button1</symbol>
+&ndash;
+<symbol>Button5</symbol>.
+</para>
+
+
+</sect3>
+<sect3 id='num_groups'>
+<title>num_groups</title>
+
+<para>
+<structfield>num_groups</structfield>
+is not a part of any control, but is reported in the
+<structname>XkbControlsRec</structname>
+structure whenever any of its components are fetched from the server. It
+reports the number of groups the particular keyboard configuration uses and is
+computed automatically by the server whenever the keyboard mapping changes.
+</para>
+
+
+</sect3>
+<sect3 id='groups_wrap'>
+<title>groups_wrap</title>
+
+<para>
+<structfield>groups_wrap</structfield>
+is an attribute of the
+<emphasis>GroupsWrap</emphasis>
+control (see <link linkend="The_GroupsWrap_Control">section 10.7.1</link>). It specifies the handling of illegal groups on a
+global basis. Valid values for
+<structfield>groups_wrap</structfield>
+are shown in <link linkend="table10.8">Table 10.8</link>.
+</para>
+
+<table id='table10.8' frame='topbot'>
+<title>GroupsWrap options (groups_wrap field)</title>
+<?dbfo keep-together="always" ?>
+<tgroup cols='2' align='left' colsep='0' rowsep='0'>
+<colspec colname='c1' colwidth='1.0*'/>
+<colspec colname='c2' colwidth='1.0*'/>
+<thead>
+<row rowsep='1'>
+  <entry>groups_wrap symbolic name</entry>
+  <entry>value</entry>
+  </row>
+</thead>
+<tbody>
+  <row>
+    <entry><symbol>XkbWrapIntoRange</symbol></entry>
+    <entry>(0x00)</entry>
+  </row>
+  <row>
+    <entry><symbol>XkbClampIntoRange</symbol></entry>
+    <entry>(0x40)</entry>
+  </row>
+  <row>
+    <entry><symbol>XkbRedirectIntoRange</symbol></entry>
+    <entry>(0x80)</entry>
+  </row>
+</tbody>
+</tgroup>
+</table>
+
+<para>
+When
+<structfield>groups_wrap</structfield>
+is set to
+<symbol>XkbRedirectIntoRange</symbol>,
+its four low-order bits specify the index of the group to use.
+</para>
+
+
+</sect3>
+<sect3 id='internal'>
+<title>internal</title>
+
+<para>
+<structfield>internal</structfield>
+is an attribute of the
+<emphasis>InternalMods</emphasis>
+control (see <link linkend="The_InternalMods_Control">section 10.7.4</link>). It specifies modifiers to be consumed in the
+server and not passed on to clients when events are reported. Valid values
+consist of any combination of the eight core modifier bits:
+<symbol>ShiftMask</symbol>,
+<symbol>LockMask</symbol>,
+<symbol>ControlMask</symbol>,
+<symbol>Mod1Mask</symbol>
+&ndash;
+<symbol>Mod5Mask</symbol>.
+</para>
+
+
+</sect3>
+<sect3 id='ignore_lock'>
+<title>ignore_lock</title>
+
+<para>
+<structfield>ignore_lock</structfield>
+is an attribute of the
+<emphasis>IgnoreLockMods</emphasis>
+control (see <link linkend="The_IgnoreLockMods_Control">section 10.7.2</link>). It specifies modifiers to be ignored in grab
+calculations. Valid values consist of any combination of the eight core
+modifier bits:
+<symbol>ShiftMask</symbol>,
+<symbol>LockMask</symbol>,
+<symbol>ControlMask</symbol>,
+<symbol>Mod1Mask</symbol>
+&ndash;
+<symbol>Mod5Mask</symbol>.
+</para>
+
+
+</sect3>
+<sect3 id='enabled_ctrls'>
+<title>enabled_ctrls</title>
+
+<para>
+<structfield>enabled_ctrls</structfield>
+is an attribute of the
+<emphasis>EnabledControls</emphasis>
+control (see <link linkend="The_EnabledControls_Control">section 10.1.1</link>). It contains one bit per boolean control. Each
+bit determines whether the corresponding control is enabled or disabled; a one
+bit means the control is enabled. The mask bits used to enable these controls
+are listed in <link linkend="table10.7">Table 10.7</link>,
+using only those masks with <quote>ok</quote> in the
+<structfield>enabled_ctrls</structfield>
+column.
+</para>
+
+
+</sect3>
+<sect3 id='repeat_delay_and_repeat_interval'>
+<title>repeat_delay and repeat_interval</title>
+
+<para>
+<structfield>repeat_delay</structfield>
+and
+<structfield>repeat_interval</structfield>
+are attributes of the
+<emphasis>RepeatKeys</emphasis>
+control (see <link linkend="The_RepeatKeys_Control">section 10.3.2</link>).
+<structfield>repeat_delay</structfield>
+is the initial delay before a key begins repeating, in milliseconds;
+<structfield>repeat_interval</structfield>
+is the delay between subsequent key events, in milliseconds.
+</para>
+
+
+</sect3>
+<sect3 id='slow_keys_delay'>
+<title>slow_keys_delay</title>
+
+<para>
+<structfield>slow_keys_delay</structfield>
+is an attribute of the
+<emphasis>SlowKeys</emphasis>
+control (see <link linkend="The_SlowKeys_Control">section 10.6.6</link>). Its value specifies the
+<emphasis>SlowKeys</emphasis>
+acceptance delay period in milliseconds before a key press is accepted by the
+server.
+</para>
+
+
+</sect3>
+<sect3 id='debounce_delay'>
+<title>debounce_delay</title>
+
+<para>
+<structfield>debounce_delay</structfield>
+is an attribute of the
+<emphasis>BounceKeys</emphasis>
+control (see <link linkend="The_BounceKeys_Control">section 10.6.7</link>). Its value specifies the
+<emphasis>BounceKeys</emphasis>
+delay period in milliseconds for which the key is disabled after having been
+pressed before another press of the same key is accepted by the server.
+</para>
+
+
+</sect3>
+<sect3 id='mk_delay_mk_interval_mk_time_to_max_mk_max_speed_and_mk_curve'>
+<title>mk_delay, mk_interval, mk_time_to_max, mk_max_speed, and mk_curve</title>
+
+<para>
+<structfield>mk_delay</structfield>,
+<structfield>mk_interval</structfield>,
+<structfield>mk_time_to_max</structfield>,
+<structfield>mk_max_speed</structfield>,
+and
+<structfield>mk_curve</structfield>
+are attributes of the
+<emphasis>MouseKeysAccel</emphasis>
+control. Refer to <link linkend="The_MouseKeysAccel_Control">section 10.5.2</link> for a description of these fields and the
+units involved.
+</para>
+
+
+</sect3>
+<sect3 id='ax_options'>
+<title>ax_options</title>
+
+<para>
+The
+<structfield>ax_options</structfield>
+field contains attributes used to configure two different controls, the
+<emphasis>StickyKeys</emphasis>
+control (see <link linkend="The_StickyKeys_Control">section 10.6.8</link>) and the
+<emphasis>AccessXFeedback</emphasis>
+control (see <link linkend="The_AccessXFeedback_Control">section 10.6.3</link>). The
+<structfield>ax_options</structfield>
+field is a bitmask and may include any combination of the bits defined in
+<link linkend="table10.9">Table 10.9</link>.
+</para>
+
+<table id='table10.9' frame='topbot'>
+<title>Access X Enable/Disable Bits (ax_options field)</title>
+<?dbfo keep-together="always" ?>
+<tgroup cols='3' align='left' colsep='0' rowsep='0'>
+<colspec colname='c1' colwidth='1.0*'/>
+<colspec colname='c2' colwidth='1.3*'/>
+<colspec colname='c3' colwidth='0.7*'/>
+<thead>
+<row rowsep='1'>
+  <entry>Access X Control</entry>
+  <entry>ax_options bit</entry>
+  <entry>value</entry>
+  </row>
+</thead>
+<tbody>
+  <row>
+    <entry>AccessXFeedback</entry>
+    <entry><symbol>XkbAX_SKPressFBMask</symbol></entry>
+    <entry>(1L&lt;&lt;0)</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry><symbol>XkbAX_SKAcceptFBMask</symbol></entry>
+    <entry>(1L &lt;&lt; 1)</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry><symbol>XkbAX_FeatureFBMask</symbol></entry>
+    <entry>(1L &lt;&lt; 2)</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry><symbol>XkbAX_SlowWarnFBMask</symbol></entry>
+    <entry>(1L &lt;&lt; 3)</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry><symbol>XkbAX_IndicatorFBMask</symbol></entry>
+    <entry>(1L &lt;&lt; 4)</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry><symbol>XkbAX_StickyKeysFBMask</symbol></entry>
+    <entry>(1L &lt;&lt; 5)</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry><symbol>XkbAX_SKReleaseFBMask</symbol></entry>
+    <entry>(1L &lt;&lt; 8)</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry><symbol>XkbAX_SKRejectFBMask</symbol></entry>
+    <entry>(1L &lt;&lt; 9)</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry><symbol>XkbAX_BKRejectFBMask</symbol></entry>
+    <entry>(1L &lt;&lt; 10)</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry><symbol>XkbAX_DumbBellFBMask</symbol></entry>
+    <entry>(1L &lt;&lt; 11)</entry>
+  </row>
+  <row>
+    <entry>StickyKeys</entry>
+    <entry><symbol>XkbAX_TwoKeysMask</symbol></entry>
+    <entry>(1L &lt;&lt; 6)</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry><symbol>XkbAX_LatchToLockMask</symbol></entry>
+    <entry>(1L &lt;&lt; 7)</entry>
+  </row>
+  <row>
+    <entry></entry>
+    <entry><symbol>XkbAX_AllOptionsMask</symbol></entry>
+    <entry>(0xFFF)</entry>
+  </row>
+</tbody>
+</tgroup>
+</table>
+
+<para>
+The fields pertaining to each control are relevant only when the control is
+enabled
+(<symbol>XkbAccessXFeedbackMask</symbol>
+or
+<symbol>XkbStickyKeysMask</symbol>
+bit is turned on in the
+<structfield>enabled_ctrls</structfield>
+field).
+</para>
+
+
+<para>
+Xkb provides a set of convenience macros for working with the
+<structfield>ax_options</structfield>
+field of an
+<structname>XkbControlsRec</structname>
+structure:
+
+<programlisting>
+#define      <symbol>XkbAX_NeedOption</symbol>(c,w)      ((c)-&gt;ax_options &amp; (w))
+</programlisting></para>
+
+<para>
+The
+<symbol>XkbAX_NeedOption</symbol>
+macro is useful for determining whether a particular AccessX option is enabled
+or not. It accepts a pointer to an
+<structname>XkbControlsRec</structname>
+structure and a valid mask bit from
+<link linkend="table10.9">Table 10.9</link>.
+If the specified mask bit in the
+<structfield>ax_options</structfield>
+field of the controls structure is set, the macro returns the mask bit.
+Otherwise, it returns zero. Thus,
+
+<programlisting>
+    XkbAX_NeedOption(ctlrec, XkbAX_LatchToLockMask)
+</programlisting>
+
+is nonzero if the latch to lock transition for latching keys is enabled, and
+zero if it is disabled. Note that
+<symbol>XkbAX_NeedOption</symbol>
+only determines whether or not the particular capability is configured to
+operate; the
+<symbol>XkbAccessXFeedbackMask</symbol>
+bit must also be turned on in
+<structfield>enabled_ctrls</structfield>
+for the capability to actually be functioning.
+</para>
+
+<para><programlisting>
+#define      <symbol>XkbAX_AnyFeedback</symbol>(c) \
+                 ((c)-&gt;enabled_ctrls &amp; XkbAccessXFeedbackMask)
+</programlisting></para>
+
+<para>
+The
+<symbol>XkbAX_AnyFeedback</symbol>
+macro accepts a pointer to an
+<structname>XkbControlsRec</structname>
+structure and tells whether the
+<emphasis>AccessXFeedback</emphasis>
+control is enabled or not. If the
+<emphasis>AccessXFeedback</emphasis>
+control is enabled, the macro returns
+<symbol>XkbAccessXFeedbackMask</symbol>.
+Otherwise, it returns zero.
+</para>
+
+<para><programlisting>
+#define      <symbol>XkbAX_NeedFeedback</symbol>(c,w) \
+                 (XkbAX_AnyFeedback(c) &amp;&amp; XkbAX_NeedOption(c,w))
+</programlisting></para>
+
+<para>
+The
+<symbol>XkbAX_NeedFeedback</symbol>
+macro is useful for determining if both the
+<emphasis>AccessXFeedback</emphasis>
+control and a particular AccessX feedback option are enabled. The macro
+accepts a pointer to an
+<structname>XkbControlsRec</structname>
+structure and a feedback option from the table above. If both the
+<emphasis>AccessXFeedback</emphasis>
+control and the specified feedback option are enabled, the macro returns
+<symbol>True</symbol>.
+Otherwise it returns
+<symbol>False</symbol>.
+</para>
+
+
+</sect3>
+<sect3
+id='ax_timeout_axt_opts_mask_axt_opts_values_axt_ctrls_mask_and_axt_ctrls_values'>
+<title>ax_timeout, axt_opts_mask, axt_opts_values, axt_ctrls_mask, and axt_ctrls_values</title>
+
+<para>
+<structfield>ax_timeout</structfield>,
+<structfield>axt_opts_mask</structfield>,
+<structfield>axt_opts_values</structfield>,
+<structfield>axt_ctrls_mask</structfield>,
+and
+<structfield>axt_ctrls_values</structfield>
+are attributes of the
+<emphasis>AccessXTimeout</emphasis>
+control. Refer to <link linkend="The_AccessXTimeout_Control">section 10.6.2</link> for a description of these fields and the
+units involved.
+</para>
+
+
+</sect3>
+<sect3 id='per_key_repeat'>
+<title>per_key_repeat</title>
+
+<para>
+The
+<structfield>per_key_repeat</structfield>
+field mirrors the
+<structfield>auto_repeats</structfield>
+field of the core protocol
+<structname>XKeyboardState</structname>
+structure: changing the
+<structfield>auto_repeats</structfield>
+field automatically changes
+<structfield>per_key_repeat</structfield>
+and vice versa. It is provided for convenience and to reduce protocol traffic.
+For example, to obtain the individual repeat key behavior as well as the repeat
+delay and rate, use
+<function>XkbGetControls</function>.
+If the
+<structfield>per_key_repeat</structfield>
+were not in this structure, you would have to call both
+<function>XGetKeyboardControl</function>
+and
+<function>XkbGetControls</function>
+to get this information. The bits correspond to keycodes. The first seven keys
+(keycodes 1&ndash;7) are indicated in
+<structfield>per_key_repeat</structfield>[0],
+with bit position 0 (low order) corresponding to the fictitious keycode 0.
+Following array elements correspond to 8 keycodes per element. A 1 bit
+indicates that the key is a repeating key.
+</para>
+
+
+</sect3>
+</sect2>
+</sect1>
+<sect1 id='Querying_Controls'>
+<title>Querying Controls</title>
+
+<para>
+Use
+<function>XkbGetControls</function>
+to find the current state of Xkb server controls.
+</para>
+
+<indexterm significance="preferred" zone="XkbGetControls"><primary><function>XkbGetControls</function></primary></indexterm>
+<funcsynopsis id="XkbGetControls">
+  <funcprototype>
+    <funcdef>Status <function>XkbGetControls</function></funcdef>
+<!-- (
+<parameter>display, which, xkb)</parameter> -->
+
+    <paramdef>Display *<parameter>display</parameter></paramdef>
+    <paramdef>unsigned long <parameter>which</parameter></paramdef>
+    <paramdef>XkbDescPtr <parameter>xkb</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>display</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>which</parameter>
+    </term>
+    <listitem>
+      <para>
+        mask of controls requested
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>xkb</parameter>
+    </term>
+    <listitem>
+      <para>
+        keyboard description for controls information
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbGetControls</function>
+queries the server for the requested control information, waits for a reply,
+and then copies the server’s values for the requested information into the
+<structfield>ctrls</structfield>
+structure of the
+<parameter>xkb</parameter>
+argument. Only those components specified by the
+<parameter>which</parameter>
+parameter are copied. Valid values for
+<parameter>which</parameter>
+are any combination of the masks listed in
+<link linkend="table10.7">Table 10.7</link> that have <quote>ok</quote> in the
+<parameter>which</parameter>
+column.
+</para>
+
+
+<para>
+If
+<parameter>xkb</parameter>-&gt;<structfield>ctrls</structfield>
+is
+<symbol>NULL</symbol>,
+<function>XkbGetControls</function>
+allocates and initializes it before obtaining the values specified by
+<parameter>which</parameter>.
+If
+<parameter>xkb</parameter>-&gt;<structfield>ctrls</structfield>
+is not
+<symbol>NULL</symbol>,
+<function>XkbGetControls</function>
+modifies only those portions of
+<parameter>xkb</parameter>-&gt;<structfield>ctrls</structfield>
+corresponding to the values specified by
+<parameter>which</parameter>.
+</para>
+
+
+<para>
+<function>XkbGetControls</function>
+returns
+<symbol>Success</symbol>
+if successful; otherwise, it returns
+<errorname>BadAlloc</errorname>
+if it cannot obtain sufficient storage,
+<errorname>BadMatch</errorname>
+if
+<parameter>xkb</parameter>
+is
+<symbol>NULL</symbol>
+or
+<parameter>which</parameter>
+is empty, or
+<errorname>BadImplementation</errorname>.
+</para>
+
+
+<para>
+To free the
+<structfield>ctrls</structfield>
+member of a keyboard description, use
+<function>XkbFreeControls</function>
+(see <link linkend="Allocating_and_Freeing_an_XkbControlsRec">section 10.12</link>)
+</para>
+
+
+<para>
+The
+<structfield>num_groups</structfield>
+field in the
+<structfield>ctrls</structfield>
+structure is always filled in by
+<function>XkbGetControls</function>,
+regardless of which bits are selected by
+<parameter>which</parameter>.
+</para>
+
+
+</sect1>
+<sect1 id='Changing_Controls'>
+<title>Changing Controls</title>
+
+<para>
+There are two ways to make changes to controls: either change a local copy
+keyboard description and call
+<function>XkbSetControls</function>,
+or, to reduce network traffic, use an
+<structname>XkbControlsChangesRec</structname>
+structure and call
+<function>XkbChangeControls</function>.
+</para>
+
+
+<para>
+To change the state of one or more controls, first modify the
+<structfield>ctrls</structfield>
+structure in a local copy of the keyboard description and then use
+<function>XkbSetControls</function>
+to copy those changes to the X server.
+</para>
+
+<indexterm significance="preferred" zone="XkbSetControls"><primary><function>XkbSetControls</function></primary></indexterm>
+<funcsynopsis id="XkbSetControls">
+  <funcprototype>
+    <funcdef>Bool <function>XkbSetControls</function></funcdef>
+<!-- (
+<parameter>display, which, xkb)</parameter> -->
+
+    <paramdef>Display *<parameter>display</parameter></paramdef>
+    <paramdef>unsigned long <parameter>which</parameter></paramdef>
+    <paramdef>XkbDescPtr <parameter>xkb</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>display</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>which</parameter>
+    </term>
+    <listitem>
+      <para>
+        mask of controls to change
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>xkb</parameter>
+    </term>
+    <listitem>
+      <para>
+        <structfield>ctrls</structfield> field contains new values to be set
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+For each bit that is set in the
+<parameter>which</parameter>
+parameter,
+<function>XkbSetControls</function>
+sends the corresponding values from the
+<parameter>xkb</parameter>-&gt;<structfield>ctrls</structfield>
+field to the server. Valid values for
+<parameter>which</parameter>
+are any combination of the masks listed in
+<link linkend="table10.7">Table 10.7</link> that have <quote>ok</quote> in the
+<parameter>which</parameter>
+column.
+</para>
+
+
+<para>
+If
+<parameter>xkb</parameter>-&gt;<structfield>ctrls</structfield>
+is
+<symbol>NULL</symbol>,
+the server does not support a compatible version of Xkb, or the Xkb extension
+has not been properly initialized,
+<function>XkbSetControls</function>
+returns
+<symbol>False</symbol>.
+Otherwise, it sends the request to the X server and returns
+<symbol>True</symbol>.
+</para>
+
+
+<para>
+Note that changes to attributes of controls in the
+<structname>XkbControlsRec</structname>
+structure are apparent only when the associated control is enabled, although
+the corresponding values are still updated in the X server. For example, the
+<structfield>repeat_delay</structfield>
+and
+<structfield>repeat_interval</structfield>
+fields are ignored unless the
+<emphasis>RepeatKeys</emphasis>
+control is enabled (that is, the X server’s equivalent of
+<structfield>xkb-&gt;ctrls</structfield>
+has
+<symbol>XkbRepeatKeysMask</symbol>
+set in
+<structfield>enabled_ctrls</structfield>).
+It is permissible to modify the attributes of a control in one call to
+XkbSetControls and enable the control in a subsequent call. See <link linkend="The_EnabledControls_Control">section 10.1.1</link>
+for more information on enabling and disabling controls.
+</para>
+
+
+<para>
+Note that the
+<structfield>enabled_ctrls</structfield>
+field is itself a control — the
+<emphasis>EnabledControls</emphasis>
+control. As such, to set a specific configuration of enabled and disabled
+boolean controls, you must set
+<structfield>enabled_ctrls</structfield>
+to the appropriate bits to enable only the controls you want and disable all
+others, then specify the
+<symbol>XkbControlsEnabledMask</symbol>
+in a call to
+<function>XkbSetControls</function>.
+Because this is somewhat awkward if all you want to do is enable and disable
+controls, and not modify any of their attributes, a convenience function is
+also provided for this purpose
+(<function>XkbChangeEnabledControls</function>,
+<link linkend="The_EnabledControls_Control">section 10.1.1</link>).
+</para>
+
+
+<sect2 id='The_XkbControlsChangesRec_Structure'>
+<title>The XkbControlsChangesRec Structure</title>
+
+<indexterm significance="preferred" zone="The_XkbControlsChangesRec_Structure">
+<primary><structname>XkbControlsChangesRec</structname></primary></indexterm>
+
+<para>
+The
+<structname>XkbControlsChangesRec</structname>
+structure allows applications to track modifications to an
+<structname>XkbControlsRec</structname>
+structure and thereby reduce the amount of traffic sent to the server. The
+same
+<structname>XkbControlsChangesRec</structname>
+structure may be used in several successive modifications to the same
+<structname>XkbControlsRec</structname>
+structure, then subsequently used to cause all of the changes, and only the
+changes, to be propagated to the server. The
+<structname>XkbControlsChangesRec</structname>
+structure is defined as follows:
+
+<programlisting>
+typedef struct _XkbControlsChanges {
+    unsigned int changed_ctrls;          /* bits indicating changed
+                                             control data */
+    unsigned int enabled_ctrls_changes;  /* bits indicating
+                                             enabled/disabled controls */
+    Bool         num_groups_changed;     /* <symbol>True</symbol> if number of keyboard
+                                             groups changed */
+} <structname>XkbControlsChangesRec</structname>, *XkbControlsChangesPtr;
+</programlisting></para>
+
+<para>
+The
+<structfield>changed_ctrls</structfield>
+field is a mask specifying which logical sets of data in the controls
+structure have been modified. In this context, modified means
+<emphasis>set</emphasis>,
+that is, if a value is set to the same value it previously contained, it has
+still been modified, and is noted as changed. Valid values for
+<structfield>changed_ctrls</structfield>
+are any combination of the masks listed in
+<link linkend="table10.7">Table 10.7</link> that have <quote>ok</quote> in the
+<structfield>changed_ctrls</structfield>
+column. Setting a bit implies the corresponding data fields from the
+<quote>Relevant XkbControlsRec Data Fields</quote> column in
+<link linkend="table10.6">Table 10.6</link> have been modified. The
+<structfield>enabled_ctrls_changes</structfield>
+field specifies which bits in the
+<structfield>enabled_ctrls</structfield>
+field have changed. If the number of keyboard groups has changed, the
+<structfield>num_groups_changed</structfield>
+field is set to <symbol>True</symbol>.
+</para>
+
+
+<para>
+If you have an Xkb description with controls that have been modified and an
+<structname>XkbControlsChangesRec</structname>
+that describes the changes that have been made, the
+<function>XkbChangeControls</function>
+function provides a flexible method for updating the controls in a server to
+match those in the changed keyboard description.
+</para>
+
+<indexterm significance="preferred" zone="XkbChangeControls"><primary><function>XkbChangeControls</function></primary></indexterm>
+<funcsynopsis id="XkbChangeControls">
+  <funcprototype>
+    <funcdef>Bool <function>XkbChangeControls</function></funcdef>
+<!-- (
+<parameter>dpy, xkb, changes</parameter>
+) -->
+
+    <paramdef>Display *<parameter>dpy</parameter></paramdef>
+    <paramdef>XkbDescPtr <parameter>xkb</parameter></paramdef>
+    <paramdef>XkbControlsChangesPtr <parameter>changes</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>dpy</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>xkb</parameter>
+    </term>
+    <listitem>
+      <para>
+        keyboard description with changed <structfield>xkb-&gt;ctrls</structfield>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>changes</parameter>
+    </term>
+    <listitem>
+      <para>
+        which parts of <structfield>xkb-&gt;ctrls</structfield> have changed
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbChangeControls</function>
+copies any controls fields specified by
+<parameter>changes</parameter>
+from the keyboard description controls structure,
+<parameter>xkb</parameter>-&gt;<structfield>ctrls</structfield>,
+to the server specified by
+<parameter>dpy</parameter>.
+</para>
+
+
+</sect2>
+</sect1>
+<sect1 id='Tracking_Changes_to_Keyboard_Controls'>
+<title>Tracking Changes to Keyboard Controls</title>
+
+<indexterm significance="preferred" zone="Tracking_Changes_to_Keyboard_Controls">
+<primary>events</primary><secondary><symbol>XkbControlsNotify</symbol></secondary></indexterm>
+<indexterm significance="preferred" zone="Tracking_Changes_to_Keyboard_Controls">
+<primary><structname>XkbControlsNotifyEvent</structname></primary></indexterm>
+
+<para>
+Whenever a field in the controls structure changes in the server’s keyboard
+description, the server sends an
+<symbol>XkbControlsNotify</symbol>
+event to all interested clients.To receive
+<symbol>XkbControlsNotify</symbol>
+events under all possible conditions, use
+<function>XkbSelectEvents</function>
+(see <link linkend="Selecting_Xkb_Events">section 4.3</link>) and pass
+<symbol>XkbControlsNotifyMask</symbol>
+in both
+<parameter>bits_to_change</parameter>
+and
+<parameter>values_for_bits</parameter>.
+</para>
+
+
+<para>
+To receive
+<symbol>XkbControlsNotify</symbol>
+events only under certain conditions, use
+<function>XkbSelectEventDetails</function>
+using
+<symbol>XkbControlsNotify</symbol>
+as the
+<structfield>event_type</structfield>
+and specifying the desired state changes in
+<parameter>bits_to_change</parameter>
+and
+<parameter>values_for_bits</parameter>
+using mask bits from <link linkend="table10.7">Table 10.7</link>.
+</para>
+
+
+<para>
+The structure for the
+<symbol>XkbControlsNotify</symbol>
+event is defined as follows:
+
+<programlisting>
+typedef struct {
+    int            type;          /* Xkb extension base event code */
+    unsigned long  serial;        /* X server serial number for event */
+    Bool           send_event;    /* <symbol>True</symbol> &rArr; synthetically generated */
+    Display *      display;       /* server connection where event generated */
+    Time           time;          /* server time when event generated */
+    int            xkb_type;      /* <symbol>XkbCompatMapNotify</symbol> */
+    int            device;        /* Xkb device ID,
+                                     will not be <symbol>XkbUseCoreKbd</symbol> */
+    unsigned int   changed_ctrls; /* bits indicating which controls
+                                     data have changed */
+    unsigned int   enabled_ctrls; /* controls currently enabled in server */
+    unsigned int   enabled_ctrl_changes;  /* bits indicating
+                                             enabled/disabled controls */
+    int            num_groups;    /* current number of keyboard groups */
+    KeyCode        keycode;       /* != 0 &rArr; keycode of key causing change */
+    char           event_type;    /* Type of event causing change */
+    char           req_major;     /* major event code of event causing change */
+    char           req_minor;     /* minor event code of event causing change */
+} <structname>XkbControlsNotifyEvent</structname>;
+</programlisting></para>
+
+<para>
+The
+<structfield>changed_ctrls</structfield>
+field specifies the controls components that have changed and consists of bits
+taken from the masks defined in
+<link linkend="table10.7">Table 10.7</link> with <quote>ok</quote> in the
+<structfield>changed_ctrls</structfield>
+column.
+</para>
+
+
+<para>
+The controls currently enabled in the server are reported in the
+<structfield>enabled_ctrls</structfield>
+field. If any controls were just enabled or disabled (that is, the contents of
+the
+<structfield>enabled_ctrls</structfield>
+field changed), they are flagged in the
+<structfield>enabled_ctrl_changes</structfield>
+field. The valid bits for these fields are the masks listed in
+<link linkend="table10.7">Table 10.7</link> with
+<quote>ok</quote> in the
+<structfield>enabled_ctrls</structfield>
+column. The
+<structfield>num_groups</structfield>
+field reports the number of groups bound to the key belonging to the most
+number of groups and is automatically updated when the keyboard mapping changes.
+</para>
+
+
+<para>
+If the change was caused by a request from a client, the
+<structfield>keycode</structfield>
+and
+<structfield>event_type</structfield>
+fields are set to
+<emphasis>zero</emphasis>
+and the
+<structfield>req_major</structfield>
+and
+<structfield>req_minor</structfield>
+fields identify the request. The
+<structfield>req_major</structfield>
+value is the same as the major extension opcode. Otherwise,
+<structfield>event_type</structfield>
+is set to the type of event that caused the change (one of
+<symbol>KeyPress</symbol>,
+<symbol>KeyRelease</symbol>,
+<symbol>DeviceKeyPress</symbol>,
+<symbol>DeviceKeyRelease</symbol>,
+<symbol>ButtonPress</symbol>
+or
+<symbol>ButtonRelease</symbol>),
+and
+<structfield>req_major</structfield>
+and
+<structfield>req_minor</structfield>
+are undefined. If
+<structfield>event_type</structfield>
+is
+<symbol>KeyPress</symbol>,
+<symbol>KeyRelease</symbol>,
+<symbol>DeviceKeyPress</symbol>,
+or
+<symbol>DeviceKeyRelease</symbol>,
+the
+<structfield>keycode</structfield>
+field is set to the key that caused the change. If
+<structfield>event_type</structfield>
+is
+<symbol>ButtonPress</symbol>
+or
+<symbol>ButtonRelease</symbol>,
+<structfield>keycode</structfield>
+contains the button number.
+</para>
+
+
+<para>
+When a client receives an
+<symbol>XkbControlsNotify</symbol>
+event, it can note the changes in a changes structure using
+<function>XkbNoteControlsChanges</function>.
+</para>
+
+<indexterm significance="preferred" zone="XkbNoteControlsChanges"><primary><function>XkbNoteControlsChanges</function></primary></indexterm>
+<funcsynopsis id="XkbNoteControlsChanges">
+  <funcprototype>
+    <funcdef>void <function>XkbNoteControlsChanges</function></funcdef>
+<!-- (
+<parameter>changes</parameter>,
+<parameter>new</parameter>,
+<parameter>wanted</parameter>
+) -->
+
+    <paramdef>XkbControlsChangesPtr <parameter>changes</parameter></paramdef>
+    <paramdef>XkbControlsNotifyEvent *<parameter>new</parameter></paramdef>
+    <paramdef>unsigned int <parameter>wanted</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>changes</parameter>
+    </term>
+    <listitem>
+      <para>
+        records changes indicated by new
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>new</parameter>
+    </term>
+    <listitem>
+      <para>
+        tells which things have changed
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>wanted</parameter>
+    </term>
+    <listitem>
+      <para>
+        tells which parts of new to record in changes
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<parameter>wanted</parameter>
+parameter is a bitwise inclusive OR of bits taken from the set of masks
+specified in <link linkend="table10.7">Table 10.7</link> with <quote>ok</quote>
+in the
+<structfield>changed_ctrls</structfield>
+column.
+<function>XkbNoteControlsChanges</function>
+copies any changes reported in
+<parameter>new</parameter>
+and specified in
+<parameter>wanted</parameter>
+into the changes record specified by
+<parameter>changes</parameter>.
+</para>
+
+
+<para>
+Use
+<function>XkbGetControlsChanges</function>
+to update a local copy of a keyboard description with the changes previously
+noted by one or more calls to
+<function>XkbNoteControlsChanges</function>.
+</para>
+
+
+<indexterm significance="preferred" zone="XkbGetControlsChanges"><primary><function>XkbGetControlsChanges</function></primary></indexterm>
+<funcsynopsis id="XkbGetControlsChanges">
+  <funcprototype>
+    <funcdef>Status <function>XkbGetControlsChanges</function></funcdef>
+<!-- (
+<parameter>dpy</parameter>,
+<parameter>xkb</parameter>,
+<parameter>changes</parameter>
+) -->
+
+    <paramdef>Display *<parameter>dpy</parameter></paramdef>
+    <paramdef>XkbDescPtr <parameter>xkb</parameter></paramdef>
+    <paramdef>XkbNameChangesPtr <parameter>changes</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>dpy</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>xkb</parameter>
+    </term>
+    <listitem>
+      <para>
+        <structfield>xkb-&gt;ctrls</structfield> will be updated
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>changes</parameter>
+    </term>
+    <listitem>
+      <para>
+        indicates which parts of <structfield>xkb-&gt;ctrls</structfield> to update
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbGetControlsChanges</function>
+examines the
+<parameter>changes</parameter>
+parameter, queries the server for the necessary information, and copies the
+results into the
+<parameter>xkb</parameter>-&gt;<structfield>ctrls</structfield>
+keyboard description. If the
+<structfield>ctrls</structfield>
+field of
+<parameter>xkb</parameter>
+is
+<symbol>NULL</symbol>,
+<function>XkbGetControlsChanges</function>
+allocates and initializes it. To free the
+<structfield>ctrls</structfield>
+field, use
+<function>XkbFreeControls</function>
+(see <link linkend="Allocating_and_Freeing_an_XkbControlsRec">section 10.12</link>).
+</para>
+
+
+<para>
+<function>XkbGetControlsChanges</function>
+returns
+<symbol>Success</symbol>
+if successful and can generate
+<errorname>BadAlloc</errorname>,
+<errorname>BadImplementation</errorname>,
+and
+<errorname>BadMatch</errorname>
+errors.
+</para>
+
+
+</sect1>
+<sect1 id='Allocating_and_Freeing_an_XkbControlsRec'>
+<title>Allocating and Freeing an XkbControlsRec</title>
+
+<para>
+The need to allocate an
+<structname>XkbControlsRec</structname>
+structure seldom arises; Xkb creates one when an application calls
+<function>XkbGetControls</function>
+or a related function. For those situations where there is not an
+<structname>XkbControlsRec</structname>
+structure allocated in the
+<structname>XkbDescRec</structname>,
+allocate one by calling
+<function>XkbAllocControls</function>.
+</para>
+
+<indexterm significance="preferred" zone="XkbAllocControls"><primary><function>XkbAllocControls</function></primary></indexterm>
+<funcsynopsis id="XkbAllocControls">
+  <funcprototype>
+    <funcdef>Status <function>XkbAllocControls</function></funcdef>
+<!-- (
+<parameter>xkb, which</parameter>
+) -->
+
+    <paramdef>XkbDescPtr <parameter>xkb</parameter></paramdef>
+    <paramdef>unsigned int <parameter>which</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>xkb</parameter>
+    </term>
+    <listitem>
+      <para>
+        Xkb description in which to allocate ctrls rec
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>which</parameter>
+    </term>
+    <listitem>
+      <para>
+        mask of components of <structfield>ctrls</structfield> to allocate
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbAllocControls</function>
+allocates the
+<structfield>ctrls</structfield>
+field of the
+<parameter>xkb</parameter>
+parameter, initializes all fields to zero, and returns
+<symbol>Success</symbol>.
+If the
+<structfield>ctrls</structfield>
+field is not
+<symbol>NULL</symbol>,
+<function>XkbAllocControls</function>
+simply returns
+<symbol>Success</symbol>.
+If
+<parameter>xkb</parameter>
+is
+<symbol>NULL</symbol>,
+<function>XkbAllocControls</function>
+reports a
+<errorname>BadMatch</errorname>
+error. If the
+<structfield>ctrls</structfield>
+field could not be allocated, it reports a
+<errorname>BadAlloc</errorname>
+error.
+</para>
+
+
+<para>
+The
+<parameter>which</parameter>
+mask specifies the individual fields of the
+<structfield>ctrls</structfield>
+structure to be allocated and can contain any of the valid masks defined in
+<link linkend="table10.7">Table 10.7</link>.
+Because none of the currently existing controls have any structures
+associated with them, which is currently of little practical value in this call.
+</para>
+
+
+<para>
+To free memory used by the
+<structfield>ctrls</structfield>
+member of an
+<structname>XkbDescRec</structname>
+structure, use
+<function>XkbFreeControls</function>:
+</para>
+
+
+<indexterm significance="preferred" zone="XkbFreeControls"><primary><function>XkbFreeControls</function></primary></indexterm>
+<funcsynopsis id="XkbFreeControls">
+  <funcprototype>
+    <funcdef>void <function>XkbFreeControls</function></funcdef>
+<!-- (
+<parameter>xkb, which, free_all</parameter>
+) -->
+
+    <paramdef>XkbDescPtr <parameter>xkb</parameter></paramdef>
+    <paramdef>unsigned int <parameter>which</parameter></paramdef>
+    <paramdef>Bool <parameter>free_all</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>xkb</parameter>
+    </term>
+    <listitem>
+      <para>
+        Xkb description in which to free controls components
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>which</parameter>
+    </term>
+    <listitem>
+      <para>
+        mask of components of <structfield>ctrls</structfield> to free
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>free_all</parameter>
+    </term>
+    <listitem>
+      <para>
+        <symbol>True</symbol> &rArr; free everything + ctrls itself
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbFreeControls</function>
+frees the specified components of the
+<structfield>ctrls</structfield>
+field in the
+<parameter>xkb</parameter>
+keyboard description and sets the corresponding structure component values to
+<symbol>NULL</symbol>
+or
+<emphasis>zero</emphasis>.
+The
+<parameter>which</parameter>
+mask specifies the fields of
+<structfield>ctrls</structfield>
+to be freed and can contain any of the controls components specified in
+<link linkend="table10.7">Table 10.7</link>.
+</para>
+
+
+<para>
+If
+<parameter>free_all</parameter>
+is
+<symbol>True</symbol>,
+<function>XkbFreeControls</function>
+frees every non-
+<symbol>NULL</symbol>
+structure component in the controls, frees the
+<structname>XkbControlsRec</structname>
+structure referenced by the
+<structfield>ctrls</structfield>
+member of
+<parameter>xkb</parameter>,
+and sets
+<structfield>ctrls</structfield>
+to
+<symbol>NULL</symbol>.
+</para>
+
+</sect1>
+<sect1 id='The_Miscellaneous_Per_client_Controls'>
+<title>The Miscellaneous Per-client Controls</title>
+
+<para>
+You can configure the boolean per-client controls which affect the state
+reported in button and key events. See
+section 12.1.1,
+12.3,
+12.5,
+and
+16.3.11
+of the
+<citetitle>XKB Protocol specification</citetitle>
+for more details.
+</para>
+
+
+<para>
+To get the current values of the
+<emphasis>per-client</emphasis>
+controls, use
+<function>XkbGetPerClientControls</function>.
+</para>
+
+<indexterm significance="preferred" zone="XkbGetPerClientControls"><primary><function>XkbGetPerClientControls</function></primary></indexterm>
+<funcsynopsis id="XkbGetPerClientControls">
+  <funcprototype>
+    <funcdef>Bool <function>XkbGetPerClientControls</function></funcdef>
+<!-- (
+<parameter>dpy</parameter>,
+<parameter>ctrls</parameter>
+) -->
+
+    <paramdef>Display *<parameter>dpy</parameter></paramdef>
+    <paramdef>unsigned int *<parameter>ctrls</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>dpy</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>ctrls</parameter>
+    </term>
+    <listitem>
+      <para>
+        1 bit &rArr; corresponding control is on
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbGetPerClientControls</function>
+backfills
+<parameter>ctrls</parameter>
+with the
+<emphasis>per-client</emphasis>
+control attributes for this particular client. It returns
+<symbol>True</symbol>
+if successful, and
+<symbol>False</symbol>
+otherwise.
+</para>
+
+
+<para>
+To change the current values of the
+<emphasis>per-client</emphasis>
+control attributes, use
+<function>XkbSetPerClientControls</function>.
+</para>
+
+
+<indexterm significance="preferred" zone="XkbSetPerClientControls"><primary><function>XkbSetPerClientControls</function></primary></indexterm>
+<funcsynopsis id="XkbSetPerClientControls">
+  <funcprototype>
+    <funcdef>Bool <function>XkbSetPerClientControls</function></funcdef>
+<!-- (
+<parameter>dpy</parameter>,
+<parameter>ctrls</parameter>
+) -->
+
+    <paramdef>Display *<parameter>dpy</parameter></paramdef>
+    <paramdef>unsigned int <parameter>change</parameter></paramdef>
+    <paramdef>unsigned int *<parameter>value</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>dpy</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>change</parameter>
+    </term>
+    <listitem>
+      <para>
+        1 bit &rArr; change control
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>value</parameter>
+    </term>
+    <listitem>
+      <para>
+        1 bit &rArr; control on
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbSetPerClientControls</function>
+changes the per-client values for the controls selected by
+<parameter>change</parameter> to the corresponding value in
+<parameter>value</parameter>. Legal values for
+<parameter>change</parameter> and <parameter>value</parameter>
+are: XkbPCF_GrabsUseXKBStateMask, XkbPCF_LookupStateWhenGrabbed, and
+XkbPCF_SendEventUsesXKBState. More than one control may be changed at one time
+by OR-ing the values together. XkbSetPerClientControls backfills value with the
+<emphasis>per-client</emphasis>
+control attributes for this particular client.
+It returns
+<symbol>True</symbol>
+if successful, and
+<symbol>False</symbol>
+otherwise.
+</para>
+
+</sect1>
+</chapter>
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/XKB/ch12.xml
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/XKB/ch12.xml	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/XKB/ch12.xml	(revision 5)
@@ -0,0 +1,886 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+	  "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+<chapter id='Interpreting_Key_Events'>
+<title>Interpreting Key Events</title>
+
+<para>
+Xkb provides functions to help developers interpret key events without having
+to directly interpret Xkb data structures. Xkb also modifies the behavior of
+several core X library functions.
+</para>
+
+<sect1 id='Effects_of_Xkb_on_the_Core_X_Library'>
+<title>Effects of Xkb on the Core X Library</title>
+
+<para>
+When support for Xkb is built into the X library, the
+<function>XOpenDisplay</function>
+function looks for a compatible version of Xkb on the server. If it finds a
+compatible version, it initializes the extension and enables
+<firstterm>implicit support</firstterm>
+for Xkb in a number of X library functions. This makes it possible for clients
+to take advantage of nearly all Xkb features without having to be rewritten or
+even recompiled, if they are built with shared libraries. This implicit support
+is invisible to most clients, but it can have side effects, so the extension
+includes ways to control or disable it.
+</para>
+
+
+<sect2 id='Effects_of_Xkb_on_Event_State'>
+<title>Effects of Xkb on Event State</title>
+
+<para>
+Because
+<function>XOpenDisplay</function>
+initializes Xkb, some events contain an Xkb description of the keyboard state
+instead of that normally used by the core protocol. See <link linkend="Xkb_State_to_Core_Protocol_State_Transformation">section 17.1.1</link> for more
+information about the differences between Xkb keyboard state and that reported
+by the core protocol.
+</para>
+
+
+</sect2>
+<sect2 id='Effects_of_Xkb_on_MappingNotify_Events'>
+<title>Effects of Xkb on MappingNotify Events</title>
+
+<indexterm zone="Effects_of_Xkb_on_MappingNotify_Events">
+<primary>events</primary><secondary><symbol>MappingNotify</symbol></secondary></indexterm>
+
+<para>
+When Xkb is missing or disabled, the X library tracks changes to the keyboard
+mapping using
+<symbol>MappingNotify</symbol>
+events. Whenever the keyboard mapping is changed, the server sends all clients
+a
+<symbol>MappingNotify</symbol>
+event to report the change. When a client receives a
+<symbol>MappingNotify</symbol>
+event, it is supposed to call
+<function>XRefreshKeyboardMapping</function>
+to update the keyboard description used internally by the X library.
+</para>
+
+
+<para>
+The X Keyboard Extension uses
+<symbol>XkbMapNotify</symbol>
+and
+<symbol>XkbNewKeyboardNotify</symbol>
+events to track changes to the keyboard mapping. When an Xkb-aware client
+receives either event, it should call
+<function>XkbRefreshKeyboardMapping</function>
+to update the keyboard description used internally by the X library. To avoid
+duplicate events, the X server does not send core protocol
+<symbol>MappingNotify</symbol>
+events to a client that has selected for
+<symbol>XkbMapNotify</symbol>
+events.
+</para>
+
+
+<para>
+The implicit support for Xkb selects for
+<symbol>XkbMapNotify</symbol>
+events. This means that clients that do not explicitly use Xkb but that are
+using a version of the X library that has implicit support for Xkb do not
+receive
+<symbol>MappingNotify</symbol>
+events over the wire. Clients that were not written with Xkb in mind do not
+recognize or properly handle the new Xkb events, so the implicit support
+converts them to
+<symbol>MappingNotify</symbol>
+events that report approximately the same information, unless the client has
+explicitly selected for the Xkb version of the event.
+</para>
+
+
+<para>
+An Xkb-capable X server does not send events from keys that fall outside the
+legal range of keycodes expected by that client. Once the server sends a client
+an
+<symbol>XkbNewKeyboardNotify</symbol>
+event, it reports events from all keys because it assumes that any client that
+has received an
+<symbol>XkbNewKeyboardNotify</symbol>
+event expects key events from the new range of keycodes. The implicit support
+for Xkb asks for
+<symbol>XkbNewKeyboardNotify</symbol>
+events, so the range of keycodes reported to the client might vary without the
+client’s knowledge. Most clients don’t really care about the range of legal
+keycodes, but some clients maintain information about each key and might have
+problems with events that come from unexpected keys. Such clients can set the
+<symbol>XkbLC_IgnoreNewKeyboards</symbol>
+library control (see <link linkend="IgnoreNewKeyboards">section 11.3.1</link>) to prevent the implicit support from
+requesting notification of changes to the legal range of keycodes.
+</para>
+
+
+</sect2>
+<sect2 id='X_Library_Functions_Affected_by_Xkb'>
+<title>X Library Functions Affected by Xkb</title>
+
+<para>
+The following X library functions are modified by Xkb:
+
+  <simplelist type='vert' columns='1'>
+    <member><function>XKeycodeToKeysym</function></member>
+    <member><function>XKeysymToKeycode</function></member>
+    <member><function>XLookupKeysym</function></member>
+    <member><function>XLookupString</function></member>
+    <member><function>XRefreshKeyboardMapping</function></member>
+    <member><function>XRebindKeysym</function></member>
+  </simplelist>
+</para>
+
+<para>
+The implicit support for Xkb replaces a number of X library functions with
+versions that understand and use the X Keyboard Extension. In most cases, the
+semantics of the new versions are identical to those of the old, but there are
+occasional visible differences. This section lists all of the functions that
+are affected and the differences in behavior, if any, that are visible to
+clients.
+</para>
+
+
+<para id='XKeycodeToKeysym'>
+The
+<function>XKeycodeToKeysym</function>
+<indexterm significance="preferred" zone="XKeycodeToKeysym"><primary><function>XKeycodeToKeysym</function></primary></indexterm>
+function reports the keysym associated with a particular index for a single
+key. The index specifies a column of symbols in the core keyboard mapping (that
+is, as reported by the core protocol
+<systemitem>GetKeyboardMapping</systemitem>
+request). The order of the symbols in the core mapping does not necessarily
+correspond to the order of the symbols used by Xkb; <link linkend="Xkb_Keyboard_Mapping_to_Core_Keyboard_Mapping_Transformations">section 17.1.3</link> describes
+the differences.
+</para>
+
+
+<para id='XKeysymToKeycode'>
+The
+<function>XKeysymToKeycode</function>
+<indexterm significance="preferred" zone="XKeysymToKeycode"><primary><function>XKeysymToKeycode</function></primary></indexterm>
+function reports a keycode to which a particular keysym is bound. When Xkb is
+missing or disabled, this function looks in each column of the core keyboard
+mapping in turn and returns the lowest numbered key that matches in the lowest
+numbered group. When Xkb is present, this function uses the Xkb ordering for
+symbols instead.
+</para>
+
+
+<para id='XLookupKeysym'>
+The
+<function>XLookupKeysym</function>
+<indexterm significance="preferred" zone="XLookupKeysym"><primary><function>XLookupKeysym</function></primary></indexterm>
+function reports the symbol in a specific column of the key associated with an
+event. Whether or not Xkb is present, the column specifies an index into the
+core symbol mapping.
+</para>
+
+
+<para id='XLookupString'>
+The
+<function>XLookupString</function>
+<indexterm significance="preferred" zone="XLookupString"><primary><function>XLookupString</function></primary></indexterm>
+function reports the symbol and string associated with a key event, taking
+into account the keycode and keyboard state as reported in the event. When Xkb
+is disabled or missing,
+<function>XLookupString</function>
+uses the rules specified by the core protocol and reports only ISO Latin-1
+characters. When Xkb is present,
+<function>XLookupString</function>
+uses the explicit keyboard group, key types, and rules specified by Xkb. When
+Xkb is present,
+<function>XLookupString</function>
+is allowed, but not required, to return strings in character sets other than
+ISO Latin-1, depending on the current locale. If any key bindings are defined,
+<function>XLookupString</function>
+does not use any consumed modifiers (see <link linkend="ConsumeLookupMods">section 11.1.2</link> and <link linkend="Key_Types">section 15.2</link>) to
+determine matching bindings.
+</para>
+
+
+<para id='XRefreshKeyboardMapping'>
+The
+<function>XRefreshKeyboardMapping</function>
+<indexterm significance="preferred" zone="XRefreshKeyboardMapping"><primary><function>XRefreshKeyboardMapping</function></primary></indexterm>
+function updates the X library’s internal representation of the keyboard to
+reflect changes reported via
+<symbol>MappingNotify</symbol>
+events. When Xkb is missing or disabled, this function reloads the entire
+modifier map or keyboard mapping. When Xkb is present, the implicit Xkb support
+keeps track of the changed components reported by each
+<symbol>XkbMapNotify</symbol>
+event and updates only those pieces of the keyboard description that have
+changed. If the implicit support has not noted any keyboard mapping changes,
+<function>XRefreshKeyboardMapping</function>
+updates the entire keyboard description.
+</para>
+
+
+<para id='XRebindKeysym'>
+The
+<function>XRebindKeysym</function>
+<indexterm significance="preferred" zone="XRebindKeysym"><primary><function>XRebindKeysym</function></primary></indexterm>
+function associates a string with a keysym and a set of modifiers. Xkb does
+not directly change this function, but it does affect the way that the state
+reported in the event is compared to the state specified to
+<function>XRebindKeysym</function>.
+When Xkb is missing or disabled,
+<function>XLookupString</function>
+returns the specified string if the modifiers in the event exactly match the
+modifiers from this call. When Xkb is present, any modifiers used to determine
+the keysym are consumed and are not used to look up the string.
+</para>
+
+
+</sect2>
+</sect1>
+<sect1 id='Xkb_Event_and_Keymap_Functions'>
+<title>Xkb Event and Keymap Functions</title>
+
+<para>
+To find the keysym bound to a particular key at a specified group and shift
+level, use <function>XkbKeycodeToKeysym</function>.
+</para>
+
+<indexterm significance="preferred" zone="XkbKeycodeToKeysym"><primary><function>XkbKeycodeToKeysym</function></primary></indexterm>
+<funcsynopsis id="XkbKeycodeToKeysym">
+  <funcprototype>
+    <funcdef>KeySym <function>XkbKeycodeToKeysym</function></funcdef>
+<!-- (
+<parameter>dpy, kc, group, level</parameter>
+) -->
+
+    <paramdef>Display *<parameter>dpy</parameter></paramdef>
+    <paramdef>KeyCode <parameter>kc</parameter></paramdef>
+    <paramdef>unsigned int <parameter>group</parameter></paramdef>
+    <paramdef>unsigned int <parameter>level</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>dpy</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>kc</parameter>
+    </term>
+    <listitem>
+      <para>
+        key of interest
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>group</parameter>
+    </term>
+    <listitem>
+      <para>
+        group of interest
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>level</parameter>
+    </term>
+    <listitem>
+      <para>
+        shift level of interest
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbKeycodeToKeysym</function>
+returns the keysym bound to a particular group and shift level for a
+particular key on the core keyboard. If
+<parameter>kc</parameter>
+is not a legal keycode for the core keyboard, or if
+<parameter>group</parameter>
+or
+<parameter>level</parameter>
+are out of range for the specified key,
+<function>XkbKeycodeToKeysym</function>
+returns
+<symbol>NoSymbol</symbol>.
+</para>
+
+
+<para>
+To find the set of modifiers bound to a particular keysym on the core keyboard,
+use
+<function>XkbKeysymToModifiers</function>.
+</para>
+
+
+<indexterm significance="preferred" zone="XkbKeysymToModifiers"><primary><function>XkbKeysymToModifiers</function></primary></indexterm>
+<funcsynopsis id="XkbKeysymToModifiers">
+  <funcprototype>
+    <funcdef>unsigned int <function>XkbKeysymToModifiers</function></funcdef>
+<!-- (
+<parameter>dpy</parameter>,
+<parameter>ks</parameter>
+) -->
+
+    <paramdef>Display *<parameter>dpy</parameter></paramdef>
+    <paramdef>KeySym <parameter>ks</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>dpy</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>ks</parameter>
+    </term>
+    <listitem>
+      <para>
+        keysym of interest
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbKeysymToModifiers</function>
+finds the set of modifiers currently bound to the keysym
+<parameter>ks</parameter>
+on the core keyboard. The value returned is the mask of modifiers bound to the
+keysym
+<parameter>ks</parameter>.
+If no modifiers are bound to the keysym,
+<function>XkbKeysymToModifiers</function>
+returns zero; otherwise, it returns the inclusive OR of zero or more of the
+following:
+<symbol>ShiftMask</symbol>,
+<symbol>ControlMask</symbol>,
+<symbol>LockMask</symbol>,
+<symbol>Mod1Mask</symbol>,
+<symbol>Mod2Mask</symbol>,
+<symbol>Mod3Mask</symbol>,
+<symbol>Mod4Mask</symbol>,
+and
+<symbol>Mod5Mask</symbol>.
+</para>
+
+
+<para>
+Use
+<function>XkbLookupKeySym</function>
+to find the symbol associated with a key for a particular state.
+</para>
+
+
+<indexterm significance="preferred" zone="XkbLookupKeySym"><primary><function>XkbLookupKeySym</function></primary></indexterm>
+<funcsynopsis id="XkbLookupKeySym">
+  <funcprototype>
+    <funcdef>Bool <function>XkbLookupKeySym</function></funcdef>
+<!-- (
+<parameter>dpy</parameter>,
+<parameter>key</parameter>,
+<parameter>state</parameter>,
+<parameter>mods_rtrn</parameter>,
+<parameter>sym_rtrn</parameter>
+) -->
+
+    <paramdef>Display *<parameter>dpy</parameter></paramdef>
+    <paramdef>KeyCode <parameter>key</parameter></paramdef>
+    <paramdef>unsigned int <parameter>state</parameter></paramdef>
+    <paramdef>unsigned int *<parameter>mods_rtrn</parameter></paramdef>
+    <paramdef>KeySym *<parameter>sym_rtrn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>dpy</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>key</parameter>
+    </term>
+    <listitem>
+      <para>
+        key for which symbols are to be found
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>state</parameter>
+    </term>
+    <listitem>
+      <para>
+        state for which symbol should be found
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>mods_rtrn</parameter>
+    </term>
+    <listitem>
+      <para>
+        backfilled with consumed modifiers
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>sym_rtrn</parameter>
+    </term>
+    <listitem>
+      <para>
+        backfilled with symbol associated with key + state
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbLookupKeySym</function>
+is the equivalent of the core
+<symbol>XLookupKeySym</symbol>
+function. For the core keyboard, given a keycode
+<parameter>key</parameter>
+and an Xkb state
+<parameter>state</parameter>,
+<function>XkbLookupKeySym</function>
+returns the symbol associated with the key  in
+<parameter>sym_rtrn</parameter>
+and the list of modifiers that should still be applied in
+<parameter>mods_rtrn</parameter>.
+The
+<parameter>state</parameter>
+parameter is the state from a
+<symbol>KeyPress</symbol>
+or
+<symbol>KeyRelease</symbol>
+event.
+<function>XkbLookupKeySym</function>
+returns
+<symbol>True</symbol>
+if it succeeds.
+</para>
+
+
+<para>
+Use
+<function>XkbLookupKeyBinding</function>
+to find the string bound to a key by
+<function>XRebindKeysym</function>.
+<function>XkbLookupKeyBinding</function>
+is the equivalent of the core
+<function>XLookupString</function>
+function.
+</para>
+
+
+<indexterm significance="preferred" zone="XkbLookupKeyBinding"><primary><function>XkbLookupKeyBinding</function></primary></indexterm>
+<funcsynopsis id="XkbLookupKeyBinding">
+  <funcprototype>
+    <funcdef>int <function>XkbLookupKeyBinding</function></funcdef>
+<!-- (
+<parameter>dpy</parameter>,
+<parameter>sym</parameter>,
+<parameter>state</parameter>,
+<parameter>buf</parameter>,
+<parameter>nbytes</parameter>,
+<parameter>extra_rtrn</parameter>
+) -->
+
+    <paramdef>Display *<parameter>dpy</parameter></paramdef>
+    <paramdef>KeySym <parameter>sym</parameter></paramdef>
+    <paramdef>unsigned int <parameter>state</parameter></paramdef>
+    <paramdef>char *<parameter>buf</parameter></paramdef>
+    <paramdef>int <parameter>nbytes</parameter></paramdef>
+    <paramdef>int *<parameter>extra_rtrn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>dpy</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>sym</parameter>
+    </term>
+    <listitem>
+      <para>
+        symbol to be looked up
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>state</parameter>
+    </term>
+    <listitem>
+      <para>
+        state for which string is to be looked up
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>buf</parameter>
+    </term>
+    <listitem>
+      <para>
+        buffer into which returned string is written
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>nbytes</parameter>
+    </term>
+    <listitem>
+      <para>
+        size of buffer in bytes
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>extra_rtrn</parameter>
+    </term>
+    <listitem>
+      <para>
+        backfilled with number bytes overflow
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XRebindKeysym</function>
+binds an ASCII string to a specified keysym, so that the string and keysym are
+returned when the key is pressed and a specified list of modifiers are also
+being held down.
+<function>XkbLookupKeyBinding</function>
+returns in
+<parameter>buf</parameter>
+the string associated with the keysym
+<parameter>sym</parameter>
+and modifier state
+<parameter>state</parameter>.
+<parameter>buf</parameter>
+is
+<symbol>NULL</symbol>
+terminated unless there’s an overflow. If the string returned is larger than
+<parameter>nbytes</parameter>,
+a count of bytes that does not fit into the buffer is returned in extra_rtrn.
+<function>XkbTranslateKeySym</function>
+returns the number of bytes that it placed into
+<parameter>buf</parameter>.
+</para>
+
+
+<para>
+To find the string and symbol associated with a keysym for a given keyboard
+state, use
+<function>XkbTranslateKeySym</function>.
+</para>
+
+
+<indexterm significance="preferred" zone="XkbTranslateKeySym"><primary><function>XkbTranslateKeySym</function></primary></indexterm>
+<funcsynopsis id="XkbTranslateKeySym">
+  <funcprototype>
+    <funcdef>int <function>XkbTranslateKeySym</function></funcdef>
+<!-- (
+<parameter>dpy</parameter>,
+<parameter>sym_inout</parameter>,
+<parameter>mods</parameter>,
+<parameter>buf</parameter>,
+<parameter>nbytes</parameter>,
+<parameter>extra_rtrn</parameter>
+) -->
+
+    <paramdef>Display *<parameter>dpy</parameter></paramdef>
+    <paramdef>KeySym *<parameter>sym_inout</parameter></paramdef>
+    <paramdef>unsigned int <parameter>mods</parameter></paramdef>
+    <paramdef>char *<parameter>buf</parameter></paramdef>
+    <paramdef>int <parameter>nbytes</parameter></paramdef>
+    <paramdef>int *<parameter>extra_rtrn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>dpy</parameter>
+    </term>
+    <listitem>
+      <para>
+        connection to X server
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>sym_inout</parameter>
+    </term>
+    <listitem>
+      <para>
+        symbol to be translated; result of translation
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>mods</parameter>
+    </term>
+    <listitem>
+      <para>
+        modifiers to apply to <parameter>sym_inout</parameter>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>buf</parameter>
+    </term>
+    <listitem>
+      <para>
+        buffer into which returned string is written
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>nbytes</parameter>
+    </term>
+    <listitem>
+      <para>
+        size of buffer in bytes
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>extra_rtrn</parameter>
+    </term>
+    <listitem>
+      <para>
+        number of bytes overflow
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbTranslateKeySym</function>
+applies the transformations specified in
+<parameter>mods</parameter>
+to the symbol specified by
+<parameter>sym_inout</parameter>.
+It returns in
+<parameter>buf</parameter>
+the string, if any, associated with the keysym for the current locale. If the
+transformations in
+<parameter>mods</parameter>
+changes the keysym,
+<parameter>sym_inout</parameter>
+is updated accordingly. If the string returned is larger than
+<parameter>nbytes</parameter>,
+a count of bytes that does not fit into the buffer is returned in extra_rtrn.
+<function>XkbTranslateKeySym</function>
+returns the number of bytes it placed into
+<parameter>buf</parameter>.
+</para>
+
+
+<para>
+To update the keyboard description that is internal to the X library, use
+<function>XkbRefreshKeyboardMapping</function>.
+</para>
+
+
+<indexterm significance="preferred" zone="XkbRefreshKeyboardMapping"><primary><function>XkbRefreshKeyboardMapping</function></primary></indexterm>
+<funcsynopsis id="XkbRefreshKeyboardMapping">
+  <funcprototype>
+    <funcdef>Status <function>XkbRefreshKeyboardMapping</function></funcdef>
+<!-- (
+<parameter>event)</parameter> -->
+
+    <paramdef>XkbMapNotifyEvent *<parameter>event</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>event</parameter>
+    </term>
+    <listitem>
+      <para>
+        event initiating remapping
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XkbRefreshKeyboardMapping</function>
+is the Xkb equivalent of the core
+<function>XRefreshKeyboardMapping</function>
+function. It requests that the X server send the current key mapping
+information to this client. A client usually invokes
+<function>XkbRefreshKeyboardMapping</function>
+after receiving an
+<symbol>XkbMapNotify</symbol>
+event.
+<function>XkbRefreshKeyboardMapping</function>
+returns
+<symbol>Success</symbol>
+if it succeeds and
+<errorname>BadMatch</errorname>
+if the event is not an Xkb event.
+</para>
+
+
+<para>
+The
+<symbol>XkbMapNotify</symbol>
+event can be generated when some client calls
+<function>XkbSetMap</function>,
+<function>XkbChangeMap</function>,
+<function>XkbGetKeyboardByName</function>,
+or any of the standard X library functions that change the keyboard mapping
+or modifier mapping.
+</para>
+
+
+<para>
+To translate a keycode to a key symbol and modifiers, use
+<function>XkbTranslateKeyCode</function>.
+</para>
+
+
+<indexterm significance="preferred" zone="XkbTranslateKeyCode"><primary><function>XkbTranslateKeyCode</function></primary></indexterm>
+<funcsynopsis id="XkbTranslateKeyCode">
+  <funcprototype>
+    <funcdef>Bool <function>XkbTranslateKeyCode</function></funcdef>
+<!-- (
+<parameter>xkb, key, mods, mods_rtrn, keysym_rtrn)</parameter> -->
+
+    <paramdef>XkbDescPtr <parameter>xkb</parameter></paramdef>
+    <paramdef>KeyCode <parameter>key</parameter></paramdef>
+    <paramdef>unsigned int <parameter>mods</parameter></paramdef>
+    <paramdef>unsigned int *<parameter>mods_rtrn</parameter></paramdef>
+    <paramdef>KeySym *<parameter>keysym_rtrn</parameter></paramdef>
+  </funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <parameter>xkb</parameter>
+    </term>
+    <listitem>
+      <para>
+        keyboard description to use for translation
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>key</parameter>
+    </term>
+    <listitem>
+      <para>
+        keycode to translate
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>mods</parameter>
+    </term>
+    <listitem>
+      <para>
+        modifiers to apply when translating <parameter>key</parameter>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>mods_rtrn</parameter>
+    </term>
+    <listitem>
+      <para>
+        backfilled with consumed modifiers
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <parameter>keysym_rtrn</parameter>
+    </term>
+    <listitem>
+      <para>
+        keysym resulting from translation
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<parameter>mods_rtrn</parameter>
+is backfilled with the modifiers consumed by the translation process.
+<parameter>mods</parameter>
+is a bitwise inclusive OR of the legal modifier masks:
+<symbol>ShiftMask</symbol>,
+<symbol>LockMask</symbol>,
+<symbol>ControlMask</symbol>,
+<symbol>Mod1Mask</symbol>,
+<symbol>Mod2Mask</symbol>,
+<symbol>Mod3Mask</symbol>,
+<symbol>Mod4Mask</symbol>,
+<symbol>Mod5Mask</symbol>.
+The
+<emphasis>AlwaysConsumeShiftAndLock</emphasis>
+library control (see <link linkend="AlwaysConsumeShiftAndLock">section 11.1.3</link>), if enabled, causes
+<function>XkbTranslateKeyCode</function>
+to consume shift and lock.
+<function>XkbTranslateKeyCode</function>
+returns
+<symbol>True</symbol>
+if the translation resulted in a keysym, and
+<symbol>False</symbol>
+if it resulted in
+<symbol>NoSymbol</symbol>.
+</para>
+</sect1>
+</chapter>
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/XKB
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/XKB	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/XKB	(revision 5)

Property changes on: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/XKB
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/i18n/localedb/localedb.xml
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/i18n/localedb/localedb.xml	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/i18n/localedb/localedb.xml	(revision 5)
@@ -0,0 +1,786 @@
+<?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"
+[
+<!ENTITY % defs SYSTEM "defs.ent"> %defs;
+]>
+
+<book id="localedb">
+
+<bookinfo>
+   <title>X Locale Database Specification</title>
+   <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
+   <authorgroup>
+      <author>
+         <firstname>Yoshio</firstname><surname>Horiuchi</surname>
+         <affiliation><orgname>IBM Japan</orgname></affiliation>
+      </author>
+   </authorgroup>
+   <copyright><year>1994</year><holder>IBM Corporation</holder></copyright>
+
+<legalnotice>
+<para>
+License 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 IBM not be used in advertising
+or publicity pertaining to distribution of the software without specific, written
+prior permission.
+</para>
+<para>
+IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
+WARRANTIES OF MERCHANTABILITY, FITNESS, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS,
+IN NO EVENT SHALL IBM 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.
+</para>
+</legalnotice>
+
+<legalnotice>
+<para role="multiLicensing">Copyright © 1994 X Consortium</para>
+<para>
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files
+(the &ldquo;Software&rdquo;), 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>
+
+<para>X Window System is a trademark of The Open Group.</para>
+
+</legalnotice>
+</bookinfo>
+
+<chapter id='LocaleDB'>
+<title>LocaleDB</title>
+
+<sect1 id="General">
+<title>General</title>
+<para>
+An X Locale Database contains the subset of a user's environment that
+depends on language, in X Window System.  It is made up from one or more
+categories.  Each category consists of some classes and sub-classes.
+</para>
+
+<para>
+It is provided as a plain ASCII text file, so a user can change its
+contents easily.  It allows a user to customize the behavior of
+internationalized portion of Xlib without changing Xlib itself.
+</para>
+
+<para>
+This document describes;
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+Database Format Definition
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Contents of Database in sample implementation
+<!-- .RE -->
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+Since it is hard to define the set of required information for all
+platforms, only the flexible database format is defined.
+The available entries in database are implementation dependent.
+</para>
+
+</sect1>
+<sect1 id="Database_Format_Definition">
+<title>Database Format Definition</title>
+<para>
+The X Locale Database contains one or more category definitions.
+This section describes the format of each category definition.
+</para>
+
+<para>
+The category definition consists of one or more class definitions.
+Each class definition has a pair of class name and class value, or
+has several subclasses which are enclosed by the left brace ({) and
+the right brace (}).
+</para>
+
+<para>
+Comments can be placed by using the number sign character (#).
+Putting the number sign character on the top of the line indicates
+that the entire line is comment.  Also, putting any whitespace character
+followed by the number sign character indicates that a part of the line
+(from the number sign to the end of the line) is comment.
+A line can be continued by placing backslash (\) character as the
+last character on the line;  this continuation character will be
+discarded from the input.  Comment lines cannot be continued on
+a subsequent line using an escaped new line character.
+</para>
+
+<para>
+X Locale Database only accepts XPCS, the X Portable Character Set.
+The reserved symbols are;  the quotation mark("), the number sign (#),
+the semicolon(;), the backslash(\), the left brace({) and
+the right brace(}).
+</para>
+
+<para>
+The format of category definition is;
+</para>
+
+<informaltable frame="none">
+  <?dbfo keep-together="auto" ?>
+  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth='3.0*'/>
+  <colspec colname='c2' colwidth='1.0*'/>
+  <colspec colname='c3' colwidth='6.0*'/>
+  <tbody>
+    <row>
+      <entry>CategoryDefinition</entry>
+      <entry>::=</entry>
+      <entry>CategoryHeader CategorySpec CategoryTrailer</entry>
+    </row>
+    <row>
+      <entry>CategoryHeader</entry>
+      <entry>::=</entry>
+      <entry>CategoryName NL</entry>
+    </row>
+    <row>
+      <entry>CategorySpec</entry>
+      <entry>::=</entry>
+      <entry>{ ClassSpec }</entry>
+    </row>
+    <row>
+      <entry>CategoryTrailer</entry>
+      <entry>::=</entry>
+      <entry>"END" Delimiter CategoryName NL</entry>
+    </row>
+    <row>
+      <entry>CategoryName</entry>
+      <entry>::=</entry>
+      <entry>String</entry>
+    </row>
+    <row>
+      <entry>ClassSpec</entry>
+      <entry>::=</entry>
+      <entry>ClassName Delimiter ClassValue NL</entry>
+    </row>
+    <row>
+      <entry>ClassName</entry>
+      <entry>::=</entry>
+      <entry>String</entry>
+    </row>
+    <row>
+      <entry>ClassValue</entry>
+      <entry>::=</entry>
+      <entry>ValueList | "{" NL { ClassSpec } "}"</entry>
+    </row>
+    <row>
+      <entry>ValueList</entry>
+      <entry>::=</entry>
+      <entry>Value | Value ";" ValueList</entry>
+    </row>
+    <row>
+      <entry>Value</entry>
+      <entry>::=</entry>
+      <entry>ValuePiece | ValuePiece Value</entry>
+    </row>
+    <row>
+      <entry>ValuePiece</entry>
+      <entry>::=</entry>
+      <entry>String | QuotedString | NumericString</entry>
+    </row>
+    <row>
+      <entry>String</entry>
+      <entry>::=</entry>
+      <entry>Char { Char }</entry>
+    </row>
+    <row>
+      <entry>QuotedString</entry>
+      <entry>::=</entry>
+      <entry>""" QuotedChar { QuotedChar } """</entry>
+    </row>
+    <row>
+      <entry>NumericString</entry>
+      <entry>::=</entry>
+      <entry>"\\o" OctDigit { OctDigit }</entry>
+    </row>
+    <row>
+      <entry></entry>
+      <entry>|</entry>
+      <entry>"\\d" DecDigit { DecDigit }</entry>
+    </row>
+    <row>
+      <entry></entry>
+      <entry>|</entry>
+      <entry>"\\x" HexDigit { HexDigit }</entry>
+    </row>
+    <row>
+      <entry>Char</entry>
+      <entry>::=</entry>
+      <entry>&lt;XPCS except NL, Space or unescaped reserved symbols&gt;</entry>
+    </row>
+    <row>
+      <entry>QuotedChar</entry>
+      <entry>::=</entry>
+      <entry>&lt;XPCS except unescaped """&gt;</entry>
+    </row>
+    <row>
+      <entry>OctDigit</entry>
+      <entry>::=</entry>
+      <entry>&lt;character in the range of "0" - "7"&gt;</entry>
+    </row>
+    <row>
+      <entry>DecDigit</entry>
+      <entry>::=</entry>
+      <entry>&lt;character in the range of "0" - "9"&gt;</entry>
+    </row>
+    <row>
+      <entry>HexDigit</entry>
+      <entry>::=</entry>
+      <entry>&lt;character in the range of "0" - "9", "a" - "f", "A" - "F"&gt;</entry>
+    </row>
+    <row>
+      <entry>Delimiter</entry>
+      <entry>::=</entry>
+      <entry>Space { Space }</entry>
+    </row>
+    <row>
+      <entry>Space</entry>
+      <entry>::=</entry>
+      <entry>&lt;space&gt; | &lt;horizontal tab&gt;</entry>
+    </row>
+    <row>
+      <entry>NL</entry>
+      <entry>::=</entry>
+      <entry>&lt;newline&gt;</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+Elements separated by vertical bar (|) are alternatives.  Curly
+braces ({...}) indicate zero or more repetitions of the enclosed
+elements.  Square brackets ([...]) indicate that the enclosed element
+is optional. Quotes ("...") are used around literal characters.
+</para>
+
+<para>
+The backslash, which is not the top character of the NumericString, is
+recognized as an escape character, so that the next one character is
+treated as a literal character.  For example, the two-character
+sequence, ""\"""(the backslash followed by the quotation mark) is
+recognized and replaced with a quotation mark character.
+Any whitespace character, that is not the Delimiter, unquoted and
+unescaped, is ignored.
+</para>
+
+</sect1>
+<sect1 id='Contents_of_Database'>
+<title>Contents of Database</title>
+<para>
+The available categories and classes depend on implementation, because
+different platform will require different information set.
+For example, some platform have system locale but some platform don't.
+Furthermore, there might be a difference in functionality even if the
+platform has system locale.
+</para>
+
+<para>
+In current sample implementation, categories listed below are available.
+</para>
+
+<informaltable frame="none">
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='1' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth='1.0*'/>
+  <tbody>
+    <row>
+      <entry>XLC_FONTSET:XFontSet relative information</entry>
+    </row>
+    <row>
+      <entry>XLC_XLOCALE:Character classification and conversion information</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+</sect1>
+<sect1 id="XLC_FONTSET_Category">
+<title>XLC_FONTSET Category</title>
+<para>
+The XLC_FONTSET category defines the XFontSet relative information.
+It contains the CHARSET_REGISTRY-CHARSET_ENCODING name and character
+mapping side (GL, GR, etc), and is used in Output Method (OM).
+</para>
+
+<informaltable frame="topbot">
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+  <thead>
+  <colspec colname='c1' colwidth='3.0*'/>
+  <colspec colname='c2' colwidth='1.0*'/>
+  <colspec colname='c3' colwidth='3.0*'/>
+    <row rowsep='1'>
+      <entry>class</entry>
+      <entry>super class</entry>
+      <entry>description</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>fsN</entry>
+      <entry></entry>
+      <entry>Nth fontset (N=0,1,2, ...)</entry>
+    </row>
+    <row>
+      <entry>charset</entry>
+      <entry>fsN</entry>
+      <entry>list of encoding name</entry>
+    </row>
+    <row>
+      <entry>font</entry>
+      <entry>fsN</entry>
+      <entry>list of font encoding name</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<variablelist>
+  <varlistentry>
+    <term>fsN</term>
+    <listitem>
+      <para>
+Includes an encoding information for Nth charset, where N is
+the index number (0,1,2,...).  If there are 4 charsets available
+in current locale, 4 fontsets, fs0, fs1, fs2 and fs3, should be
+defined.
+This class has two subclasses, 'charset' and 'font'.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>charset</term>
+    <listitem>
+      <para>
+Specifies an encoding information to be used internally in Xlib
+for this fontset.  The format of value is;
+      </para>
+<informaltable frame="none">
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth='3.0*'/>
+  <colspec colname='c2' colwidth='1.0*'/>
+  <colspec colname='c3' colwidth='4.0*'/>
+  <tbody>
+    <row>
+      <entry>EncodingInfo</entry>
+      <entry>::=</entry>
+      <entry>EncodingName [ ":" EncodingSide ]</entry>
+    </row>
+    <row>
+      <entry>EncodingName</entry>
+      <entry>::=</entry>
+      <entry>CHARSET_REGISTRY-CHARSET_ENCODING</entry>
+    </row>
+    <row>
+      <entry>EncodingSide</entry>
+      <entry>::=</entry>
+      <entry>"GL" | "GR"</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+For detail definition of CHARSET_REGISTRY-CHARSET_ENCODING, refer
+to the <citetitle>X Logical Font Description Conventions</citetitle> document.
+</para>
+<literallayout>
+example:
+     ISO8859-1:GL
+</literallayout>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>font</term>
+    <listitem>
+      <para>
+Specifies a list of encoding information which is used for searching
+appropriate font for this fontset.  The left most entry has highest
+priority.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+</sect1>
+<sect1 id="XLC_XLOCALE_Category">
+<title>XLC_XLOCALE Category</title>
+<para>
+The XLC_XLOCALE category defines character classification, conversion
+and other character attributes.
+</para>
+
+<informaltable frame="topbot">
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth='3.0*'/>
+  <colspec colname='c2' colwidth='1.0*'/>
+  <colspec colname='c3' colwidth='3.0*'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>class</entry>
+      <entry>super class</entry>
+      <entry>description</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>encoding_name</entry>
+      <entry></entry>
+      <entry>codeset name</entry>
+    </row>
+    <row>
+      <entry>mb_cur_max</entry>
+      <entry></entry>
+      <entry>MB_CUR_MAX</entry>
+    </row>
+    <row>
+      <entry>state_depend_encoding</entry>
+      <entry></entry>
+      <entry>state dependent or not</entry>
+    </row>
+    <row>
+      <entry>wc_encoding_mask</entry>
+      <entry></entry>
+      <entry>for parsing wc string</entry>
+    </row>
+    <row>
+      <entry>wc_shift_bits</entry>
+      <entry></entry>
+      <entry>for conversion between wc and mb</entry>
+    </row>
+    <row>
+      <entry>csN</entry>
+      <entry></entry>
+      <entry>Nth charset (N=0,1,2,...)</entry>
+    </row>
+    <row>
+      <entry>side</entry>
+      <entry>csN</entry>
+      <entry>mapping side (GL, etc)</entry>
+    </row>
+    <row>
+      <entry>length</entry>
+      <entry>csN</entry>
+      <entry>length of a character</entry>
+    </row>
+    <row>
+      <entry>mb_encoding</entry>
+      <entry>csN</entry>
+      <entry>for parsing mb string</entry>
+    </row>
+    <row>
+      <entry>wc_encoding</entry>
+      <entry>csN</entry>
+      <entry>for parsing wc string</entry>
+    </row>
+    <row>
+      <entry>ct_encoding</entry>
+      <entry>csN</entry>
+      <entry>list of encoding name for ct</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<variablelist>
+  <varlistentry>
+    <term>encoding_name</term>
+    <listitem>
+      <para>
+Specifies a codeset name of current locale.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>mb_cur_max</term>
+    <listitem>
+      <para>
+Specifies a maximum allowable number of bytes in a multi-byte character.
+It is corresponding to MB_CUR_MAX of "ISO/IEC 9899:1990 C Language Standard".
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>state_depend_encoding</term>
+    <listitem>
+      <para>
+Indicates a current locale is state dependent. The value should be
+specified "True" or "False".
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>wc_encoding_mask</term>
+    <listitem>
+      <para>
+Specifies a bit-mask for parsing wide-char string.  Each wide character is
+applied bit-and operation with this bit-mask, then is classified into
+the unique charset, by using 'wc_encoding'.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>wc_shift_bits</term>
+    <listitem>
+      <para>
+Specifies a number of bit to be shifted for converting from a multi-byte
+character to a wide character, and vice-versa.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>csN</term>
+    <listitem>
+      <para>
+<!-- .br -->
+Includes a character set information for Nth charset, where N is the
+index number (0,1,2,...).  If there are 4 charsets available in current
+locale, cs0, cs1, cs2 and cs3 should be defined. This class has five
+subclasses, 'side', 'length', 'mb_encoding' 'wc_encoding' and 'ct_encoding'.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>side</term>
+    <listitem>
+      <para>
+Specifies a mapping side of this charset. The format of this value is;
+      </para>
+      <literallayout>
+   Side    ::=  EncodingSide[":Default"]
+      </literallayout>
+      <para>
+The suffix ":Default" can be specified.  It indicates that a character
+belongs to the specified side is mapped to this charset in initial state.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>length</term>
+    <listitem>
+      <para>
+<!-- .br -->
+Specifies a number of bytes of a multi-byte character of this charset.
+It should not contain the length of any single-shift sequence.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>mb_encoding</term>
+    <listitem>
+      <para>
+Specifies a list of shift sequence for parsing multi-byte string.
+The format of this value is;
+      </para>
+<informaltable frame="none">
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth='3.0*'/>
+  <colspec colname='c2' colwidth='1.0*'/>
+  <colspec colname='c3' colwidth='5.0*'/>
+  <tbody>
+    <row>
+      <entry>MBEncoding</entry>
+      <entry>::=</entry>
+      <entry>ShiftType ShiftSequence</entry>
+    </row>
+    <row>
+      <entry></entry>
+      <entry>|</entry>
+      <entry>ShiftType ShiftSequence ";" MBEncoding</entry>
+    </row>
+    <row>
+      <entry>ShiftType</entry>
+      <entry>::=</entry>
+      <entry>"&lt;SS&gt;"|"&lt;LSL&gt;"|"&lt;LSR&gt;"</entry>
+    </row>
+    <row>
+      <entry>ShiftSequence</entry>
+      <entry>::=</entry>
+      <entry>SequenceValue|SequenceValue ShiftSequence</entry>
+    </row>
+    <row>
+      <entry>SequenceValue</entry>
+      <entry>::=</entry>
+      <entry>NumericString</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+      <literallayout>
+example:
+     &lt;LSL&gt; \x1b \x28 \x4a; &lt;LSL&gt; \x1b \x28 \x42
+      </literallayout>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>wc_encoding</term>
+    <listitem>
+      <para>
+Specifies an integer value for parsing wide-char string.
+It is used to determine the charset for each wide character, after
+applying bit-and operation using 'wc_encoding_mask'.
+This value should be unique in all csN classes.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>ct_encoding</term>
+    <listitem>
+      <para>
+Specifies a list of encoding information that can be used for Compound
+Text.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+</sect1>
+
+<sect1 id="Sample_of_X_Locale_Database">
+<title>Sample of X Locale Database</title>
+<para>
+The following is sample X Locale Database file.
+</para>
+
+<literallayout class="monospaced">
+#  XLocale Database Sample for ja_JP.euc
+#
+
+#
+#      XLC_FONTSET category
+#
+XLC_FONTSET
+#      fs0 class (7 bit ASCII)
+fs0     {
+        charset              ISO8859-1:GL
+        font                 ISO8859-1:GL; JISX0201.1976-0:GL
+}
+#      fs1 class (Kanji)
+fs1     {
+        charset              JISX0208.1983-0:GL
+        font                 JISX0208.1983-0:GL
+}
+#      fs2 class (Half Kana)
+fs2     {
+        charset              JISX0201.1976-0:GR
+        font                 JISX0201.1976-0:GR
+}
+#      fs3 class (User Defined Character)
+# fs3     {
+#        charset             JISX0212.1990-0:GL
+#        font                JISX0212.1990-0:GL
+# }
+END XLC_FONTSET
+
+#
+#      XLC_XLOCALE category
+#
+XLC_XLOCALE
+
+encoding_name             ja.euc
+mb_cur_max                3
+state_depend_encoding     False
+
+wc_encoding_mask          \x00008080
+wc_shift_bits             8
+
+#      cs0 class
+cs0     {
+        side                 GL:Default
+        length               1
+        wc_encoding          \x00000000
+        ct_encoding          ISO8859-1:GL; JISX0201.1976-0:GL
+}
+#      cs1 class
+cs1     {
+        side                 GR:Default
+        length               2
+
+        wc_encoding          \x00008080
+
+        ct_encoding          JISX0208.1983-0:GL; JISX0208.1983-0:GR;\
+                             JISX0208.1983-1:GL; JISX0208.1983-1:GR
+}
+
+#      cs2 class
+cs2     {
+        side                 GR
+        length               1
+        mb_encoding          &lt;SS&gt; \x8e
+
+        wc_encoding          \x00000080
+
+        ct_encoding          JISX0201.1976-0:GR
+}
+
+#      cs3 class
+# cs3     {
+#         side               GL
+#         length             2
+#         mb_encoding        &lt;SS&gt; \x8f
+# #if HasWChar32
+#         wc_encoding        \x20000000
+# #else
+#         wc_encoding        \x00008000
+# #endif
+#         ct_encoding        JISX0212.1990-0:GL; JISX0212.1990-0:GR
+# }
+
+END XLC_XLOCALE
+</literallayout>
+</sect1>
+
+<sect1 id="Reference">
+<title>Reference</title>
+<para>
+[1] <emphasis remap='I'>ISO/IEC 9899:1990 C Language Standard</emphasis>
+</para>
+<para>
+[2] <citetitle>X Logical Font Description Conventions</citetitle>
+</para>
+
+</sect1>
+</chapter>
+</book>
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/i18n/localedb
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/i18n/localedb	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/i18n/localedb	(revision 5)

Property changes on: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/i18n/localedb
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/i18n/trans/trans.xml
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/i18n/trans/trans.xml	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/i18n/trans/trans.xml	(revision 5)
@@ -0,0 +1,2002 @@
+<?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"
+[
+<!ENTITY % defs SYSTEM "defs.ent"> %defs;
+]>
+
+<book id="trans">
+
+<bookinfo>
+   <title>The XIM Transport Specification</title>
+   <subtitle>Revision 0.1</subtitle>
+   <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
+   <authorgroup>
+      <author>
+         <firstname>Takashi</firstname><surname>Fujiwara</surname>
+         <affiliation><orgname>FUJITSU LIMITED</orgname></affiliation>
+      </author>
+   </authorgroup>
+   <copyright><year>1994</year><holder>FUJITSU LIMITED</holder></copyright>
+
+<abstract>
+<title>Abstract</title>
+<para>
+This specification describes the transport layer interfaces between Xlib and IM Server,
+which makes various channels usable such as X protocol or TCP/IP, DECnet and etc.
+</para>
+</abstract>
+
+<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.
+Fujitsu 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 role="multiLicensing">Copyright © 1994 X Consortium</para>
+<para>
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files
+(the &ldquo;Software&rdquo;), 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>
+
+<para>X Window System is a trademark of The Open Group.</para>
+
+</legalnotice>
+</bookinfo>
+
+<chapter id='X_Transport_Specification'>
+<title>X Transport Specification</title>
+
+<sect1 id="Introduction">
+<title>Introduction</title>
+<!-- .XS -->
+<!-- (SN Introduction -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The Xlib XIM implementation is layered into three functions, a protocol
+layer, an interface layer and a transport layer. The purpose of this
+layering is to make the protocol independent of transport implementation.
+Each function of these layers are:
+<!-- .RS 3 -->
+</para>
+<variablelist>
+  <varlistentry>
+    <term><emphasis>The protocol layer</emphasis></term>
+    <listitem>
+      <para>
+implements overall function of XIM and calls the interface layer
+functions when it needs to communicate to IM Server.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis>The interface layer</emphasis></term>
+    <listitem>
+      <para>
+separates the implementation of the transport layer from the protocol
+layer, in other words, it provides implementation independent hook for
+the transport layer functions.
+      </para>
+    </listitem>
+  </varlistentry>
+
+  <varlistentry>
+    <term><emphasis>The transport layer</emphasis></term>
+    <listitem>
+      <para>
+handles actual data communication with IM Server. It is done by a set
+of several functions named transporters.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+This specification describes the interface layer and the transport
+layer, which makes various communication channels usable such as
+X protocol or, TCP/IP, DECnet, STREAM, etc., and provides
+the information needed for adding another new transport layer.
+In addition, sample implementations for the transporter using the
+X connection is described in section 4. <!-- xref -->
+</para>
+</sect1>
+
+<sect1 id="Initialization">
+<title>Initialization</title>
+
+<sect2 id="Registering_structure_to_initialize">
+<title>Registering structure to initialize</title>
+
+<para>
+The structure typed as TransportSW contains the list of the transport
+layer the specific implementations supports.
+</para>
+
+<literallayout class="monospaced">
+typedef struct {
+      char *transport_name;
+      Bool (*config);
+} TransportSW;
+</literallayout>
+
+<informaltable frame="none">
+  <?dbfo keep-together="always" ?>
+  <tgroup cols="2" align='left' colsep='0' rowsep='0'>
+  <colspec colname="col1" colwidth='1.0*'/>
+  <colspec colname="col2" colwidth='1.0*'/>
+  <tbody>
+    <row>
+      <entry><emphasis>transport_name</emphasis></entry>
+      <entry>name of transport<footnote><para>Refer to "The Input Method Protocol: Appendix B</para></footnote></entry>
+    </row>
+    <row>
+      <entry><emphasis>config</emphasis></entry>
+      <entry>initial configuration function</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+A sample entry for the Xlib supporting transporters is shown below:
+</para>
+
+<literallayout class="monospaced">
+TransportSW _XimTransportRec[] = {
+/*     char <emphasis remap='I'>*</emphasis>:
+ *     transport_name,     Bool <emphasis remap='I'>(*config)()</emphasis>
+ */
+      "X",             _XimXConf,
+      "tcp",           _XimTransConf,
+      "local",         _XimTransConf,
+      "decnet",        _XimTransConf,
+      "streams",       _XimTransConf,
+      (char *)NULL,    (Bool (*)())NULL,
+};
+</literallayout>
+
+</sect2>
+<sect2 id="Initialization_function">
+<title>Initialization function</title>
+<!-- .XS -->
+<!-- (SN Initialization function -->
+<!-- .XE -->
+<para>
+The following function will be called once when Xlib configures the
+transporter functions.
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Bool <function>(*config)</function></funcdef>
+  <paramdef>XIM<parameter> im</parameter></paramdef>
+  <paramdef>char<parameter> *transport_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>im</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies XIM structure address.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>transport_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the data specific to the transporter, in IM Server address.<footnote><para>Refer to "The Input Method Protocol: Appendix B</para></footnote>
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+This function must setup the transporter function pointers.
+</para>
+
+<para>
+<!-- .LP -->
+The actual <emphasis remap='I'>config</emphasis> function will be chosen by IM Server at the
+pre-connection time, matching by the <emphasis remap='I'>transport_name</emphasis> specified
+in the <function>_XimTransportRec</function> array; The specific members of XimProto
+structure listed below must be initialized so that point they
+appropriate transporter functions.
+</para>
+
+<para>
+If the specified transporter has been configured successfully, this
+function returns True. There is no Alternative Entry for config
+function itself.
+</para>
+
+<para>
+The structure XimProto contains the following function pointers:
+</para>
+
+<literallayout class="monospaced">
+Bool (*connect)();               /* Open connection */
+Bool (*shutdown)();              /* Close connection */
+Bool (*write)();                 /* Write data */
+Bool (*read)();                  /* Read data */
+Bool (*flush)();                 /* Flush data buffer */
+Bool (*register_dispatcher)();   /* Register asynchronous data handler */
+Bool (*call_dispatcher)();       /* Call dispatcher */
+</literallayout>
+
+<para>
+These functions are called when Xlib needs to communicate the
+IM Server. These functions must process the appropriate procedure
+described below.
+</para>
+
+</sect2>
+</sect1>
+<sect1 id='The_interfacetransport_layer_functions'>
+<title>The interface/transport layer functions</title>
+<para>
+Following functions are used for the transport interface.
+</para>
+
+<table frame="all" id="transport_layer_functions_2">
+  <?dbfo keep-together="always" ?>
+  <title>The Transport Layer Functions</title>
+  <tgroup cols="3" align='left' colsep='1' rowsep='1'>
+  <colspec colname="col1" colwidth="3.0*"/>
+  <colspec colname="col2" colwidth="3.0*"/>
+  <colspec colname="col3" colwidth='1.0*'/>
+  <thead>
+    <row>
+      <entry align='center'>Alternate Entry (Interface Layer)</entry>
+      <entry align='center'>XimProto member (Transport Layer)</entry>
+      <entry align='center'>Section</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>_XimConnect</entry>
+      <entry>connect</entry>
+      <entry>3.1</entry>
+    </row>
+    <row>
+      <entry>_XimShutdown</entry>
+      <entry>shutdown</entry>
+      <entry>3.2</entry>
+    </row>
+    <row>
+      <entry>_XimWrite</entry>
+      <entry>write</entry>
+      <entry>3.3</entry>
+    </row>
+    <row>
+      <entry>_XimRead</entry>
+      <entry>read</entry>
+      <entry>3.4</entry>
+    </row>
+    <row>
+      <entry>_XimFlush</entry>
+      <entry>flush</entry>
+      <entry>3.5</entry>
+    </row>
+    <row>
+      <entry>_XimRegisterDispatcher</entry>
+      <entry>register_dispatcher</entry>
+      <entry>3.6</entry>
+    </row>
+    <row>
+      <entry>_XimCallDispatcher</entry>
+      <entry>call_dispatcher</entry>
+      <entry>3.7</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+
+<para>
+The Protocol layer calls the above functions using the Alternative
+Entry in the left column. The transport implementation defines
+XimProto member function in the right column. The Alternative Entry is
+provided so as to make easier to implement the Protocol Layer.
+</para>
+
+<sect2 id="Opening_connection">
+<title>Opening connection</title>
+<para>
+<!-- .LP -->
+When <function>XOpenIM</function> is called, the following function is called to connect
+with the IM Server.
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Bool <function>(*connect)</function></funcdef>
+  <paramdef>XIM<parameter> im</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>im</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies XIM structure address.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+This function must establishes the connection to the IM Server. If the
+connection is established successfully, this function returns True.
+The Alternative Entry for this function is:
+</para>
+
+<funcsynopsis id='_XimConnect'>
+<funcprototype>
+  <funcdef>Bool <function> _XimConnect</function></funcdef>
+  <paramdef>XIM<parameter> im</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>im</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies XIM structure address.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+</sect2>
+
+<sect2 id="Closing_connection">
+<title>Closing connection</title>
+<!-- .XS -->
+<!-- (SN Closing connection -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+When <function>XCloseIM</function> is called, the following function is called to
+disconnect the connection with the IM Server. The Alternative Entry
+for this function is:
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Bool <function> (*shutdown)</function></funcdef>
+  <paramdef>XIM<parameter> im</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>im</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies XIM structure address.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+This function must close connection with the IM Server. If the
+connection is closed successfully, this function returns True. The
+Alternative Entry for this function is:
+</para>
+
+<funcsynopsis id='_XimShutdown'>
+<funcprototype>
+  <funcdef>Bool <function>_XimShutdown</function></funcdef>
+  <paramdef>XIM<parameter> im</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>im</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies XIM structure address.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+</sect2>
+
+<sect2 id="Writing_data">
+<title>Writing data</title>
+<para>
+The following function is called, when Xlib needs to write data to the
+IM Server.
+</para>
+
+<funcsynopsis id='_XimWrite'>
+<funcprototype>
+  <funcdef>Bool <function> _XimWrite</function></funcdef>
+  <paramdef>XIM<parameter> im</parameter></paramdef>
+  <paramdef>INT16<parameter> len</parameter></paramdef>
+  <paramdef>XPointer<parameter> data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>im</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies XIM structure address.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>len</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the length of writing data.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the writing data.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+This function writes the <emphasis remap='I'>data</emphasis> to the IM Server, regardless
+of the contents.  The number of bytes is passed to <emphasis remap='I'>len</emphasis>. The
+writing data is passed to <emphasis remap='I'>data</emphasis>. If data is sent successfully,
+the function returns True. Refer to "The Input Method Protocol" for
+the contents of the writing data. The Alternative Entry for this
+function is:
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Bool <function>_XimWrite</function></funcdef>
+  <paramdef>XIM<parameter> im</parameter></paramdef>
+  <paramdef>INT16<parameter> len</parameter></paramdef>
+  <paramdef>XPointer<parameter> data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>im</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies XIM structure address.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>len</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the length of writing data.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the writing data.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+</sect2>
+<sect2 id="Reading_data">
+<title>Reading data</title>
+<para>
+The following function is called when Xlib waits for response from IM
+server synchronously.
+</para>
+
+<funcsynopsis id='_XimRead'>
+<funcprototype>
+  <funcdef>Bool <function> _XimRead</function></funcdef>
+  <paramdef>XIM<parameter> im</parameter></paramdef>
+  <paramdef>XPointer<parameter> read_buf</parameter></paramdef>
+  <paramdef>int<parameter> buf_len</parameter></paramdef>
+  <paramdef>int<parameter> *ret_len</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>im</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies XIM structure address.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>read_buf</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the buffer to store data.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>buf_len</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the size of the <emphasis remap='I'>buffer</emphasis>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ret_len</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the length of stored data.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+This function stores the read data in <emphasis remap='I'>read_buf</emphasis>, which size is
+specified as <emphasis remap='I'>buf_len</emphasis>. The size of data is set to <emphasis remap='I'>ret_len</emphasis>.
+This function return True, if the data is read normally or reading
+data is completed.
+</para>
+<para>
+The Alternative Entry for this function is:
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Bool <function> _XimRead</function></funcdef>
+  <paramdef>XIM<parameter> im</parameter></paramdef>
+  <paramdef>INT16<parameter> *ret_len</parameter></paramdef>
+  <paramdef>XPointer<parameter> buf</parameter></paramdef>
+  <paramdef>int<parameter> buf_len</parameter></paramdef>
+  <paramdef>Bool<parameter> (*predicate)()</parameter></paramdef>
+  <paramdef>XPointer<parameter> predicate_arg</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>im</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies XIM structure address.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ret_len</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the size of the <emphasis remap='I'>data</emphasis> buffer.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>buf</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the buffer to store data.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>buf_len</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the length of <emphasis remap='I'>buffer</emphasis>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>predicate</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the predicate for the XIM data.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>predicate_arg</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the predicate specific data.
+<!-- .sp 6p -->
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The predicate procedure indicates whether the <emphasis remap='I'>data</emphasis> is for the
+XIM or not. <emphasis remap='I'>len</emphasis>
+This function stores the read data in <emphasis remap='I'>buf</emphasis>, which size
+is specified as <emphasis remap='I'>buf_len</emphasis>. The size of data is set to
+<emphasis remap='I'>ret_len</emphasis>.  If <emphasis remap='I'>preedicate()</emphasis>
+returns True, this function returns True.  If not, it calls the registered callback function.
+</para>
+
+<para>
+The procedure and its arguments are:
+</para>
+
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>void <function>(*predicate)</function></funcdef>
+  <paramdef>XIM<parameter> im</parameter></paramdef>
+  <paramdef>INT16<parameter> len</parameter></paramdef>
+  <paramdef>XPointer<parameter> data</parameter></paramdef>
+  <paramdef>XPointer<parameter> predicate_arg</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>im</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies XIM structure address.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>len</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the size of the <emphasis remap='I'>data</emphasis> buffer.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the buffer to store data.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>predicate_arg</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the predicate specific data.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+</sect2>
+<sect2 id="Flushing_buffer">
+<title>Flushing buffer</title>
+<para>
+The following function is called when Xlib needs to flush the data.
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>void <function>(*flush)</function></funcdef>
+  <paramdef>XIM<parameter> im</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>im</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies XIM structure address.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+This function must flush the data stored in internal buffer on the
+transport layer. If data transfer is completed, the function returns
+True.  The Alternative Entry for this function is:
+</para>
+
+<funcsynopsis id='_XimFlush'>
+<funcprototype>
+  <funcdef>void <function> _XimFlush</function></funcdef>
+  <paramdef>XIM<parameter> im</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>im</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies XIM structure address.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+</sect2>
+<sect2 id="Registering_asynchronous_data_handler">
+<title>Registering asynchronous data handler</title>
+<para>
+Xlib needs to handle asynchronous response from IM Server. This is
+because some of the XIM data occur asynchronously to X events.
+</para>
+
+<para>
+Those data will be handled in the <emphasis remap='I'>Filter</emphasis>,
+and the <emphasis remap='I'>Filter</emphasis>
+will call asynchronous data handler in the protocol layer. Then it
+calls dispatchers in the transport layer. The dispatchers are
+implemented by the protocol layer. This function must store the
+information and prepare for later call of the dispatchers using
+<xref linkend='_XimCallDispatcher' xrefstyle='select: title'/>.
+</para>
+
+<para>
+When multiple dispatchers are registered, they will be called
+sequentially in order of registration, on arrival of asynchronous
+data. The register_dispatcher is declared as following:
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Bool <function>(*register_dispatcher)</function></funcdef>
+  <paramdef>XIM<parameter> im</parameter></paramdef>
+  <paramdef>Bool<parameter> (*dispatcher)()</parameter></paramdef>
+  <paramdef>XPointer<parameter> call_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>im</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies XIM structure address.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>dispatcher</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the dispatcher function to register.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>call_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a parameter for the <emphasis remap='I'>dispatcher</emphasis>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The dispatcher is a function of the following type:
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Bool <function>(*dispatcher)</function></funcdef>
+  <paramdef>XIM<parameter> im</parameter></paramdef>
+  <paramdef>INT16<parameter> len</parameter></paramdef>
+  <paramdef>XPointer<parameter> data</parameter></paramdef>
+  <paramdef>XPointer<parameter> call_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>im</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies XIM structure address.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>len</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the size of the <emphasis remap='I'>data</emphasis> buffer.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the buffer to store data.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>call_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a parameter passed to the register_dispatcher.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The dispatcher is provided by the protocol layer. They are called once
+for every asynchronous data, in order of registration. If the data is
+used, it must return True. otherwise, it must return False.
+</para>
+
+<para>
+If the dispatcher function returns True, the Transport Layer assume
+that the data has been processed by the upper layer.  The Alternative
+Entry for this function is:
+</para>
+
+<funcsynopsis id='_XimRegisterDispatcher'>
+<funcprototype>
+  <funcdef>Bool <function> _XimRegisterDispatcher</function></funcdef>
+  <paramdef>XIM<parameter> im</parameter></paramdef>
+  <paramdef>Bool<parameter> (*dispatcher)()</parameter></paramdef>
+  <paramdef>XPointer<parameter> call_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>im</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies XIM structure address.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>dispatcher</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the dispatcher function to register.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>call_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a parameter for the <emphasis remap='I'>dispatcher</emphasis>.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+</sect2>
+<sect2 id="Calling_dispatcher">
+<title>Calling dispatcher</title>
+<para>
+The following function is used to call the registered dispatcher
+function, when the asynchronous response from IM Server has arrived.
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Bool <function>(*call_dispatcher)</function></funcdef>
+  <paramdef>XIM<parameter> im</parameter></paramdef>
+  <paramdef>INT16<parameter> len</parameter></paramdef>
+  <paramdef>XPointer<parameter> data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>im</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies XIM structure address.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>len</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the size of <emphasis remap='I'>data</emphasis> buffer.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the buffer to store data.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The call_dispatcher must call the dispatcher function, in order of
+their registration. <emphasis remap='I'>len</emphasis> and <emphasis remap='I'>data</emphasis> are the data passed to
+register_dispatcher.
+</para>
+
+<para>
+The return values are checked at each invocation, and if it finds
+True, it immediately return with true for its return value.
+</para>
+
+<para>
+It is depend on the upper layer whether the read data is XIM
+Protocol packet unit or not.
+The Alternative Entry for this function is:
+</para>
+
+<funcsynopsis id='_XimCallDispatcher'>
+<funcprototype>
+  <funcdef>Bool <function> _XimCallDispatcher</function></funcdef>
+  <paramdef>XIM<parameter> im</parameter></paramdef>
+  <paramdef>INT16<parameter> len</parameter></paramdef>
+  <paramdef>XPointer<parameter> call_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+</sect2>
+</sect1>
+<sect1 id="Sample_implementations_for_the_Transport_Layer">
+<title>Sample implementations for the Transport Layer</title>
+<para>
+Sample implementations for the transporter using the X connection is
+described here.
+</para>
+
+<sect2 id="X_Transport">
+<title>X Transport</title>
+<para>
+At the beginning of the X Transport connection for the XIM transport
+mechanism, two different windows must be created either in an Xlib XIM
+or in an IM Server, with which the Xlib and the IM Server exchange the
+XIM transports by using the ClientMessage events and Window Properties.
+In the following, the window created by the Xlib is referred as the
+"client communication window", and on the other hand, the window created
+by the IM Server is referred as the "IMS communication window".
+</para>
+
+<sect3 id="Connection">
+<title>Connection</title>
+<para>
+In order to establish a connection, a communication window is created.
+A ClientMessage in the following event's format is sent to the owner
+window of XIM_SERVER selection, which the IM Server has created.
+</para>
+
+<para>
+<!-- .LP -->
+Refer to "The Input Method Protocol" for the XIM_SERVER atom.
+</para>
+
+<table frame="topbot" id="transport_layer_functions">
+  <?dbfo keep-together="always" ?>
+  <title>The ClientMessage sent to the IMS window.</title>
+  <tgroup cols="3" align='left' colsep='0' rowsep='0'>
+  <colspec colname="col1" colwidth='1.0*'/>
+  <colspec colname="col2" colwidth='1.0*' colsep='1'/>
+  <colspec colname="col3" colwidth="3.5*"/>
+  <spanspec namest="col1" nameend="col2" spanname="span-horiz"/>
+  <thead>
+    <row rowsep='1'>
+      <entry spanname="span-horiz" colsep='1'>Structure Member</entry>
+      <entry>Contents</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>int</entry>
+      <entry>type</entry>
+      <entry>ClientMessage</entry>
+    </row>
+    <row>
+      <entry>u_long</entry>
+      <entry>serial</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Bool</entry>
+      <entry>send_event</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Display</entry>
+      <entry>*display</entry>
+      <entry>The display to which connects</entry>
+    </row>
+    <row>
+      <entry>Window</entry>
+      <entry>window</entry>
+      <entry>IMS Window ID</entry>
+    </row>
+    <row>
+      <entry>Atom</entry>
+      <entry>message_type</entry>
+      <entry>XInternAtom(display, "_XIM_CONNECT", false)</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>format</entry>
+      <entry>32</entry>
+    </row>
+    <row>
+      <entry>long</entry>
+      <entry>data.1[0]</entry>
+      <entry>client communication window ID</entry>
+    </row>
+    <row>
+      <entry>long</entry>
+      <entry>data.1[1]</entry>
+      <entry>client-major-transport-version(*1)</entry>
+    </row>
+    <row>
+      <entry>long</entry>
+      <entry>data.1[2]</entry>
+      <entry>client-major-transport-version(*1)</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+
+<para>
+In order to establish the connection (to notify the IM Server communication
+window), the IM Server sends a ClientMessage in the following event's
+format to the client communication window.
+</para>
+
+<table frame="topbot" id="clientmessage_sent_by_im_server">
+  <?dbfo keep-together="always" ?>
+  <title>The ClientMessage sent by IM Server.</title>
+  <tgroup cols="3" colsep='0' rowsep='0'>
+  <colspec colname="col1" colwidth='1.0*'/>
+  <colspec colname="col2" colwidth='1.0*' colsep="1"/>
+  <colspec colname="col3" colwidth="3.5*"/>
+  <spanspec namest="col1" nameend="col2" spanname="span-horiz"/>
+  <thead>
+    <row rowsep='1'>
+      <entry spanname="span-horiz" colsep='1'>Structure Member</entry>
+      <entry>Contents</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>int</entry>
+      <entry>type</entry>
+      <entry>ClientMessage</entry>
+    </row>
+    <row>
+      <entry>u_long</entry>
+      <entry>serial</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Bool</entry>
+      <entry>send_event</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Display</entry>
+      <entry>*display</entry>
+      <entry>The display to which connects</entry>
+    </row>
+    <row>
+      <entry>Window</entry>
+      <entry>window</entry>
+      <entry>IMS Window ID</entry>
+    </row>
+    <row>
+      <entry>Atom</entry>
+      <entry>message_type</entry>
+      <entry>XInternAtom(display, "_XIM_CONNECT", false)</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>format</entry>
+      <entry>32</entry>
+    </row>
+    <row>
+      <entry>long</entry>
+      <entry>data.1[0]</entry>
+      <entry>client communication window ID</entry>
+    </row>
+    <row>
+      <entry>long</entry>
+      <entry>data.1[1]</entry>
+      <entry>client-major-transport-version(*1)</entry>
+    </row>
+    <row>
+      <entry>long</entry>
+      <entry>data.1[2]</entry>
+      <entry>client-major-transport-version(*1)</entry>
+    </row>
+    <row>
+      <entry>long</entry>
+      <entry>data.1[3]</entry>
+      <entry>dividing size between ClientMessage and Property(*2)</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+
+<para>
+(*1) major/minor-transport-version
+</para>
+
+<para>
+The read/write method is decided by the combination of
+major/minor-transport-version, as follows:
+</para>
+
+<table frame="all" id="readwrite_method_and_the_majorminor_transport_version">
+  <?dbfo keep-together="always" ?>
+  <title>The read/write method and the major/minor-transport-version</title>
+  <tgroup cols="3" colsep='1' rowsep='1'>
+  <colspec colname="col1" colwidth='1.0*'/>
+  <colspec colname="col2" colwidth='1.0*'/>
+  <colspec colname="col3" colwidth="3.0*"/>
+  <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="center"/>
+  <thead>
+    <row>
+      <entry spanname="span-horiz">Transport-version</entry>
+      <entry>read/write</entry>
+    </row>
+    <row>
+      <entry>major</entry>
+      <entry>minor</entry>
+      <entry></entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry morerows="2">0</entry>
+      <entry>0</entry>
+      <entry>only-CM &amp; Property-with-CM</entry>
+    </row>
+    <row>
+      <entry>1</entry>
+      <entry>only-CM &amp; multi-CM</entry>
+    </row>
+    <row>
+      <entry>2</entry>
+      <entry>only-CM &amp; multi-CM &amp; Property-with-CM</entry>
+    </row>
+    <row>
+      <entry>1</entry>
+      <entry>0</entry>
+      <entry>PropertyNotify</entry>
+    </row>
+    <row>
+      <entry morerows="1">2</entry>
+      <entry>0</entry>
+      <entry>only-CM &amp; PropertyNotify</entry>
+    </row>
+    <row>
+      <entry>1</entry>
+      <entry>only-CM &amp; multi-CM &amp; PropertyNotify</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+
+<literallayout class="monospaced">
+only-CM            :    data is sent via a ClientMessage
+multi-CM           :    data is sent via multiple ClientMessages
+Property-with-CM   :    data is written in Property, and its Atom
+                        is send via ClientMessage
+PropertyNotify     :    data is written in Property, and its Atom
+                        is send via PropertyNotify
+
+</literallayout>
+
+
+<para>
+The method to decide major/minor-transport-version is as follows:
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+The client sends 0 as major/minor-transport-version to the IM Server.
+The client must support all methods in Table 4-3. <!-- xref -->
+The client may send another number as major/minor-transport-version to
+use other method than the above in the future.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The IM Server sends its major/minor-transport-version number to
+the client. The client sends data using the method specified by the
+IM Server.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If major/minor-transport-version number is not available, it is regarded
+as 0.
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+(*2) dividing size between ClientMessage and Property
+</para>
+
+<para>
+If data is sent via both of multi-CM and Property, specify the dividing
+size between ClientMessage and Property. The data, which is smaller than
+this size, is sent via multi-CM (or only-CM), and the data, which is
+lager than this size, is sent via Property.
+</para>
+
+</sect3>
+
+<sect3 id='readwrite'>
+<title>read/write</title>
+<para>
+The data is transferred via either ClientMessage or Window Property in
+the X Window System.
+</para>
+
+<sect4 id="Format_for_the_data_from_the_Client_to_the_IM_Server">
+<title>Format for the data from the Client to the IM Server</title>
+<para>
+<emphasis role="bold">ClientMessage</emphasis>
+</para>
+
+<para>
+If data is sent via ClientMessage event, the format is as follows:
+</para>
+
+<table frame="topbot" id="clientmessage_events_format_first_or_middle">
+  <?dbfo keep-together="always" ?>
+  <title>The ClientMessage event's format (first or middle)</title>
+  <tgroup cols="3" align='left' colsep='0' rowsep='0'>
+  <colspec colname="col1" colwidth='1.0*'/>
+  <colspec colname="col2" colwidth='1.0*' colsep="1"/>
+  <colspec colname="col3" colwidth="3.5*"/>
+  <spanspec namest="col1" nameend="col2" spanname="span-horiz"/>
+  <thead>
+    <row rowsep='1'>
+      <entry spanname="span-horiz" colsep='1'>Structure Member</entry>
+      <entry>Contents</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>int</entry>
+      <entry>type</entry>
+      <entry>ClientMessage</entry>
+    </row>
+    <row>
+      <entry>u_long</entry>
+      <entry>serial</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Bool</entry>
+      <entry>send_event</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Display</entry>
+      <entry>*display</entry>
+      <entry>The display to which connects</entry>
+    </row>
+    <row>
+      <entry>Window</entry>
+      <entry>window</entry>
+      <entry>IMS Window ID</entry>
+    </row>
+    <row>
+      <entry>Atom</entry>
+      <entry>message_type</entry>
+      <entry>XInternAtom(display, "_XIM_MOREDATA", False)</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>format</entry>
+      <entry>8</entry>
+    </row>
+    <row>
+      <entry>char</entry>
+      <entry>data.b[20]</entry>
+      <entry>(read/write DATA : 20 byte)</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+
+
+
+<table frame="topbot" id="clientmessage_events_format_only_or_last">
+  <?dbfo keep-together="always" ?>
+  <title>The ClientMessage event's format (only or last)</title>
+  <tgroup cols="3" align='left' colsep='0' rowsep='0'>
+  <colspec colname="col1" colwidth='1.0*'/>
+  <colspec colname="col2" colwidth='1.0*' colsep="1"/>
+  <colspec colname="col3" colwidth="3.5*"/>
+  <spanspec namest="col1" nameend="col2" spanname="span-horiz"/>
+  <thead>
+    <row rowsep='1'>
+      <entry spanname="span-horiz" colsep='1'>Structure Member</entry>
+      <entry>Contents</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>int</entry>
+      <entry>type</entry>
+      <entry>ClientMessage</entry>
+    </row>
+    <row>
+      <entry>u_long</entry>
+      <entry>serial</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Bool</entry>
+      <entry>send_event</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Display</entry>
+      <entry>*display</entry>
+      <entry>The display to which connects</entry>
+    </row>
+    <row>
+      <entry>Window</entry>
+      <entry>window</entry>
+      <entry>IMS Window ID</entry>
+    </row>
+    <row>
+      <entry>Atom</entry>
+      <entry>message_type</entry>
+      <entry>XInternAtom(display, "_XIM_PROTOCOL", False)</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>format</entry>
+      <entry>8</entry>
+    </row>
+    <row>
+      <entry>char</entry>
+      <entry>data.b[20]</entry>
+      <entry>(read/write DATA : MAX 20 byte)
+<footnote><para>If the data is smaller
+than 20 bytes, all data other than available data must be 0.
+</para></footnote>
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+
+<para>
+<emphasis role="bold">Property</emphasis>
+</para>
+
+<para>
+In the case of large data, data will be sent via the Window Property
+for the efficiency.  There are the following two methods to notify
+Property, and transport-version is decided which method is used.
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+The XChangeProperty function is used to store data in the client
+communication window, and Atom of the stored data is notified to the
+IM Server via ClientMessage event.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The XChangeProperty function is used to store data in the client
+communication window, and Atom of the stored data is notified to the
+IM Server via PropertyNotify event.
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+The arguments of the XChangeProperty are as follows:
+</para>
+
+
+<table frame="topbot" id="xchangeproperty_events_format">
+  <?dbfo keep-together="always" ?>
+  <title>The XChangeProperty event's format</title>
+  <tgroup cols="3" align='left' colsep='0' rowsep='0'>
+  <colspec colname="col1" colwidth='1.0*'/>
+  <colspec colname="col2" colwidth='1.0*' colsep="1"/>
+  <colspec colname="col3" colwidth="3.5*"/>
+  <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="left"/>
+  <thead>
+    <row rowsep='1'>
+      <entry spanname="span-horiz" colsep='1'>Argument</entry>
+      <entry>Contents</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>Display</entry>
+      <entry>*display</entry>
+      <entry>The display to which connects</entry>
+    </row>
+    <row>
+      <entry>Window</entry>
+      <entry>window</entry>
+      <entry>IMS communication window ID</entry>
+    </row>
+    <row>
+      <entry>Atom</entry>
+      <entry>property</entry>
+      <entry>read/write property Atom (*1)</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>format</entry>
+      <entry>8</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>mode</entry>
+      <entry>PropModeAppend</entry>
+    </row>
+    <row>
+      <entry>u_char</entry>
+      <entry>*data</entry>
+      <entry>read/write DATA</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>nelements</entry>
+      <entry>length of DATA</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+
+<para>
+(*1) The read/write property ATOM allocates the following strings by
+<function>XInternAtom</function>.
+"_clientXXX"
+</para>
+
+<para>
+The client changes the property with the mode of PropModeAppend and
+the IM Server will read it with the delete mode i.e. (delete = True).
+</para>
+
+<para>
+If Atom is notified via ClientMessage event, the format of the ClientMessage
+is as follows:
+</para>
+
+<table frame="topbot" id="clientmessage_events_format_to_send_atom_of_property">
+  <?dbfo keep-together="always" ?>
+  <title>The ClientMessage event's format to send Atom of property</title>
+  <tgroup cols="3" align='left' colsep='0' rowsep='0'>
+  <colspec colname="col1" colwidth='1.0*'/>
+  <colspec colname="col2" colwidth='1.0*' colsep="1"/>
+  <colspec colname="col3" colwidth="3.5*"/>
+  <spanspec namest="col1" nameend="col2" spanname="span-horiz"/>
+  <thead>
+    <row rowsep='1'>
+      <entry spanname="span-horiz" colsep='1'>Structure Member</entry>
+      <entry>Contents</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>int</entry>
+      <entry>type</entry>
+      <entry>ClientMessage</entry>
+    </row>
+    <row>
+      <entry>u_long</entry>
+      <entry>serial</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Bool</entry>
+      <entry>send_event</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Display</entry>
+      <entry>*display</entry>
+      <entry>The display to which connects</entry>
+    </row>
+    <row>
+      <entry>Window</entry>
+      <entry>window</entry>
+      <entry>IMS Window ID</entry>
+    </row>
+    <row>
+      <entry>Atom</entry>
+      <entry>message_type</entry>
+      <entry>XInternAtom(display, "_XIM_PROTOCOL", False)</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>format</entry>
+      <entry>8</entry>
+    </row>
+    <row>
+      <entry>long</entry>
+      <entry>data.1[0]</entry>
+      <entry>length of read/write property Atom</entry>
+    </row>
+    <row>
+      <entry>long</entry>
+      <entry>data.1[1]</entry>
+      <entry>read/write property Atom</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+</sect4>
+
+<sect4 id="Format_for_the_data_from_the_IM_Server_to_the_Client">
+<title>Format for the data from the IM Server to the Client</title>
+<para>
+<emphasis role="bold">ClientMessage</emphasis>
+</para>
+
+<para>
+The format of the ClientMessage is as follows:
+</para>
+
+<table frame="topbot" id="clientmessage_events_format_first_or_middle_2">
+  <?dbfo keep-together="always" ?>
+  <title>The ClientMessage event's format (first or middle)</title>
+  <tgroup cols="3" align='left' colsep='0' rowsep='0'>
+  <colspec colname="col1" colwidth='1.0*'/>
+  <colspec colname="col2" colwidth='1.0*' colsep="1"/>
+  <colspec colname="col3" colwidth="3.5*"/>
+  <spanspec namest="col1" nameend="col2" spanname="span-horiz"/>
+  <thead>
+    <row rowsep='1'>
+      <entry spanname="span-horiz" colsep='1'>Structure Member</entry>
+      <entry>Contents</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>int</entry>
+      <entry>type</entry>
+      <entry>ClientMessage</entry>
+    </row>
+    <row>
+      <entry>u_long</entry>
+      <entry>serial</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Bool</entry>
+      <entry>send_event</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Display</entry>
+      <entry>*display</entry>
+      <entry>The display to which connects</entry>
+    </row>
+    <row>
+      <entry>Window</entry>
+      <entry>window</entry>
+      <entry>IMS Window ID</entry>
+    </row>
+    <row>
+      <entry>Atom</entry>
+      <entry>message_type</entry>
+      <entry>XInternAtom(display, "_XIM_MOREDATA", False)</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>format</entry>
+      <entry>8</entry>
+    </row>
+    <row>
+      <entry>char</entry>
+      <entry>data.b[20]</entry>
+      <entry>(read/write DATA : 20 byte)</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+
+
+
+
+
+<table frame="topbot" id="clientmessage_events_format_only_or_last_2">
+  <?dbfo keep-together="always" ?>
+  <title>The ClientMessage event's format (only or last)</title>
+  <tgroup cols="3" align='left' colsep='0' rowsep='0'>
+  <colspec colname="col1" colwidth='1.0*'/>
+  <colspec colname="col2" colwidth='1.0*' colsep="1"/>
+  <colspec colname="col3" colwidth="3.5*"/>
+  <spanspec namest="col1" nameend="col2" spanname="span-horiz"/>
+  <thead>
+    <row rowsep='1'>
+      <entry spanname="span-horiz" colsep='1'>Structure Member</entry>
+      <entry>Contents</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>int</entry>
+      <entry>type</entry>
+      <entry>ClientMessage</entry>
+    </row>
+    <row>
+      <entry>u_long</entry>
+      <entry>serial</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Bool</entry>
+      <entry>send_event</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Display</entry>
+      <entry>*display</entry>
+      <entry>The display to which connects</entry>
+    </row>
+    <row>
+      <entry>Window</entry>
+      <entry>window</entry>
+      <entry>IMS Window ID</entry>
+    </row>
+    <row>
+      <entry>Atom</entry>
+      <entry>message_type</entry>
+      <entry>XInternAtom(display, "_XIM_PROTOCOL", False)</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>format</entry>
+      <entry>8</entry>
+    </row>
+    <row>
+      <entry>char</entry>
+      <entry>data.b[20]</entry>
+      <entry>(read/write DATA : MAX 20 byte) (*1)</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+
+<para>
+(*1) If the data size is smaller than 20 bytes, all data other than available
+data must be 0.
+</para>
+
+<para>
+<emphasis role="bold">Property</emphasis>
+</para>
+
+<para>
+In the case of large data, data will be sent via the Window Property
+for the efficiency. There are the following two methods to notify
+Property, and transport-version is decided which method is used.
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+The XChangeProperty function is used to store data in the IMS
+communication window, and Atom of the property is sent via the
+ClientMessage event.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The XChangeProperty function is used to store data in the IMS
+communication window, and Atom of the property is sent via
+PropertyNotify event.
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+The arguments of the XChangeProperty are as follows:
+</para>
+
+<table frame="topbot" id="xchangeproperty_events_format_b">
+  <?dbfo keep-together="always" ?>
+  <title>The XChangeProperty event's format</title>
+  <tgroup cols="3" align='left' colsep='0' rowsep='0'>
+  <colspec colname="col1" colwidth='1.0*'/>
+  <colspec colname="col2" colwidth='1.0*' colsep="1"/>
+  <colspec colname="col3" colwidth="3.5*"/>
+  <spanspec namest="col1" nameend="col2" spanname="span-horiz" align="left"/>
+  <thead>
+    <row rowsep='1'>
+      <entry spanname="span-horiz" colsep='1'>Argument</entry>
+      <entry>Contents</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>Display</entry>
+      <entry>*display</entry>
+      <entry>The display to which connects</entry>
+    </row>
+    <row>
+      <entry>Window</entry>
+      <entry>window</entry>
+      <entry>IMS communication window ID</entry>
+    </row>
+    <row>
+      <entry>Atom</entry>
+      <entry>property</entry>
+      <entry>read/write property Atom (*1)</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>format</entry>
+      <entry>8</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>mode</entry>
+      <entry>PropModeAppend</entry>
+    </row>
+    <row>
+      <entry>u_char</entry>
+      <entry>*data</entry>
+      <entry>read/write DATA</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>nelements</entry>
+      <entry>length of DATA</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+
+<para>
+(*1) The read/write property ATOM allocates some strings, which are not
+allocated by the client, by <function>XInternAtom</function>.
+</para>
+
+<para>
+The IM Server changes the property with the mode of PropModeAppend and
+the client reads it with the delete mode, i.e. (delete = True).
+</para>
+
+<para>
+If Atom is notified via ClientMessage event, the format of the ClientMessage
+is as follows:
+</para>
+
+<table frame="topbot" id="clientmessage_events_format_to_send_atom_of_property_2">
+  <?dbfo keep-together="always" ?>
+  <title>The ClientMessage event's format to send Atom of property</title>
+  <tgroup cols="3" align='left' colsep='0' rowsep='0'>
+  <colspec colname="col1" colwidth='1.0*'/>
+  <colspec colname="col2" colwidth='1.0*' colsep="1"/>
+  <colspec colname="col3" colwidth="3.5*"/>
+  <spanspec namest="col1" nameend="col2" spanname="span-horiz"/>
+  <thead>
+    <row rowsep='1'>
+      <entry spanname="span-horiz" colsep='1'>Structure Member</entry>
+      <entry>Contents</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>int</entry>
+      <entry>type</entry>
+      <entry>ClientMessage</entry>
+    </row>
+    <row>
+      <entry>u_long</entry>
+      <entry>serial</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Bool</entry>
+      <entry>send_event</entry>
+      <entry>Set by the X Window System</entry>
+    </row>
+    <row>
+      <entry>Display</entry>
+      <entry>*display</entry>
+      <entry>The display to which connects</entry>
+    </row>
+    <row>
+      <entry>Window</entry>
+      <entry>window</entry>
+      <entry>IMS Window ID</entry>
+    </row>
+    <row>
+      <entry>Atom</entry>
+      <entry>message_type</entry>
+      <entry>XInternAtom(display, "_XIM_PROTOCOL", False)</entry>
+    </row>
+    <row>
+      <entry>int</entry>
+      <entry>format</entry>
+      <entry>8</entry>
+    </row>
+    <row>
+      <entry>long</entry>
+      <entry>data.1[0]</entry>
+      <entry>length of read/write property Atom</entry>
+    </row>
+    <row>
+      <entry>long</entry>
+      <entry>data.1[1]</entry>
+      <entry>read/write property Atom</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</table>
+
+</sect4>
+</sect3>
+<sect3 id="Closing_Connection">
+<title>Closing Connection</title>
+
+<para>
+If the client disconnect with the IM Server, shutdown function should
+free the communication window properties and etc..
+</para>
+
+</sect3>
+</sect2>
+</sect1>
+
+<sect1 id="References">
+<title>References</title>
+<para>
+[1] Masahiko Narita and Hideki Hiura, <emphasis remap='I'>"The Input Method Protocol"</emphasis>
+</para>
+</sect1>
+
+</chapter>
+</book>
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/i18n/trans
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/i18n/trans	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/i18n/trans	(revision 5)

Property changes on: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/i18n/trans
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/i18n
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/i18n	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/i18n	(revision 5)

Property changes on: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/i18n
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/AppC.xml
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/AppC.xml	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/AppC.xml	(revision 5)
@@ -0,0 +1,3340 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+	  "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+<appendix id="extensions">
+<title>Extensions</title>
+<para>
+<!-- .XE -->
+Because X can evolve by extensions to the core protocol, 
+it is important that extensions not be perceived as second-class citizens.
+At some point, 
+your favorite extensions may be adopted as additional parts of the 
+X Standard.
+</para>
+<para>
+<!-- .LP -->
+Therefore, there should be little to distinguish the use of an extension from 
+that of the core protocol.
+To avoid having to initialize extensions explicitly in application programs, 
+it is also important that extensions perform lazy evaluations,
+automatically initializing themselves when called for the first time.  
+</para>
+<para>
+<!-- .LP -->
+This appendix describes techniques for writing extensions to Xlib that will
+run at essentially the same performance as the core protocol requests.
+</para>
+<!-- .NT -->
+<note><para>
+It is expected that a given extension to X consists of multiple
+requests.
+Defining 10 new features as 10 separate extensions is a bad practice.
+Rather, they should be packaged into a single extension
+and should use minor opcodes to distinguish the requests.
+</para></note>
+<!-- .NE -->
+<para>
+<!-- .LP -->
+The symbols and macros used for writing stubs to Xlib are listed in
+<filename class="headerfile">&lt;X11/Xlibint.h&gt;</filename>.
+</para>
+<sect1 id="Basic_Protocol_Support_Routines">
+<title>Basic Protocol Support Routines</title>
+<para>
+The basic protocol requests for extensions are 
+<xref linkend='XQueryExtension' xrefstyle='select: title'/>
+and
+<xref linkend='XListExtensions' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XQueryExtension</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XQueryExtension'>
+<funcprototype>
+  <funcdef>Bool <function>XQueryExtension</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>char *<parameter>name</parameter></paramdef>
+  <paramdef>int *<parameter>major_opcode_return</parameter></paramdef>
+  <paramdef>int *<parameter>first_event_return</parameter></paramdef>
+  <paramdef>int *<parameter>first_error_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>display</term>
+    <listitem>
+      <para>Specifies the connection to the X server.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>name</term>
+    <listitem>
+      <para>Specifies the extension name.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>major_opcode_return</term>
+    <listitem>
+      <para>Returns the major opcode.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>first_event_return</term>
+    <listitem>
+      <para>Returns the first event code, if any.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>first_error_return</term>
+    <listitem>
+      <para>Returns the first error code, if any.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XQueryExtension' xrefstyle='select: title'/>
+function determines if the named extension is present.  
+If the extension is not present,
+<xref linkend='XQueryExtension' xrefstyle='select: title'/>
+returns
+<symbol>False</symbol>;
+otherwise, it returns
+<symbol>True</symbol>.
+If the extension is present,
+<xref linkend='XQueryExtension' xrefstyle='select: title'/>
+returns the major opcode for the extension to major_opcode_return;
+otherwise,
+it returns zero.
+Any minor opcode and the request formats are specific to the
+extension.  
+If the extension involves additional event types, 
+<xref linkend='XQueryExtension' xrefstyle='select: title'/>
+returns the base event type code to first_event_return;
+otherwise, 
+it returns zero.  
+The format of the events is specific to the extension.  
+If the extension involves additional error codes, 
+<xref linkend='XQueryExtension' xrefstyle='select: title'/>
+returns the base error code to first_error_return;
+otherwise, 
+it returns zero.  
+The format of additional data in the errors is specific to the extension.
+</para>
+<para>
+<!-- .LP -->
+If the extension name is not in the Host Portable Character Encoding
+the result is implementation-dependent.
+Uppercase and lowercase matter;
+the strings ``thing'', ``Thing'', and ``thinG'' 
+are all considered different names.
+</para>
+<indexterm significance="preferred"><primary>XListExtensions</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XListExtensions'>
+<funcprototype>
+  <funcdef>char **<function>XListExtensions</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int *<parameter>nextensions_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>nextensions_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of extensions listed.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XListExtensions' xrefstyle='select: title'/>
+function returns a list of all extensions supported by the server.
+If the data returned by the server is in the Latin Portable Character Encoding,
+then the returned strings are in the Host Portable Character Encoding.
+Otherwise, the result is implementation-dependent.
+</para>
+<indexterm significance="preferred"><primary>XFreeExtensionList</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XFreeExtensionList'>
+<funcprototype>
+  <funcdef><function>XFreeExtensionList</function></funcdef>
+  <paramdef>char **<parameter>list</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>list</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the list of extension names.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XFreeExtensionList' xrefstyle='select: title'/>
+function frees the memory allocated by 
+<xref linkend='XListExtensions' xrefstyle='select: title'/>.
+</para>
+</sect1>
+<sect1 id="Hooking_into_Xlib">
+<title>Hooking into Xlib</title>
+<para>
+<!-- .LP -->
+These functions allow you to hook into the library.  
+They are not normally used by application programmers but are used 
+by people who need to extend the core X protocol and
+the X library interface.
+The functions, which generate protocol requests for X, are typically
+called stubs.
+</para>
+<para>
+<!-- .LP -->
+In extensions, stubs first should check to see if they have initialized 
+themselves on a connection.
+If they have not, they then should call 
+<xref linkend='XInitExtension' xrefstyle='select: title'/>
+to attempt to initialize themselves on the connection.
+</para>
+<para>
+<!-- .LP -->
+If the extension needs to be informed of GC/font allocation or
+deallocation or if the extension defines new event types, 
+the functions described here allow the extension to be 
+called when these events occur.
+</para>
+<para>
+<!-- .LP -->
+The
+<structname>XExtCodes</structname>
+structure returns the information from 
+<xref linkend='XInitExtension' xrefstyle='select: title'/>
+and is defined in
+<filename class="headerfile">&lt;X11/Xlib.h&gt;</filename>:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XExtCodes</primary></indexterm>
+<!-- .sM -->
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+<synopsis>
+typedef struct _XExtCodes {	/* public to extension, cannot be changed */
+	int extension;		/* extension number */
+	int major_opcode;	/* major op-code assigned by server */
+	int first_event;	/* first event number for the extension */
+	int first_error;	/* first error number for the extension */
+} XExtCodes;
+</synopsis>
+</para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>XInitExtension</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XInitExtension'>
+<funcprototype>
+  <funcdef>XExtCodes *<function>XInitExtension</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>char *<parameter>name</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the extension name.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XInitExtension' xrefstyle='select: title'/>
+function determines if the named extension exists. 
+Then, it allocates storage for maintaining the 
+information about the extension on the connection, 
+chains this onto the extension list for the connection,
+and returns the information the stub implementor will need to access
+the extension.
+If the extension does not exist,
+<xref linkend='XInitExtension' xrefstyle='select: title'/>
+returns NULL.
+</para>
+<para>
+<!-- .LP -->
+If the extension name is not in the Host Portable Character Encoding,
+the result is implementation-dependent.
+Uppercase and lowercase matter;
+the strings ``thing'', ``Thing'', and ``thinG'' 
+are all considered different names.
+</para>
+<para>
+<!-- .LP -->
+The extension number in the 
+<structname>XExtCodes</structname>
+structure is
+needed in the other calls that follow.  
+This extension number is unique only to a single connection.
+</para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XAddExtension</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XAddExtension'>
+<funcprototype>
+  <funcdef>XExtCodes *<function>XAddExtension</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+For local Xlib extensions, the
+<xref linkend='XAddExtension' xrefstyle='select: title'/>
+function allocates the
+<structname>XExtCodes</structname>
+structure, bumps the extension number count,
+and chains the extension onto the extension list.
+(This permits extensions to Xlib without requiring server extensions.)
+</para>
+<sect2 id="Hooks_into_the_Library">
+<title>Hooks into the Library</title>
+<para>
+<!-- .LP -->
+These functions allow you to define procedures that are to be
+called when various circumstances occur.
+The procedures include the creation of a new GC for a connection,
+the copying of a GC, the freeing of a GC, the creating and freeing of fonts,
+the conversion of events defined by extensions to and from wire
+format, and the handling of errors.
+</para>
+<para>
+<!-- .LP -->
+All of these functions return the previous procedure defined for this
+extension.
+</para>
+<indexterm significance="preferred"><primary>XESetCloseDisplay</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XESetCloseDisplay'>
+<funcprototype>
+  <funcdef>int <function>XESetCloseDisplay</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>extension</parameter></paramdef>
+  <paramdef>int <parameter>(*proc)()</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>extension</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the extension number.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to call when the display is closed.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XESetCloseDisplay' xrefstyle='select: title'/>
+function defines a procedure to be called whenever
+<function>XCloseDisplay</function>
+is called.  
+It returns any previously defined procedure, usually NULL.
+</para>
+<para>
+<!-- .LP -->
+When 
+<function>XCloseDisplay</function>
+is called, 
+your procedure is called 
+with these arguments:
+<funcsynopsis>
+<funcprototype>
+  <funcdef>int <function>(*<replaceable>proc</replaceable>)</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XExtCodes *<parameter>codes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+</para>
+<indexterm significance="preferred"><primary>XESetCreateGC</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XESetCreateGC'>
+<funcprototype>
+  <funcdef>int *<function>XESetCreateGC</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>extension</parameter></paramdef>
+  <paramdef>int <parameter>(*proc)()</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>extension</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the extension number.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to call when a GC is closed.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XESetCreateGC' xrefstyle='select: title'/>
+function defines a procedure to be called whenever
+a new GC is created.  
+It returns any previously defined procedure, usually NULL.
+</para>
+<para>
+<!-- .LP -->
+When a GC is created, 
+your procedure is called with these arguments:
+<!-- .LP -->
+<!-- .sM -->
+<funcsynopsis>
+<funcprototype>
+  <funcdef>int <function>(*<replaceable>proc</replaceable>)</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>XExtCodes *<parameter>codes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+</para>
+<indexterm significance="preferred"><primary>XESetCopyGC</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XESetCopyGC'>
+<funcprototype>
+  <funcdef>int *<function>XESetCopyGC</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>extension</parameter></paramdef>
+  <paramdef>int <parameter>(*proc)()</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>extension</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the extension number.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to call when GC components are copied.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XESetCopyGC' xrefstyle='select: title'/>
+function defines a procedure to be called whenever
+a GC is copied.  
+It returns any previously defined procedure, usually NULL.
+</para>
+<para>
+<!-- .LP -->
+When a GC is copied, 
+your procedure is called with these arguments:
+<funcsynopsis>
+<funcprototype>
+  <funcdef>int <function>(*<replaceable>proc</replaceable>)</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>XExtCodes *<parameter>codes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+</para>
+<funcsynopsis id='XESetFreeGC'>
+<funcprototype>
+  <funcdef>int *<function>XESetFreeGC</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>extension</parameter></paramdef>
+  <paramdef>int <parameter>(*proc)()</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'>extension</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the extension number.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to call when a GC is freed.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XESetFreeGC' xrefstyle='select: title'/>
+function defines a procedure to be called whenever
+a GC is freed.  
+It returns any previously defined procedure, usually NULL.
+</para>
+<para>
+<!-- .LP -->
+When a GC is freed, 
+your procedure is called with these arguments:
+<!-- .LP -->
+<!-- .sM -->
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+<!-- .R -->
+<funcsynopsis>
+<funcprototype>
+  <funcdef>int <function>(*<replaceable>proc</replaceable>)</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>XExtCodes *<parameter>codes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+</para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>XESetCreateFont</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XESetCreateFont'>
+<funcprototype>
+  <funcdef>int *<function>XESetCreateFont</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>extension</parameter></paramdef>
+  <paramdef>int <parameter>(*proc)()</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>extension</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the extension number.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to call when a font is created.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XESetCreateFont' xrefstyle='select: title'/>
+function defines a procedure to be called whenever
+<xref linkend='XLoadQueryFont' xrefstyle='select: title'/>
+and
+<xref linkend='XQueryFont' xrefstyle='select: title'/>
+are called.  
+It returns any previously defined procedure, usually NULL.
+</para>
+<para>
+<!-- .LP -->
+When 
+<xref linkend='XLoadQueryFont' xrefstyle='select: title'/>
+or
+<xref linkend='XQueryFont' xrefstyle='select: title'/>
+is called, 
+your procedure is called with these arguments:
+<!-- .LP -->
+<!-- .sM -->
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+<!-- .R -->
+<funcsynopsis>
+<funcprototype>
+  <funcdef>int <function>(*<replaceable>proc</replaceable>)</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XFontStruct *<parameter>fs</parameter></paramdef>
+  <paramdef>XExtCodes *<parameter>codes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+</para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>XESetFreeFont</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XESetFreeFont'>
+<funcprototype>
+  <funcdef>int *<function>XESetFreeFont</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>extension</parameter></paramdef>
+  <paramdef>int <parameter>(*proc)()</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>extension</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the extension number.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to call when a font is freed.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XESetFreeFont' xrefstyle='select: title'/>
+function defines a procedure to be called whenever
+<xref linkend='XFreeFont' xrefstyle='select: title'/>
+is called.  
+It returns any previously defined procedure, usually NULL.
+</para>
+<para>
+<!-- .LP -->
+When 
+<xref linkend='XFreeFont' xrefstyle='select: title'/>
+is called, your procedure is called with these arguments:
+<!-- .LP -->
+<!-- .sM -->
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+<!-- .R -->
+<funcsynopsis>
+<funcprototype>
+  <funcdef>int <function>(*<replaceable>proc</replaceable>)</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XFontStruct *<parameter>fs</parameter></paramdef>
+  <paramdef>XExtCodes *<parameter>codes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XESetWireToEvent' xrefstyle='select: title'/>
+and
+<xref linkend='XESetEventToWire' xrefstyle='select: title'/>
+functions allow you to define new events to the library.
+An 
+<structname>XEvent</structname>
+structure always has a type code (type
+<type>int</type>)
+as the first component.
+This uniquely identifies what kind of event it is.
+The second component is always the serial number (type
+<type>unsigned</type>
+<type>long</type>)
+of the last request processed by the server.
+The third component is always a Boolean (type
+<type>Bool</type>)
+indicating whether the event came from a
+<systemitem>SendEvent</systemitem>
+protocol request.
+The fourth component is always a pointer to the display
+the event was read from.
+The fifth component is always a resource ID of one kind or another,
+usually a window, carefully selected to be useful to toolkit dispatchers.
+The fifth component should always exist, even if
+the event does not have a natural destination;
+if there is no value
+from the protocol to put in this component, initialize it to zero.
+<!-- .NT -->
+There is an implementation limit such that your host event
+structure size cannot be bigger than the size of the
+<structname>XEvent</structname>
+union of structures.
+There also is no way to guarantee that more than 24 elements or 96 characters
+in the structure will be fully portable between machines.
+</para>
+<!-- .NE -->
+<indexterm significance="preferred"><primary>XESetWireToEvent</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XESetWireToEvent'>
+<funcprototype>
+  <funcdef>int *<function>XESetWireToEvent</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>event_number</parameter></paramdef>
+  <paramdef>Status <parameter>(*proc)()</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>event_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the event code.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to call when converting an event.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XESetWireToEvent' xrefstyle='select: title'/>
+function defines a procedure to be called when an event
+needs to be converted from wire format 
+(<structname>xEvent</structname>)
+to host format 
+(<structname>XEvent</structname>).
+The event number defines which protocol event number to install a
+conversion procedure for.
+<xref linkend='XESetWireToEvent' xrefstyle='select: title'/>
+returns any previously defined procedure.
+<!-- .NT -->
+You can replace a core event conversion function with one
+of your own, although this is not encouraged.
+It would, however, allow you to intercept a core event 
+and modify it before being placed in the queue or otherwise examined.
+<!-- .NE -->
+When Xlib needs to convert an event from wire format to host
+format, your procedure is called with these arguments:
+<!-- .LP -->
+<!-- .sM -->
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+<!-- .R -->
+<funcsynopsis>
+<funcprototype>
+  <funcdef>int <function>(*<replaceable>proc</replaceable>)</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XEvent *<parameter>re</parameter></paramdef>
+  <paramdef>xEvent *<parameter>event</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .LP -->
+<!-- .eM -->
+Your procedure must return status to indicate if the conversion succeeded.
+The re argument is a pointer to where the host format event should be stored,
+and the event argument is the 32-byte wire event structure.
+In the 
+<structname>XEvent</structname>
+structure you are creating, 
+you must fill in the five required members of the event structure.
+You should fill in the type member with the type specified for the 
+<structname>xEvent</structname>
+structure.
+You should copy all other members from the 
+<structname>xEvent</structname>
+structure (wire format) to the
+<structname>XEvent</structname>
+structure (host format).
+Your conversion procedure should return 
+<symbol>True</symbol>
+if the event should be placed in the queue or
+<symbol>False</symbol>
+if it should not be placed in the queue.
+</para>
+<para>
+<!-- .LP -->
+To initialize the serial number component of the event, call
+<xref linkend='_XSetLastRequestRead' xrefstyle='select: title'/>
+with the event and use the return value.
+</para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>_XSetLastRequestRead</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='_XSetLastRequestRead'>
+<funcprototype>
+  <funcdef>unsigned long<function>_XSetLastRequestRead</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>xGenericReply *<parameter>rep</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>rep</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the wire event structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='_XSetLastRequestRead' xrefstyle='select: title'/>
+function computes and returns a complete serial number from the partial
+serial number in the event.
+<!-- .sp -->
+</para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XESetEventToWire</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XESetEventToWire'>
+<funcprototype>
+  <funcdef>Status *<function>XESetEventToWire</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>event_number</parameter></paramdef>
+  <paramdef>int <parameter>(*proc)()</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>event_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the event code.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to call when converting an event.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XESetEventToWire' xrefstyle='select: title'/>
+function defines a procedure to be called when an event
+needs to be converted from host format
+(<structname>XEvent</structname>)
+to wire format
+(<structname>xEvent</structname>)
+form.  
+The event number defines which protocol event number to install a
+conversion procedure for.
+<xref linkend='XESetEventToWire' xrefstyle='select: title'/>
+returns any previously defined procedure.
+It returns zero if the conversion fails or nonzero otherwise.
+<!-- .NT -->
+You can replace a core event conversion function with one
+of your own, although this is not encouraged.  
+It would, however, allow you to intercept a core event 
+and modify it before being sent to another client.
+<!-- .NE -->
+When Xlib needs to convert an event from host format to wire format, 
+your procedure is called with these arguments:
+<!-- .LP -->
+<!-- .sM -->
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+<!-- .R -->
+<funcsynopsis>
+<funcprototype>
+  <funcdef>int <function>(*<replaceable>proc</replaceable>)</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XEvent *<parameter>re</parameter></paramdef>
+  <paramdef>xEvent *<parameter>event</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .LP -->
+<!-- .eM -->
+The re argument is a pointer to the host format event,
+and the event argument is a pointer to where the 32-byte wire event 
+structure should be stored.
+You should fill in the type with the type from the 
+<structname>XEvent</structname>
+structure.
+All other members then should be copied from the host format to the 
+<structname>xEvent</structname>
+structure.
+</para>
+<indexterm significance="preferred"><primary>XESetWireToError</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XESetWireToError'>
+<funcprototype>
+  <funcdef>Bool *<function>XESetWireToError</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>error_number</parameter></paramdef>
+  <paramdef>Bool <parameter>(*proc)()</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>error_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the error code.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to call when an error is received.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XESetWireToError' xrefstyle='select: title'/>
+function defines a procedure to be called when an extension
+error needs to be converted from wire format to host format.
+The error number defines which protocol error code to install
+the conversion procedure for.
+<xref linkend='XESetWireToError' xrefstyle='select: title'/>
+returns any previously defined procedure.
+</para>
+<para>
+<!-- .LP -->
+Use this function for extension errors that contain additional error values
+beyond those in a core X error, when multiple wire errors must be combined
+into a single Xlib error, or when it is necessary to intercept an
+X error before it is otherwise examined.
+</para>
+<para>
+<!-- .LP -->
+When Xlib needs to convert an error from wire format to host format,
+the procedure is called with these arguments:
+<!-- .LP -->
+<!-- .sM -->
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+<!-- .R -->
+<funcsynopsis>
+<funcprototype>
+  <funcdef>int <function>(*<replaceable>proc</replaceable>)</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XErrorEvent *<parameter>he</parameter></paramdef>
+  <paramdef>xError *<parameter>we</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .LP -->
+<!-- .eM -->
+The he argument is a pointer to where the host format error should be stored.
+The structure pointed at by he is guaranteed to be as large as an
+<structname>XEvent</structname>
+structure and so can be cast to a type larger than an
+<structname>XErrorEvent</structname>
+to store additional values.
+If the error is to be completely ignored by Xlib
+(for example, several protocol error structures will be combined into
+one Xlib error),
+then the function should return
+<symbol>False</symbol>;
+otherwise, it should return
+<symbol>True</symbol>.
+</para>
+<indexterm significance="preferred"><primary>XESetError</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XESetError'>
+<funcprototype>
+  <funcdef>int *<function>XESetError</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>extension</parameter></paramdef>
+  <paramdef>int <parameter>(*proc)()</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>extension</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the extension number.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to call when an error is received.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Inside Xlib, there are times that you may want to suppress the
+calling of the external error handling when an error occurs.
+This allows status to be returned on a call at the cost of the call
+being synchronous (though most such functions are query operations, in any
+case, and are typically programmed to be synchronous).
+</para>
+<para>
+<!-- .LP -->
+When Xlib detects a protocol error in 
+<xref linkend='_XReply' xrefstyle='select: title'/>,
+it calls your procedure with these arguments:
+<!-- .LP -->
+<!-- .sM -->
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+<!-- .R -->
+<funcsynopsis>
+<funcprototype>
+  <funcdef>int <function>(*<replaceable>proc</replaceable>)</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>xError *<parameter>err</parameter></paramdef>
+  <paramdef>XExtCodes *<parameter>codes</parameter></paramdef>
+  <paramdef>int *<parameter>ret_code</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .LP -->
+<!-- .eM -->
+The err argument is a pointer to the 32-byte wire format error.
+The codes argument is a pointer to the extension codes structure.
+The ret_code argument is the return code you may want 
+<xref linkend='_XReply' xrefstyle='select: title'/>
+returned to.
+</para>
+<para>
+<!-- .LP -->
+If your procedure returns a zero value, 
+the error is not suppressed, and 
+the client's error handler is called.
+(For further information,
+see <link linkend="Using_the_Default_Error_Handlers">section 11.8.2</link>.)
+If your procedure returns nonzero, 
+the error is suppressed, and 
+<xref linkend='_XReply' xrefstyle='select: title'/>
+returns the value of ret_code.
+</para>
+<indexterm significance="preferred"><primary>XESetErrorString</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XESetErrorString'>
+<funcprototype>
+  <funcdef>char *<function>XESetErrorString</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>extension</parameter></paramdef>
+  <paramdef>char *<parameter>(*proc)()</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>extension</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the extension number.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to call to obtain an error string.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XGetErrorText' xrefstyle='select: title'/>
+function returns a string to the user for an error.
+<xref linkend='XESetErrorString' xrefstyle='select: title'/>
+allows you to define a procedure to be called that
+should return a pointer to the error message.
+The following is an example.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+<!-- .R -->
+<funcsynopsis>
+<funcprototype>
+  <funcdef>int <function>(*<replaceable>proc</replaceable>)</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>code</parameter></paramdef>
+  <paramdef>XExtCodes *<parameter>codes</parameter></paramdef>
+  <paramdef>char *<parameter>buffer</parameter></paramdef>
+  <paramdef>int <parameter>nbytes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .LP -->
+<!-- .eM -->
+Your procedure is called with the error code for every error detected.
+You should copy nbytes of a null-terminated string containing the
+error message into buffer.
+</para>
+<indexterm significance="preferred"><primary>XESetPrintErrorValues</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XESetPrintErrorValues'>
+<funcprototype>
+  <funcdef>void *<function>XESetPrintErrorValues</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>extension</parameter></paramdef>
+  <paramdef>void <parameter>(*proc)()</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>extension</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the extension number.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to call when an error is printed.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XESetPrintErrorValues' xrefstyle='select: title'/>
+function defines a procedure to be called when an extension
+error is printed, to print the error values.
+Use this function for extension errors that contain additional error values
+beyond those in a core X error.
+It returns any previously defined procedure.
+</para>
+<para>
+<!-- .LP -->
+When Xlib needs to print an error,
+the procedure is called with these arguments:
+<!-- .LP -->
+<!-- .sM -->
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+<!-- .R -->
+<funcsynopsis>
+<funcprototype>
+  <funcdef>void <function>(*<replaceable>proc</replaceable>)</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XErrorEvent *<parameter>ev</parameter></paramdef>
+  <paramdef>void *<parameter>fp</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .LP -->
+<!-- .eM -->
+The structure pointed at by ev is guaranteed to be as large as an
+<structname>XEvent</structname>
+structure and so can be cast to a type larger than an
+<structname>XErrorEvent</structname>
+to obtain additional values set by using
+<xref linkend='XESetWireToError' xrefstyle='select: title'/>.
+The underlying type of the fp argument is system dependent;
+on a <acronym>POSIX</acronym>-compliant system, fp should be cast to type FILE*.
+</para>
+<indexterm significance="preferred"><primary>XESetFlushGC</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XESetFlushGC'>
+<funcprototype>
+  <funcdef>int *<function>XESetFlushGC</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>extension</parameter></paramdef>
+  <paramdef>int *<parameter>(*proc)()</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>extension</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the extension number.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to call when a GC is flushed.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The procedure set by the
+<xref linkend='XESetFlushGC' xrefstyle='select: title'/>
+function has the same interface as the procedure set by the
+<xref linkend='XESetCopyGC' xrefstyle='select: title'/>
+function, but is called when a GC cache needs to be updated in the server.
+</para>
+<indexterm significance="preferred"><primary>XESetBeforeFlush</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis>
+<funcprototype>
+  <funcdef>int *<function>XESetCopyGC</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>extension</parameter></paramdef>
+  <paramdef>int *<parameter>(*proc)()</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>extension</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the extension number.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to call when a buffer is flushed.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<function>XESetBeforeFlush</function>
+function defines a procedure to be called when data is about to be
+sent to the server.  When data is about to be sent, your procedure is  
+called one or more times with these arguments:
+<!-- .LP -->
+<!-- .sM -->
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+<!-- .R -->
+<funcsynopsis>
+<funcprototype>
+  <funcdef>void <function>(*<replaceable>proc</replaceable>)</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XExtCodes *<parameter>codes</parameter></paramdef>
+  <paramdef>char *<parameter>data</parameter></paramdef>
+  <paramdef>long <parameter>len</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .LP -->
+<!-- .eM -->
+The data argument specifies a portion of the outgoing data buffer,
+and its length in bytes is specified by the len argument.
+Your procedure must not alter the contents of the data and must not
+do additional protocol requests to the same display.
+</para>
+</sect2>
+<sect2 id="Hooks_onto_Xlib_Data_Structures">
+<title>Hooks onto Xlib Data Structures</title>
+<para>
+<!-- .LP -->
+Various Xlib data structures have provisions for extension procedures
+to chain extension supplied data onto a list.
+These structures are
+<structname>GC</structname>,
+<structname>Visual</structname>,
+<type>Screen</type>,
+<structname>ScreenFormat</structname>,
+<type>Display</type>,
+and 
+<structname>XFontStruct</structname>.
+Because the list pointer is always the first member in the structure, 
+a single set of procedures can be used to manipulate the data
+on these lists.
+</para>
+<para>
+<!-- .LP -->
+The following structure is used in the functions in this section
+and is defined in 
+<filename class="headerfile">&lt;X11/Xlib.h&gt;</filename>
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XExtData</primary></indexterm>
+<!-- .sM -->
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+<synopsis>
+typedef struct _XExtData {
+	int number;	/* number returned by XInitExtension */
+	struct _XExtData *next;	/* next item on list of data for structure */
+	int (*free_private)();	/* if defined,  called to free private */
+	XPointer private_data;	/* data private to this extension. */
+} XExtData;
+</synopsis>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+When any of the data structures listed above are freed, 
+the list is walked, and the structure's free procedure (if any) is called. 
+If free is NULL, 
+then the library frees both the data pointed to by the private_data member
+and the structure itself. 
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+<synopsis>
+union {	Display *display;
+	GC gc;
+	Visual *visual;
+	Screen *screen;
+	ScreenFormat *pixmap_format;
+	XFontStruct *font } XEDataObject;
+</synopsis>
+</para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>XEHeadOfExtensionList</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XEHeadOfExtensionList'>
+<funcprototype>
+  <funcdef>XExtData **<function>XEHeadOfExtensionList</function></funcdef>
+  <paramdef>XEDataObject <parameter>object</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>object</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the object.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XEHeadOfExtensionList' xrefstyle='select: title'/>
+function returns a pointer to the list of extension structures attached
+to the specified object.
+In concert with 
+<xref linkend='XAddToExtensionList' xrefstyle='select: title'/>,
+<xref linkend='XEHeadOfExtensionList' xrefstyle='select: title'/>
+allows an extension to attach arbitrary data to any of the structures
+of types contained in
+<structname>XEDataObject</structname>.
+</para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XAddToExtensionList</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XAddToExtensionList'>
+<funcprototype>
+  <funcdef><function>XAddToExtensionList</function></funcdef>
+  <paramdef>XExtData **<parameter>structure</parameter></paramdef>
+  <paramdef>XExtData *<parameter>ext_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>structure</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the extension list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ext_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the extension data structure to add.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The structure argument is a pointer to one of the data structures
+enumerated above.
+You must initialize ext_data-&gt;number with the extension number
+before calling this function.
+</para>
+<indexterm significance="preferred"><primary>XFindOnExtensionList</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XFindOnExtensionList'>
+<funcprototype>
+  <funcdef>XExtData *<function>XFindOnExtensionList</function></funcdef>
+  <paramdef>struct_XExtData **<parameter>structure</parameter></paramdef>
+  <paramdef>int <parameter>number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>structure</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the extension list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the extension number from
+<xref linkend='XInitExtension' xrefstyle='select: title'/>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XFindOnExtensionList' xrefstyle='select: title'/>
+function returns the first extension data structure
+for the extension numbered number.
+It is expected that an extension will add at most one extension
+data structure to any single data structure's extension data list.
+There is no way to find additional structures.
+</para>
+<para>
+<!-- .LP -->
+The 
+<xref linkend='XAllocID' xrefstyle='select: title'/>
+macro, which allocates and returns a resource ID, is defined in 
+<filename class="headerfile">&lt;X11/Xlib.h&gt;</filename>.
+</para>
+<indexterm significance="preferred"><primary>XAllocID</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XAllocID'>
+<funcprototype>
+  <funcdef><function>XAllocID</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+This macro is a call through the 
+<type>Display</type>
+structure to an internal resource ID allocator.
+It returns a resource ID that you can use when creating new resources.
+</para>
+<para>
+<!-- .LP -->
+The 
+<xref linkend='XAllocIDs' xrefstyle='select: title'/>
+macro allocates and returns an array of resource ID.
+</para>
+<indexterm significance="preferred"><primary>XAllocIDs</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XAllocIDs'>
+<funcprototype>
+  <funcdef><function>XAllocIDs</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XID *<parameter>ids_return</parameter></paramdef>
+  <paramdef>int <parameter>count</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>ids_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the resource IDs.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>rep</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of resource IDs requested.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+This macro is a call through the 
+<type>Display</type>
+structure to an internal resource ID allocator.
+It returns resource IDs to the array supplied by the caller.
+To correctly handle automatic reuse of resource IDs, you must call
+<xref linkend='XAllocIDs' xrefstyle='select: title'/>
+when requesting multiple resource IDs.  This call might generate
+protocol requests.
+</para>
+</sect2>
+</sect1>
+<sect1 id="GC_Caching">
+<title>GC Caching</title>
+<para>
+<!-- .LP -->
+GCs are cached by the library to allow merging of independent change
+requests to the same GC into single protocol requests.
+This is typically called a write-back cache.
+Any extension procedure whose behavior depends on the contents of a GC
+must flush the GC cache to make sure the server has up-to-date contents
+in its GC.
+</para>
+<para>
+<!-- .LP -->
+The 
+<xref linkend='FlushGC' xrefstyle='select: title'/>
+macro checks the dirty bits in the library's GC structure and calls
+<xref linkend='_XFlushGCCache' xrefstyle='select: title'/>
+if any elements have changed.
+The
+<xref linkend='FlushGC' xrefstyle='select: title'/>
+macro is defined as follows:
+</para>
+<indexterm significance="preferred"><primary>FlushGC</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='FlushGC'>
+<funcprototype>
+  <funcdef><function>FlushGC</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Note that if you extend the GC to add additional resource ID components,
+you should ensure that the library stub sends the change request immediately.
+This is because a client can free a resource immediately after
+using it, so if you only stored the value in the cache without
+forcing a protocol request, the resource might be destroyed before being
+set into the GC.
+You can use the
+<xref linkend='_XFlushGCCache' xrefstyle='select: title'/>
+procedure 
+to force the cache to be flushed.
+The
+<xref linkend='_XFlushGCCache' xrefstyle='select: title'/>
+procedure
+is defined as follows:
+</para>
+<indexterm significance="preferred"><primary>_XFlushGCCache</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='_XFlushGCCache'>
+<funcprototype>
+  <funcdef><function>_XFlushGCCache</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<!-- .LP -->
+<!-- .eM -->
+</sect1>
+<sect1 id="Graphics_Batching">
+<title>Graphics Batching</title>
+<para>
+<!-- .LP -->
+If you extend X to add more poly graphics primitives, you may be able to
+take advantage of facilities in the library to allow back-to-back 
+single calls to be transformed into poly requests.
+This may dramatically improve performance of programs that are not
+written using poly requests. 
+A pointer to an 
+<structname>xReq</structname>,
+called last_req in the display structure, is the last request being processed.  
+By checking that the last request
+type, drawable, gc, and other options are the same as the new one
+and that there is enough space left in the buffer, you may be able
+to just extend the previous graphics request by extending the length
+field of the request and appending the data to the buffer.  
+This can improve performance by five times or more in naive programs.  
+For example, here is the source for the 
+<xref linkend='XDrawPoint' xrefstyle='select: title'/>
+stub.
+(Writing extension stubs is discussed in the next section.)
+</para>
+<!-- .sM -->
+<!-- .nf -->
+<programlisting>
+#include &lt;X11/Xlibint.h&gt;
+
+/* precompute the maximum size of batching request allowed */
+
+static int size = sizeof(xPolyPointReq) + EPERBATCH * sizeof(xPoint);
+
+XDrawPoint(dpy, d, gc, x, y)
+    register Display *dpy;
+    Drawable d;
+    GC gc;
+    int x, y; /* INT16 */
+{
+    xPoint *point;
+    LockDisplay(dpy);
+    FlushGC(dpy, gc);
+    {
+    register xPolyPointReq *req = (xPolyPointReq *) dpy-&gt;last_req;
+    /* if same as previous request, with same drawable, batch requests */
+    if (
+          (req-&gt;reqType == X_PolyPoint)
+       &amp;&amp; (req-&gt;drawable == d)
+       &amp;&amp; (req-&gt;gc == gc-&gt;gid)
+       &amp;&amp; (req-&gt;coordMode == CoordModeOrigin)
+       &amp;&amp; ((dpy-&gt;bufptr + sizeof (xPoint)) &lt;= dpy-&gt;bufmax)
+       &amp;&amp; (((char *)dpy-&gt;bufptr - (char *)req) &lt; size) ) {
+         point = (xPoint *) dpy-&gt;bufptr;
+         req-&gt;length += sizeof (xPoint) &gt;&gt; 2;
+         dpy-&gt;bufptr += sizeof (xPoint);
+         }
+
+    else {
+        GetReqExtra(PolyPoint, 4, req); /* 1 point = 4 bytes */
+        req-&gt;drawable = d;
+        req-&gt;gc = gc-&gt;gid;
+        req-&gt;coordMode = CoordModeOrigin;
+        point = (xPoint *) (req + 1);
+        }
+    point-&gt;x = x;
+    point-&gt;y = y;
+    }
+    UnlockDisplay(dpy);
+    SyncHandle();
+}
+</programlisting>
+<!-- .fi -->
+<para>
+<!-- .LP -->
+<!-- .eM -->
+To keep clients from generating very long requests that may monopolize the 
+server,
+there is a symbol defined in
+<filename class="headerfile">&lt;X11/Xlibint.h&gt;</filename>
+of EPERBATCH on the number of requests batched.
+Most of the performance benefit occurs in the first few merged requests.
+Note that 
+<xref linkend='FlushGC' xrefstyle='select: title'/>
+is called <emphasis remap='I'>before</emphasis> picking up the value of last_req,
+because it may modify this field.
+</para>
+</sect1>
+<sect1 id="Writing_Extension_Stubs">
+<title>Writing Extension Stubs</title>
+<para>
+<!-- .LP -->
+All X requests always contain the length of the request,
+expressed as a 16-bit quantity of 32 bit words.
+This means that a single request can be no more than 256K bytes in
+length.
+Some servers may not support single requests of such a length.
+The value of dpy-&gt;max_request_size contains the maximum length as
+defined by the server implementation.
+For further information,
+see <citetitle>X Window System Protocol</citetitle>.
+</para>
+<sect2 id="Requests_Replies_and_Xproto.h">
+<title>Requests, Replies, and Xproto.h</title>
+<para>
+<!-- .LP -->
+The 
+<filename class="headerfile">&lt;X11/Xproto.h&gt;</filename>
+file contains three sets of definitions that
+are of interest to the stub implementor:  
+request names, request structures, and reply structures.
+</para>
+<para>
+<!-- .LP -->
+You need to generate a file equivalent to 
+<filename class="headerfile">&lt;X11/Xproto.h&gt;</filename>
+for your extension and need to include it in your stub procedure.
+Each stub procedure also must include 
+<filename class="headerfile">&lt;X11/Xlibint.h&gt;</filename>.
+</para>
+<para>
+<!-- .LP -->
+The identifiers are deliberately chosen in such a way that, if the
+request is called X_DoSomething, then its request structure is
+xDoSomethingReq, and its reply is xDoSomethingReply.  
+The GetReq family of macros, defined in 
+<filename class="headerfile">&lt;X11/Xlibint.h&gt;</filename>,
+takes advantage of this naming scheme.
+</para>
+<para>
+<!-- .LP -->
+For each X request, 
+there is a definition in 
+<filename class="headerfile">&lt;X11/Xproto.h&gt;</filename>
+that looks similar to this:
+</para>
+<para>
+<!-- .LP -->
+<!-- .R -->
+<programlisting>
+#define X_DoSomething   42
+</programlisting>
+In your extension header file, 
+this will be a minor opcode, 
+instead of a major opcode.
+</para>
+</sect2>
+<sect2 id="Request_Format">
+<title>Request Format</title>
+<para>
+<!-- .LP -->
+Every request contains an 8-bit major opcode and a 16-bit length field
+expressed in units of 4 bytes.  
+Every request consists of 4 bytes of header
+(containing the major opcode, the length field, and a data byte) followed by
+zero or more additional bytes of data. 
+The length field defines the total length of the request, including the header.
+The length field in a request must equal the minimum length required to contain 
+the request. 
+If the specified length is smaller or larger than the required length, 
+the server should generate a 
+<errorname>BadLength</errorname>
+error.
+Unused bytes in a request are not required to be zero.  
+Extensions should be designed in such a way that long protocol requests
+can be split up into smaller requests,
+if it is possible to exceed the maximum request size of the server.
+The protocol guarantees the maximum request size to be no smaller than
+4096 units (16384 bytes).
+</para>
+<para>
+<!-- .LP -->
+Major opcodes 128 through 255 are reserved for extensions.
+Extensions are intended to contain multiple requests, 
+so extension requests typically have an additional minor opcode encoded 
+in the second data byte in the request header, 
+but the placement and interpretation of this minor opcode as well as all
+other fields in extension requests are not defined by the core protocol.
+Every request is implicitly assigned a sequence number (starting with one)
+used in replies, errors, and events.
+</para>
+<para>
+<!-- .LP -->
+Most protocol requests have a corresponding structure typedef in
+<filename class="headerfile">&lt;X11/Xproto.h&gt;</filename>,
+which looks like:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>xDoSomethingReq</primary></indexterm>
+<!-- .sM -->
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+<synopsis>
+typedef struct _DoSomethingReq {
+	CARD8 reqType;		/* X_DoSomething */
+	CARD8 someDatum;	/* used differently in different requests */
+	CARD16 length;		/* total # of bytes in request, divided by 4 */
+	...
+	/* request-specific data */
+	...
+} xDoSomethingReq;
+</synopsis>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+If a core protocol request has a single 32-bit argument, 
+you need not declare a request structure in your extension header file.
+Instead, such requests use the
+<structname>xResourceReq</structname>
+structure in
+<filename class="headerfile">&lt;X11/Xproto.h&gt;</filename>.
+This structure is used for any request whose single argument is a 
+<type>Window</type>,
+<type>Pixmap</type>,
+<type>Drawable</type>,
+<type>GContext</type>,
+<type>Font</type>,
+<type>Cursor</type>,
+<type>Colormap</type>,
+<type>Atom</type>,
+or
+<type>VisualID</type>.
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>xResourceReq</primary></indexterm>
+<!-- .sM -->
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+<synopsis>
+typedef struct _ResourceReq {
+	CARD8 reqType;	/* the request type, e.g. X_DoSomething */
+	BYTE pad;	/* not used */
+	CARD16 length;	/* 2 (= total # of bytes in request, divided by 4) */
+	CARD32 id;	/* the Window, Drawable, Font, GContext, etc. */
+} xResourceReq;
+</synopsis>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+If convenient,
+you can do something similar in your extension header file. 
+</para>
+<para>
+<!-- .LP -->
+In both of these structures, 
+the reqType field identifies the type of the request (for example, 
+X_MapWindow or X_CreatePixmap).  
+The length field tells how long the request is
+in units of 4-byte longwords. 
+This length includes both the request structure itself and any
+variable-length data, such as strings or lists, that follow the
+request structure.  
+Request structures come in different sizes, 
+but all requests are padded to be multiples of four bytes long.
+</para>
+<para>
+<!-- .LP -->
+A few protocol requests take no arguments at all. 
+Instead, they use the
+<structname>xReq</structname>
+structure in
+<filename class="headerfile">&lt;X11/Xproto.h&gt;</filename>,
+which contains only a reqType and a length (and a pad byte).
+</para>
+<para>
+<!-- .LP  -->
+If the protocol request requires a reply, 
+then
+<filename class="headerfile">&lt;X11/Xproto.h&gt;</filename>
+also contains a reply structure typedef:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>xDoSomethingReply</primary></indexterm>
+<!-- .sM -->
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+<synopsis>
+typedef struct _DoSomethingReply {
+	BYTE type;	/* always X_Reply */
+	BYTE someDatum;	/* used differently in different requests */
+	CARD16 sequenceNumber;	/* # of requests sent so far */
+	CARD32 length;	/* # of additional bytes, divided by 4 */
+	...
+	/* request-specific data */
+	...
+} xDoSomethingReply;
+</synopsis>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Most of these reply structures are 32 bytes long. 
+If there are not that many reply values, 
+then they contain a sufficient number of pad fields
+to bring them up to 32 bytes.  
+The length field is the total number of bytes in the request minus 32, 
+divided by 4.  
+This length will be nonzero only if:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+The reply structure is followed by variable-length data,
+such as a list or string.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The reply structure is longer than 32 bytes.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+Only 
+<systemitem>GetWindowAttributesl</systemitem>,
+<systemitem>QueryFont</systemitem>,
+<systemitem>QueryKeymap</systemitem>,
+and
+<systemitem>GetKeyboardControl</systemitem>
+have reply structures longer than 32 bytes in the core protocol.
+</para>
+<para>
+<!-- .LP -->
+A few protocol requests return replies that contain no data.  
+<filename class="headerfile">&lt;X11/Xproto.h&gt;</filename>
+does not define reply structures for these.
+Instead, they use the 
+<structname>xGenericReply</structname>
+structure, which contains only a type, length,
+and sequence number (and sufficient padding to make it 32 bytes long).
+</para>
+</sect2>
+<sect2 id="Starting_to_Write_a_Stub_Procedure">
+<title>Starting to Write a Stub Procedure</title>
+<para>
+<!-- .LP -->
+An Xlib stub procedure should start like this:
+</para>
+<para>
+<!-- .LP -->
+<!-- .R -->
+<programlisting>
+#include "&lt;X11/Xlibint.h&gt;
+
+XDoSomething (arguments, ... )
+/* argument declarations */
+{
+
+register XDoSomethingReq *req;
+...
+</programlisting>
+If the protocol request has a reply, 
+then the variable declarations should include the reply structure for the request.
+The following is an example:
+</para>
+<para>
+<!-- .LP -->
+<!-- .R -->
+<programlisting>
+xDoSomethingReply rep;
+</programlisting>
+</para>
+</sect2>
+<sect2 id="Locking_Data_Structures">
+<title>Locking Data Structures</title>
+<para>
+<!-- .LP -->
+To lock the display structure for systems that
+want to support multithreaded access to a single display connection,
+each stub will need to lock its critical section.
+Generally, this section is the point from just before the appropriate GetReq
+call until all arguments to the call have been stored into the buffer.
+The precise instructions needed for this locking depend upon the machine
+architecture. 
+Two calls, which are generally implemented as macros, have been provided.
+<indexterm significance="preferred"><primary>LockDisplay</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='LockDisplay'>
+<funcprototype>
+  <funcdef><function>LockDisplay</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+</para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>UnlockDisplay</primary></indexterm>
+<funcsynopsis id='UnlockDisplay'>
+<funcprototype>
+  <funcdef><function>UnlockDisplay</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<!-- .LP -->
+<!-- .eM -->
+</sect2>
+<sect2 id="Sending_the_Protocol_Request_and_Arguments">
+<title>Sending the Protocol Request and Arguments</title>
+<para>
+<!-- .LP -->
+After the variable declarations, 
+a stub procedure should call one of four macros defined in 
+<filename class="headerfile">&lt;X11/Xlibint.h&gt;</filename>:
+<function>GetReq</function>,
+<function>GetReqExtra</function>,
+<function>GetResReq</function>,
+or 
+<function>GetEmptyReq</function>.
+All of these macros take, as their first argument,
+the name of the protocol request as declared in 
+<filename class="headerfile">&lt;X11/Xproto.h&gt;</filename>
+except with X_ removed.   
+Each one declares a 
+<type>Display</type>
+structure pointer,
+called dpy, and a pointer to a request structure, called req,
+which is of the appropriate type.
+The macro then appends the request structure to the output buffer, 
+fills in its type and length field, and sets req to point to it.
+</para>
+<para>
+<!-- .LP -->
+If the protocol request has no arguments (for instance, X_GrabServer),
+then use 
+<function>GetEmptyReq</function>.
+</para>
+<para>
+<!-- .LP -->
+<!-- .R  -->
+<programlisting>
+GetEmptyReq (DoSomething, req);
+</programlisting>
+If the protocol request has a single 32-bit argument (such as a
+<type>Pixmap</type>,
+<type>Window</type>,
+<type>Drawable</type>,
+<type>Atom</type>,
+and so on),
+then use 
+<function>GetResReq</function>.
+The second argument to the macro is the 32-bit object.  
+<symbol>X_MapWindow</symbol>
+is a good example.
+</para>
+<para>
+<!-- .LP -->
+<!-- .R -->
+<programlisting>
+GetResReq (DoSomething, rid, req);
+</programlisting>
+The rid argument is the 
+<type>Pixmap</type>,
+<type>Window</type>,
+or other resource ID.
+</para>
+<para>
+<!-- .LP -->
+If the protocol request takes any other argument list, 
+then call 
+<function>GetReq</function>.
+After the 
+<function>GetReq</function>,
+you need to set all the other fields in the request structure,
+usually from arguments to the stub procedure.
+</para>
+<para>
+<!-- .LP -->
+<!-- .R -->
+<programlisting>
+GetReq (DoSomething, req);
+/* fill in arguments here */
+req-&gt;arg1 = arg1;
+req-&gt;arg2 = arg2;
+...
+</programlisting>
+A few stub procedures (such as 
+<xref linkend='XCreateGC' xrefstyle='select: title'/>
+and 
+<xref linkend='XCreatePixmap' xrefstyle='select: title'/>)
+return a resource ID to the caller but pass a resource ID as an argument
+to the protocol request.   
+Such procedures use the macro 
+<xref linkend='XAllocID' xrefstyle='select: title'/>
+to allocate a resource ID from the range of IDs 
+that were assigned to this client when it opened the connection.
+</para>
+<para>
+<!-- .LP -->
+<!-- .R -->
+<programlisting>
+rid = req-&gt;rid = XAllocID();
+...
+return (rid);
+</programlisting>
+Finally, some stub procedures transmit a fixed amount of variable-length
+data after the request.  
+Typically, these procedures (such as
+<xref linkend='XMoveWindow' xrefstyle='select: title'/>
+and 
+<xref linkend='XSetBackground' xrefstyle='select: title'/>)
+are special cases of more general functions like 
+<xref linkend='XMoveResizeWindow' xrefstyle='select: title'/>
+and 
+<xref linkend='XChangeGC' xrefstyle='select: title'/>.
+These procedures use 
+<function>GetReqExtra</function>,
+which is the same as 
+<function>GetReq</function>
+except that it takes an additional argument (the number of
+extra bytes to allocate in the output buffer after the request structure).  
+This number should always be a multiple of four. Note that it is possible
+for req to be set to NULL as a defensive measure if the requested length
+exceeds the Xlib's buffer size (normally 16K).
+</para>
+</sect2>
+<sect2 id="Variable_Length_Arguments">
+<title>Variable Length Arguments</title>
+<para>
+<!-- .LP -->
+Some protocol requests take additional variable-length data that
+follow the 
+<type>xDoSomethingReq</type>
+structure.    
+The format of this data varies from request to request. 
+Some requests require a sequence of 8-bit bytes, 
+others a sequence of 16-bit or 32-bit entities, 
+and still others a sequence of structures.
+</para>
+<para>
+<!-- .LP -->
+It is necessary to add the length of any variable-length data to the
+length field of the request structure.  
+That length field is in units of 32-bit longwords.  
+If the data is a string or other sequence of 8-bit bytes, 
+then you must round the length up and shift it before adding:
+</para>
+<para>
+<!-- .LP -->
+<!-- .R -->
+<programlisting>
+req-&gt;length += (nbytes+3)&gt;&gt;2;
+</programlisting>
+To transmit variable-length data, use the 
+<xref linkend='Data' xrefstyle='select: title'/>
+macros.
+If the data fits into the output buffer, 
+then this macro copies it to the buffer.  
+If it does not fit, however,
+the 
+<xref linkend='Data' xrefstyle='select: title'/>
+macro calls 
+<function>_XSend</function>,
+which transmits first the contents of the buffer and then your data.
+The 
+<xref linkend='Data' xrefstyle='select: title'/>
+macros take three arguments:  
+the display, a pointer to the beginning of the data, 
+and the number of bytes to be sent.
+<!-- .sM -->
+<funcsynopsis id='Data'>
+<funcprototype role='macro'>
+  <funcdef><function>Data</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+  <paramdef>(char *) <parameter>data</parameter></paramdef>
+  <paramdef><parameter>nbytes</parameter></paramdef>
+</funcprototype>
+<funcprototype role='macro'>
+  <funcdef><function>Data16</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+  <paramdef>(short *) <parameter>data</parameter></paramdef>
+  <paramdef><parameter>nbytes</parameter></paramdef>
+</funcprototype>
+<funcprototype role='macro'>
+  <funcdef><function>Data32</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+  <paramdef>(long *) <parameter>data</parameter></paramdef>
+  <paramdef><parameter>nbytes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<function>Data</function>,
+<function>Data16</function>,
+and
+<function>Data32</function>
+are macros that may use their last argument
+more than once, so that argument should be a variable rather than
+an expression such as ``nitems*sizeof(item)''.  
+You should do that kind of computation in a separate statement before calling 
+them.
+Use the appropriate macro when sending byte, short, or long data.
+</para>
+<para>
+<!-- .LP -->
+If the protocol request requires a reply, 
+then call the procedure 
+<function>_XSend</function>
+instead of the 
+<xref linkend='Data' xrefstyle='select: title'/>
+macro.  
+<function>_XSend</function>
+takes the same arguments, but because it sends your data immediately instead of 
+copying it into the output buffer (which would later be flushed
+anyway by the following call on 
+<xref linkend='_XReply' xrefstyle='select: title'/>),
+it is faster.
+</para>
+</sect2>
+<sect2 id="Replies">
+<title>Replies</title>
+<para>
+<!-- .LP -->
+If the protocol request has a reply, 
+then call 
+<xref linkend='_XReply' xrefstyle='select: title'/>
+after you have finished dealing with 
+all the fixed-length and variable-length arguments.  
+<xref linkend='_XReply' xrefstyle='select: title'/>
+flushes the output buffer and waits for an 
+<structname>xReply</structname>
+packet to arrive.  
+If any events arrive in the meantime,
+<xref linkend='_XReply' xrefstyle='select: title'/>
+places them in the queue for later use.
+</para>
+<indexterm significance="preferred"><primary>_XReply</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='_XReply'>
+<funcprototype>
+  <funcdef>Status <function>_XReply</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>xReply *<parameter>rep</parameter></paramdef>
+  <paramdef>int <parameter>extra</parameter></paramdef>
+  <paramdef>Bool <parameter>discard</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>rep</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the reply structure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>extra</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of 32-bit words expected after the replay.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>discard</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies if any data beyond that specified in the extra argument
+should be discarded.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='_XReply' xrefstyle='select: title'/>
+function waits for a reply packet and copies its contents into the
+specified rep.  
+<xref linkend='_XReply' xrefstyle='select: title'/>
+handles error and event packets that occur before the reply is received.
+<xref linkend='_XReply' xrefstyle='select: title'/>
+takes four arguments:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+A 
+<type>Display</type>
+* structure
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A pointer to a reply structure (which must be cast to an 
+<structname>xReply</structname>
+*)
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The number of additional 32-bit words (beyond 
+<function>sizeof( xReply</function>)
+= 32 bytes)
+in the reply structure
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A Boolean that indicates whether
+<xref linkend='_XReply' xrefstyle='select: title'/>
+is to discard any additional bytes
+beyond those it was told to read
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+Because most reply structures are 32 bytes long, 
+the third argument is usually 0.  
+The only core protocol exceptions are the replies to 
+<systemitem>GetWindowAttributesl</systemitem>,
+<systemitem>QueryFont</systemitem>,
+<systemitem>QueryKeymap</systemitem>,
+and 
+<systemitem>GetKeyboardControl</systemitem>,
+which have longer replies.
+</para>
+<para>
+<!-- .LP -->
+The last argument should be 
+<symbol>False</symbol>
+if the reply structure is followed
+by additional variable-length data (such as a list or string).  
+It should be 
+<symbol>True</symbol>
+if there is not any variable-length data.
+<!-- .NT -->
+This last argument is provided for upward-compatibility reasons
+to allow a client to communicate properly with a hypothetical later
+version of the server that sends more data than the client expected.
+For example, some later version of 
+<systemitem>GetWindowAttributesl</systemitem>
+might use a
+larger, but compatible, 
+<structname>xGetWindowAttributesReply</structname>
+that contains additional attribute data at the end.
+<!-- .NE -->
+<xref linkend='_XReply' xrefstyle='select: title'/>
+returns 
+<symbol>True</symbol>
+if it received a reply successfully or 
+<symbol>False</symbol>
+if it received any sort of error. 
+</para>
+<para>
+<!-- .LP -->
+For a request with a reply that is not followed by variable-length
+data, you write something like:
+</para>
+<para>
+<!-- .LP -->
+<!-- .R -->
+<programlisting>
+_XReply(display, (xReply *)&amp;rep, 0, True);
+*ret1 = rep.ret1;
+*ret2 = rep.ret2;
+*ret3 = rep.ret3;
+...
+UnlockDisplay(dpy);
+SyncHandle();
+return (rep.ret4);
+}
+</programlisting>
+If there is variable-length data after the reply, 
+change the 
+<symbol>True</symbol>
+to 
+<symbol>False</symbol>,
+and use the appropriate
+<xref linkend='_XRead' xrefstyle='select: title'/>
+function to read the variable-length data.
+</para>
+<!-- .LP -->
+<!-- .sM -->
+<funcsynopsis id='_XRead'>
+<funcprototype>
+  <funcdef><function>_XRead</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>char *<parameter>data_return</parameter></paramdef>
+  <paramdef>long <parameter>nbytes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>data_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the buffer.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nbytes</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of bytes required.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='_XRead' xrefstyle='select: title'/>
+function reads the specified number of bytes into data_return.
+</para>
+<!-- .LP -->
+<!-- .sM -->
+<funcsynopsis id='_XRead16'>
+<funcprototype>
+  <funcdef><function>_XRead16</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>short *<parameter>data_return</parameter></paramdef>
+  <paramdef>long <parameter>nbytes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>data_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the buffer.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nbytes</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of bytes required.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='_XRead16' xrefstyle='select: title'/>
+function reads the specified number of bytes,
+unpacking them as 16-bit quantities,
+into the specified array as shorts.
+</para>
+<!-- .LP -->
+<!-- .sM -->
+<funcsynopsis id='_XRead32'>
+<funcprototype>
+  <funcdef><function>_XRead32</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>long *<parameter>data_return</parameter></paramdef>
+  <paramdef>long <parameter>nbytes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>data_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the buffer.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nbytes</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of bytes required.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='_XRead32' xrefstyle='select: title'/>
+function reads the specified number of bytes,
+unpacking them as 32-bit quantities,
+into the specified array as longs.
+</para>
+<!-- .LP -->
+<!-- .sM -->
+<funcsynopsis id='_XRead16Pad'>
+<funcprototype>
+  <funcdef><function>_XRead16Pad</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>short *<parameter>data_return</parameter></paramdef>
+  <paramdef>long <parameter>nbytes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>data_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the buffer.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nbytes</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of bytes required.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='_XRead16Pad' xrefstyle='select: title'/>
+function reads the specified number of bytes,
+unpacking them as 16-bit quantities,
+into the specified array as shorts.
+If the number of bytes is not a multiple of four,
+<xref linkend='_XRead16Pad' xrefstyle='select: title'/>
+reads and discards up to two additional pad bytes.
+</para>
+<!-- .LP -->
+<!-- .sM -->
+<funcsynopsis id='_XReadPad'>
+<funcprototype>
+  <funcdef><function>_XReadPad</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>char *<parameter>data_return</parameter></paramdef>
+  <paramdef>long <parameter>nbytes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>data_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the buffer.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nbytes</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of bytes required.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='_XReadPad' xrefstyle='select: title'/>
+function reads the specified number of bytes into data_return.
+If the number of bytes is not a multiple of four,
+<xref linkend='_XReadPad' xrefstyle='select: title'/>
+reads and discards up to three additional pad bytes.
+</para>
+<para>
+<!-- .LP -->
+Each protocol request is a little different. 
+For further information,
+see the Xlib sources for examples.
+</para>
+</sect2>
+<sect2 id="Synchronous_Calling">
+<title>Synchronous Calling</title>
+<para>
+<!-- .LP -->
+Each procedure should have a call, just before returning to the user, 
+to a macro called
+<systemitem>SyncHandle</systemitem>.
+If synchronous mode is enabled (see 
+<function>XSynchronize</function>),
+the request is sent immediately.
+The library, however, waits until any error the procedure could generate
+at the server has been handled.
+</para>
+</sect2>
+<sect2 id="Allocating_and_Deallocating_Memory">
+<title>Allocating and Deallocating Memory</title>
+<para>
+<!-- .LP -->
+To support the possible reentry of these procedures, 
+you must observe several conventions when allocating and deallocating memory,
+most often done when returning data to the user from the window
+system of a size the caller could not know in advance
+(for example, a list of fonts or a list of extensions).
+The standard C library functions on many systems
+are not protected against signals or other multithreaded uses.
+The following analogies to standard I/O library functions
+have been defined:
+</para>
+<para>
+<!-- .LP -->
+These should be used in place of any calls you would make to the normal
+C library functions.
+</para>
+<para>
+<!-- .LP -->
+If you need a single scratch buffer inside a critical section 
+(for example, to pack and unpack data to and from the wire protocol),
+the general memory allocators may be too expensive to use
+(particularly in output functions, which are performance critical).  
+The following function returns a scratch buffer for use within a
+critical section:
+</para>
+<indexterm significance="preferred"><primary>_XAllocScratch</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='_XAllocScratch'>
+<funcprototype>
+  <funcdef>char *<function>_XAllocScratch</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>unsigned long <parameter>nbytes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>nbytes</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of bytes required.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+This storage must only be used inside of a critical section of your
+stub.  The returned pointer cannot be assumed valid after any call
+that might permit another thread to execute inside Xlib.  For example,
+the pointer cannot be assumed valid after any use of the
+<function>GetReq</function>
+or
+<xref linkend='Data' xrefstyle='select: title'/>
+families of macros,
+after any use of
+<xref linkend='_XReply' xrefstyle='select: title'/>,
+or after any use of the
+<function>_XSend</function>
+or
+<xref linkend='_XRead' xrefstyle='select: title'/>
+families of functions.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+The following function returns a scratch buffer for use across
+critical sections:
+</para>
+<indexterm significance="preferred"><primary>_XAllocTemp</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='_XAllocTemp'>
+<funcprototype>
+  <funcdef>char *<function>_XAllocTemp</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>unsigned long <parameter>nbytes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>nbytes</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of bytes required.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+This storage can be used across calls that might permit another thread to
+execute inside Xlib.  The storage must be explicitly returned to Xlib.
+The following function returns the storage:
+</para>
+<indexterm significance="preferred"><primary>_XFreeTemp</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='_XFreeTemp'>
+<funcprototype>
+  <funcdef>void <function>_XFreeTemp</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>char *<parameter>buf</parameter></paramdef>
+  <paramdef>unsigned long <parameter>nbytes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>buf</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the buffer to return.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nbytes</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the size of the buffer.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+You must pass back the same pointer and size that were returned by
+<xref linkend='_XAllocTemp' xrefstyle='select: title'/>.
+</para>
+</sect2>
+<sect2 id="Portability_Considerations">
+<title>Portability Considerations</title>
+<para>
+<!-- .LP -->
+Many machine architectures
+do not correctly or efficiently access data at unaligned locations;
+their compilers pad out structures to preserve this characteristic.
+Many other machines capable of unaligned references pad inside of structures
+as well to preserve alignment, because accessing aligned data is
+usually much faster.
+Because the library and the server use structures to access data at
+arbitrary points in a byte stream,
+all data in request and reply packets <emphasis remap='I'>must</emphasis> be naturally aligned;
+that is, 16-bit data starts on 16-bit boundaries in the request
+and 32-bit data on 32-bit boundaries.
+All requests <emphasis remap='I'>must</emphasis> be a multiple of 32 bits in length to preserve
+the natural alignment in the data stream.
+You must pad structures out to 32-bit boundaries.
+Pad information does not have to be zeroed unless you want to
+preserve such fields for future use in your protocol requests,
+but it is recommended to zero it to avoid inadvertent data leakage
+and improve compressability.
+Floating point varies radically between machines and should be
+avoided completely if at all possible.
+</para>
+<para>
+<!-- .LP -->
+This code may run on machines with 16-bit ints.  
+So, if any integer argument, variable, or return value either can take 
+only nonnegative values or is declared as a
+<type>CARD16</type>
+in the protocol, be sure to declare it as
+<type>unsigned</type>
+<type>int</type>
+and not as
+<type>int</type>.
+(This, of course, does not apply to Booleans or enumerations.)
+</para>
+<para>
+<!-- .LP -->
+Similarly, 
+if any integer argument or return value is declared
+<type>CARD32</type>
+in the protocol, 
+declare it as an
+<type>unsigned</type>
+<type>long</type>
+and not as
+<type>int</type>
+or
+<type>long</type>.
+This also goes for any internal variables that may
+take on values larger than the maximum 16-bit
+<type>unsigned</type>
+<type>int</type>.
+</para>
+<para>
+<!-- .LP -->
+The library has always assumed that a
+<type>char</type>
+is 8 bits, a
+<type>short</type>
+is 16 bits, an
+<type>int</type>
+is 16 or 32 bits, and a
+<type>long</type>
+is 32 bits.
+Unfortunately, this assumption remains on machines where a <type>long</type>
+can hold 64-bits, and many functions and structures require unnecessarily
+large fields to avoid breaking compatibility with existing code.  Special
+care must be taken with arrays of values that are transmitted in the
+protocol as CARD32 or INT32 but have to be converted to arrays of 64-bit
+<type>long</type> when passed to or from client applications.
+</para>
+<para>
+The 
+<function>PackData</function>
+macro is a half-hearted attempt to deal with the possibility of 32 bit shorts. 
+However, much more work is needed to make this work properly.
+</para>
+</sect2>
+<sect2 id="Deriving_the_Correct_Extension_Opcode">
+<title>Deriving the Correct Extension Opcode</title>
+<para>
+<!-- .LP -->
+The remaining problem a writer of an extension stub procedure faces that
+the core protocol does not face is to map from the call to the proper
+major and minor opcodes.  
+While there are a number of strategies, 
+the simplest and fastest is outlined below.
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Declare an array of pointers, _NFILE long (this is normally found
+in 
+<filename class="headerfile">&lt;stdio.h&gt;</filename>
+and is the number of file descriptors supported on the system)
+of type 
+<structname>XExtCodes</structname>.
+Make sure these are all initialized to NULL.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+When your stub is entered, your initialization test is just to use
+the display pointer passed in to access the file descriptor and an index
+into the array.  
+If the entry is NULL, then this is the first time you
+are entering the procedure for this display.  
+Call your initialization procedure and pass to it the display pointer.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Once in your initialization procedure, call 
+<xref linkend='XInitExtension' xrefstyle='select: title'/>;
+if it succeeds, store the pointer returned into this array.  
+Make sure to establish a close display handler to allow you to zero the entry.
+Do whatever other initialization your extension requires.
+(For example, install event handlers and so on.)
+Your initialization procedure would normally return a pointer to the
+<structname>XExtCodes</structname>
+structure for this extension, which is what would normally
+be found in your array of pointers.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+After returning from your initialization procedure, 
+the stub can now continue normally, because it has its major opcode safely 
+in its hand in the 
+<structname>XExtCodes</structname>
+structure.
+<!-- .bp -->
+    </para>
+  </listitem>
+</itemizedlist>
+</sect2>
+</sect1>
+</appendix>
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH01.xml
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH01.xml	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH01.xml	(revision 5)
@@ -0,0 +1,846 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+	  "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+<chapter id="Introduction_to_Xlib"><title>Introduction to Xlib</title>
+
+  <para>
+The X Window System is a network-transparent window system that was
+designed at MIT. X display servers run on computers with either
+monochrome or color bitmap display hardware. The server distributes
+user input to and accepts output requests from various client programs
+located either on the same machine or elsewhere in the network. Xlib
+is a C subroutine library that application programs (clients) use to
+interface with the window system by means of a stream connection.
+Although a client usually runs on the same machine as the X server
+it is talking to, this need not be the case.
+  </para>
+  <para>
+<citetitle>Xlib − C Language X Interface</citetitle> is a reference
+guide to the low-level C language interface to the X Window System
+protocol. It is neither a tutorial nor a user’s guide to programming
+the X Window System. Rather, it provides a detailed description of
+each function in the library as well as a discussion of the related
+background information. <citetitle>Xlib − C Language X Interface</citetitle>
+assumes a basic understanding of a graphics window system and of the C
+programming language. Other higher-level abstractions (for example,
+those provided by the toolkits for X) are built on top of the Xlib
+library. For further information about these higher-level libraries,
+see the appropriate toolkit documentation.
+The <citetitle>X Window System Protocol</citetitle> provides the
+definitive word on the behavior of X.
+Although additional information appears here, the protocol document is
+the ruling document.
+  </para>
+  <para>
+To provide an introduction to X programming, this chapter discusses:
+
+    <itemizedlist>
+      <listitem><para><link linkend="Overview_of_the_X_Window_System">Overview of the X Window System</link></para></listitem>
+      <listitem><para><link linkend="Errors">Errors</link></para></listitem>
+      <listitem><para><link linkend="Standard_Header_Files">Standard header files</link></para></listitem>
+      <listitem><para><link linkend="Generic_Values_and_Types">Generic values and types</link></para></listitem>
+      <listitem><para><link linkend="Naming_and_Argument_Conventions_within_Xlib">Naming and argument conventions within Xlib</link></para></listitem>
+      <listitem><para><link linkend="Programming_Considerations">Programming considerations</link></para></listitem>
+      <listitem><para><link linkend="Character_Sets_and_Encodings">Character sets and encodings</link></para></listitem>
+      <listitem><para><link linkend="Formatting_Conventions">Formatting conventions</link></para></listitem>
+    </itemizedlist>
+  </para>
+
+  <sect1 id="Overview_of_the_X_Window_System">
+    <title>Overview of the X Window System</title>
+    <para>
+Some of the terms used in this book are unique to X,
+and other terms that are common to other window systems
+have different meanings in X. You may find it helpful to refer to
+<link linkend="glossary">the glossary</link>,
+which is located at the end of the book.
+    </para>
+    <para>
+The X Window System supports one or more screens containing
+overlapping windows or subwindows.
+<indexterm><primary>Screen</primary></indexterm>
+A <firstterm>screen</firstterm> is a physical monitor and hardware
+that can be color, grayscale, or monochrome.
+There can be multiple screens for each display or workstation.
+A single X server can provide display services for any number of screens.
+A set of screens for a single user with one keyboard and one pointer
+(usually a mouse) is called a <firstterm>display</firstterm>.
+    </para>
+    <para>
+All the windows in an X server are arranged in strict hierarchies.
+At the top of each hierarchy is a <firstterm>root window</firstterm>,
+which covers each of the display screens.
+Each root window is partially or completely covered by child windows.
+All windows, except for root windows, have parents.
+There is usually at least one window for each application program.
+<indexterm><primary>Child window</primary></indexterm>
+<indexterm><primary>Parent Window</primary></indexterm>
+Child windows may in turn have their own children.
+In this way,
+an application program can create an arbitrarily deep tree
+on each screen.
+X provides graphics, text, and raster operations for windows.
+    </para>
+    <para>
+A child window can be larger than its parent.
+That is, part or all of
+the child window can extend beyond the boundaries of the parent,
+but all output to a window is clipped by its parent.
+<indexterm><primary>Stacking order</primary></indexterm>
+If several children of a window have overlapping locations,
+one of the children is considered to be on top of or raised over the
+others, thus obscuring them.
+Output to areas covered by other windows is suppressed by the window
+system unless the window has backing store.
+If a window is obscured by a second window,
+the second window obscures only those ancestors of the second window
+that are also ancestors of the first window.
+    </para>
+    <para>
+<indexterm significance="preferred"><primary>Window</primary></indexterm>
+A window has a border zero or more pixels in width, which can
+be any pattern (pixmap) or solid color you like.
+A window usually but not always has a background pattern,
+which will be repainted by the window system when uncovered.
+Child windows obscure their parents,
+and graphic operations in the parent window usually
+are clipped by the children.
+    </para>
+    <para>
+Each window and pixmap has its own coordinate system.
+The coordinate system has the X axis horizontal and the Y axis vertical
+with the origin [0, 0] at the upper-left corner.
+Coordinates are integral,
+in terms of pixels,
+and coincide with pixel centers.
+For a window,
+the origin is inside the border at the inside, upper-left corner.
+    </para>
+    <para>
+X does not guarantee to preserve the contents of windows.
+When part or all of a window is hidden and then brought back onto the screen,
+its contents may be lost.
+The server then sends the client program an
+<systemitem class="event">Expose</systemitem>
+event to notify it that part or all of the window needs to be repainted.
+Programs must be prepared to regenerate the contents of windows on demand.
+    </para>
+    <para>
+<indexterm><primary>Pixmap</primary></indexterm>
+<indexterm><primary>Drawable</primary></indexterm>
+<indexterm><primary>Tile</primary></indexterm>
+<indexterm><primary>Bitmap</primary></indexterm>
+X also provides off-screen storage of graphics objects,
+called <firstterm linkend="glossary:Pixmap">pixmaps</firstterm>.
+Single plane (depth 1) pixmaps are sometimes referred to as
+<firstterm>bitmaps</firstterm>.
+Pixmaps can be used in most graphics functions interchangeably with
+windows and are used in various graphics operations to define patterns or tiles.
+Windows and pixmaps together are referred to as drawables.
+    </para>
+    <para>
+Most of the functions in Xlib just add requests to an output buffer.
+These requests later execute asynchronously on the X server.
+Functions that return values of information stored in
+the server do not return (that is, they block)
+until an explicit reply is received or an error occurs.
+You can provide an error handler,
+which will be called when the error is reported.
+    </para>
+    <para>
+<indexterm><primary>XSync</primary></indexterm>
+If a client does not want a request to execute asynchronously,
+it can follow the request with a call to
+<xref linkend='XSync' xrefstyle='select: title'/>,
+which blocks until all previously buffered
+asynchronous events have been sent and acted on.
+As an important side effect,
+the output buffer in Xlib is always flushed by a call to any function
+that returns a value from the server or waits for input.
+    </para>
+    <para>
+<indexterm><primary>Resource IDs</primary></indexterm>
+<indexterm><primary>Resource IDs</primary><secondary>Window</secondary></indexterm>
+<indexterm><primary>Resource IDs</primary><secondary>Font</secondary></indexterm>
+<indexterm><primary>Resource IDs</primary><secondary>Pixmap</secondary></indexterm>
+<indexterm><primary>Resource IDs</primary><secondary>Colormap</secondary></indexterm>
+<indexterm><primary>Resource IDs</primary><secondary>Cursor</secondary></indexterm>
+<indexterm><primary>Resource IDs</primary><secondary>GContext</secondary></indexterm>
+Many Xlib functions will return an integer resource ID,
+which allows you to refer to objects stored on the X server.
+These can be of type
+<type>Window</type>,
+<type>Font</type>,
+<type>Pixmap</type>,
+<type>Colormap</type>,
+<type>Cursor</type>,
+and
+<type>GContext</type>,
+as defined in the file
+<filename class="headerfile">&lt;X11/X.h&gt;</filename>.
+<indexterm type="file"><primary><filename class="headerfile">X11/X.h</filename></primary></indexterm>
+<indexterm><primary>Files</primary><secondary><filename class="headerfile">&lt;X11/X.h&gt;</filename></secondary></indexterm>
+<indexterm><primary>Headers</primary><secondary><filename class="headerfile">&lt;X11/X.h&gt;</filename></secondary></indexterm>
+These resources are created by requests and are destroyed
+(or freed) by requests or when connections are closed.
+Most of these resources are potentially shareable between
+applications, and in fact, windows are manipulated explicitly by
+window manager programs.
+Fonts and cursors are shared automatically across multiple screens.
+Fonts are loaded and unloaded as needed and are shared by multiple clients.
+Fonts are often cached in the server.
+Xlib provides no support for sharing graphics contexts between applications.
+    </para>
+    <para>
+<indexterm><primary>Event</primary></indexterm>
+Client programs are informed of events.
+Events may either be side effects of a request (for example, restacking windows
+generates
+<systemitem class="event">Expose</systemitem>
+events) or completely asynchronous (for example, from the keyboard).
+A client program asks to be informed of events.
+Because other applications can send events to your application,
+programs must be prepared to handle (or ignore) events of all types.
+    </para>
+    <para>
+Input events (for example, a key pressed or the pointer moved)
+arrive asynchronously from the server and are queued until they are
+requested by an explicit call (for example,
+<xref linkend='XNextEvent' xrefstyle='select: title'/>
+or
+<xref linkend='XWindowEvent' xrefstyle='select: title'/>).
+In addition, some library
+functions (for example,
+<xref linkend='XRaiseWindow' xrefstyle='select: title'/>)
+generate
+<symbol>Expose</symbol>
+and
+<symbol>ConfigureRequest</symbol>
+events.
+These events also arrive asynchronously, but the client may
+<indexterm><primary>XSync</primary></indexterm>
+wish to explicitly wait for them by calling
+<xref linkend='XSync' xrefstyle='select: title'/>
+after calling a function that can cause the server to generate events.
+    </para>
+  </sect1>
+
+  <sect1 id="Errors">
+    <title>Errors</title>
+
+    <para>
+Some functions return
+<type>Status</type>,
+an integer error indication.
+If the function fails, it returns a zero.
+If the function returns a status of zero,
+it has not updated the return arguments.
+<indexterm><primary>Status</primary></indexterm>
+Because C does not provide multiple return values,
+many functions must return their results by writing into client-passed storage.
+<indexterm><primary>Error</primary><secondary>handling</secondary></indexterm>
+By default, errors are handled either by a standard library function
+or by one that you provide.
+Functions that return pointers to strings return NULL pointers if
+the string does not exist.
+    </para>
+    <para>
+The X server reports protocol errors at the time that it detects them.
+If more than one error could be generated for a given request,
+the server can report any of them.
+    </para>
+    <para>
+Because Xlib usually does not transmit requests to the server immediately
+(that is, it buffers them), errors can be reported much later than they
+actually occur.
+For debugging purposes, however,
+Xlib provides a mechanism for forcing synchronous behavior
+(see <link linkend="Enabling_or_Disabling_Synchronization">section 11.8.1</link>).
+When synchronization is enabled,
+errors are reported as they are generated.
+    </para>
+    <para>
+When Xlib detects an error,
+it calls an error handler,
+which your program can provide.
+If you do not provide an error handler,
+the error is printed, and your program terminates.
+    </para>
+  </sect1>
+
+  <sect1 id="Standard_Header_Files">
+    <title>Standard Header Files</title>
+
+    <para>
+The following include files are part of the Xlib standard:
+<indexterm><primary>Headers</primary></indexterm>
+
+<variablelist>
+  <varlistentry id="Standard_Header_Files:Xlib.h">
+    <term><filename class="headerfile">&lt;X11/Xlib.h&gt;</filename></term>
+    <listitem>
+      <indexterm type="file"><primary><filename class="headerfile">X11/Xlib.h</filename></primary></indexterm>
+      <indexterm><primary>Files</primary><secondary>&lt;X11/Xlib.h&gt;</secondary></indexterm>
+      <indexterm><primary>Headers</primary><secondary>&lt;X11/Xlib.h&gt;</secondary></indexterm>
+      <para>
+This is the main header file for Xlib.
+The majority of all Xlib symbols are declared by including this file.
+This file also contains the preprocessor symbol
+<symbol>XlibSpecificationRelease</symbol>.
+<indexterm significance="preferred"><primary>XlibSpecificationRelease</primary></indexterm>
+This symbol is defined to have the 6 in this release of the standard.
+(Release 5 of Xlib was the first release to have this symbol.)
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry id="Standard_Header_Files:X.h">
+    <term><filename class="headerfile">&lt;X11/X.h&gt;</filename></term>
+    <listitem>
+      <indexterm type="file"><primary><filename class="headerfile">X11/X.h</filename></primary></indexterm>
+      <indexterm><primary>Files</primary><secondary>&lt;X11/X.h&gt;</secondary></indexterm>
+      <indexterm><primary>Headers</primary><secondary>&lt;X11/X.h&gt;</secondary></indexterm>
+      <para>
+This file declares types and constants for the X protocol that are
+to be used by applications.  It is included automatically from
+<filename class="headerfile">&lt;X11/Xlib.h&gt;</filename>
+so application code should never need to
+reference this file directly.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry id="Standard_Header_Files:Xcms.h">
+    <term><filename class="headerfile">&lt;X11/Xcms.h&gt;</filename></term>
+    <listitem>
+      <indexterm type="file"><primary><filename class="headerfile">X11/Xcms.h</filename></primary></indexterm>
+      <indexterm><primary>Files</primary><secondary>&lt;X11/Xcms.h&gt;</secondary></indexterm>
+      <indexterm><primary>Headers</primary><secondary>&lt;X11/Xcms.h&gt;</secondary></indexterm>
+      <para>
+This file contains symbols for much of the color management facilities
+described in <link linkend='Color_Management_Functions'>chapter 6</link>.
+All functions, types, and symbols with the prefix "Xcms",
+plus the Color Conversion Contexts macros, are declared in this file.
+<filename class="headerfile">&lt;X11/Xlib.h&gt;</filename>
+must be included before including this file.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry id="Standard_Header_Files:Xutil.h">
+    <term><filename class="headerfile">&lt;X11/Xutil.h&gt;</filename></term>
+    <listitem>
+      <indexterm type="file"><primary><filename class="headerfile">X11/Xutil.h</filename></primary></indexterm>
+      <indexterm><primary>Files</primary><secondary>&lt;X11/Xutil.h&gt;</secondary></indexterm>
+      <indexterm><primary>Headers</primary><secondary>&lt;X11/Xutil.h&gt;</secondary></indexterm>
+      <para>
+This file declares various functions, types, and symbols used for
+inter-client communication and application utility functions,
+which are described in chapters
+<link linkend='Inter_Client_Communication_Functions'>14</link> and
+<link linkend='Application_Utility_Functions'>16</link>.
+<filename class="headerfile">&lt;X11/Xlib.h&gt;</filename> must be included before including this file.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry id="Standard_Header_Files:Xresource.h">
+    <term><filename class="headerfile">&lt;X11/Xresource.h&gt;</filename></term>
+    <listitem>
+      <indexterm type="file"><primary><filename class="headerfile">X11/Xresource.h</filename></primary></indexterm>
+      <indexterm><primary>Files</primary><secondary>&lt;X11/Xresource.h&gt;</secondary></indexterm>
+      <indexterm><primary>Headers</primary><secondary>&lt;X11/Xresource.h&gt;</secondary></indexterm>
+      <para>
+This file declares all functions, types, and symbols for the
+resource manager facilities, which are described in
+<link linkend='Resource_Manager_Functions'>chapter 15</link>.
+<filename class="headerfile">&lt;X11/Xlib.h&gt;</filename> <!-- xref -->
+must be included before including this file.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry id="Standard_Header_Files:Xatom.h">
+    <term><filename class="headerfile">&lt;X11/Xatom.h&gt;</filename></term>
+    <listitem>
+      <indexterm type="file"><primary><filename class="headerfile">X11/Xatom.h</filename></primary></indexterm>
+      <indexterm><primary>Files</primary><secondary>&lt;X11/Xatom.h&gt;</secondary></indexterm>
+      <indexterm><primary>Headers</primary><secondary>&lt;X11/Xatom.h&gt;</secondary></indexterm>
+      <para>
+This file declares all predefined atoms,
+which are symbols with the prefix "XA_".
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry id="Standard_Header_Files:cursorfont.h">
+    <term><filename class="headerfile">&lt;X11/cursorfont.h&gt;</filename></term>
+    <listitem>
+      <indexterm type="file"><primary><filename class="headerfile">X11/cursorfont.h</filename></primary></indexterm>
+      <indexterm><primary>Files</primary><secondary>&lt;X11/cursorfont.h&gt;</secondary></indexterm>
+      <indexterm><primary>Headers</primary><secondary>&lt;X11/cursorfont.h&gt;</secondary></indexterm>
+      <para>
+This file declares the cursor symbols for the standard cursor font,
+which are listed in <link linkend="x_font_cursors">Appendix B</link>.
+All cursor symbols have the prefix "XC_".
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry id="Standard_Header_Files:keysymdef.h">
+    <term><filename class="headerfile">&lt;X11/keysymdef.h&gt;</filename></term>
+    <listitem>
+      <indexterm type="file"><primary><filename class="headerfile">X11/keysymdef.h</filename></primary></indexterm>
+      <indexterm><primary>Files</primary><secondary>&lt;X11/keysymdef.h&gt;</secondary></indexterm>
+      <indexterm><primary>Headers</primary><secondary>&lt;X11/keysymdef.h&gt;</secondary></indexterm>
+      <para>
+This file declares all standard KeySym values,
+which are symbols with the prefix "XK_".
+The KeySyms are arranged in groups, and a preprocessor symbol controls
+inclusion of each group.  The preprocessor symbol must be defined
+prior to inclusion of the file to obtain the associated values.
+The preprocessor symbols are
+<symbol>XK_MISCELLANY</symbol>,
+<symbol>XK_XKB_KEYS</symbol>,
+<symbol>XK_3270</symbol>,
+<symbol>XK_LATIN1</symbol>,
+<symbol>XK_LATIN2</symbol>,
+<symbol>XK_LATIN3</symbol>,
+<symbol>XK_LATIN4</symbol>,
+<symbol>XK_KATAKANA</symbol>,
+<symbol>XK_ARABIC</symbol>,
+<symbol>XK_CYRILLIC</symbol>,
+<symbol>XK_GREEK</symbol>,
+<symbol>XK_TECHNICAL</symbol>,
+<symbol>XK_SPECIAL</symbol>,
+<symbol>XK_PUBLISHING</symbol>,
+<symbol>XK_APL</symbol>,
+<symbol>XK_HEBREW</symbol>,
+<symbol>XK_THAI</symbol>, and
+<symbol>XK_KOREAN</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry id="Standard_Header_Files:keysym.h">
+    <term><filename class="headerfile">&lt;X11/keysym.h&gt;</filename></term>
+    <listitem>
+      <indexterm type="file"><primary><filename class="headerfile">X11/keysym.h</filename></primary></indexterm>
+      <indexterm><primary>Files</primary><secondary>&lt;X11/keysym.h&gt;</secondary></indexterm>
+      <indexterm><primary>Headers</primary><secondary>&lt;X11/keysym.h&gt;</secondary></indexterm>
+      <para>
+This file defines the preprocessor symbols
+<symbol>XK_MISCELLANY</symbol>,
+<symbol>XK_XKB_KEYS</symbol>,
+<symbol>XK_LATIN1</symbol>,
+<symbol>XK_LATIN2</symbol>,
+<symbol>XK_LATIN3</symbol>,
+<symbol>XK_LATIN4</symbol>, and
+<symbol>XK_GREEK</symbol>
+and then includes <filename class="headerfile">&lt;X11/keysymdef.h&gt;</filename>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry id="Standard_Header_Files:Xlibint.h">
+    <term><filename class="headerfile">&lt;X11/Xlibint.h&gt;</filename></term>
+    <listitem>
+      <indexterm type="file"><primary><filename class="headerfile">X11/Xlibint.h</filename></primary></indexterm>
+      <indexterm><primary>Files</primary><secondary>&lt;X11/Xlibint.h&gt;</secondary></indexterm>
+      <indexterm><primary>Headers</primary><secondary>&lt;X11/Xlibint.h&gt;</secondary></indexterm>
+      <para>
+This file declares all the functions, types, and symbols used for
+extensions, which are described in <link linkend="extensions">Appendix C</link>.
+This file automatically includes
+<filename class="headerfile">&lt;X11/Xlib.h&gt;</filename>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry id="Standard_Header_Files:Xproto.h">
+    <term><filename class="headerfile">&lt;X11/Xproto.h&gt;</filename></term>
+    <listitem>
+      <indexterm type="file"><primary><filename class="headerfile">X11/Xproto.h</filename></primary></indexterm>
+      <indexterm><primary>Files</primary><secondary>&lt;X11/Xproto.h&gt;</secondary></indexterm>
+      <indexterm><primary>Headers</primary><secondary>&lt;X11/Xproto.h&gt;</secondary></indexterm>
+      <para>
+This file declares types and symbols for the basic X protocol,
+for use in implementing extensions.
+It is included automatically from
+<filename class="headerfile">&lt;X11/Xlibint.h&gt;</filename>,
+so application and extension code should never need to
+reference this file directly.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry id="Standard_Header_Files:Xprotostr.h">
+    <term><filename class="headerfile">&lt;X11/Xprotostr.h&gt;</filename></term>
+    <listitem>
+      <indexterm type="file"><primary><filename class="headerfile">X11/Xprotostr.h</filename></primary></indexterm>
+      <indexterm><primary>Files</primary><secondary>&lt;X11/Xprotostr.h&gt;</secondary></indexterm>
+      <indexterm><primary>Headers</primary><secondary>&lt;X11/Xprotostr.h&gt;</secondary></indexterm>
+      <para>
+This file declares types and symbols for the basic X protocol,
+for use in implementing extensions.
+It is included automatically from
+<filename class="headerfile">&lt;X11/Xproto.h&gt;</filename>,
+so application and extension code should never need to
+reference this file directly.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry id="Standard_Header_Files:X10.h">
+    <term><filename class="headerfile">&lt;X11/X10.h&gt;</filename></term>
+    <listitem>
+      <indexterm type="file"><primary><filename class="headerfile">X11/X10.h</filename></primary></indexterm>
+      <indexterm><primary>Files</primary><secondary>&lt;X11/X10.h&gt;</secondary></indexterm>
+      <indexterm><primary>Headers</primary><secondary>&lt;X11/X10.h&gt;</secondary></indexterm>
+      <para>
+This file declares all the functions, types, and symbols used for the
+X10 compatibility functions, which are described in
+<link linkend="X_Version_10_Compatibility_Functions">Appendix D</link>.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+    </para>
+  </sect1>
+
+  <sect1 id="Generic_Values_and_Types">
+    <title>Generic Values and Types</title>
+
+    <para>
+The following symbols are defined by Xlib and used throughout the manual:
+<itemizedlist>
+  <listitem>
+    <para>
+<indexterm significance="preferred"><primary>Bool</primary></indexterm>
+<indexterm significance="preferred"><primary>True</primary></indexterm>
+<indexterm significance="preferred"><primary>False</primary></indexterm>
+Xlib defines the type
+<type>Bool</type>
+and the Boolean values
+<symbol>True</symbol>
+and
+<symbol>False</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<indexterm significance="preferred"><primary>None</primary></indexterm>
+<symbol>None</symbol>
+is the universal null resource ID or atom.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<indexterm significance="preferred"><primary>XID</primary></indexterm>
+The type
+<type>XID</type>
+is used for generic resource IDs.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<indexterm significance="preferred"><primary>XPointer</primary></indexterm>
+The type <type>XPointer</type> is defined to be <type>char&hairsp;*</type>
+and is used as a generic opaque pointer to data.
+    </para>
+  </listitem>
+</itemizedlist>
+    </para>
+  </sect1>
+
+  <sect1 id="Naming_and_Argument_Conventions_within_Xlib">
+    <title>Naming and Argument Conventions within Xlib</title>
+
+    <para>
+Xlib follows a number of conventions for the naming and syntax of the functions.
+Given that you remember what information the function requires,
+these conventions are intended to make the syntax of the functions more
+predictable.
+    </para>
+    <para>
+The major naming conventions are:
+<itemizedlist>
+  <listitem>
+    <para>
+To differentiate the X symbols from the other symbols,
+the library uses mixed case for external symbols.
+It leaves lowercase for variables and all uppercase for user macros,
+as per existing convention.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+All Xlib functions begin with a capital X.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The beginnings of all function names and symbols are capitalized.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+All user-visible data structures begin with a capital X.
+More generally,
+anything that a user might dereference begins with a capital X.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Macros and other symbols do not begin with a capital X.
+To distinguish them from all user symbols,
+each word in the macro is capitalized.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+All elements  of or variables in a data structure are in lowercase.
+Compound words, where needed, are constructed with underscores (_).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The display argument, where used, is always first in the argument list.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+All resource objects, where used, occur at the beginning of the argument list
+immediately after the display argument.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+When a  graphics context is present together with
+another type of resource (most commonly, a drawable), the
+graphics context occurs in the argument list after the other
+resource.
+Drawables outrank all other resources.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Source arguments always precede the destination arguments in the argument list.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The x argument always precedes the y argument in the argument list.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The width argument always precedes the height argument in the argument list.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Where the x, y, width, and height arguments are used together,
+the x and y arguments always precede the width and height arguments.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Where a mask is accompanied with a structure,
+the mask always precedes the pointer to the structure in the argument list.
+    </para>
+  </listitem>
+</itemizedlist>
+    </para>
+  </sect1>
+
+  <sect1 id="Programming_Considerations">
+    <title>Programming Considerations</title>
+
+    <para>
+The major programming considerations are:
+<itemizedlist>
+  <listitem>
+    <para>
+Coordinates and sizes in X are actually 16-bit quantities.
+This decision was made to minimize the bandwidth required for a
+given level of performance.
+Coordinates usually are declared as an
+<type>int</type>
+in the interface.
+Values larger than 16 bits are truncated silently.
+Sizes (width and height) are declared as unsigned quantities.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Keyboards are the greatest variable between different
+manufacturers' workstations.
+If you want your program to be portable,
+you should be particularly conservative here.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Many display systems have limited amounts of off-screen memory.
+If you can, you should minimize use of pixmaps and backing
+store.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The user should have control of their screen real estate.
+Therefore, you should write your applications to react to window management
+rather than presume control of the entire screen.
+What you do inside of your top-level window, however,
+is up to your application.
+For further information,
+see <link linkend='Inter_Client_Communication_Functions'>chapter 14</link>
+and the <citetitle>Inter-Client Communication Conventions Manual</citetitle>.
+    </para>
+  </listitem>
+</itemizedlist>
+    </para>
+  </sect1>
+
+  <sect1 id="Character_Sets_and_Encodings">
+    <title>Character Sets and Encodings</title>
+
+    <para>
+Some of the Xlib functions make reference to specific character sets
+and character encodings.
+The following are the most common:
+
+<variablelist>
+  <varlistentry>
+    <term><firstterm>X Portable Character Set</firstterm></term>
+    <listitem><para>
+A basic set of 97 characters,
+which are assumed to exist in all locales supported by Xlib.
+This set contains the following characters:
+<literallayout>
+a..z A..Z 0..9 !"#$%&amp;'()*+,-./:;&lt;=&gt;?@[\\]^_`{|}~ &lt;space&gt;, &lt;tab&gt;, and &lt;newline&gt;
+</literallayout>
+      </para>
+      <para>
+This set is the left/lower half
+of the graphic character set of ISO8859-1 plus space, tab, and newline.
+It is also the set of graphic characters in 7-bit ASCII plus the same
+three control characters.
+The actual encoding of these characters on the host is system dependent.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><firstterm>Host Portable Character Encoding</firstterm></term>
+    <listitem>
+      <para>
+The encoding of the X Portable Character Set on the host.
+The encoding itself is not defined by this standard,
+but the encoding must be the same in all locales supported by Xlib on the host.
+If a string is said to be in the Host Portable Character Encoding,
+then it only contains characters from the X Portable Character Set,
+in the host encoding.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><firstterm>Latin-1</firstterm></term>
+    <listitem>
+      <para>
+The coded character set defined by the ISO8859-1 standard.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><firstterm>Latin Portable Character Encoding</firstterm></term>
+    <listitem>
+      <para>
+The encoding of the X Portable Character Set using the Latin-1 codepoints
+plus ASCII control characters.
+If a string is said to be in the Latin Portable Character Encoding,
+then it only contains characters from the X Portable Character Set,
+not all of Latin-1.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><firstterm>STRING Encoding</firstterm></term>
+    <listitem>
+      <para>
+Latin-1, plus tab and newline.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><firstterm><acronym>POSIX</acronym> Portable Filename Character Set</firstterm></term>
+    <listitem>
+      <para>
+The set of 65 characters,
+which can be used in naming files on a <acronym>POSIX</acronym>-compliant host,
+that are correctly processed in all locales.
+The set is:
+<literallayout>
+a..z A..Z 0..9 ._-
+</literallayout>
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+    </para>
+  </sect1>
+
+  <sect1 id="Formatting_Conventions">
+    <title>Formatting Conventions</title>
+
+    <para>
+      <citetitle>Xlib − C Language X Interface</citetitle> uses the
+      following conventions:
+
+      <itemizedlist>
+	<listitem>
+	  <para>
+Global symbols are printed in
+<function>this</function>
+<function>special</function>
+<function>font</function>.
+These can be either function names,
+symbols defined in include files, or structure names.
+When declared and defined,
+function arguments are printed in <emphasis remap='I'>italics</emphasis>.
+In the explanatory text that follows,
+they usually are printed in regular type.
+	  </para>
+	</listitem>
+	<listitem>
+	  <para>
+Each function is introduced by a general discussion that
+distinguishes it from other functions.
+The function declaration itself follows,
+and each argument is specifically explained.
+Although ANSI C function prototype syntax is not used,
+Xlib header files normally declare functions using function prototypes
+in ANSI C environments.
+General discussion of the function, if any is required,
+follows the arguments.
+Where applicable,
+the last paragraph of the explanation lists the possible
+Xlib error codes that the function can generate.
+For a complete discussion of the Xlib error codes,
+see <link linkend="Using_the_Default_Error_Handlers">section 11.8.2</link>.
+	  </para>
+	</listitem>
+	<listitem>
+	  <para>
+To eliminate any ambiguity between those arguments that you pass and those that
+a function returns to you,
+the explanations for all arguments that you pass start with the word
+<emphasis remap='I'>specifies</emphasis> or, in the case of multiple arguments, the word <emphasis remap='I'>specify</emphasis>.
+The explanations for all arguments that are returned to you start with the
+word <emphasis remap='I'>returns</emphasis> or, in the case of multiple arguments, the word <emphasis remap='I'>return</emphasis>.
+The explanations for all arguments that you can pass and are returned start
+with the words <emphasis remap='I'>specifies and returns</emphasis>.
+	  </para>
+	</listitem>
+	<listitem>
+	  <para>
+Any pointer to a structure that is used to return a value is designated as
+such by the <emphasis remap='I'>_return</emphasis> suffix as part of its name.
+All other pointers passed to these functions are
+used for reading only.
+A few arguments use pointers to structures that are used for
+both input and output and are indicated by using the <emphasis remap='I'>_in_out</emphasis> suffix.
+	  </para>
+	</listitem>
+      </itemizedlist>
+    </para>
+  </sect1>
+</chapter>
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH02.xml
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH02.xml	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH02.xml	(revision 5)
@@ -0,0 +1,3652 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+	  "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+<chapter id='Display_Functions'>
+<title>Display Functions</title>
+<para>
+Before your program can use a display, you must establish a connection
+to the X server.
+Once you have established a connection,
+you then can use the Xlib macros and functions discussed in this chapter
+to return information about the display.
+This chapter discusses how to:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Open (connect to) the display
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Obtain information about the display, image formats, or screens
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Generate a
+<systemitem>NoOperation</systemitem>
+protocol request
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Free client-created data
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Close (disconnect from) a display
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Use X Server connection close operations
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Use Xlib with threads
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Use internal connections
+    </para>
+  </listitem>
+</itemizedlist>
+<sect1 id="Opening_the_Display">
+<title>Opening the Display</title>
+<!-- .XS -->
+<!-- (SN Opening the Display -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To open a connection to the X server that controls a display, use
+<xref linkend='XOpenDisplay' xrefstyle='select: title'/>.
+<indexterm significance="preferred"><primary>XOpenDisplay</primary></indexterm>
+</para>
+<funcsynopsis id='XOpenDisplay'>
+<funcprototype>
+  <funcdef>Display *<function>XOpenDisplay</function></funcdef>
+  <paramdef>char *<parameter>display_name</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display_name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the hardware display name, which determines the display
+and communications domain to be used.
+On a <acronym>POSIX</acronym>-conformant system, if the display_name is NULL, 
+it defaults to the value of the DISPLAY environment variable. 
+<indexterm><primary>Environment</primary><secondary>DISPLAY</secondary></indexterm>
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The encoding and interpretation of the display name are
+implementation-dependent.
+Strings in the Host Portable Character Encoding are supported;
+support for other characters is implementation-dependent.
+On <acronym>POSIX</acronym>-conformant systems,
+the display name or DISPLAY environment variable can be a string in the format:
+</para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA 1i -->
+<!-- .ta 1i -->
+	<emphasis remap='I'>protocol</emphasis>/<emphasis remap='I'>hostname</emphasis>:<emphasis remap='I'>number</emphasis>.<emphasis remap='I'>screen_number</emphasis>
+</literallayout>
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>protocol</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a protocol family or an alias for a protocol family.  Supported 
+protocol families are implementation dependent.  The protocol entry is 
+optional.  If protocol is not specified, the / separating protocol and 
+hostname must also not be specified.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>hostname</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the name of the host machine on which the display is physically
+attached.
+You follow the hostname with either a single colon (:) or a double colon (::).
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of the display server on that host machine.
+You may optionally follow this display number with a period (.).
+A single <acronym>CPU</acronym> can have more than one display.
+Multiple displays are usually numbered starting with zero.
+<indexterm><primary>Screen</primary></indexterm>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the screen to be used on that server.
+Multiple screens can be controlled by a single X server.
+The screen_number sets an internal variable that can be accessed by
+using the 
+<function>DefaultScreen</function>
+macro or the 
+<xref linkend='XDefaultScreen' xrefstyle='select: title'/>
+function if you are using languages other than C
+(see <link linkend='Display_Macros'>section 2.2.1</link>).
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+For example, the following would specify screen 1 of display 0 on the 
+machine named ``dual-headed'':
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+dual-headed:0.1
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+The
+<xref linkend='XOpenDisplay' xrefstyle='select: title'/>
+function returns a 
+<type>Display</type>
+structure that serves as the
+connection to the X server and that contains all the information
+about that X server.
+<xref linkend='XOpenDisplay' xrefstyle='select: title'/>
+connects your application to the X server through <acronym>TCP</acronym>
+or DECnet communications protocols,
+or through some local inter-process communication protocol.
+<indexterm><primary>Protocol</primary><secondary><acronym>TCP</acronym></secondary></indexterm>
+<indexterm><primary>Protocol</primary><secondary>DECnet</secondary></indexterm>
+If the protocol is specified as "tcp", "inet", or "inet6", or
+if no protocol is specified and the hostname is a host machine name and a single colon (:)
+separates the hostname and display number,
+<xref linkend='XOpenDisplay' xrefstyle='select: title'/>
+connects using <acronym>TCP</acronym> streams.  (If the protocol is specified as "inet", <acronym>TCP</acronym> over
+IPv4 is used.  If the protocol is specified as "inet6", <acronym>TCP</acronym> over IPv6 is used.
+Otherwise, the implementation determines which <acronym>IP</acronym> version is used.)
+If the hostname and protocol are both not specified,
+Xlib uses whatever it believes is the fastest transport.
+If the hostname is a host machine name and a double colon (::)
+separates the hostname and display number,
+<xref linkend='XOpenDisplay' xrefstyle='select: title'/>
+connects using DECnet.
+A single X server can support any or all of these transport mechanisms
+simultaneously.
+A particular Xlib implementation can support many more of these transport
+mechanisms.
+</para>
+<para>
+<!-- .LP -->
+<indexterm><primary>Display</primary></indexterm>
+If successful, 
+<xref linkend='XOpenDisplay' xrefstyle='select: title'/>
+returns a pointer to a 
+<type>Display</type>
+structure,
+which is defined in 
+<filename class="headerfile">&lt;X11/Xlib.h&gt;</filename>.
+<indexterm type="file"><primary><filename class="headerfile">X11/Xlib.h</filename></primary></indexterm>
+<indexterm><primary>Files</primary><secondary><filename class="headerfile">&lt;X11/Xlib.h&gt;</filename></secondary></indexterm>
+<indexterm><primary>Headers</primary><secondary><filename class="headerfile">&lt;X11/Xlib.h&gt;</filename></secondary></indexterm>
+If 
+<xref linkend='XOpenDisplay' xrefstyle='select: title'/>
+does not succeed, it returns NULL.
+After a successful call to
+<xref linkend='XOpenDisplay' xrefstyle='select: title'/>,
+all of the screens in the display can be used by the client.
+The screen number specified in the display_name argument is returned 
+by the 
+<function>DefaultScreen</function>
+macro (or the
+<xref linkend='XDefaultScreen' xrefstyle='select: title'/>
+function).
+You can access elements of the
+<type>Display</type>
+and
+<type>Screen</type>
+structures only by using the information macros or functions.
+For information about using macros and functions to obtain information from 
+the
+<type>Display</type>
+structure,
+see <link linkend='Display_Macros'>section 2.2.1</link>.
+</para>
+<para>
+<!-- .LP -->
+X servers may implement various types of access control mechanisms
+(see <link linkend="Controlling_Host_Access">section 9.8</link>).
+</para>
+</sect1>
+<sect1 id="Obtaining_Information_about_the_Display_Image_Formats_or_Screens">
+<title>Obtaining Information about the Display, Image Formats, or Screens</title>
+<!-- .XS -->
+<!-- (SN Obtaining Information about the Display, Image Formats, or Screens -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The Xlib library provides a number of useful macros 
+and corresponding functions that return data from the 
+<type>Display</type>
+structure.
+The macros are used for C programming, 
+and their corresponding function equivalents are for other language bindings.
+This section discusses the:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Display macros
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Image format functions and macros
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Screen information macros
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+<indexterm ><primary>Display</primary><secondary>data structure</secondary></indexterm>
+All other members of the 
+<type>Display</type>
+structure (that is, those for which no macros are defined) are private to Xlib 
+and must not be used.
+Applications must never directly modify or inspect these private members of the 
+<type>Display</type>
+structure.
+<!-- .NT Note -->
+The
+<xref linkend='XDisplayWidth' xrefstyle='select: title'/>,
+<xref linkend='XDisplayHeight' xrefstyle='select: title'/>,
+<xref linkend='XDisplayCells' xrefstyle='select: title'/>,
+<xref linkend='XDisplayPlanes' xrefstyle='select: title'/>,
+<xref linkend='XDisplayWidthMM' xrefstyle='select: title'/>,
+and
+<xref linkend='XDisplayHeightMM' xrefstyle='select: title'/>
+functions in the next sections are misnamed.
+These functions really should be named Screen<emphasis remap='I'>whatever</emphasis> 
+and XScreen<emphasis remap='I'>whatever</emphasis>, not Display<emphasis remap='I'>whatever</emphasis> or XDisplay<emphasis remap='I'>whatever</emphasis>.
+Our apologies for the resulting confusion.
+<!-- .NE -->
+</para>
+<sect2 id='Display_Macros'>
+<title>Display Macros</title>
+<!-- .XS -->
+<!-- (SN Display Macros -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Applications should not directly modify any part of the
+<type>Display</type>
+and
+<type>Screen</type>
+structures.
+The members should be considered read-only,
+although they may change as the result of other operations on the display.
+</para>
+<para>
+<!-- .LP  -->
+The following lists the C language macros,
+their corresponding function equivalents that are for other language bindings,
+and what data both can return.
+</para>
+<synopsis id='AllPlanes' role='macro'><constant>AllPlanes</constant></synopsis>
+<funcsynopsis id='XAllPlanes'>
+<funcprototype>
+  <funcdef>unsigned long <function>XAllPlanes</function></funcdef>
+  <void />
+</funcprototype>
+</funcsynopsis>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>AllPlanes</primary></indexterm>
+<indexterm significance="preferred"><primary>XAllPlanes</primary></indexterm>
+Both return a value with all bits set to 1 suitable for use in a plane argument to
+a procedure.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<indexterm significance="preferred"><primary>BlackPixel</primary></indexterm>
+<indexterm significance="preferred"><primary>XBlackPixel</primary></indexterm>
+<indexterm significance="preferred"><primary>WhitePixel</primary></indexterm>
+<indexterm significance="preferred"><primary>XWhitePixel</primary></indexterm>
+Both 
+<function>BlackPixel</function>
+and 
+<function>WhitePixel</function>
+can be used in implementing a monochrome application.
+These pixel values are for permanently allocated entries in the default
+colormap.
+The actual <acronym>RGB</acronym> (red, green, and blue) values are settable on some screens 
+and, in any case, may not actually be black or white.
+The names are intended to convey the expected relative intensity of the colors.
+<!-- .sM -->
+</para>
+<funcsynopsis id='BlackPixel'>
+<funcprototype role='macro'>
+  <funcdef><function>BlackPixel</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+  <paramdef><parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XBlackPixel'>
+<funcprototype>
+  <funcdef>unsigned long <function>XBlackPixel</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>screen_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate screen number on the host server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Both return the black pixel value for the specified screen.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='WhitePixel'>
+<funcprototype role='macro'>
+  <funcdef><function>WhitePixel</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+  <paramdef><parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XWhitePixel'>
+<funcprototype>
+  <funcdef>unsigned long <function>XWhitePixel</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>screen_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate screen number on the host server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Both return the white pixel value for the specified screen. 
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='ConnectionNumber'>
+<funcprototype role='macro'>
+  <funcdef><function>ConnectionNumber</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XConnectionNumber'>
+<funcprototype>
+  <funcdef>int <function>XConnectionNumber</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>ConnectionNumber</primary></indexterm>
+<indexterm significance="preferred"><primary>XConnectionNumber</primary></indexterm>
+Both return a connection number for the specified display.
+On a <acronym>POSIX</acronym>-conformant system,
+this is the file descriptor of the connection.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='DefaultColormap'>
+<funcprototype role='macro'>
+  <funcdef><function>DefaultColormap</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+  <paramdef><parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XDefaultColormap'>
+<funcprototype>
+  <funcdef>Colormap <function>XDefaultColormap</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>screen_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate screen number on the host server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>DefaultColormap</primary></indexterm>
+<indexterm significance="preferred"><primary>XDefaultColormap</primary></indexterm>
+Both return the default colormap ID for allocation on the specified screen.
+Most routine allocations of color should be made out of this colormap.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='DefaultDepth'>
+<funcprototype role='macro'>
+  <funcdef><function>DefaultDepth</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+  <paramdef><parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XDefaultDepth'>
+<funcprototype>
+  <funcdef>int <function>XDefaultDepth</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>screen_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate screen number on the host server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>DefaultDepth</primary></indexterm>
+<indexterm significance="preferred"><primary>XDefaultDepth</primary></indexterm>
+Both return the depth (number of planes) of the default root window for the
+specified screen.
+Other depths may also be supported on this screen (see
+<xref linkend='XMatchVisualInfo' xrefstyle='select: title'/>).
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<indexterm significance="preferred"><primary>XListDepths</primary></indexterm>
+To determine the number of depths that are available on a given screen, use
+<function>XListDepths</function>.
+<!-- .sM -->
+</para>
+<funcsynopsis id='XListDepths'>
+<funcprototype>
+  <funcdef>int *<function>XListDepths</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>screen_number</parameter></paramdef>
+  <paramdef>int *<parameter>count_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>screen_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate screen number on the host server.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of depths.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<function>XListDepths</function>
+function returns the array of depths 
+that are available on the specified screen.
+If the specified screen_number is valid and sufficient memory for the array
+can be allocated,
+<function>XListDepths</function>
+sets count_return to the number of available depths.
+Otherwise, it does not set count_return and returns NULL.
+To release the memory allocated for the array of depths, use
+<xref linkend='XFree' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='DefaultGC'>
+<funcprototype role='macro'>
+  <funcdef><function>DefaultGC</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+  <paramdef><parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XDefaultGC'>
+<funcprototype>
+  <funcdef>GC <function>XDefaultGC</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>screen_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate screen number on the host server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>DefaultGC</primary></indexterm>
+<indexterm significance="preferred"><primary>XDefaultGC</primary></indexterm>
+Both return the default graphics context for the root window of the 
+specified screen.
+This GC is created for the convenience of simple applications
+and contains the default GC components with the foreground and
+background pixel values initialized to the black and white
+pixels for the screen, respectively.
+You can modify its contents freely because it is not used in any Xlib
+function.
+This GC should never be freed.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='DefaultRootWindow'>
+<funcprototype role='macro'>
+  <funcdef><function>DefaultRootWindow</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XDefaultRootWindow'>
+<funcprototype>
+  <funcdef>Window <function>XDefaultRootWindow</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>DefaultRootWindow</primary></indexterm>
+<indexterm significance="preferred"><primary>XDefaultRootWindow</primary></indexterm>
+Both return the root window for the default screen.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='DefaultScreenOfDisplay'>
+<funcprototype role='macro'>
+  <funcdef><function>DefaultScreenOfDisplay</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XDefaultScreenOfDisplay'>
+<funcprototype>
+  <funcdef>Screen *<function>XDefaultScreenOfDisplay</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>DefaultScreenOfDisplay</primary></indexterm>
+<indexterm significance="preferred"><primary>XDefaultScreenOfDisplay</primary></indexterm>
+Both return a pointer to the default screen.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='ScreenOfDisplay'>
+<funcprototype role='macro'>
+  <funcdef><function>ScreenOfDisplay</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+  <paramdef><parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XScreenOfDisplay'>
+<funcprototype>
+  <funcdef>Screen *<function>XScreenOfDisplay</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>screen_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate screen number on the host server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>ScreenOfDisplay</primary></indexterm>
+<indexterm significance="preferred"><primary>XScreenOfDisplay</primary></indexterm>
+Both return a pointer to the indicated screen.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='DefaultScreen'>
+<funcprototype role='macro'>
+  <funcdef><function>DefaultScreen</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XDefaultScreen'>
+<funcprototype>
+  <funcdef>int <function>XDefaultScreen</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>DefaultScreen</primary></indexterm>
+<indexterm significance="preferred"><primary>XDefaultScreen</primary></indexterm>
+Both return the default screen number referenced by the 
+<xref linkend='XOpenDisplay' xrefstyle='select: title'/>
+function. 
+This macro or function should be used to retrieve the screen number 
+in applications that will use only a single screen.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='DefaultVisual'>
+<funcprototype role='macro'>
+  <funcdef><function>DefaultVisual</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+  <paramdef><parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XDefaultVisual'>
+<funcprototype>
+  <funcdef>Visual *<function>XDefaultVisual</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>screen_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate screen number on the host server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>DefaultVisual</primary></indexterm>
+<indexterm significance="preferred"><primary>XDefaultVisual</primary></indexterm>
+Both return the default visual type for the specified screen.
+For further information about visual types,
+see <link linkend="Visual_Types">section 3.1</link>.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='DisplayCells'>
+<funcprototype role='macro'>
+  <funcdef><function>DisplayCells</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+  <paramdef><parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XDisplayCells'>
+<funcprototype>
+  <funcdef>int <function>XDisplayCells</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>screen_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate screen number on the host server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>DisplayCells</primary></indexterm>
+<indexterm significance="preferred"><primary>XDisplayCells</primary></indexterm>
+Both return the number of entries in the default colormap.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='DisplayPlanes'>
+<funcprototype role='macro'>
+  <funcdef><function>DisplayPlanes</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+  <paramdef><parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XDisplayPlanes'>
+<funcprototype>
+  <funcdef>int <function>XDisplayPlanes</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>screen_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate screen number on the host server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>DisplayPlanes</primary></indexterm>
+<indexterm significance="preferred"><primary>XDisplayPlanes</primary></indexterm>
+Both return the depth of the root window of the specified screen.
+For an explanation of depth,
+see the glossary.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='DisplayString'>
+<funcprototype role='macro'>
+  <funcdef><function>DisplayString</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XDisplayString'>
+<funcprototype>
+  <funcdef>char *<function>XDisplayString</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>DisplayString</primary></indexterm>
+<indexterm significance="preferred"><primary>XDisplayString</primary></indexterm>
+Both return the string that was passed to 
+<xref linkend='XOpenDisplay' xrefstyle='select: title'/>
+when the current display was opened. 
+On <acronym>POSIX</acronym>-conformant systems,
+if the passed string was NULL, these return the value of
+the DISPLAY environment variable when the current display was opened.
+<indexterm><primary><acronym>POSIX</acronym> System Call</primary><secondary>fork</secondary></indexterm>
+These are useful to applications that invoke the 
+<function>fork</function>
+system call and want to open a new connection to the same display from the 
+child process as well as for printing error messages.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='XExtendedMaxRequestSize'>
+<funcprototype>
+  <funcdef>long <function>XExtendedMaxRequestSize</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>XExtendedMaxRequestSize</primary></indexterm>
+The
+<function>XExtendedMaxRequestSize</function>
+function returns zero if the specified display does not support an
+extended-length protocol encoding; otherwise,
+it returns the maximum request size (in 4-byte units) supported
+by the server using the extended-length encoding.
+The Xlib functions
+<xref linkend='XDrawLines' xrefstyle='select: title'/>,
+<xref linkend='XDrawArcs' xrefstyle='select: title'/>,
+<xref linkend='XFillPolygon' xrefstyle='select: title'/>,
+<xref linkend='XChangeProperty' xrefstyle='select: title'/>,
+<xref linkend='XSetClipRectangles' xrefstyle='select: title'/>,
+and
+<xref linkend='XSetRegion' xrefstyle='select: title'/>
+will use the extended-length encoding as necessary, if supported
+by the server.  Use of the extended-length encoding in other Xlib
+functions (for example,
+<xref linkend='XDrawPoints' xrefstyle='select: title'/>,
+<xref linkend='XDrawRectangles' xrefstyle='select: title'/>,
+<xref linkend='XDrawSegments' xrefstyle='select: title'/>,
+<xref linkend='XFillArcs' xrefstyle='select: title'/>,
+<xref linkend='XFillRectangles' xrefstyle='select: title'/>,
+<xref linkend='XPutImage' xrefstyle='select: title'/>)
+is permitted but not required; an Xlib implementation may choose to
+split the data across multiple smaller requests instead.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis>
+<funcprototype>
+  <funcdef>long <function>XMaxRequestSize</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>XMaxRequestSize</primary></indexterm>
+The
+<function>XMaxRequestSize</function>
+function returns the maximum request size (in 4-byte units) supported
+by the server without using an extended-length protocol encoding.
+Single protocol requests to the server can be no larger than this size
+unless an extended-length protocol encoding is supported by the server.
+The protocol guarantees the size to be no smaller than 4096 units
+(16384 bytes).
+Xlib automatically breaks data up into multiple protocol requests
+as necessary for the following functions:
+<xref linkend='XDrawPoints' xrefstyle='select: title'/>,
+<xref linkend='XDrawRectangles' xrefstyle='select: title'/>,
+<xref linkend='XDrawSegments' xrefstyle='select: title'/>,
+<xref linkend='XFillArcs' xrefstyle='select: title'/>,
+<xref linkend='XFillRectangles' xrefstyle='select: title'/>,
+and 
+<xref linkend='XPutImage' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='LastKnownRequestProcessed'>
+<funcprototype role='macro'>
+  <funcdef><function>LastKnownRequestProcessed</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XLastKnownRequestProcessed'>
+<funcprototype>
+  <funcdef>unsigned long <function>XLastKnownRequestProcessed</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>LastKnownRequestProcessed</primary></indexterm>
+<indexterm significance="preferred"><primary>XLastKnownRequestProcessed</primary></indexterm>
+Both extract the full serial number of the last request known by Xlib
+to have been processed by the X server.
+Xlib automatically sets this number when replies, events, and errors
+are received.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='NextRequest'>
+<funcprototype role='macro'>
+  <funcdef><function>NextRequest</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XNextRequest'>
+<funcprototype>
+  <funcdef>unsigned long <function>XNextRequest</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>NextRequest</primary></indexterm>
+<indexterm significance="preferred"><primary>XNextRequest</primary></indexterm>
+Both extract the full serial number that is to be used for the next
+request.
+Serial numbers are maintained separately for each display connection.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='ProtocolVersion'>
+<funcprototype role='macro'>
+  <funcdef><function>ProtocolVersion</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XProtocolVersion'>
+<funcprototype>
+  <funcdef>int <function>XProtocolVersion</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>ProtocolVersion</primary></indexterm>
+<indexterm significance="preferred"><primary>XProtocolVersion</primary></indexterm>
+Both return the major version number (11) of the X protocol associated with 
+the connected display.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='ProtocolRevision'>
+<funcprototype role='macro'>
+  <funcdef><function>ProtocolRevision</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XProtocolRevision'>
+<funcprototype>
+  <funcdef>int <function>XProtocolRevision</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>ProtocolRevision</primary></indexterm>
+<indexterm significance="preferred"><primary>XProtocolRevision</primary></indexterm>
+Both return the minor protocol revision number of the X server.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='QLength'>
+<funcprototype role='macro'>
+  <funcdef><function>QLength</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XQLength'>
+<funcprototype>
+  <funcdef>int <function>XQLength</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>QLength</primary></indexterm>
+<indexterm significance="preferred"><primary>XQLength</primary></indexterm>
+Both return the length of the event queue for the connected display.
+Note that there may be more events that have not been read into
+the queue yet (see
+<xref linkend='XEventsQueued' xrefstyle='select: title'/>).
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='RootWindow'>
+<funcprototype role='macro'>
+  <funcdef><function>RootWindow</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+  <paramdef><parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XRootWindow'>
+<funcprototype>
+  <funcdef>Window <function>XRootWindow</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>screen_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate screen number on the host server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm><primary>Window</primary><secondary>RootWindow</secondary></indexterm>
+<indexterm significance="preferred"><primary>RootWindow</primary></indexterm>
+<indexterm><primary>Window</primary><secondary>XRootWindow</secondary></indexterm>
+<indexterm significance="preferred"><primary>XRootWindow</primary></indexterm>
+Both return the root window.
+These are useful with functions that need a drawable of a particular screen
+and for creating top-level windows.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='ScreenCount'>
+<funcprototype role='macro'>
+  <funcdef><function>ScreenCount</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XScreenCount'>
+<funcprototype>
+  <funcdef>int <function>XScreenCount</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>ScreenCount</primary></indexterm>
+<indexterm significance="preferred"><primary>XScreenCount</primary></indexterm>
+Both return the number of available screens.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='ServerVendor'>
+<funcprototype role='macro'>
+  <funcdef><function>ServerVendor</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XServerVendor'>
+<funcprototype>
+  <funcdef>char *<function>XServerVendor</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>ServerVendor</primary></indexterm>
+<indexterm significance="preferred"><primary>XServerVendor</primary></indexterm>
+Both return a pointer to a null-terminated string that provides
+some identification of the owner of the X server implementation.
+If the data returned by the server is in the Latin Portable Character Encoding,
+then the string is in the Host Portable Character Encoding.
+Otherwise, the contents of the string are implementation-dependent.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='VendorRelease'>
+<funcprototype role='macro'>
+  <funcdef><function>VendorRelease</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XVendorRelease'>
+<funcprototype>
+  <funcdef>int <function>XVendorRelease</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>VendorRelease</primary></indexterm>
+<indexterm significance="preferred"><primary>XVendorRelease</primary></indexterm>
+Both return a number related to a vendor's release of the X server.
+</para>
+</sect2>
+<sect2 id="Image_Format_Functions_and_Macros">
+<title>Image Format Functions and Macros</title>
+<!-- .XS -->
+<!-- (SN Image Format Functions and Macros -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Applications are required to present data to the X server
+in a format that the server demands.
+To help simplify applications,
+most of the work required to convert the data is provided by Xlib
+(see sections
+<link linkend="Transferring_Images_between_Client_and_Server">8.7</link> and
+<link linkend="Manipulating_Images">16.8</link>).
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XPixmapFormatValues</primary></indexterm>
+The
+<structname>XPixmapFormatValues</structname>
+structure provides an interface to the pixmap format information
+that is returned at the time of a connection setup.
+It contains:
+<synopsis id='XPixmapFormatValues'>
+typedef struct {
+	<type>int</type> <structfield>depth</structfield>;
+	<type>int</type> <structfield>bits_per_pixel</structfield>;
+	<type>int</type> <structfield>scanline_pad</structfield>;
+} <structname>XPixmapFormatValues</structname>;
+</synopsis>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<!-- .sp -->
+To obtain the pixmap format information for a given display, use
+<function>XListPixmapFormats</function>.
+<indexterm significance="preferred"><primary>XListPixmapFormats</primary></indexterm>
+<!-- .sM -->
+</para>
+<funcsynopsis id='XListPixmapFormats'>
+<funcprototype>
+  <funcdef>XPixmapFormatValues *<function>XListPixmapFormats</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int *<parameter>count_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>count_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of pixmap formats that are supported by the display.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<function>XListPixmapFormats</function>
+function returns an array of
+<structname>XPixmapFormatValues</structname>
+structures that describe the types of Z format images supported
+by the specified display.
+If insufficient memory is available,
+<function>XListPixmapFormats</function>
+returns NULL.
+To free the allocated storage for the
+<structname>XPixmapFormatValues</structname>
+structures, use
+<xref linkend='XFree' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP  -->
+The following lists the C language macros,
+their corresponding function equivalents that are for other language bindings,
+and what data they both return for the specified server and screen.
+These are often used by toolkits as well as by simple applications.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='ImageByteOrder'>
+<funcprototype role='macro'>
+  <funcdef><function>ImageByteOrder</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XImageByteOrder'>
+<funcprototype>
+  <funcdef>int <function>XImageByteOrder</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>ImageByteOrder</primary></indexterm>
+<indexterm significance="preferred"><primary>XImageByteOrder</primary></indexterm>
+Both specify the required byte order for images for each scanline unit in 
+XY format (bitmap) or for each pixel value in 
+Z format.
+The macro or function can return either
+<symbol>LSBFirst</symbol>
+or 
+<symbol>MSBFirst</symbol>.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='BitmapUnit'>
+<funcprototype role='macro'>
+  <funcdef><function>XBitmapUnit</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XBitmapUnit'>
+<funcprototype>
+  <funcdef>int <function>XBitmapUnit</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>BitmapUnit</primary></indexterm>
+<indexterm significance="preferred"><primary>XBitmapUnit</primary></indexterm>
+Both return the size of a bitmap's scanline unit in bits.
+The scanline is calculated in multiples of this value.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='BitmapBitOrder'>
+<funcprototype role='macro'>
+  <funcdef><function>BitmapBitOrder</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XBitmapBitOrder'>
+<funcprototype>
+  <funcdef>int <function>XBitmapBitOrder</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>BitmapBitOrder</primary></indexterm>
+<indexterm significance="preferred"><primary>XBitmapBitOrder</primary></indexterm>
+Within each bitmap unit, the left-most bit in the bitmap as displayed
+on the screen is either the least significant or most significant bit in the
+unit.
+This macro or function can return 
+<symbol>LSBFirst</symbol>
+or 
+<symbol>MSBFirst</symbol>.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='BitmapPad'>
+<funcprototype role='macro'>
+  <funcdef><function>BitmapPad</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XBitmapPad'>
+<funcprototype>
+  <funcdef>int <function>XBitmapPad</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>BitmapPad</primary></indexterm>
+<indexterm significance="preferred"><primary>XBitmapPad</primary></indexterm>
+Each scanline must be padded to a multiple of bits returned
+by this macro or function.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='DisplayHeight'>
+<funcprototype role='macro'>
+  <funcdef><function>DisplayHeight</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+  <paramdef><parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XDisplayHeight'>
+<funcprototype>
+  <funcdef>int <function>XDisplayHeight</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>screen_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate screen number on the host server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>DisplayHeight</primary></indexterm>
+<indexterm significance="preferred"><primary>XDisplayHeight</primary></indexterm>
+Both return an integer that describes the height of the screen
+in pixels.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='DisplayHeightMM'>
+<funcprototype role='macro'>
+  <funcdef><function>DisplayHeightMM</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+  <paramdef><parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XDisplayHeightMM'>
+<funcprototype>
+  <funcdef>int <function>XDisplayHeightMM</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>screen_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate screen number on the host server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>DisplayHeightMM</primary></indexterm>
+<indexterm significance="preferred"><primary>XDisplayHeightMM</primary></indexterm>
+Both return the height of the specified screen in millimeters.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='DisplayWidth'>
+<funcprototype role='macro'>
+  <funcdef><function>DisplayWidth</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+  <paramdef><parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XDisplayWidth'>
+<funcprototype>
+  <funcdef>int <function>XDisplayWidth</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>screen_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate screen number on the host server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>DisplayWidth</primary></indexterm>
+<indexterm significance="preferred"><primary>XDisplayWidth</primary></indexterm>
+Both return the width of the screen in pixels.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='DisplayWidthMM'>
+<funcprototype role='macro'>
+  <funcdef><function>DisplayWidthMM</function></funcdef>
+  <paramdef><parameter>display</parameter></paramdef>
+  <paramdef><parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XDisplayWidthMM'>
+<funcprototype>
+  <funcdef>int <function>XDisplayWidthMM</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>screen_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate screen number on the host server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>DisplayWidthMM</primary></indexterm>
+<indexterm significance="preferred"><primary>XDisplayWidthMM</primary></indexterm>
+Both return the width of the specified screen in millimeters.
+</para>
+</sect2>
+<sect2 id="Screen_Information_Macros">
+<title>Screen Information Macros</title>
+<!-- .XS -->
+<!-- (SN Screen Information Macros -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The following lists the C language macros,
+their corresponding function equivalents that are for other language bindings,
+and what data they both can return.
+These macros or functions all take a pointer to the appropriate screen
+structure.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='BlackPixelOfScreen'>
+<funcprototype role='macro'>
+  <funcdef><function>BlackPixelOfScreen</function></funcdef>
+  <paramdef><parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XBlackPixelOfScreen'>
+<funcprototype>
+  <funcdef>unsigned long <function>XBlackPixelOfScreen</function></funcdef>
+  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate 
+<type>Screen</type>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>BlackPixelOfScreen</primary></indexterm>
+<indexterm significance="preferred"><primary>XBlackPixelOfScreen</primary></indexterm>
+Both return the black pixel value of the specified screen.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='WhitePixelOfScreen'>
+<funcprototype role='macro'>
+  <funcdef><function>XWhitePixelOfScreen</function></funcdef>
+  <paramdef><parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XWhitePixelOfScreen'>
+<funcprototype>
+  <funcdef>unsigned long <function>XWhitePixelOfScreen</function></funcdef>
+  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate 
+<type>Screen</type>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>WhitePixelOfScreen</primary></indexterm>
+<indexterm significance="preferred"><primary>XWhitePixelOfScreen</primary></indexterm>
+Both return the white pixel value of the specified screen.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='CellsOfScreen'>
+  <funcprototype role='macro'>
+  <funcdef><function>CellsOfScreen</function></funcdef>
+  <paramdef><parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XCellsOfScreen'>
+<funcprototype>
+  <funcdef>int <function>XCellsOfScreen</function></funcdef>
+  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate 
+<type>Screen</type>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>CellsOfScreen</primary></indexterm>
+<indexterm significance="preferred"><primary>XCellsOfScreen</primary></indexterm>
+Both return the number of colormap cells in the default colormap 
+of the specified screen.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='DefaultColormapOfScreen'>
+<funcprototype role='macro'>
+  <funcdef><function>DefaultColormapOfScreen</function></funcdef>
+  <paramdef><parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XDefaultColormapOfScreen'>
+<funcprototype>
+  <funcdef>Colormap <function>XDefaultColormapOfScreen</function></funcdef>
+  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate 
+<type>Screen</type>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>DefaultColormapOfScreen</primary></indexterm>
+<indexterm significance="preferred"><primary>XDefaultColormapOfScreen</primary></indexterm>
+Both return the default colormap of the specified screen.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='DefaultDepthOfScreen'>
+<funcprototype role='macro'>
+  <funcdef><function>DefaultDepthOfScreen</function></funcdef>
+  <paramdef><parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XDefaultDepthOfScreen'>
+<funcprototype>
+  <funcdef>int <function>XDefaultDepthOfScreen</function></funcdef>
+  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate 
+<type>Screen</type>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>DefaultDepthOfScreen</primary></indexterm>
+<indexterm significance="preferred"><primary>XDefaultDepthOfScreen</primary></indexterm>
+Both return the depth of the root window.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='DefaultGCOfScreen'>
+<funcprototype role='macro'>
+  <funcdef><function>DefaultGCOfScreen</function></funcdef>
+  <paramdef><parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XDefaultGCOfScreen'>
+<funcprototype>
+  <funcdef>GC <function>XDefaultGCOfScreen</function></funcdef>
+  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate 
+<type>Screen</type>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>DefaultGCOfScreen</primary></indexterm>
+<indexterm significance="preferred"><primary>XDefaultGCOfScreen</primary></indexterm>
+Both return a default graphics context (GC) of the specified screen,
+which has the same depth as the root window of the screen.
+The GC must never be freed.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='DefaultVisualOfScreen'>
+<funcprototype role='macro'>
+  <funcdef><function>XDefaultVisualOfScreen</function></funcdef>
+  <paramdef><parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XDefaultVisualOfScreen'>
+<funcprototype>
+  <funcdef>Visual *<function>XDefaultVisualOfScreen</function></funcdef>
+  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate 
+<type>Screen</type>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>DefaultVisualOfScreen</primary></indexterm>
+<indexterm significance="preferred"><primary>XDefaultVisualOfScreen</primary></indexterm>
+Both return the default visual of the specified screen.
+For information on visual types,
+see <link linkend="Visual_Types">section 3.1</link>.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='DoesBackingStore'>
+<funcprototype role='macro'>
+  <funcdef><function>DoesBackingStore</function></funcdef>
+  <paramdef><parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XDoesBackingStore'>
+<funcprototype>
+  <funcdef>int <function>XDoesBackingStore</function></funcdef>
+  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate 
+<type>Screen</type>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>DoesBackingStore</primary></indexterm>
+<indexterm significance="preferred"><primary>XDoesBackingStore</primary></indexterm>
+Both return a value indicating whether the screen supports backing
+stores.
+The value returned can be one of 
+<symbol>WhenMapped</symbol>,
+<symbol>NotUseful</symbol>,
+or
+<symbol>Always</symbol>
+(see <link linkend="Backing_Store_Attribute">section 3.2.4</link>).
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='DoesSaveUnders'>
+<funcprototype role='macro'>
+  <funcdef><function>DoesSaveUnders</function></funcdef>
+  <paramdef><parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XDoesSaveUnders'>
+<funcprototype>
+  <funcdef>Bool <function>XDoesSaveUnders</function></funcdef>
+  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate 
+<type>Screen</type>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>DoesSaveUnders</primary></indexterm>
+<indexterm significance="preferred"><primary>XDoesSaveUnders</primary></indexterm>
+Both return a Boolean value indicating whether the
+screen supports save unders.
+If
+<symbol>True</symbol>,
+the screen supports save unders.
+If
+<symbol>False</symbol>,
+the screen does not support save unders
+(see <link linkend="Save_Under_Flag">section 3.2.5</link>).
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='DisplayOfScreen'>
+<funcprototype role='macro'>
+  <funcdef><function>DisplayOfScreen</function></funcdef>
+  <paramdef><parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XDisplayOfScreen'>
+<funcprototype>
+  <funcdef>Display *<function>XDisplayOfScreen</function></funcdef>
+  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate 
+<type>Screen</type>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>DisplayOfScreen</primary></indexterm>
+<indexterm significance="preferred"><primary>XDisplayOfScreen</primary></indexterm>
+Both return the display of the specified screen.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+<indexterm significance="preferred"><primary>XScreenNumberOfScreen</primary></indexterm>
+</para>
+<funcsynopsis id='ScreenNumberOfScreen'>
+<funcprototype role='macro'>
+  <funcdef><function>ScreenNumberOfScreen</function></funcdef>
+  <paramdef><parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XScreenNumberOfScreen'>
+<funcprototype>
+  <funcdef>long <function>XScreenNumberOfScreen</function></funcdef>
+  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate 
+<type>Screen</type>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<function>XScreenNumberOfScreen</function>
+function returns the screen index number of the specified screen.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='EventMaskOfScreen'>
+<funcprototype role='macro'>
+  <funcdef><function>EventMaskOfScreen</function></funcdef>
+  <paramdef><parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XEventMaskOfScreen'>
+<funcprototype>
+  <funcdef>long <function>XEventMaskOfScreen</function></funcdef>
+  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate 
+<type>Screen</type>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>EventMaskOfScreen</primary></indexterm>
+<indexterm significance="preferred"><primary>XEventMaskOfScreen</primary></indexterm>
+Both return the event mask of the root window for the specified screen
+at connection setup time.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='WidthOfScreen'>
+<funcprototype role='macro'>
+  <funcdef><function>WidthOfScreen</function></funcdef>
+  <paramdef><parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XWidthOfScreen'>
+<funcprototype>
+  <funcdef>int <function>XWidthOfScreen</function></funcdef>
+  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate 
+<type>Screen</type>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>WidthOfScreen</primary></indexterm>
+<indexterm significance="preferred"><primary>XWidthOfScreen</primary></indexterm>
+Both return the width of the specified screen in pixels.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='HeightOfScreen'>
+<funcprototype role='macro'>
+  <funcdef><function>HeightOfScreen</function></funcdef>
+  <paramdef><parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XHeightOfScreen'>
+<funcprototype>
+  <funcdef>int <function>XHeightOfScreen</function></funcdef>
+  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate 
+<type>Screen</type>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>HeightOfScreen</primary></indexterm>
+<indexterm significance="preferred"><primary>XHeightOfScreen</primary></indexterm>
+Both return the height of the specified screen in pixels.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='WidthMMOfScreen'>
+<funcprototype role='macro'>
+  <funcdef><function>WidthMMOfScreen</function></funcdef>
+  <paramdef><parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XWidthMMOfScreen'>
+<funcprototype>
+  <funcdef>int <function>XWidthMMOfScreen</function></funcdef>
+  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate 
+<type>Screen</type>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>WidthMMOfScreen</primary></indexterm>
+<indexterm significance="preferred"><primary>XWidthMMOfScreen</primary></indexterm>
+Both return the width of the specified screen in millimeters.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='HeightMMOfScreen'>
+<funcprototype role='macro'>
+  <funcdef><function>HeightMMOfScreen</function></funcdef>
+  <paramdef><parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XHeightMMOfScreen'>
+<funcprototype>
+  <funcdef>int <function>XHeightMMOfScreen</function></funcdef>
+  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate 
+<type>Screen</type>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>HeightMMOfScreen</primary></indexterm>
+<indexterm significance="preferred"><primary>XHeightMMOfScreen</primary></indexterm>
+Both return the height of the specified screen in millimeters.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='MaxCmapsOfScreen'>
+<funcprototype role='macro'>
+  <funcdef><function>MaxCmapsOfScreen</function></funcdef>
+  <paramdef><parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XMaxCmapsOfScreen'>
+<funcprototype>
+  <funcdef>int <function>XMaxCmapsOfScreen</function></funcdef>
+  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate 
+<type>Screen</type>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>MaxCmapsOfScreen</primary></indexterm>
+<indexterm significance="preferred"><primary>XMaxCmapsOfScreen</primary></indexterm>
+Both return the maximum number of installed colormaps supported 
+by the specified screen
+(see <link linkend="Managing_Installed_Colormaps">section 9.3</link>).
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='MinCmapsOfScreen'>
+<funcprototype role='macro'>
+  <funcdef><function>MinCmapsOfScreen</function></funcdef>
+  <paramdef><parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XMinCmapsOfScreen'>
+<funcprototype>
+  <funcdef>int <function>XMinCmapsOfScreen</function></funcdef>
+  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate 
+<type>Screen</type>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>MinCmapsOfScreen</primary></indexterm>
+<indexterm significance="preferred"><primary>XMinCmapsOfScreen</primary></indexterm>
+Both return the minimum number of installed colormaps supported 
+by the specified screen
+(see <link linkend="Managing_Installed_Colormaps">section 9.3</link>).
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='PlanesOfScreen'>
+<funcprototype role='macro'>
+  <funcdef><function>PlanesOfScreen</function></funcdef>
+  <paramdef><parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XPlanesOfScreen'>
+<funcprototype>
+  <funcdef>int <function>XPlanesOfScreen</function></funcdef>
+  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate 
+<type>Screen</type>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>PlanesOfScreen</primary></indexterm>
+<indexterm significance="preferred"><primary>XPlanesOfScreen</primary></indexterm>
+Both return the depth of the root window.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='RootWindowOfScreen'>
+<funcprototype role='macro'>
+  <funcdef><function>RootWindowOfScreen</function></funcdef>
+  <paramdef><parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XRootWindowOfScreen'>
+<funcprototype>
+  <funcdef>Window <function>XRootWindowOfScreen</function></funcdef>
+  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate 
+<type>Screen</type>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>RootWindowOfScreen</primary></indexterm>
+<indexterm significance="preferred"><primary>XRootWindowOfScreen</primary></indexterm>
+Both return the root window of the specified screen.
+</para>
+</sect2>
+</sect1>
+<sect1 id="Generating_a_NoOperation_Protocol_Request">
+<title>Generating a NoOperation Protocol Request</title>
+<!-- .XS -->
+<!-- (SN Generating a NoOperation Protocol Request -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To execute a 
+<systemitem>NoOperation</systemitem>
+protocol request, use
+<xref linkend='XNoOp' xrefstyle='select: title'/>.
+<indexterm significance="preferred"><primary>XNoOp</primary></indexterm>
+<!-- .sM -->
+</para>
+<funcsynopsis id='XNoOp'>
+<funcprototype>
+  <funcdef><function>XNoOp</function></funcdef>
+  <paramdef>Display *<parameter>display</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>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XNoOp' xrefstyle='select: title'/>
+function sends a 
+<systemitem>NoOperation</systemitem>
+protocol request to the X server,
+thereby exercising the connection.
+</para>
+</sect1>
+<sect1 id="Freeing_Client_Created_Data">
+<title>Freeing Client-Created Data</title>
+<!-- .XS -->
+<!-- (SN Freeing Client-Created Data -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To free in-memory data that was created by an Xlib function, use
+<xref linkend='XFree' xrefstyle='select: title'/>.
+<indexterm significance="preferred"><primary>XFree</primary></indexterm>
+<!-- .sM -->
+</para>
+<funcsynopsis id='XFree'>
+<funcprototype>
+  <funcdef><function>XFree</function></funcdef>
+  <paramdef>void *<parameter>data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the data that is to be freed.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XFree' xrefstyle='select: title'/>
+function is a general-purpose Xlib routine that frees the specified data.
+You must use it to free any objects that were allocated by Xlib,
+unless an alternate function is explicitly specified for the object.
+A NULL pointer cannot be passed to this function.
+</para>
+</sect1>
+<sect1 id="Closing_the_Display">
+<title>Closing the Display</title>
+<!-- .XS -->
+<!-- (SN Closing the Display -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To close a display or disconnect from the X server, use
+<function>XCloseDisplay</function>.
+<indexterm significance="preferred"><primary>XCloseDisplay</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+</para>
+<funcsynopsis id='xclosedisplay'>
+<funcprototype>
+  <funcdef><function>XCloseDisplay</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<function>XCloseDisplay</function>
+function closes the connection to the X server for the display specified in the
+<type>Display</type>
+structure and destroys all windows, resource IDs
+(<type>Window</type>,
+<type>Font</type>,
+<type>Pixmap</type>,
+<type>Colormap</type>,
+<type>Cursor</type>,
+and
+<type>GContext</type>),
+or other resources that the client has created
+on this display, unless the close-down mode of the client has been changed
+(see
+<xref linkend='XSetCloseDownMode' xrefstyle='select: title'/>).
+Therefore, these windows, resource IDs, and other resources should never be 
+referenced again or an error will be generated.
+Before exiting, you should call
+<function>XCloseDisplay</function>
+explicitly so that any pending errors are reported as
+<function>XCloseDisplay</function>
+performs a final
+<xref linkend='XSync' xrefstyle='select: title'/>
+operation.
+<indexterm><primary>Resource IDs</primary></indexterm>
+<indexterm><primary>XCloseDisplay</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+<function>XCloseDisplay</function>
+can generate a
+<errorname>BadGC</errorname>
+error.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+Xlib provides a function to permit the resources owned by a client
+to survive after the client's connection is closed.
+To change a client's close-down mode, use
+<xref linkend='XSetCloseDownMode' xrefstyle='select: title'/>.
+<indexterm significance="preferred"><primary>XSetCloseDownMode</primary></indexterm>
+<!-- .sM -->
+</para>
+<funcsynopsis id='XSetCloseDownMode'>
+<funcprototype>
+  <funcdef><function>XSetCloseDownMode</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>close_mode</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>close_mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the client close-down mode.
+You can pass 
+<symbol>DestroyAll</symbol>,
+<symbol>RetainPermanent</symbol>,
+or
+<symbol>RetainTemporary</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XSetCloseDownMode' xrefstyle='select: title'/> function
+defines what will happen to the client's resources at connection close.
+A connection starts in
+<symbol>DestroyAll</symbol>
+mode.
+For information on what happens to the client's resources when the
+close_mode argument is
+<symbol>RetainPermanent</symbol>
+or
+<symbol>RetainTemporary</symbol>,
+see <link linkend='Using_X_Server_Connection_Close_Operations'>section 2.6</link>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetCloseDownMode' xrefstyle='select: title'/>
+can generate a
+<errorname>BadValue</errorname>
+error.
+</para>
+</sect1>
+<sect1 id='Using_X_Server_Connection_Close_Operations'>
+<title>Using X Server Connection Close Operations</title>
+<!-- .XS -->
+<!-- (SN Using X Server Connection Close Operations -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+When the X server's connection to a client is closed
+either by an explicit call to
+<function>XCloseDisplay</function>
+or by a process that exits, the X server performs the following
+automatic operations:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+It disowns all selections owned by the client
+(see 
+<xref linkend='XSetSelectionOwner' xrefstyle='select: title'/>).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It performs an
+<xref linkend='XUngrabPointer' xrefstyle='select: title'/>
+and
+<xref linkend='XUngrabKeyboard' xrefstyle='select: title'/>
+if the client has actively grabbed the pointer 
+or the keyboard.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It performs an
+<xref linkend='XUngrabServer' xrefstyle='select: title'/>
+if the client has grabbed the server.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It releases all passive grabs made by the client.  
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It marks all resources (including colormap entries) allocated 
+by the client either as permanent or temporary, 
+depending on whether the close-down mode is 
+<symbol>RetainPermanent</symbol>
+or
+<symbol>RetainTemporary</symbol>.
+However, this does not prevent other client applications from explicitly
+destroying the resources (see 
+<xref linkend='XSetCloseDownMode' xrefstyle='select: title'/>).
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+When the close-down mode is
+<symbol>DestroyAll</symbol>,
+the X server destroys all of a client's resources as follows:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+It examines each window in the client's save-set to determine if it is an inferior
+(subwindow) of a window created by the client.
+(The save-set is a list of other clients' windows
+that are referred to as save-set windows.)
+If so, the X server reparents the save-set window to the closest ancestor so
+that the save-set window is not an inferior of a window created by the client.
+The reparenting leaves unchanged the absolute coordinates (with respect to
+the root window) of the upper-left outer corner of the save-set
+window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It performs a
+<systemitem>MapWindow</systemitem>
+request on the save-set window if the save-set window is unmapped.
+The X server does this even if the save-set window was not an inferior of 
+a window created by the client.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It destroys all windows created by the client.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It performs the appropriate free request on each nonwindow resource created by
+the client in the server (for example, 
+<type>Font</type>,
+<type>Pixmap</type>,
+<type>Cursor</type>,
+<type>Colormap</type>,
+and 
+<type>GContext</type>).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It frees all colors and colormap entries allocated by a client application.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+Additional processing occurs when the last connection to the X server closes.
+An X server goes through a cycle of having no connections and having some
+connections.
+When the last connection to the X server closes as a result of a connection
+closing with the close_mode of
+<symbol>DestroyAll</symbol>,
+the X server does the following: 
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+It resets its state as if it had just been
+started.  
+The X server begins by destroying all lingering resources from
+clients that have terminated in 
+<symbol>RetainPermanent</symbol>
+or
+<symbol>RetainTemporary</symbol>
+mode.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It deletes all but the predefined atom identifiers.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It deletes all properties on all root windows
+(see <link linkend="Properties_and_Atoms">section 4.3</link>).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It resets all device maps and attributes 
+(for example, key click, bell volume, and acceleration) 
+as well as the access control list.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It restores the standard root tiles and cursors.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It restores the default font path.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It restores the input focus to state
+<symbol>PointerRoot</symbol>.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+However, the X server does not reset if you close a connection with a close-down
+mode set to
+<symbol>RetainPermanent</symbol>
+or
+<symbol>RetainTemporary</symbol>.
+</para>
+</sect1>
+<sect1 id="Using_Xlib_with_Threads">
+<title>Using Xlib with Threads</title>
+<!-- .XS -->
+<!-- (SN Using Xlib with Threads -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+On systems that have threads, support may be provided to permit
+multiple threads to use Xlib concurrently.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To initialize support for concurrent threads, use
+<function>XInitThreads</function>.
+<indexterm significance="preferred"><primary>XInitThreads</primary></indexterm>
+<!-- .sM -->
+</para>
+<funcsynopsis id='XInitThreads'>
+<funcprototype>
+  <funcdef>Status <function>XInitThreads</function></funcdef>
+  <void />
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<function>XInitThreads</function>
+function initializes Xlib support for concurrent threads.
+This function must be the first Xlib function a
+multi-threaded program calls, and it must complete
+before any other Xlib call is made.
+This function returns a nonzero status if initialization was
+successful; otherwise, it returns zero.
+On systems that do not support threads, this function always returns zero.
+</para>
+<para>
+<!-- .LP -->
+It is only necessary to call this function if multiple threads
+might use Xlib concurrently.  If all calls to Xlib functions
+are protected by some other access mechanism (for example,
+a mutual exclusion lock in a toolkit or through explicit client
+programming), Xlib thread initialization is not required.
+It is recommended that single-threaded programs not call this function.
+
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To lock a display across several Xlib calls, use
+<function>XLockDisplay</function>.
+<indexterm significance="preferred"><primary>XLockDisplay</primary></indexterm>
+<!-- .sM -->
+</para>
+<funcsynopsis id='xlockdisplay'>
+<funcprototype>
+  <funcdef><function>XLockDisplay</function></funcdef>
+  <paramdef>Display *<parameter>display</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>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<function>XLockDisplay</function>
+function locks out all other threads from using the specified display.
+Other threads attempting to use the display will block until
+the display is unlocked by this thread.
+Nested calls to
+<function>XLockDisplay</function>
+work correctly; the display will not actually be unlocked until
+<xref linkend='XUnlockDisplay' xrefstyle='select: title'/>
+has been called the same number of times as
+<function>XLockDisplay</function>.
+This function has no effect unless Xlib was successfully initialized
+for threads using
+<function>XInitThreads</function>.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To unlock a display, use
+<xref linkend='XUnlockDisplay' xrefstyle='select: title'/>.
+<indexterm significance="preferred"><primary>XUnlockDisplay</primary></indexterm>
+<!-- .sM -->
+</para>
+<funcsynopsis id='XUnlockDisplay'>
+<funcprototype>
+  <funcdef><function>XUnlockDisplay</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XUnlockDisplay' xrefstyle='select: title'/>
+function allows other threads to use the specified display again.
+Any threads that have blocked on the display are allowed to continue.
+Nested locking works correctly; if
+<function>XLockDisplay</function>
+has been called multiple times by a thread, then
+<xref linkend='XUnlockDisplay' xrefstyle='select: title'/>
+must be called an equal number of times before the display is
+actually unlocked.
+This function has no effect unless Xlib was successfully initialized
+for threads using
+<function>XInitThreads</function>.
+</para>
+</sect1>
+<sect1 id="Using_Internal_Connections">
+<title>Using Internal Connections</title>
+<!-- .XS -->
+<!-- (SN Using Internal Connections -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+In addition to the connection to the X server, an Xlib implementation
+may require connections to other kinds of servers (for example, to
+input method servers as described in
+<link linkend='Locales_and_Internationalized_Text_Functions'>chapter 13</link>).
+Toolkits and clients
+that use multiple displays, or that use displays in combination with
+other inputs, need to obtain these additional connections to correctly
+block until input is available and need to process that input
+when it is available.  Simple clients that use a single display and
+block for input in an Xlib event function do not need to use these
+facilities.
+</para>
+<para>
+<!-- .LP -->
+To track internal connections for a display, use
+<xref linkend='XAddConnectionWatch' xrefstyle='select: title'/>.
+</para>
+<funcsynopsis id='xconnectionwatch'>
+<funcprototype>
+  <funcdef>typedef void (*XConnectionWatchProc)</funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XPointer <parameter>client_data</parameter></paramdef>
+  <paramdef>int <parameter>fd</parameter></paramdef>
+  <paramdef>Bool <parameter>opening</parameter></paramdef>
+  <paramdef>XPointer *<parameter>watch_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<funcsynopsis id='XAddConnectionWatch'>
+<funcprototype>
+  <funcdef>Status <function>XAddConnectionWatch</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XConnectionWatchProc <parameter>procedure</parameter></paramdef>
+  <paramdef>XPointer <parameter>client_data</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'>procedure</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to be called.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the additional client data.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XAddConnectionWatch' xrefstyle='select: title'/>
+function registers a procedure to be called each time Xlib opens or closes an
+internal connection for the specified display.  The procedure is passed the
+display, the specified client_data, the file descriptor for the connection,
+a Boolean indicating whether the connection is being opened or closed, and a
+pointer to a location for private watch data.  If opening is
+<symbol>True</symbol>,
+the procedure can store a pointer to private data in the location pointed
+to by watch_data;
+when the procedure is later called for this same connection and opening is
+<symbol>False</symbol>,
+the location pointed to by watch_data will hold this same private data pointer.
+</para>
+<para>
+<!-- .LP -->
+This function can be called at any time after a display is opened.
+If internal connections already exist, the registered procedure will
+immediately be called for each of them, before
+<xref linkend='XAddConnectionWatch' xrefstyle='select: title'/>
+returns.
+<xref linkend='XAddConnectionWatch' xrefstyle='select: title'/>
+returns a nonzero status if the procedure is successfully registered;
+otherwise, it returns zero.
+</para>
+<para>
+<!-- .LP -->
+The registered procedure should not call any Xlib functions.
+If the procedure directly or indirectly causes the state of internal
+connections or watch procedures to change, the result is not defined.
+If Xlib has been initialized for threads, the procedure is called with
+the display locked and the result of a call by the procedure to any
+Xlib function that locks the display is not defined unless the executing
+thread has externally locked the display using
+<function>XLockDisplay</function>.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To stop tracking internal connections for a display, use
+<function>XRemoveConnectionWatch</function>.
+<indexterm significance="preferred"><primary>XRemoveConnectionWatch</primary></indexterm>
+<!-- .sM -->
+</para>
+<para>
+</para>
+<funcsynopsis id='xremoveconnectionwatch'>
+<funcprototype>
+  <funcdef>Status <function>XRemoveConnectionWatch</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XConnectionWatchProc <parameter>procedure</parameter></paramdef>
+  <paramdef>XPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>procedure</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to be called.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the additional client data.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<function>XRemoveConnectionWatch</function>
+function removes a previously registered connection watch procedure.
+The client_data must match the client_data used when the procedure
+was initially registered.
+
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To process input on an internal connection, use
+<xref linkend='XProcessInternalConnection' xrefstyle='select: title'/>.
+<indexterm significance="preferred"><primary>XProcessInternalConnection</primary></indexterm>
+<!-- .sM -->
+</para>
+<para>
+</para>
+<funcsynopsis id='XProcessInternalConnection'>
+<funcprototype>
+  <funcdef>void <function>XProcessInternalConnection</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>fd</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>fd</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the file descriptor.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XProcessInternalConnection' xrefstyle='select: title'/>
+function processes input available on an internal connection.
+This function should be called for an internal connection only
+after an operating system facility (for example,
+<function>select</function>
+or
+<function>poll</function>)
+has indicated that input is available; otherwise,
+the effect is not defined.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To obtain all of the current internal connections for a display, use
+<xref linkend='XInternalConnectionNumbers' xrefstyle='select: title'/>.
+<indexterm significance="preferred"><primary>XInternalConnectionNumbers</primary></indexterm>
+<!-- .sM -->
+</para>
+<para>
+</para>
+<funcsynopsis id='XInternalConnectionNumbers'>
+<funcprototype>
+  <funcdef>Status <function>XInternalConnectionNumbers</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int ** <parameter>fd</parameter></paramdef>
+  <paramdef>int * <parameter>count_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>fd_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the file descriptors.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of file descriptors.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XInternalConnectionNumbers' xrefstyle='select: title'/>
+function returns a list of the file descriptors for all internal
+connections currently open for the specified display.
+When the allocated list is no longer needed,
+free it by using
+<xref linkend='XFree' xrefstyle='select: title'/>.
+This functions returns a nonzero status if the list is successfully allocated;
+otherwise, it returns zero.
+</para>
+</sect1>
+</chapter>
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH03.xml
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH03.xml	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH03.xml	(revision 5)
@@ -0,0 +1,4179 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+	  "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+<chapter id='Window_Functions'><title>Window Functions</title>
+<sect1 id="Visual_Types">
+<title>Visual Types</title>
+<!-- .XS -->
+<!-- (SN Visual Types -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>Visual Type</primary></indexterm>
+On some display hardware, 
+it may be possible to deal with color resources in more than one way.
+For example, you may be able to deal with a screen of either 12-bit depth
+with arbitrary mapping of pixel to color (pseudo-color) or 24-bit depth
+with 8 bits of the pixel dedicated to each of red, green, and blue.
+These different ways of dealing with the visual aspects of the screen
+are called visuals.
+For each screen of the display, there may be a list of valid visual types
+supported at different depths of the screen.
+Because default windows and visual types are defined for each screen,
+most simple applications need not deal with this complexity.
+Xlib provides macros and functions that return the default root window, 
+the default depth of the default root window, and the default visual type
+(see sections <link linkend='Display_Macros'>2.2.1</link>
+and <link linkend="Determining_the_Appropriate_Visual_Type">16.7</link>).
+</para>
+<para>
+<!-- .LP -->
+Xlib uses an opaque 
+<structname>Visual</structname>
+<indexterm significance="preferred"><primary>Visual</primary></indexterm>
+structure that contains information about the possible color mapping.
+The visual utility functions
+(see <link linkend="Determining_the_Appropriate_Visual_Type">section 16.7</link>)
+use an
+<structname>XVisualInfo</structname>
+structure to return this information to an application.
+The members of this structure pertinent to this discussion are class, red_mask,
+green_mask, blue_mask, bits_per_rgb, and colormap_size.
+The class member specifies one of the possible visual classes of the screen
+and can be 
+<indexterm><primary>Visual Classes</primary><secondary>StaticGray</secondary></indexterm>
+<indexterm><primary>Visual Classes</primary><secondary>StaticColor</secondary></indexterm>
+<indexterm><primary>Visual Classes</primary><secondary>TrueColor</secondary></indexterm>
+<indexterm><primary>Visual Classes</primary><secondary>StaticColor</secondary></indexterm>
+<indexterm><primary>Visual Classes</primary><secondary>GrayScale</secondary></indexterm>
+<indexterm><primary>Visual Classes</primary><secondary>PseudoColor</secondary></indexterm>
+<symbol>StaticGray</symbol>,
+<symbol>StaticColor</symbol>,
+<symbol>TrueColor</symbol>,
+<symbol>GrayScale</symbol>,
+<symbol>PseudoColor</symbol>,
+or
+<symbol>DirectColor</symbol>.
+</para>
+<para>
+<!-- .LP -->
+The following concepts may serve to make the explanation of
+visual types clearer. 
+The screen can be color or grayscale,
+can have a colormap that is writable or read-only,
+and can also have a colormap whose indices are decomposed into separate 
+<acronym>RGB</acronym> pieces, provided one is not on a grayscale screen.
+This leads to the following diagram:
+</para>
+
+<literallayout class="monospaced">
+                      Color        Gray-Scale
+                   R/O    R/W      R/O   R/W
+----------------------------------------------
+ Undecomposed    Static  Pseudo   Static  Gray
+   Colormap      Color   Color    Gray    Scale
+
+ Decomposed       True   Direct
+   Colormap       Color  Color
+----------------------------------------------
+</literallayout>
+
+<para>
+<!-- .LP -->
+Conceptually, 
+as each pixel is read out of video memory for display on the screen,
+it goes through a look-up stage by indexing into a colormap.
+Colormaps can be manipulated arbitrarily on some hardware, 
+in limited ways on other hardware, and not at all on other hardware.  
+The visual types affect the colormap and 
+the <acronym>RGB</acronym> values in the following ways:
+</para>
+<para>
+<!-- .LP -->
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+For 
+<symbol>PseudoColor</symbol>,
+a pixel value indexes a colormap to produce
+independent <acronym>RGB</acronym> values, and the <acronym>RGB</acronym> values can be changed dynamically.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>GrayScale</symbol>
+is treated the same way as 
+<symbol>PseudoColor</symbol>
+except that the primary that drives the screen is undefined. 
+Thus, the client should always store the
+same value for red, green, and blue in the colormaps.  
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+For 
+<symbol>DirectColor</symbol>,
+a pixel value is decomposed into separate <acronym>RGB</acronym> subfields, and each
+subfield separately indexes the colormap for the corresponding value.
+The <acronym>RGB</acronym> values can be changed dynamically.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>TrueColor</symbol>
+is treated the same way as 
+<symbol>DirectColor</symbol>
+except that the colormap has predefined, read-only <acronym>RGB</acronym> values.
+These <acronym>RGB</acronym> values are server dependent but provide linear or near-linear
+ramps in each primary.  
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>StaticColor</symbol>
+is treated the same way as 
+<symbol>PseudoColor</symbol>
+except that the colormap has predefined, 
+read-only, server-dependent <acronym>RGB</acronym> values.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>StaticGray</symbol>
+is treated the same way as 
+<symbol>StaticColor</symbol>
+except that the <acronym>RGB</acronym> values are equal for any single pixel
+value, thus resulting in shades of gray.  
+<symbol>StaticGray</symbol>
+with a two-entry
+colormap can be thought of as monochrome.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+The red_mask, green_mask, and blue_mask members are only defined for
+<symbol>DirectColor</symbol>
+and 
+<symbol>TrueColor</symbol>.
+Each has one contiguous set of bits with no
+intersections.
+The bits_per_rgb member specifies the log base 2 of the
+number of distinct color values (individually) of red, green, and blue.
+Actual <acronym>RGB</acronym> values are unsigned 16-bit numbers.
+The colormap_size member defines the number of available colormap entries
+in a newly created colormap.  
+For 
+<symbol>DirectColor</symbol>
+and 
+<symbol>TrueColor</symbol>,
+this is the size of an individual pixel subfield.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To obtain the visual ID from a 
+<structname>Visual</structname>,
+use
+<xref linkend='XVisualIDFromVisual' xrefstyle='select: title'/>.
+<indexterm significance="preferred"><primary>XVisualIDFromVisual</primary></indexterm>
+</para>
+<!-- .sM -->
+<funcsynopsis id='XVisualIDFromVisual'>
+<funcprototype>
+  <funcdef>VisualID <function>XVisualIDFromVisual</function></funcdef>
+  <paramdef>Visual *<parameter>visual</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>visual</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the visual type.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XVisualIDFromVisual' xrefstyle='select: title'/>
+function returns the visual ID for the specified visual type.
+</para>
+</sect1>
+<sect1 id="Window_Attributes">
+<title>Window Attributes</title>
+<!-- .XS -->
+<!-- (SN Window Attributes -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Window</primary></indexterm>
+<indexterm><primary>Window</primary><secondary>attributes</secondary></indexterm>
+All 
+<symbol>InputOutput</symbol>
+windows have a border width of zero or more pixels, an optional background, 
+an event suppression mask (which suppresses propagation of events from 
+children), and a property list
+(see <link linkend="Properties_and_Atoms">section 4.3</link>).
+The window border and background can be a solid color or a pattern, called
+a tile.
+All windows except the root have a parent and are clipped by their parent.
+If a window is stacked on top of another window, it obscures that other
+window for the purpose of input.
+If a window has a background (almost all do), it obscures the other
+window for purposes of output.
+Attempts to output to the obscured area do nothing, 
+and no input events (for example, pointer motion) are generated for the 
+obscured area.
+</para>
+<para>
+<!-- .LP -->
+Windows also have associated property lists
+(see <link linkend="Properties_and_Atoms">section 4.3</link>).
+</para>
+<para>
+<!-- .LP -->
+Both
+<symbol>InputOutput</symbol>
+and
+<symbol>InputOnly</symbol>
+windows have the following common attributes,
+which are the only attributes of an
+<symbol>InputOnly</symbol>
+window:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+win-gravity
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+event-mask
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+do-not-propagate-mask
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+override-redirect
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+cursor
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+If you specify any other attributes for an
+<symbol>InputOnly</symbol>
+window,
+a
+<errorname>BadMatch</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+<symbol>InputOnly</symbol>
+windows are used for controlling input events in situations where
+<symbol>InputOutput</symbol>
+windows are unnecessary.
+<symbol>InputOnly</symbol>
+windows are invisible; can only be used to control such things as
+cursors, input event generation, and grabbing;
+and cannot be used in any graphics requests.
+Note that
+<symbol>InputOnly</symbol>
+windows cannot have
+<symbol>InputOutput</symbol>
+windows as inferiors.
+</para>
+<para>
+<!-- .LP -->
+Windows have borders of a programmable width and pattern
+as well as a background pattern or tile.
+<indexterm><primary>Tile</primary><secondary>pixmaps</secondary></indexterm>
+Pixel values can be used for solid colors.
+<indexterm><primary>Resource IDs</primary><secondary>freeing</secondary></indexterm>
+<indexterm><primary>Freeing</primary><secondary>resources</secondary></indexterm>
+The background and border pixmaps can be destroyed immediately after
+creating the window if no further explicit references to them
+are to be made.
+<indexterm ><primary>Tile</primary><secondary>mode</secondary></indexterm>
+The pattern can either be relative to the parent 
+or absolute.
+If
+<symbol>ParentRelative</symbol>,
+the parent's background is used.
+</para>
+<para>
+<!-- .LP -->
+When windows are first created, 
+they are not visible (not mapped) on the screen.
+Any output to a window that is not visible on the screen 
+and that does not have backing store will be discarded.
+<indexterm><primary>Window</primary><secondary>mapping</secondary></indexterm>
+An application may wish to create a window long before it is
+mapped to the screen.
+When a window is eventually mapped to the screen 
+(using
+<xref linkend='XMapWindow' xrefstyle='select: title'/>),
+<indexterm><primary>XMapWindow</primary></indexterm>
+the X server generates an 
+<symbol>Expose</symbol>
+event for the window if backing store has not been maintained.
+</para>
+<para>
+<!-- .LP -->
+A window manager can override your choice of size, 
+border width, and position for a top-level window.
+Your program must be prepared to use the actual size and position
+of the top window.
+It is not acceptable for a client application to resize itself
+unless in direct response to a human command to do so.
+Instead, either your program should use the space given to it,
+or if the space is too small for any useful work, your program
+might ask the user to resize the window.
+The border of your top-level window is considered fair game 
+for window managers.
+</para>
+<para>
+<!-- .LP -->
+To set an attribute of a window,
+set the appropriate member of the
+<structname>XSetWindowAttributes</structname>
+structure and OR in the corresponding value bitmask in your subsequent calls to
+<xref linkend='XCreateWindow' xrefstyle='select: title'/>
+and
+<xref linkend='XChangeWindowAttributes' xrefstyle='select: title'/>,
+or use one of the other convenience functions that set the appropriate 
+attribute.
+The symbols for the value mask bits and the
+<structname>XSetWindowAttributes</structname>
+structure are:
+<!-- .sM -->
+</para>
+<para>
+<!-- .LP -->
+/* Window attribute value mask bits */
+
+
+<literallayout class="monospaced">
+/* Window attribute value mask bits */
+#define    CWBackPixmap                    (1L&lt;&lt;0)
+#define    CWBackPixel                     (1L&lt;&lt;1)
+#define    CWBorderPixmap                  (1L&lt;&lt;2)
+#define    CWBorderPixel                   (1L&lt;&lt;3)
+#define    CWBitGravity                    (1L&lt;&lt;4)
+#define    CWWinGravity                    (1L&lt;&lt;5)
+#define    CWBackingStore                  (1L&lt;&lt;6)
+#define    CWBackingPlanes                 (1L&lt;&lt;7)
+#define    CWBackingPixel                  (1L&lt;&lt;8)
+#define    CWOverrideRedirect              (1L&lt;&lt;9)
+#define    CWSaveUnder                     (1L&lt;&lt;10)
+#define    CWEventMask                     (1L&lt;&lt;11)
+#define    CWDontPropagate                 (1L&lt;&lt;12)
+#define    CWColormap                      (1L&lt;&lt;13)
+#define    CWCursor                        (1L&lt;&lt;14)
+</literallayout>
+
+<indexterm significance="preferred"><primary>XSetWindowAttributes</primary></indexterm>
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+/* Values */
+
+typedef struct {
+     Pixmap background_pixmap;     /* background, None, or ParentRelative */
+     unsigned long background_pixel;     /* background pixel */
+     Pixmap border_pixmap;          /* border of the window or CopyFromParent */
+     unsigned long border_pixel;     /* border pixel value */
+     int bit_gravity;     /* one of bit gravity values */
+     int win_gravity;     /* one of the window gravity values */
+     int backing_store;     /* NotUseful, WhenMapped, Always */
+     unsigned long backing_planes;     /* planes to be preserved if possible */
+     unsigned long backing_pixel;     /* value to use in restoring planes */
+     Bool save_under;     /* should bits under be saved? (popups) */
+     long event_mask;     /* set of events that should be saved */
+     long do_not_propagate_mask;     /* set of events that should not propagate */
+     Bool override_redirect;     /* boolean value for override_redirect */
+     Colormap colormap;     /* color map to be associated with window */
+     Cursor cursor;          /* cursor to be displayed (or None) */
+} XSetWindowAttributes;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The following lists the defaults for each window attribute and indicates
+whether the attribute is applicable to
+<symbol>InputOutput</symbol>
+and
+<symbol>InputOnly</symbol>
+windows:
+</para>
+<informaltable frame='topbot'>
+  <?dbfo keep-together="auto" ?>
+  <tgroup cols='4' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth='1.0*'/>
+  <colspec colname='c2' colwidth='1.0*'/>
+  <colspec colname='c3' colwidth='1.0*'/>
+  <colspec colname='c4' colwidth='1.0*'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Attribute</entry>
+      <entry>Default</entry>
+      <entry>InputOutput</entry>
+      <entry>InputOnly</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>background-pixmap</entry>
+      <entry><symbol>None</symbol></entry>
+      <entry>Yes</entry>
+      <entry>No</entry>
+    </row>
+    <row>
+      <entry>background-pixel</entry>
+      <entry>Undefined</entry>
+      <entry>Yes</entry>
+      <entry>No</entry>
+    </row>
+    <row>
+      <entry>border-pixmap</entry>
+      <entry><symbol>CopyFromParent</symbol></entry>
+      <entry>Yes</entry>
+      <entry>No</entry>
+    </row>
+    <row>
+      <entry>border-pixel</entry>
+      <entry>Undefined</entry>
+      <entry>Yes</entry>
+      <entry>No</entry>
+    </row>
+    <row>
+      <entry>bit-gravity</entry>
+      <entry><symbol>ForgetGravity</symbol></entry>
+      <entry>Yes</entry>
+      <entry>No</entry>
+    </row>
+    <row>
+      <entry>win-gravity</entry>
+      <entry><symbol>NorthWestGravity</symbol></entry>
+      <entry>Yes</entry>
+      <entry>Yes</entry>
+    </row>
+    <row>
+      <entry>backing-store</entry>
+      <entry><symbol>NotUseful</symbol></entry>
+      <entry>Yes</entry>
+      <entry>No</entry>
+    </row>
+    <row>
+      <entry>backing-planes</entry>
+      <entry>All ones</entry>
+      <entry>Yes</entry>
+      <entry>No</entry>
+    </row>
+    <row>
+      <entry>backing-pixel</entry>
+      <entry>zero</entry>
+      <entry>Yes</entry>
+      <entry>No</entry>
+    </row>
+    <row>
+      <entry>save-under</entry>
+      <entry><symbol>False</symbol></entry>
+      <entry>Yes</entry>
+      <entry>No</entry>
+    </row>
+    <row>
+      <entry>event-mask</entry>
+      <entry>empty set</entry>
+      <entry>Yes</entry>
+      <entry>Yes</entry>
+    </row>
+    <row>
+      <entry>do-not-propagate-mask</entry>
+      <entry>empty set</entry>
+      <entry>Yes</entry>
+      <entry>Yes</entry>
+    </row>
+    <row>
+      <entry>override-redirect</entry>
+      <entry><symbol>False</symbol></entry>
+      <entry>Yes</entry>
+      <entry>Yes</entry>
+    </row>
+    <row>
+      <entry>colormap</entry>
+      <entry><symbol>CopyFromParent</symbol></entry>
+      <entry>Yes</entry>
+      <entry>No</entry>
+    </row>
+    <row>
+      <entry>cursor</entry>
+      <entry><symbol>None</symbol></entry>
+      <entry>Yes</entry>
+      <entry>Yes</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<sect2 id="Background_Attribute">
+<title>Background Attribute</title>
+<!-- .XS -->
+<!-- (SN Background Attribute -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Only
+<symbol>InputOutput</symbol>
+windows can have a background.
+You can set the background of an
+<symbol>InputOutput</symbol>
+window by using a pixel or a pixmap.
+</para>
+<para>
+<!-- .LP -->
+The background-pixmap attribute of a window specifies the pixmap to be used for 
+a window's background.
+This pixmap can be of any size, although some sizes may be faster than others.
+The background-pixel attribute of a window specifies a pixel value used to paint
+a window's background in a single color.
+</para>
+<para>
+<!-- .LP -->
+You can set the background-pixmap to a pixmap,  
+<symbol>None</symbol>
+(default), or 
+<symbol>ParentRelative</symbol>.
+You can set the background-pixel of a window to any pixel value (no default).
+If you specify a background-pixel, 
+it overrides either the default background-pixmap
+or any value you may have set in the background-pixmap.
+A pixmap of an undefined size that is filled with the background-pixel is used 
+for the background.
+Range checking is not performed on the background pixel;
+it simply is truncated to the appropriate number of bits.
+</para>
+<para>
+<!-- .LP -->
+If you set the background-pixmap,
+it overrides the default.
+The background-pixmap and the window must have the same depth,
+or a
+<errorname>BadMatch</errorname>
+error results.
+If you set background-pixmap to
+<symbol>None</symbol>,
+the window has no defined background.  
+If you set the background-pixmap to
+<symbol>ParentRelative</symbol>:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+The parent window's background-pixmap is used. 
+The child window, however, must have the same depth as 
+its parent,
+or a
+<errorname>BadMatch</errorname>
+error results.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the parent window has a background-pixmap of
+<symbol>None</symbol>,
+the window also has a background-pixmap of
+<symbol>None</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A copy of the parent window's background-pixmap is not made.
+The parent's background-pixmap is examined each time the child window's 
+background-pixmap is required.  
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The background tile origin always aligns with the parent window's
+background tile origin. 
+If the background-pixmap is not
+<symbol>ParentRelative</symbol>,
+the background tile origin is the child window's origin.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+Setting a new background, whether by setting background-pixmap or
+background-pixel, overrides any previous background.
+The background-pixmap can be freed immediately if no further explicit reference
+is made to it (the X server will keep a copy to use when needed).
+If you later draw into the pixmap used for the background,
+what happens is undefined because the
+X implementation is free to make a copy of the pixmap or
+to use the same pixmap.
+</para>
+<para>
+<!-- .LP -->
+When no valid contents are available for regions of a window
+and either the regions are visible or the server is maintaining backing store,
+the server automatically tiles the regions with the window's background
+unless the window has a background of
+<symbol>None</symbol>.
+If the background is
+<symbol>None</symbol>,
+the previous screen contents from other windows of the same depth as the window
+are simply left in place as long as the contents come from the parent of the
+window or an inferior of the parent.
+Otherwise, the initial contents of the exposed regions are undefined.
+<symbol>Expose</symbol>
+events are then generated for the regions, even if the background-pixmap
+is
+<symbol>None</symbol>
+(see <link linkend="Exposure_Events">section 10.9</link>).
+</para>
+</sect2>
+<sect2 id="Border_Attribute">
+<title>Border Attribute</title>
+<!-- .XS -->
+<!-- (SN Border Attribute -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Only
+<symbol>InputOutput</symbol>
+windows can have a border.
+You can set the border of an
+<symbol>InputOutput</symbol>
+window by using a pixel or a pixmap.
+</para>
+<para>
+<!-- .LP -->
+The border-pixmap attribute of a window specifies the pixmap to be used 
+for a window's border.
+The border-pixel attribute of a window specifies a pixmap of undefined size 
+filled with that pixel be used for a window's border. 
+Range checking is not performed on the background pixel;
+it simply is truncated to the appropriate number of bits.
+The border tile origin is always the same as the background tile origin.
+</para>
+<para>
+<!-- .LP -->
+You can also set the border-pixmap to a pixmap of any size (some may be faster
+than others) or to
+<symbol>CopyFromParent</symbol>
+(default).
+You can set the border-pixel to any pixel value (no default).
+</para>
+<para>
+<!-- .LP -->
+If you set a border-pixmap, 
+it overrides the default.
+The border-pixmap and the window must have the same depth,
+or a
+<errorname>BadMatch</errorname>
+error results.
+If you set the border-pixmap to 
+<symbol>CopyFromParent</symbol>,
+the parent window's border-pixmap is copied.
+Subsequent changes to the parent window's border attribute do not affect 
+the child window.
+However, the child window must have the same depth as the parent window,
+or a
+<errorname>BadMatch</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+The border-pixmap can be freed immediately if no further explicit reference
+is made to it.
+If you later draw into the pixmap used for the border,
+what happens is undefined because the
+X implementation is free either to make a copy of the pixmap or
+to use the same pixmap.
+If you specify a border-pixel, 
+it overrides either the default border-pixmap
+or any value you may have set in the border-pixmap.
+All pixels in the window's border will be set to the border-pixel.
+Setting a new border, whether by setting border-pixel or by setting
+border-pixmap, overrides any previous border.
+</para>
+<para>
+<!-- .LP -->
+Output to a window is always clipped to the inside of the window. 
+Therefore, graphics operations never affect the window border.
+</para>
+</sect2>
+<sect2 id="Gravity_Attributes">
+<title>Gravity Attributes</title>
+<!-- .XS -->
+<!-- (SN Gravity Attributes -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The bit gravity of a window defines which region of the window should be 
+retained when an
+<symbol>InputOutput</symbol>
+window is resized. 
+The default value for the bit-gravity attribute is 
+<symbol>ForgetGravity</symbol>.
+The window gravity of a window allows you to define how the 
+<symbol>InputOutput</symbol>
+or
+<symbol>InputOnly</symbol>
+window should be repositioned if its parent is resized.  
+The default value for the win-gravity attribute is 
+<symbol>NorthWestGravity</symbol>.
+</para>
+<para>
+<!-- .LP -->
+If the inside width or height of a window is not changed 
+and if the window is moved or its border is changed, 
+then the contents of the window are not lost but move with the window.
+Changing the inside width or height of the window causes its contents to be
+moved or lost (depending on the bit-gravity of the window) and causes
+children to be reconfigured (depending on their win-gravity).
+For a
+change of width and height, the (x, y) pairs are defined:
+</para>
+<para>
+<!-- .LP -->
+<informaltable frame='topbot'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth='1.0*'/>
+  <colspec colname='c2' colwidth='2.0*'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Gravity Direction</entry>
+      <entry>Coordinates</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry><symbol>NorthWestGravity</symbol></entry>
+      <entry>(0, 0)</entry>
+    </row>
+    <row>
+      <entry><symbol>NorthGravity</symbol></entry>
+      <entry>(Width/2, 0)</entry>
+    </row>
+    <row>
+      <entry><symbol>NorthEastGravity</symbol></entry>
+      <entry>(Width, 0)</entry>
+    </row>
+    <row>
+      <entry><symbol>WestGravity</symbol></entry>
+      <entry>(0, Height/2)</entry>
+    </row>
+    <row>
+      <entry><symbol>CenterGravity</symbol></entry>
+      <entry>(Width/2, Height/2)</entry>
+    </row>
+    <row>
+      <entry><symbol>EastGravity</symbol></entry>
+      <entry>(Width, Height/2)</entry>
+    </row>
+    <row>
+      <entry><symbol>SouthWestGravity</symbol></entry>
+      <entry>(0, Height)</entry>
+    </row>
+    <row>
+      <entry><symbol>SouthGravity</symbol></entry>
+      <entry>(Width/2, Height)</entry>
+    </row>
+    <row>
+      <entry><symbol>SouthEastGravity</symbol></entry>
+      <entry>(Width, Height)</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+</para>
+<para>
+<!-- .LP -->
+When a window with one of these bit-gravity values is resized, 
+the corresponding pair
+defines the change in position of each pixel in the window.
+When a window with one of these win-gravities has its parent window resized,
+the corresponding pair defines the change in position of the window 
+within the parent.
+When a window is so repositioned, a
+<symbol>GravityNotify</symbol>
+event is generated
+(see <link linkend="GravityNotify_Events">section 10.10.5</link>).
+</para>
+<para>
+<!-- .LP -->
+A bit-gravity of
+<symbol>StaticGravity</symbol>
+indicates that the contents or origin should not move relative to the 
+origin of the root window.
+If the change in size of the window is coupled with a change in position (x, y),
+then for bit-gravity the change in position of each pixel is (&minus;x, &minus;y), and for
+win-gravity the change in position of a child when its parent is so resized is
+(&minus;x, &minus;y).
+Note that
+<symbol>StaticGravity</symbol>
+still only takes effect when the width or height of the window is changed, 
+not when the window is moved.
+</para>
+<para>
+<!-- .LP -->
+A bit-gravity of 
+<symbol>ForgetGravity</symbol>
+indicates that the window's contents are always discarded after a size change, 
+even if a backing store or save under has been requested.
+The window is tiled with its background
+and zero or more 
+<symbol>Expose</symbol>
+events are generated. 
+If no background is defined, the existing screen contents are not
+altered.
+Some X servers may also ignore the specified bit-gravity and 
+always generate 
+<symbol>Expose</symbol>
+events.
+</para>
+<para>
+<!-- .LP -->
+The contents and borders of inferiors are not affected by their parent's
+bit-gravity.
+A server is permitted to ignore the specified bit-gravity and use
+<symbol>Forget</symbol>
+instead.
+</para>
+<para>
+<!-- .LP -->
+A win-gravity of 
+<symbol>UnmapGravity</symbol>
+is like 
+<symbol>NorthWestGravity</symbol>
+(the window is not moved),
+except the child is also
+unmapped when the parent is resized,
+and an 
+<symbol>UnmapNotify</symbol>
+event is
+generated.
+</para>
+</sect2>
+<sect2 id="Backing_Store_Attribute">
+<title>Backing Store Attribute</title>
+<!-- .XS -->
+<!-- (SN Backing Store Attribute -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Some implementations of the X server may choose to maintain the contents of 
+<symbol>InputOutput</symbol>
+windows.
+If the X server maintains the contents of a window, 
+the off-screen saved pixels
+are known as backing store.
+The backing store advises the X server on what to do 
+with the contents of a window.
+The backing-store attribute can be set to
+<symbol>NotUseful</symbol>
+(default),
+<symbol>WhenMapped</symbol>,
+or
+<symbol>Always</symbol>.
+</para>
+<para>
+<!-- .LP -->
+A backing-store attribute of 
+<symbol>NotUseful</symbol>
+advises the X server that 
+maintaining contents is unnecessary, 
+although some X implementations may
+still choose to maintain contents and, therefore, not generate 
+<symbol>Expose</symbol>
+events.
+A backing-store attribute of 
+<symbol>WhenMapped</symbol>
+advises the X server that maintaining contents of 
+obscured regions when the window is mapped would be beneficial.
+In this case,
+the server may generate an 
+<symbol>Expose</symbol>
+event when the window is created.
+A backing-store attribute of 
+<symbol>Always</symbol>
+advises the X server that maintaining contents even when 
+the window is unmapped would be beneficial.  
+Even if the window is larger than its parent, 
+this is a request to the X server to maintain complete contents, 
+not just the region within the parent window boundaries.  
+While the X server maintains the window's contents, 
+<symbol>Expose</symbol>
+events normally are not generated, 
+but the X server may stop maintaining 
+contents at any time.  
+</para>
+<para>
+<!-- .LP -->
+When the contents of obscured regions of a window are being maintained,
+regions obscured by noninferior windows are included in the destination
+of graphics requests (and source, when the window is the source).
+However, regions obscured by inferior windows are not included.
+</para>
+</sect2>
+<sect2 id="Save_Under_Flag">
+<title>Save Under Flag</title>
+<!-- .XS -->
+<!-- (SN Save Under Flag -->
+<!-- .XE -->
+<indexterm><primary>Save Unders</primary></indexterm>
+<para>
+<!-- .LP -->
+Some server implementations may preserve contents of 
+<symbol>InputOutput</symbol>
+windows under other 
+<symbol>InputOutput</symbol>
+windows.
+This is not the same as preserving the contents of a window for you.
+You may get better visual
+appeal if transient windows (for example, pop-up menus) request that the system
+preserve the screen contents under them, 
+so the temporarily obscured applications do not have to repaint.
+</para>
+<para>
+<!-- .LP -->
+You can set the save-under flag to
+<symbol>True</symbol>
+or
+<symbol>False</symbol>
+(default).
+If save-under is 
+<symbol>True</symbol>,
+the X server is advised that, when this window is mapped, 
+saving the contents of windows it obscures would be beneficial.
+</para>
+</sect2>
+<sect2 id="Backing_Planes_and_Backing_Pixel_Attributes">
+<title>Backing Planes and Backing Pixel Attributes</title>
+<!-- .XS -->
+<!-- (SN Backing Planes and Backing Pixel Attributes -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+You can set backing planes to indicate (with bits set to 1) 
+which bit planes of an
+<symbol>InputOutput</symbol>
+window hold dynamic data that must be preserved in backing store 
+and during save unders.
+The default value for the backing-planes attribute is all bits set to 1.
+You can set backing pixel to specify what bits to use in planes not 
+covered by backing planes.
+The default value for the backing-pixel attribute is all bits set to 0.
+The X server is free to save only the specified bit planes in the backing store
+or the save under and is free to regenerate the remaining planes with 
+the specified pixel value.
+Any extraneous bits in these values (that is, those bits beyond 
+the specified depth of the window) may be simply ignored.
+If you request backing store or save unders,
+you should use these members to minimize the amount of off-screen memory 
+required to store your window.
+</para>
+</sect2>
+<sect2 id="Event_Mask_and_Do_Not_Propagate_Mask_Attributes">
+<title>Event Mask and Do Not Propagate Mask Attributes</title>
+<!-- .XS -->
+<!-- (SN Event Mask and Do Not Propagate Mask Attributes -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The event mask defines which events the client is interested in for this 
+<symbol>InputOutput</symbol>
+or
+<symbol>InputOnly</symbol>
+window (or, for some event types, inferiors of this window).
+The event mask is the bitwise inclusive OR of zero or more of the 
+valid event mask bits.
+You can specify that no maskable events are reported by setting 
+<symbol>NoEventMask</symbol>
+(default).
+</para>
+<para>
+<!-- .LP -->
+The do-not-propagate-mask attribute
+defines which events should not be propagated to 
+ancestor windows when no client has the event type selected in this 
+<symbol>InputOutput</symbol>
+or
+<symbol>InputOnly</symbol>
+window.
+The do-not-propagate-mask is the bitwise inclusive OR of zero or more
+of the following masks:
+<symbol>KeyPress</symbol>,
+<symbol>KeyRelease</symbol>,
+<symbol>ButtonPress</symbol>,
+<symbol>ButtonRelease</symbol>,
+<symbol>PointerMotion</symbol>,
+<symbol>Button1Motion</symbol>,
+<symbol>Button2Motion</symbol>,
+<symbol>Button3Motion</symbol>,
+<symbol>Button4Motion</symbol>,
+<symbol>Button5Motion</symbol>,
+and
+<symbol>ButtonMotion</symbol>.
+You can specify that all events are propagated by setting 
+<symbol>NoEventMask</symbol>
+(default).
+</para>
+</sect2>
+<sect2 id="Override_Redirect_Flag">
+<title>Override Redirect Flag</title>
+<!-- .XS -->
+<!-- (SN Override Redirect Flag -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To control window placement or to add decoration,
+a window manager often needs to intercept (redirect) any map or configure
+request.
+Pop-up windows, however, often need to be mapped without a window manager
+getting in the way.
+To control whether an
+<symbol>InputOutput</symbol>
+or
+<symbol>InputOnly</symbol>
+window is to ignore these structure control facilities,
+use the override-redirect flag.
+</para>
+<para>
+<!-- .LP -->
+The override-redirect flag specifies whether map and configure requests 
+on this window should override a 
+<symbol>SubstructureRedirectMask</symbol>
+on the parent.
+You can set the override-redirect flag to
+<symbol>True</symbol>
+or
+<symbol>False</symbol>
+(default).
+Window managers use this information to avoid tampering with pop-up windows
+(see also <link linkend='Inter_Client_Communication_Functions'>chapter 14</link>).
+</para>
+</sect2>
+<sect2 id="Colormap_Attribute">
+<title>Colormap Attribute</title>
+<!-- .XS -->
+<!-- (SN Colormap Attribute -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The colormap attribute specifies which colormap best reflects the true
+colors of the 
+<symbol>InputOutput</symbol>
+window.  
+The colormap must have the same visual type as the window,
+or a 
+<errorname>BadMatch</errorname>
+error results.  
+X servers capable of supporting multiple 
+hardware colormaps can use this information, 
+and window managers can use it for calls to
+<xref linkend='XInstallColormap' xrefstyle='select: title'/>.
+You can set the colormap attribute to a colormap or to
+<symbol>CopyFromParent</symbol>
+(default).
+</para>
+<para>
+<!-- .LP -->
+If you set the colormap to
+<symbol>CopyFromParent</symbol>,
+the parent window's colormap is copied and used by its child.
+However, the child window must have the same visual type as the parent, 
+or a 
+<errorname>BadMatch</errorname>
+error results. 
+The parent window must not have a colormap of 
+<symbol>None</symbol>,
+or a 
+<errorname>BadMatch</errorname>
+error results.
+The colormap is copied by sharing the colormap object between the child 
+and parent, not by making a complete copy of the colormap contents.
+Subsequent changes to the parent window's colormap attribute do
+not affect the child window.
+</para>
+</sect2>
+<sect2 id="Cursor_Attribute">
+<title>Cursor Attribute</title>
+<!-- .XS -->
+<!-- (SN Cursor Attribute -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The cursor attribute specifies which cursor is to be used when the pointer is
+in the 
+<symbol>InputOutput</symbol>
+or
+<symbol>InputOnly</symbol>
+window.
+You can set the cursor to a cursor or
+<symbol>None</symbol>
+(default).
+</para>
+<para>
+<!-- .LP -->
+If you set the cursor to
+<symbol>None</symbol>,
+the parent's cursor is used when the 
+pointer is in the 
+<symbol>InputOutput</symbol>
+or
+<symbol>InputOnly</symbol>
+window, and any change in the parent's cursor will cause an
+immediate change in the displayed cursor.
+By calling
+<xref linkend='XFreeCursor' xrefstyle='select: title'/>,
+the cursor can be freed immediately as long as no further explicit reference 
+to it is made.
+</para>
+</sect2>
+</sect1>
+<sect1 id="Creating_Windows">
+<title>Creating Windows</title>
+<!-- .XS -->
+<!-- (SN Creating Windows -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides basic ways for creating windows,
+and toolkits often supply higher-level functions specifically for
+creating and placing top-level windows,
+which are discussed in the appropriate toolkit documentation.
+If you do not use a toolkit, however,
+you must provide some standard information or hints for the window
+manager by using the Xlib inter-client communication functions
+(see <link linkend='Inter_Client_Communication_Functions'>chapter 14</link>).
+</para>
+<para>
+<!-- .LP -->
+If you use Xlib to create your own top-level windows
+(direct children of the root window),
+you must observe the following rules so that all applications interact
+reasonably across the different styles of window management:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+You must never fight with the window manager for the size or
+placement of your top-level window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+You must be able to deal with whatever size window you get, 
+even if this means that your application just prints a message 
+like ``Please make me bigger'' in its window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+You should only attempt to resize or move top-level windows in
+direct response to a user request.
+If a request to change the size of a top-level window fails,
+you must be prepared to live with what you get.
+You are free to resize or move the children of top-level
+windows as necessary.
+(Toolkits often have facilities for automatic relayout.)
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If you do not use a toolkit that automatically sets standard window properties,
+you should set these properties for top-level windows before mapping them.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+For further information,
+see <link linkend='Inter_Client_Communication_Functions'>chapter 14</link> and
+the <citetitle>Inter-Client Communication Conventions Manual</citetitle>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XCreateWindow' xrefstyle='select: title'/>
+is the more general function that allows you to set specific window attributes 
+when you create a window.
+<xref linkend='XCreateSimpleWindow' xrefstyle='select: title'/>
+creates a window that inherits its attributes from its parent window.
+</para>
+<para>
+<!-- .LP -->
+<indexterm><primary>Window</primary><secondary>InputOnly</secondary></indexterm>
+The X server acts as if 
+<symbol>InputOnly</symbol>
+windows do not exist for
+the purposes of graphics requests, exposure processing, and
+<symbol>VisibilityNotify</symbol>
+events.
+An 
+<symbol>InputOnly</symbol>
+window cannot be used as a
+drawable (that is, as a source or destination for graphics requests).
+<symbol>InputOnly</symbol>
+and 
+<symbol>InputOutput</symbol>
+windows act identically in other respects (properties,
+grabs, input control, and so on).
+Extension packages can define other classes of windows.
+</para>
+<para>
+<!-- .LP -->
+To create an unmapped window and set its window attributes, use
+<xref linkend='XCreateWindow' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XCreateWindow</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XCreateWindow'>
+<funcprototype>
+  <funcdef>Window <function>XCreateWindow</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>parent</parameter></paramdef>
+  <paramdef>int <parameter>x</parameter></paramdef>
+  <paramdef>int <parameter>y</parameter></paramdef>
+  <paramdef>unsigned int <parameter>width</parameter></paramdef>
+  <paramdef>unsigned int <parameter>height</parameter></paramdef>
+  <paramdef>unsigned int <parameter>border_width</parameter></paramdef>
+  <paramdef>int <parameter>depth</parameter></paramdef>
+  <paramdef>unsigned int <parameter>class</parameter></paramdef>
+  <paramdef>Visual *<parameter>visual</parameter></paramdef>
+  <paramdef>unsigned long <parameter>valuemask</parameter></paramdef>
+  <paramdef>XSetWindowAttributes *<parameter>attributes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>parent</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the parent window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, which are the top-left outside corner of
+the created window's borders and are relative to the inside of the parent
+window's borders.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the width and height, which are the created window's inside
+dimensions and do not include the created window's borders.
+The dimensions must be nonzero,
+or a
+<errorname>BadValue</errorname>
+error results.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>border_width</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the width of the created window's border in pixels.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>depth</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window's depth.
+A depth of 
+<symbol>CopyFromParent</symbol>
+means the depth is taken from the parent.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the created window's class.
+You can pass
+<symbol>InputOutput</symbol>,
+<symbol>InputOnly</symbol>,
+or 
+<symbol>CopyFromParent</symbol>.
+A class of 
+<symbol>CopyFromParent</symbol>
+means the class
+is taken from the parent.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>visual</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the visual type.
+A visual of 
+<symbol>CopyFromParent</symbol>
+means the visual type is taken from the 
+parent.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>valuemask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies which window attributes are defined in the attributes
+argument.
+This mask is the bitwise inclusive OR of the valid attribute mask bits.
+If valuemask is zero,
+the attributes are ignored and are not referenced.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>attributes</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the structure from which the values (as specified by the value mask)
+are to be taken.
+The value mask should have the appropriate bits
+set to indicate which attributes have been set in the structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XCreateWindow' xrefstyle='select: title'/>
+function creates an unmapped subwindow for a specified parent window, 
+returns the window ID of the created window, 
+and causes the X server to generate a
+<symbol>CreateNotify</symbol>
+event.
+The created window is placed on top in the stacking order 
+with respect to siblings.
+</para>
+<para>
+<!-- .LP -->
+The coordinate system has the X axis horizontal and the Y axis vertical
+with the origin [0, 0] at the upper-left corner.
+Coordinates are integral,
+in terms of pixels,
+and coincide with pixel centers.
+Each window and pixmap has its own coordinate system.
+For a window, 
+the origin is inside the border at the inside, upper-left corner.
+</para>
+<para>
+<!-- .LP -->
+The border_width for an
+<symbol>InputOnly</symbol>
+window must be zero, or a
+<errorname>BadMatch</errorname>
+error results.
+For class
+<symbol>InputOutput</symbol>,
+the visual type and depth must be a combination supported for the screen,
+or a
+<errorname>BadMatch</errorname>
+error results.
+The depth need not be the same as the parent,
+but the parent must not be a window of class 
+<symbol>InputOnly</symbol>,
+or a
+<errorname>BadMatch</errorname>
+error results.
+For an
+<symbol>InputOnly</symbol>
+window,
+the depth must be zero, and the visual must be one supported by the screen.
+If either condition is not met,
+a
+<errorname>BadMatch</errorname>
+error results.
+The parent window, however, may have any depth and class.
+If you specify any invalid window attribute for a window, a
+<errorname>BadMatch</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+The created window is not yet displayed (mapped) on the user's display.
+To display the window, call
+<xref linkend='XMapWindow' xrefstyle='select: title'/>.
+The new window initially uses the same cursor as
+its parent. 
+A new cursor can be defined for the new window by calling
+<xref linkend='XDefineCursor' xrefstyle='select: title'/>.
+<indexterm><primary>Cursor</primary><secondary>Initial State</secondary></indexterm>
+<indexterm><primary>XDefineCursor</primary></indexterm>
+The window will not be visible on the screen unless it and all of its
+ancestors are mapped and it is not obscured by any of its ancestors.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XCreateWindow' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>,
+<errorname>BadColor</errorname>,
+<errorname>BadCursor</errorname>,
+<errorname>BadMatch</errorname>,
+<errorname>BadPixmap</errorname>,
+<errorname>BadValue</errorname>,
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To create an unmapped 
+<symbol>InputOutput</symbol>
+subwindow of a given parent window, use
+<xref linkend='XCreateSimpleWindow' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XCreateSimpleWindow</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XCreateSimpleWindow'>
+<funcprototype>
+  <funcdef>Window <function>XCreateSimpleWindow</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>parent</parameter></paramdef>
+  <paramdef>int <parameter>x</parameter></paramdef>
+  <paramdef>int <parameter>y</parameter></paramdef>
+  <paramdef>unsigned int <parameter>width</parameter></paramdef>
+  <paramdef>unsigned int <parameter>height</parameter></paramdef>
+  <paramdef>unsigned int <parameter>border_width</parameter></paramdef>
+  <paramdef>unsigned long <parameter>border</parameter></paramdef>
+  <paramdef>unsigned long <parameter>background</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>parent</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the parent window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, which are the top-left outside corner of
+the new window's borders and are relative to the inside of the parent
+window's borders.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the width and height, which are the created window's inside
+dimensions and do not include the created window's borders.
+The dimensions must be nonzero,
+or a
+<errorname>BadValue</errorname>
+error results.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>border_width</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the width of the created window's border in pixels.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>border</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the border pixel value of the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>background</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the background pixel value of the window.
+
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XCreateSimpleWindow' xrefstyle='select: title'/>
+function creates an unmapped
+<symbol>InputOutput</symbol>
+subwindow for a specified parent window, returns the
+window ID of the created window, and causes the X server to generate a
+<symbol>CreateNotify</symbol>
+event.
+The created window is placed on top in the stacking order with respect to 
+siblings.
+Any part of the window that extends outside its parent window is clipped.
+The border_width for an
+<symbol>InputOnly</symbol>
+window must be zero, or a
+<errorname>BadMatch</errorname>
+error results.
+<xref linkend='XCreateSimpleWindow' xrefstyle='select: title'/>
+inherits its depth, class, and visual from its parent.
+All other window attributes, except background and border, 
+have their default values.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XCreateSimpleWindow' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>,
+<errorname>BadMatch</errorname>,
+<errorname>BadValue</errorname>,
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+</sect1>
+<sect1 id="Destroying_Windows">
+<title>Destroying Windows</title>
+<!-- .XS -->
+<!-- (SN Destroying Windows  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to destroy a window or destroy all
+subwindows of a window.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To destroy a window and all of its subwindows, use
+<xref linkend='XDestroyWindow' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XDestroyWindow</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XDestroyWindow'>
+<funcprototype>
+  <funcdef><function>XDestroyWindow</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XDestroyWindow' xrefstyle='select: title'/>
+function destroys the specified window as well as all of its subwindows and causes
+the X server to generate a
+<symbol>DestroyNotify</symbol>
+event for each window.
+The window should never be referenced again.
+If the window specified by the w argument is mapped,
+it is unmapped automatically.
+The ordering of the
+<symbol>DestroyNotify</symbol>
+events is such that for any given window being destroyed,
+<symbol>DestroyNotify</symbol>
+is generated on any inferiors of the window before being generated on
+the window itself.
+The ordering among siblings and across subhierarchies is not otherwise
+constrained.
+If the window you specified is a root window, no windows are destroyed.
+Destroying a mapped window will generate 
+<symbol>Expose</symbol>
+events on other windows that were obscured by the window being destroyed.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XDestroyWindow' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To destroy all subwindows of a specified window, use 
+<xref linkend='XDestroySubwindows' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XDestroySubwindows</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XDestroySubwindows'>
+<funcprototype>
+  <funcdef><function>XDestroySubwindows</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XDestroySubwindows' xrefstyle='select: title'/>
+function destroys all inferior windows of the specified window, 
+in bottom-to-top stacking order.
+It causes the X server to generate a
+<symbol>DestroyNotify</symbol>
+event for each window.
+If any mapped
+subwindows were actually destroyed,
+<xref linkend='XDestroySubwindows' xrefstyle='select: title'/>
+causes the X server to generate 
+<symbol>Expose</symbol>
+events on the specified window.
+This is much more efficient than deleting many windows
+one at a time because much of the work need be performed only once for all
+of the windows, rather than for each window.
+The subwindows should never be referenced again.  
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XDestroySubwindows' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+</sect1>
+<sect1 id='Mapping_Windows'>
+<title>Mapping Windows</title>
+<!-- .XS -->
+<!-- (SN Mapping Windows  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+A window is considered mapped if an 
+<xref linkend='XMapWindow' xrefstyle='select: title'/>
+call has been made on it.
+It may not be visible on the screen for one of the following reasons:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+It is obscured by another opaque window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+One of its ancestors is not mapped.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It is entirely clipped by an ancestor.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+<symbol>Expose</symbol>
+events are generated for the window when part or all of
+it becomes visible on the screen. 
+A client receives the
+<symbol>Expose</symbol>
+events only if it has asked for them.
+Windows retain their position in the stacking order when they are unmapped.
+</para>
+<para>
+<!-- .LP -->
+A window manager may want to control the placement of subwindows.
+If 
+<symbol>SubstructureRedirectMask</symbol>
+has been selected by a window manager
+on a parent window (usually a root window),
+a map request initiated by other clients on a child window is not performed,
+and the window manager is sent a 
+<symbol>MapRequest</symbol>
+event.
+However, if the override-redirect flag on the child had been set to
+<symbol>True</symbol>
+(usually only on pop-up menus),
+the map request is performed.
+</para>
+<para>
+<!-- .LP -->
+A tiling window manager might decide to reposition and resize other clients' 
+windows and then decide to map the window to its final location.
+A window manager that wants to provide decoration might
+reparent the child into a frame first.
+For further information,
+see <link linkend="Override_Redirect_Flag">sections 3.2.8</link>
+and <link linkend='Window_State_Change_Events'>10.10</link>.
+Only a single client at a time can select for 
+<symbol>SubstructureRedirectMask</symbol>.
+</para>
+<para>
+<!-- .LP -->
+Similarly, a single client can select for 
+<symbol>ResizeRedirectMask</symbol>
+on a parent window.
+Then, any attempt to resize the window by another client is suppressed, and
+the client receives a 
+<symbol>ResizeRequest</symbol>
+event.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To map a given window, use 
+<xref linkend='XMapWindow' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XMapWindow</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XMapWindow'>
+<funcprototype>
+  <funcdef><function>XMapWindow</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XMapWindow' xrefstyle='select: title'/>
+function
+maps the window and all of its
+subwindows that have had map requests.
+Mapping a window that has an unmapped ancestor does not display the
+window but marks it as eligible for display when the ancestor becomes
+mapped.
+Such a window is called unviewable.
+When all its ancestors are mapped,
+the window becomes viewable
+and will be visible on the screen if it is not obscured by another window.
+This function has no effect if the window is already mapped.
+</para>
+<para>
+<!-- .LP -->
+If the override-redirect of the window is
+<symbol>False</symbol>
+and if some other client has selected
+<symbol>SubstructureRedirectMask</symbol>
+on the parent window, then the X server generates a
+<symbol>MapRequest</symbol>
+event, and the
+<xref linkend='XMapWindow' xrefstyle='select: title'/>
+function does not map the window.
+Otherwise, the window is mapped, and the X server generates a
+<symbol>MapNotify</symbol>
+event.
+</para>
+<para>
+<!-- .LP -->
+If the window becomes viewable and no earlier contents for it are remembered,
+the X server tiles the window with its background.
+If the window's background is undefined,
+the existing screen contents are not
+altered, and the X server generates zero or more 
+<symbol>Expose</symbol>
+events.
+If backing-store was maintained while the window was unmapped, no 
+<symbol>Expose</symbol>
+events
+are generated.
+If backing-store will now be maintained, 
+a full-window exposure is always generated.
+Otherwise, only visible regions may be reported.
+Similar tiling and exposure take place for any newly viewable inferiors.
+</para>
+<para>
+<!-- .LP -->
+<indexterm><primary>XMapWindow</primary></indexterm>
+If the window is an
+<symbol>InputOutput</symbol>
+window,
+<xref linkend='XMapWindow' xrefstyle='select: title'/>
+generates 
+<symbol>Expose</symbol>
+events on each 
+<symbol>InputOutput</symbol>
+window that it causes to be displayed.
+If the client maps and paints the window 
+and if the client begins processing events, 
+the window is painted twice.
+To avoid this,
+first ask for 
+<symbol>Expose</symbol>
+events and then map the window,
+so the client processes input events as usual.
+The event list will include 
+<symbol>Expose</symbol>
+for each
+window that has appeared on the screen. 
+The client's normal response to
+an 
+<symbol>Expose</symbol>
+event should be to repaint the window.
+This method usually leads to simpler programs and to proper interaction
+with window managers.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XMapWindow' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To map and raise a window, use
+<xref linkend='XMapRaised' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XMapRaised</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XMapRaised'>
+<funcprototype>
+  <funcdef><function>XMapRaised</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XMapRaised' xrefstyle='select: title'/>
+function
+essentially is similar to
+<xref linkend='XMapWindow' xrefstyle='select: title'/>
+in that it maps the window and all of its
+subwindows that have had map requests.
+However, it also raises the specified window to the top of the stack.
+For additional information,
+see 
+<xref linkend='XMapWindow' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XMapRaised' xrefstyle='select: title'/>
+can generate multiple
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To map all subwindows for a specified window, use 
+<xref linkend='XMapSubwindows' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XMapSubwindows</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XMapSubwindows'>
+<funcprototype>
+  <funcdef><function>XMapSubwindows</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XMapSubwindows' xrefstyle='select: title'/>
+<indexterm><primary>XMapSubwindows</primary></indexterm>
+function maps all subwindows for a specified window in top-to-bottom stacking 
+order.
+The X server generates
+<symbol>Expose</symbol>
+events on each newly displayed window.
+This may be much more efficient than mapping many windows
+one at a time because the server needs to perform much of the work
+only once, for all of the windows, rather than for each window.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XMapSubwindows' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+</sect1>
+<sect1 id="Unmapping_Windows">
+<title>Unmapping Windows</title>
+<!-- .XS -->
+<!-- (SN Unmapping Windows  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to unmap a window or all subwindows.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To unmap a window, use 
+<xref linkend='XUnmapWindow' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XUnmapWindow</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XUnmapWindow'>
+<funcprototype>
+  <funcdef><function>XUnmapWindow</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XUnmapWindow' xrefstyle='select: title'/>
+function unmaps the specified window and causes the X server to generate an
+<symbol>UnmapNotify</symbol>
+<indexterm><primary>UnmapNotify Event</primary></indexterm>
+<indexterm><primary>XUnmapWindow</primary></indexterm>
+event.
+If the specified window is already unmapped, 
+<xref linkend='XUnmapWindow' xrefstyle='select: title'/>
+has no effect.
+Normal exposure processing on formerly obscured windows is performed.
+Any child window will no longer be visible until another map call is
+made on the parent.
+In other words, the subwindows are still mapped but are not visible
+until the parent is mapped.
+Unmapping a window will generate 
+<symbol>Expose</symbol>
+events on windows that were formerly obscured by it.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XUnmapWindow' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To unmap all subwindows for a specified window, use 
+<xref linkend='XUnmapSubwindows' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XUnmapSubwindows</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XUnmapSubwindows'>
+<funcprototype>
+  <funcdef><function>XUnmapSubwindows</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XUnmapSubwindows' xrefstyle='select: title'/>
+function unmaps all subwindows for the specified window in bottom-to-top
+stacking order.
+It causes the X server to generate an
+<symbol>UnmapNotify</symbol>
+event on each subwindow and 
+<symbol>Expose</symbol>
+events on formerly obscured windows.
+<indexterm><primary>UnmapNotify Event</primary></indexterm>
+Using this function is much more efficient than unmapping multiple windows
+one at a time because the server needs to perform much of the work
+only once, for all of the windows, rather than for each window.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XUnmapSubwindows' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+</sect1>
+<sect1 id="Configuring_Windows">
+<title>Configuring Windows</title>
+<!-- .XS -->
+<!-- (SN Configuring Windows  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+</para>
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to
+move a window, resize a window, move and resize a window, or
+change a window's border width.
+To change one of these parameters,
+set the appropriate member of the
+<structname>XWindowChanges</structname>
+structure and OR in the corresponding value mask in subsequent calls to
+<xref linkend='XConfigureWindow' xrefstyle='select: title'/>.
+The symbols for the value mask bits and the
+<structname>XWindowChanges</structname>
+structure are:
+<!-- .sM -->
+</para>
+<para>
+<!-- .LP -->
+
+<literallayout class="monospaced">
+/* Configure window value mask bits */
+#define      CWX              (1&lt;&lt;0)
+#define      CWY              (1&lt;&lt;1)
+#define      CWWidth          (1&lt;&lt;2)
+#define      CWHeight         (1&lt;&lt;3)
+#define      CWBorderWidth    (1&lt;&lt;4)
+#define      CWSibling        (1&lt;&lt;5)
+#define      CWStackMode      (1&lt;&lt;6)
+</literallayout>
+
+<indexterm significance="preferred"><primary>XWindowChanges</primary></indexterm>
+<literallayout class="monospaced">
+/* Values */
+
+typedef struct {
+     int x, y;
+     int width, height;
+     int border_width;
+     Window sibling;
+     int stack_mode;
+} XWindowChanges;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The x and y members are used to set the window's x and y coordinates,
+which are relative to the parent's origin
+and indicate the position of the upper-left outer corner of the window.
+The width and height members are used to set the inside size of the window,
+not including the border, and must be nonzero, or a
+<errorname>BadValue</errorname>
+error results.
+Attempts to configure a root window have no effect.
+</para>
+<para>
+<!-- .LP -->
+The border_width member is used to set the width of the border in pixels.
+Note that setting just the border width leaves the outer-left corner of the window
+in a fixed position but moves the absolute position of the window's origin.
+If you attempt to set the border-width attribute of an
+<symbol>InputOnly</symbol>
+window nonzero, a
+<errorname>BadMatch</errorname>
+error results. 
+</para>
+<para>
+<!-- .LP -->
+The sibling member is used to set the sibling window for stacking operations.
+The stack_mode member is used to set how the window is to be restacked 
+and can be set to
+<symbol>Above</symbol>,
+<symbol>Below</symbol>,
+<symbol>TopIf</symbol>,
+<symbol>BottomIf</symbol>,
+or 
+<symbol>Opposite</symbol>.
+</para>
+<para>
+<!-- .LP -->
+If the override-redirect flag of the window is
+<symbol>False</symbol>
+and if some other client has selected
+<symbol>SubstructureRedirectMask</symbol>
+on the parent, the X server generates a
+<symbol>ConfigureRequest</symbol>
+event, and no further processing is performed.
+Otherwise, 
+if some other client has selected 
+<symbol>ResizeRedirectMask</symbol>
+on the window and the inside
+width or height of the window is being changed,
+a 
+<symbol>ResizeRequest</symbol>
+event is generated, and the current inside width and height are
+used instead.
+Note that the override-redirect flag of the window has no effect
+on
+<symbol>ResizeRedirectMask</symbol>
+and that
+<symbol>SubstructureRedirectMask</symbol>
+on the parent has precedence over
+<symbol>ResizeRedirectMask</symbol>
+on the window.
+</para>
+<para>
+<!-- .LP -->
+When the geometry of the window is changed as specified, 
+the window is restacked among siblings, and a
+<symbol>ConfigureNotify</symbol>
+event is generated if the state of the window actually changes.
+<symbol>GravityNotify</symbol>
+events are generated after 
+<symbol>ConfigureNotify</symbol>
+events.
+If the inside width or height of the window has actually changed, 
+children of the window are affected as specified.
+</para>
+<para>
+<!-- .LP -->
+If a window's size actually changes,
+the window's subwindows move according to their window gravity.
+Depending on the window's bit gravity,
+the contents of the window also may be moved
+(see <link linkend="Gravity_Attributes">section 3.2.3</link>).
+</para>
+<para>
+<!-- .LP -->
+If regions of the window were obscured but now are not,
+exposure processing is performed on these formerly obscured windows, 
+including the window itself and its inferiors. 
+As a result of increasing the width or height,
+exposure processing is also performed on any new regions of the window 
+and any regions where window contents are lost.
+</para>
+<para>
+<!-- .LP -->
+The restack check (specifically, the computation for 
+<symbol>BottomIf</symbol>,
+<symbol>TopIf</symbol>,
+and 
+<symbol>Opposite</symbol>)
+is performed with respect to the window's final size and position (as
+controlled by the other arguments of the request), not its initial position.
+If a sibling is specified without a stack_mode,
+a
+<errorname>BadMatch</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+If a sibling and a stack_mode are specified, 
+the window is restacked as follows:
+</para>
+<informaltable  frame="none">
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth='1.0*'/>
+  <colspec colname='c2' colwidth='3.0*'/>
+  <tbody>
+    <row>
+      <entry><symbol>Above</symbol></entry>
+      <entry>The window is placed just above the sibling.</entry>
+    </row>
+    <row>
+      <entry><symbol>Below</symbol></entry>
+      <entry>The window is placed just below the sibling.</entry>
+    </row>
+    <row>
+      <entry><symbol>TopIf</symbol></entry>
+      <entry>If the sibling occludes the window, the window is placed at the top of the stack.</entry>
+    </row>
+    <row>
+      <entry><symbol>BottomIf</symbol></entry>
+      <entry>If the window occludes the sibling, the window is placed at the bottom of the stack.</entry>
+    </row>
+    <row>
+      <entry><symbol>Opposite</symbol></entry>
+      <entry>
+If the sibling occludes the window, the window is placed at the top of the stack.
+If the window occludes the sibling,
+the window is placed at the bottom of the stack.
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+<!-- .LP -->
+If a stack_mode is specified but no sibling is specified,
+the window is restacked as follows:
+</para>
+
+<informaltable  frame="none">
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth='1.0*'/>
+  <colspec colname='c2' colwidth='3.0*'/>
+  <tbody>
+    <row>
+      <entry><symbol>Above</symbol></entry>
+      <entry>The window is placed at the top of the stack.</entry>
+    </row>
+    <row>
+      <entry><symbol>Below</symbol></entry>
+      <entry>The window is placed at the bottom of the stack.</entry>
+    </row>
+    <row>
+      <entry><symbol>TopIf</symbol></entry>
+      <entry>
+If any sibling occludes the window, the window is placed at
+the top of the stack.
+      </entry>
+    </row>
+    <row>
+      <entry><symbol>BottomIf</symbol></entry>
+      <entry>
+If the window occludes any sibling, the window is placed at
+the bottom of the stack.
+      </entry>
+    </row>
+    <row>
+      <entry><symbol>Opposite</symbol></entry>
+      <entry>
+If any sibling occludes the window, the window
+is placed at the top of the stack.
+If the window occludes any sibling,
+the window is placed at the bottom of the stack.
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+<!-- .LP -->
+Attempts to configure a root window have no effect.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To configure a window's size, location, stacking, or border, use
+<xref linkend='XConfigureWindow' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XConfigureWindow</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XConfigureWindow'>
+<funcprototype>
+  <funcdef><function>XConfigureWindow</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>unsigned int <parameter>value_mask</parameter></paramdef>
+  <paramdef>XWindowChanges *<parameter>values</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window to be reconfigured.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>value_mask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies which values are to be set using information in
+the values structure.
+This mask is the bitwise inclusive OR of the valid configure window values bits.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>values</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the 
+<structname>XWindowChanges</structname>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XConfigureWindow' xrefstyle='select: title'/>
+function uses the values specified in the
+<structname>XWindowChanges</structname>
+structure to reconfigure a window's size, position, border, and stacking order.
+Values not specified are taken from the existing geometry of the window.
+</para>
+<para>
+<!-- .LP -->
+If a sibling is specified without a stack_mode or if the window
+is not actually a sibling,
+a
+<errorname>BadMatch</errorname>
+error results. 
+Note that the computations for
+<symbol>BottomIf</symbol>,
+<symbol>TopIf</symbol>,
+and
+<symbol>Opposite</symbol>
+are performed with respect to the window's final geometry (as controlled by the
+other arguments passed to
+<xref linkend='XConfigureWindow' xrefstyle='select: title'/>),
+not its initial geometry.
+Any backing store contents of the window, its
+inferiors, and other newly visible windows are either discarded or
+changed to reflect the current screen contents 
+(depending on the implementation).
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XConfigureWindow' xrefstyle='select: title'/>
+can generate
+<errorname>BadMatch</errorname>,
+<errorname>BadValue</errorname>,
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To move a window without changing its size, use 
+<xref linkend='XMoveWindow' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XMoveWindow</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XMoveWindow'>
+<funcprototype>
+  <funcdef><function>XMoveWindow</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>int <parameter>x</parameter></paramdef>
+  <paramdef>int <parameter>y</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN      -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window to be moved.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, which define the new location of the
+top-left pixel of the window's border or the window itself if it has no
+border.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XMoveWindow' xrefstyle='select: title'/>
+function moves the specified window to the specified x and y coordinates,
+but it does not change the window's size, raise the window, or
+change the mapping state of the window.
+Moving a mapped window may or may not lose the window's contents 
+depending on if the window is obscured by nonchildren 
+and if no backing store exists.
+If the contents of the window are lost, 
+the X server generates
+<symbol>Expose</symbol>
+events.
+Moving a mapped window generates
+<symbol>Expose</symbol>
+events on any formerly obscured windows. 
+</para>
+<para>
+<!-- .LP -->
+If the override-redirect flag of the window is 
+<symbol>False</symbol>
+and some
+other client has selected 
+<symbol>SubstructureRedirectMask</symbol>
+on the parent, the X server generates a
+<symbol>ConfigureRequest</symbol>
+event, and no further processing is
+performed.  
+Otherwise, the window is moved.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XMoveWindow' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To change a window's size without changing the upper-left coordinate, use 
+<xref linkend='XResizeWindow' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XResizeWindow</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XResizeWindow'>
+<funcprototype>
+  <funcdef><function>XResizeWindow</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>unsigned int <parameter>width</parameter></paramdef>
+  <paramdef>unsigned int <parameter>height</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the width and height, which are the interior dimensions of the
+window after the call completes.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XResizeWindow' xrefstyle='select: title'/>
+function changes the inside dimensions of the specified window, not including
+its borders.
+This function does not change the window's upper-left coordinate or
+the origin and does not restack the window.
+Changing the size of a mapped window may lose its contents and generate
+<symbol>Expose</symbol>
+events.
+If a mapped window is made smaller, 
+changing its size generates
+<symbol>Expose</symbol>
+events on windows that the mapped window formerly obscured.
+</para>
+<para>
+<!-- .LP -->
+If the override-redirect flag of the window is 
+<symbol>False</symbol>
+and some
+other client has selected 
+<symbol>SubstructureRedirectMask</symbol>
+on the parent, the X server generates a
+<symbol>ConfigureRequest</symbol>
+event, and no further processing is performed.  
+If either width or height is zero,
+a
+<errorname>BadValue</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XResizeWindow' xrefstyle='select: title'/>
+can generate
+<errorname>BadValue</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To change the size and location of a window, use 
+<xref linkend='XMoveResizeWindow' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XMoveResizeWindow</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XMoveResizeWindow'>
+<funcprototype>
+  <funcdef><function>XMoveResizeWindow</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>int <parameter>x</parameter></paramdef>
+  <paramdef>int <parameter>y</parameter></paramdef>
+  <paramdef>unsigned int <parameter>width</parameter></paramdef>
+  <paramdef>unsigned int <parameter>height</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window to be reconfigured.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, which define the new position of the
+window relative to its parent.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the width and height, which define the interior size of the window.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XMoveResizeWindow' xrefstyle='select: title'/>
+function changes the size and location of the specified window 
+without raising it.
+Moving and resizing a mapped window may generate an
+<symbol>Expose</symbol>
+event on the window.
+Depending on the new size and location parameters,
+moving and resizing a window may generate 
+<symbol>Expose</symbol>
+events on windows that the window formerly obscured. 
+</para>
+<para>
+<!-- .LP -->
+If the override-redirect flag of the window is 
+<symbol>False</symbol>
+and some
+other client has selected 
+<symbol>SubstructureRedirectMask</symbol>
+on the parent, the X server generates a
+<symbol>ConfigureRequest</symbol>
+event, and no further processing is performed.  
+Otherwise, the window size and location are changed.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XMoveResizeWindow' xrefstyle='select: title'/>
+can generate
+<errorname>BadValue</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To change the border width of a given window, use
+<xref linkend='XSetWindowBorderWidth' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetWindowBorderWidth</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetWindowBorderWidth'>
+<funcprototype>
+  <funcdef><function>XSetWindowBorderWidth</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>unsigned int <parameter>width</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the width of the window border.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XSetWindowBorderWidth' xrefstyle='select: title'/>
+function sets the specified window's border width to the specified width.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetWindowBorderWidth' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+</sect1>
+<sect1 id="Changing_Window_Stacking_Order">
+<title>Changing Window Stacking Order</title>
+<!-- .XS -->
+<!-- (SN Changing Window Stacking Order  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+</para>
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to raise, lower, circulate,
+or restack windows.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To raise a window so that no sibling window obscures it, use 
+<xref linkend='XRaiseWindow' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XRaiseWindow</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XRaiseWindow'>
+<funcprototype>
+  <funcdef><function>XRaiseWindow</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XRaiseWindow' xrefstyle='select: title'/>
+function
+raises the specified window to the top of the stack so that no sibling window
+obscures it.
+If the windows are regarded as overlapping sheets of paper stacked 
+on a desk,
+then raising a window is analogous to moving the sheet to the top of
+the stack but leaving its x and y location on the desk constant.
+Raising a mapped window may generate 
+<symbol>Expose</symbol>
+events for the window and any mapped subwindows that were formerly obscured.  
+</para>
+<para>
+<!-- .LP -->
+If the override-redirect attribute of the window is 
+<symbol>False</symbol>
+and some
+other client has selected 
+<symbol>SubstructureRedirectMask</symbol>
+on the parent, the X server generates a
+<symbol>ConfigureRequest</symbol>
+event, and no processing is performed.
+Otherwise, the window is raised.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XRaiseWindow' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To lower a window so that it does not obscure any sibling windows, use 
+<xref linkend='XLowerWindow' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XLowerWindow</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XLowerWindow'>
+<funcprototype>
+  <funcdef><function>XLowerWindow</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XLowerWindow' xrefstyle='select: title'/>
+function lowers the specified window to the bottom of the stack
+so that it does not obscure any sibling
+windows.
+If the windows are regarded as overlapping sheets of paper
+stacked on a desk, then lowering a window is analogous to moving the
+sheet to the bottom of the stack but leaving its x and y location on
+the desk constant.
+Lowering a mapped window will generate 
+<symbol>Expose</symbol>
+events on any windows it formerly obscured.
+</para>
+<para>
+<!-- .LP -->
+If the override-redirect attribute of the window is 
+<symbol>False</symbol>
+and some
+other client has selected 
+<symbol>SubstructureRedirectMask</symbol>
+on the parent, the X server generates a
+<symbol>ConfigureRequest</symbol>
+event, and no processing is performed.  
+Otherwise, the window is lowered to the bottom of the
+stack.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XLowerWindow' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To circulate a subwindow up or down, use
+<xref linkend='XCirculateSubwindows' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XCirculateSubwindows</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XCirculateSubwindows'>
+<funcprototype>
+  <funcdef><function>XCirculateSubwindows</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>int <parameter>direction</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>direction</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the direction (up or down) that you want to circulate
+the window. 
+You can pass 
+<symbol>RaiseLowest</symbol>
+or
+<symbol>LowerHighest</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XCirculateSubwindows' xrefstyle='select: title'/>
+function circulates children of the specified window in the specified 
+direction.
+If you specify
+<symbol>RaiseLowest</symbol>,
+<xref linkend='XCirculateSubwindows' xrefstyle='select: title'/>
+raises the lowest mapped child (if any) that is occluded 
+by another child to the top of the stack.
+If you specify
+<symbol>LowerHighest</symbol>,
+<xref linkend='XCirculateSubwindows' xrefstyle='select: title'/>
+lowers the highest mapped child (if any) that occludes another child
+to the bottom of the stack.
+Exposure processing is then performed on formerly obscured windows.
+If some other client has selected 
+<symbol>SubstructureRedirectMask</symbol>
+on the window, the X server generates a 
+<symbol>CirculateRequest</symbol>
+event, and no further processing is performed.
+If a child is actually restacked,
+the X server generates a
+<symbol>CirculateNotify</symbol>
+event. 
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XCirculateSubwindows' xrefstyle='select: title'/>
+can generate
+<errorname>BadValue</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To raise the lowest mapped child of a window that is partially or completely
+occluded by another child, use
+<xref linkend='XCirculateSubwindowsUp' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XCirculateSubwindowsUp</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XCirculateSubwindowsUp'>
+<funcprototype>
+  <funcdef><function>XCirculateSubwindowsUp</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XCirculateSubwindowsUp' xrefstyle='select: title'/>
+function raises the lowest mapped child of the specified window that
+is partially
+or completely
+occluded by another child.
+Completely unobscured children are not affected.
+This is a convenience function equivalent to
+<xref linkend='XCirculateSubwindows' xrefstyle='select: title'/>
+with
+<symbol>RaiseLowest</symbol>
+specified.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XCirculateSubwindowsUp' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To lower the highest mapped child of a window that partially or 
+completely occludes another child, use 
+<xref linkend='XCirculateSubwindowsDown' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XCirculateSubwindowsDown</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XCirculateSubwindowsDown'>
+<funcprototype>
+  <funcdef><function>XCirculateSubwindowsDown</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XCirculateSubwindowsDown' xrefstyle='select: title'/>
+function lowers the highest mapped child of the specified window that partially
+or completely occludes another child.
+Completely unobscured children are not affected.
+This is a convenience function equivalent to
+<xref linkend='XCirculateSubwindows' xrefstyle='select: title'/>
+with
+<symbol>LowerHighest</symbol>
+specified.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XCirculateSubwindowsDown' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To restack a set of windows from top to bottom, use 
+<xref linkend='XRestackWindows' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XRestackWindows</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XRestackWindows'>
+<funcprototype>
+  <funcdef><function>XRestackWindows</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>windows[]</parameter></paramdef>
+  <paramdef>int <parameter>nwindows</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>windows</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an array containing the windows to be restacked.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nwindows</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of windows to be restacked.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XRestackWindows' xrefstyle='select: title'/>
+function restacks the windows in the order specified,
+from top to bottom.
+The stacking order of the first window in the windows array is unaffected,
+but the other windows in the array are stacked underneath the first window,
+in the order of the array.
+The stacking order of the other windows is not affected.
+For each window in the window array that is not a child of the specified window,
+a
+<errorname>BadMatch</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+If the override-redirect attribute of a window is 
+<symbol>False</symbol>
+and some
+other client has selected 
+<symbol>SubstructureRedirectMask</symbol>
+on the parent, the X server generates 
+<symbol>ConfigureRequest</symbol>
+events for each window whose override-redirect flag is not set, 
+and no further processing is performed.
+Otherwise, the windows will be restacked in top-to-bottom order.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XRestackWindows' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+</sect1>
+<sect1 id="Changing_Window_Attributes">
+<title>Changing Window Attributes</title>
+<!-- .XS -->
+<!-- (SN Changing Window Attributes  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+</para>
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to set window attributes.
+<xref linkend='XChangeWindowAttributes' xrefstyle='select: title'/>
+is the more general function that allows you to set one or more window
+attributes provided by the
+<structname>XSetWindowAttributes</structname>
+structure.
+The other functions described in this section allow you to set one specific
+window attribute, such as a window's background.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To change one or more attributes for a given window, use
+<xref linkend='XChangeWindowAttributes' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XChangeWindowAttributes</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XChangeWindowAttributes'>
+<funcprototype>
+  <funcdef><function>XChangeWindowAttributes</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>unsigned long <parameter>valuemask</parameter></paramdef>
+  <paramdef>XSetWindowAttributes *<parameter>attributes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>valuemask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies which window attributes are defined in the attributes
+argument.
+This mask is the bitwise inclusive OR of the valid attribute mask bits.
+If valuemask is zero,
+the attributes are ignored and are not referenced.
+The values and restrictions are
+the same as for
+<xref linkend='XCreateWindow' xrefstyle='select: title'/>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      
+    </term>
+    <listitem>
+      <para>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>attributes</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the structure from which the values (as specified by the value mask)
+are to be taken.
+The value mask should have the appropriate bits
+set to indicate which attributes have been set in the structure 
+(see <link linkend="Window_Attributes">section 3.2</link>).
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Depending on the valuemask,
+the
+<xref linkend='XChangeWindowAttributes' xrefstyle='select: title'/>
+function uses the window attributes in the
+<structname>XSetWindowAttributes</structname>
+structure to change the specified window attributes.
+Changing the background does not cause the window contents to be
+changed.
+To repaint the window and its background, use 
+<xref linkend='XClearWindow' xrefstyle='select: title'/>.
+Setting the border or changing the background such that the
+border tile origin changes causes the border to be repainted.
+Changing the background of a root window to 
+<symbol>None</symbol>
+or 
+<symbol>ParentRelative</symbol>
+restores the default background pixmap.
+Changing the border of a root window to
+<symbol>CopyFromParent</symbol>
+restores the default border pixmap.
+Changing the win-gravity does not affect the current position of the
+window.
+Changing the backing-store of an obscured window to 
+<symbol>WhenMapped</symbol>
+or
+<symbol>Always</symbol>,
+or changing the backing-planes, backing-pixel, or
+save-under of a mapped window may have no immediate effect.
+Changing the colormap of a window (that is, defining a new map, not
+changing the contents of the existing map) generates a 
+<symbol>ColormapNotify</symbol>
+event.
+Changing the colormap of a visible window may have no
+immediate effect on the screen because the map may not be installed
+(see
+<xref linkend='XInstallColormap' xrefstyle='select: title'/>).
+Changing the cursor of a root window to 
+<symbol>None</symbol>
+restores the default
+cursor.
+Whenever possible, you are encouraged to share colormaps.
+</para>
+<para>
+<!-- .LP -->
+Multiple clients can select input on the same window. 
+Their event masks are maintained separately.
+When an event is generated, 
+it is reported to all interested clients. 
+However, only one client at a time can select for 
+<symbol>SubstructureRedirectMask</symbol>,
+<symbol>ResizeRedirectMask</symbol>,
+and
+<symbol>ButtonPressMask</symbol>.
+If a client attempts to select any of these event masks 
+and some other client has already selected one, 
+a
+<errorname>BadAccess</errorname>
+error results.
+There is only one do-not-propagate-mask for a window, 
+not one per client.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XChangeWindowAttributes' xrefstyle='select: title'/>
+can generate
+<errorname>BadAccess</errorname>,
+<errorname>BadColor</errorname>,
+<errorname>BadCursor</errorname>,
+<errorname>BadMatch</errorname>,
+<errorname>BadPixmap</errorname>,
+<errorname>BadValue</errorname>,
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To set the background of a window to a given pixel, use 
+<xref linkend='XSetWindowBackground' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetWindowBackground</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetWindowBackground'>
+<funcprototype>
+  <funcdef><function>XSetWindowBackground</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>unsigned long <parameter>background_pixel</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>background_pixel</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the pixel that is to be used for the background.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XSetWindowBackground' xrefstyle='select: title'/>
+function sets the background of the window to the specified pixel value.
+Changing the background does not cause the window contents to be changed.
+<xref linkend='XSetWindowBackground' xrefstyle='select: title'/>
+uses a pixmap of undefined size filled with the pixel value you passed.
+If you try to change the background of an 
+<symbol>InputOnly</symbol>
+window, a
+<errorname>BadMatch</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetWindowBackground' xrefstyle='select: title'/>
+can generate
+<errorname>BadMatch</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To set the background of a window to a given pixmap, use 
+<xref linkend='XSetWindowBackgroundPixmap' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Window</primary><secondary>background</secondary></indexterm>
+<indexterm significance="preferred"><primary>XSetWindowBackgroundPixmap</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetWindowBackgroundPixmap'>
+<funcprototype>
+  <funcdef><function>XSetWindowBackgroundPixmap</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>Pixmap <parameter>background_pixmap</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>background_pixmap</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the background pixmap,
+<symbol>ParentRelative</symbol>,
+or
+<symbol>None</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm><primary>Resource IDs</primary><secondary>freeing</secondary></indexterm>
+<indexterm><primary>Freeing</primary><secondary>resources</secondary></indexterm>
+The
+<xref linkend='XSetWindowBackgroundPixmap' xrefstyle='select: title'/>
+function sets the background pixmap of the window to the specified pixmap.
+The background pixmap can immediately be freed if no further explicit
+references to it are to be made.
+If 
+<symbol>ParentRelative</symbol>
+is specified, 
+the background pixmap of the window's parent is used,
+or on the root window, the default background is restored.
+If you try to change the background of an 
+<symbol>InputOnly</symbol>
+window, a
+<errorname>BadMatch</errorname>
+error results.
+If the background is set to
+<symbol>None</symbol>,
+the window has no defined background.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetWindowBackgroundPixmap' xrefstyle='select: title'/>
+can generate
+<errorname>BadMatch</errorname>,
+<errorname>BadPixmap</errorname>,
+and 
+<errorname>BadWindow</errorname>
+errors.
+<!-- .NT Note -->
+<xref linkend='XSetWindowBackground' xrefstyle='select: title'/>
+and
+<xref linkend='XSetWindowBackgroundPixmap' xrefstyle='select: title'/>
+do not change the current contents of the window.
+<!-- .NE -->
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To change and repaint a window's border to a given pixel, use 
+<xref linkend='XSetWindowBorder' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetWindowBorder</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetWindowBorder'>
+<funcprototype>
+  <funcdef><function>XSetWindowBorder</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>unsigned long <parameter>border_pixel</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>border_pixel</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the entry in the colormap. 
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XSetWindowBorder' xrefstyle='select: title'/>
+function sets the border of the window to the pixel value you specify.
+If you attempt to perform this on an
+<symbol>InputOnly</symbol>
+window, a
+<errorname>BadMatch</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetWindowBorder' xrefstyle='select: title'/>
+can generate
+<errorname>BadMatch</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To change and repaint the border tile of a given window, use 
+<xref linkend='XSetWindowBorderPixmap' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetWindowBorderPixmap</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetWindowBorderPixmap'>
+<funcprototype>
+  <funcdef><function>XSetWindowBorderPixmap</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>Pixmap <parameter>border_pixmap</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>border_pixmap</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the border pixmap or
+<symbol>CopyFromParent</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XSetWindowBorderPixmap' xrefstyle='select: title'/>
+function sets the border pixmap of the window to the pixmap you specify.
+The border pixmap can be freed immediately if no further explicit
+references to it are to be made.
+If you specify
+<symbol>CopyFromParent</symbol>,
+a copy of the parent window's border pixmap is used.
+If you attempt to perform this on an
+<symbol>InputOnly</symbol>
+window, a
+<errorname>BadMatch</errorname>
+error results.
+<indexterm><primary>Resource IDs</primary><secondary>freeing</secondary></indexterm>
+<indexterm><primary>Freeing</primary><secondary>resources</secondary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetWindowBorderPixmap' xrefstyle='select: title'/>
+can generate
+<errorname>BadMatch</errorname>,
+<errorname>BadPixmap</errorname>,
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To set the colormap of a given window, use
+<xref linkend='XSetWindowColormap' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetWindowColormap</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetWindowColormap'>
+<funcprototype>
+  <funcdef><function>XSetWindowColormap</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>colormap</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the colormap.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XSetWindowColormap' xrefstyle='select: title'/>
+function sets the specified colormap of the specified window.
+The colormap must have the same visual type as the window,
+or a
+<errorname>BadMatch</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetWindowColormap' xrefstyle='select: title'/>
+can generate
+<errorname>BadColor</errorname>,
+<errorname>BadMatch</errorname>,
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To define which cursor will be used in a window, use
+<xref linkend='XDefineCursor' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Window</primary><secondary>defining the cursor</secondary></indexterm>
+<indexterm significance="preferred"><primary>XDefineCursor</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XDefineCursor'>
+<funcprototype>
+  <funcdef><function>XDefineCursor</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>Cursor <parameter>cursor</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>cursor</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the cursor that is to be displayed or
+<symbol>None</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+If a cursor is set, it will be used when the pointer is in the window.
+If the cursor is
+<symbol>None</symbol>,
+it is equivalent to
+<xref linkend='XUndefineCursor' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XDefineCursor' xrefstyle='select: title'/>
+can generate
+<errorname>BadCursor</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To undefine the cursor in a given window, use
+<xref linkend='XUndefineCursor' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Window</primary><secondary>undefining the cursor</secondary></indexterm>
+<indexterm significance="preferred"><primary>XUndefineCursor</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XUndefineCursor'>
+<funcprototype>
+  <funcdef><function>XUndefineCursor</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XUndefineCursor' xrefstyle='select: title'/>
+function undoes the effect of a previous
+<xref linkend='XDefineCursor' xrefstyle='select: title'/>
+for this window.
+When the pointer is in the window,
+the parent's cursor will now be used.
+On the root window,
+the default cursor is restored.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XUndefineCursor' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+<!-- .bp -->
+
+</para>
+</sect1>
+</chapter>
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH04.xml
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH04.xml	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH04.xml	(revision 5)
@@ -0,0 +1,2507 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+	  "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+<chapter id='Window_Information_Functions'>
+<title>Window Information Functions</title>
+
+<para>
+After you connect the display to the X server and create a window, you can use the Xlib window
+information functions to:
+</para>
+<itemizedlist>
+  <listitem><para>Obtain information about a window</para></listitem>
+  <listitem><para>Translate screen coordinates</para></listitem>
+  <listitem><para>Manipulate property lists</para></listitem>
+  <listitem><para>Obtain and change window properties</para></listitem>
+  <listitem><para>Manipulate selections</para></listitem>
+</itemizedlist>
+
+<sect1 id="Obtaining_Window_Information">
+<title>Obtaining Window Information</title>
+<!-- .XS -->
+<!-- (SN Obtaining Window Information  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to obtain information about 
+the window tree, the window's current attributes, 
+the window's current geometry, or the current pointer coordinates.
+Because they are most frequently used by window managers,
+these functions all return a status to indicate whether the window still
+exists.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To obtain the parent, a list of children, and number of children for 
+a given window, use 
+<xref linkend='XQueryTree' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Child Window</primary></indexterm>
+<indexterm><primary>Parent Window</primary></indexterm>
+<indexterm significance="preferred"><primary>XQueryTree</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XQueryTree'>
+<funcprototype>
+  <funcdef>Status <function>XQueryTree</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>Window *<parameter>root_return</parameter></paramdef>
+  <paramdef>Window *<parameter>parent_return</parameter></paramdef>
+  <paramdef>Window **<parameter>children_return</parameter></paramdef>
+  <paramdef>unsigned int *<parameter>nchildren_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window whose list of children, root, parent, and number of
+children you want to obtain.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>root_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the root window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>parent_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the parent window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>children_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the list of children.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nchildren_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of children.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XQueryTree' xrefstyle='select: title'/>
+function returns the root ID, the parent window ID, 
+a pointer to the list of children windows
+(NULL when there are no children), 
+and the number of children in the list for the specified window.
+The children are listed in current stacking order, from bottom-most 
+(first) to top-most (last).
+<xref linkend='XQueryTree' xrefstyle='select: title'/>
+returns zero if it fails and nonzero if it succeeds.
+To free a non-NULL children list when it is no longer needed, use 
+<xref linkend='XFree' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XQueryTree' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To obtain the current attributes of a given window, use 
+<xref linkend='XGetWindowAttributes' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetWindowAttributes</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetWindowAttributes'>
+<funcprototype>
+  <funcdef>Status <function>XGetWindowAttributes</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>XWindowAttributes *<parameter>window_attributes_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window whose current attributes you want to obtain.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>window_attributes_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the specified window's attributes in the
+<structname>XWindowAttributes</structname>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGetWindowAttributes' xrefstyle='select: title'/>
+function returns the current attributes for the specified window to an
+<structname>XWindowAttributes</structname>
+structure.
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XWindowAttributes</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int x, y;                     /* location of window */
+     int width, height;            /* width and height of window */
+     int border_width;             /* border width of window */
+     int depth;                    /* depth of window */
+     Visual *visual;               /* the associated visual structure */
+     Window root;                  /* root of screen containing window */
+     int class;                    /* InputOutput, InputOnly*/
+     int bit_gravity;              /* one of the bit gravity values */
+     int win_gravity;              /* one of the window gravity values */
+     int backing_store;            /* NotUseful, WhenMapped, Always */
+     unsigned long backing_planes; /* planes to be preserved if possible */
+     unsigned long backing_pixel;  /* value to be used when restoring planes */
+     Bool save_under;              /* boolean, should bits under be saved? */
+     Colormap colormap;            /* color map to be associated with window */
+     Bool map_installed;           /* boolean, is color map currently installed*/
+     int map_state;                /* IsUnmapped, IsUnviewable, IsViewable */
+     long all_event_masks;         /* set of events all people have interest in*/
+     long your_event_mask;         /* my event mask */
+     long do_not_propagate_mask;   /* set of events that should not propagate */
+     Bool override_redirect;       /* boolean value for override-redirect */
+     Screen *screen;               /* back pointer to correct screen */
+} XWindowAttributes;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The x and y members are set to the upper-left outer
+corner relative to the parent window's origin.
+The width and height members are set to the inside size of the window, 
+not including the border.
+The border_width member is set to the window's border width in pixels.
+The depth member is set to the depth of the window 
+(that is, bits per pixel for the object).
+The visual member is a pointer to the screen's associated
+<structname>Visual</structname>
+structure.
+The root member is set to the root window of the screen containing the window.
+The class member is set to the window's class and can be either
+<symbol>InputOutput</symbol>
+or
+<symbol>InputOnly</symbol>.
+</para>
+<para>
+<!-- .LP -->
+The bit_gravity member is set to the window's bit gravity
+and can be one of the following:
+  <simplelist type="vert" columns="2">
+    <member><symbol>ForgetGravity</symbol></member>
+    <member><symbol>NorthWestGravity</symbol></member>
+    <member><symbol>NorthGravity</symbol></member>
+    <member><symbol>NorthEastGravity</symbol></member>
+    <member><symbol>WestGravity</symbol></member>
+
+    <member><symbol>EastGravity</symbol></member>
+    <member><symbol>SouthWestGravity</symbol></member>
+    <member><symbol>SouthGravity</symbol></member>
+    <member><symbol>SouthEastGravity</symbol></member>
+    <member><symbol>StaticGravity</symbol></member>
+  </simplelist>
+</para>
+<para>
+The win_gravity member is set to the window's window gravity
+and can be one of the following:
+  <simplelist type="vert" columns="2">
+    <member><symbol>UnmapGravity</symbol></member>
+    <member><symbol>NorthWestGravity</symbol></member>
+    <member><symbol>NorthGravity</symbol></member>
+    <member><symbol>NorthEastGravity</symbol></member>
+    <member><symbol>WestGravity</symbol></member>
+
+    <member><symbol>EastGravity</symbol></member>
+    <member><symbol>SouthWestGravity</symbol></member>
+    <member><symbol>SouthGravity</symbol></member>
+    <member><symbol>SouthEastGravity</symbol></member>
+    <member><symbol>StaticGravity</symbol></member>
+    <member><symbol>CenterGravity</symbol></member>
+  </simplelist>
+</para>
+<para>
+<!-- .LP -->
+For additional information on gravity,
+see <link linkend="Gravity_Attributes">section 3.2.3</link>.
+</para>
+<para>
+<!-- .LP -->
+The backing_store member is set to indicate how the X server should maintain
+the contents of a window 
+and can be 
+<symbol>WhenMapped</symbol>,
+<symbol>Always</symbol>,
+or
+<symbol>NotUseful</symbol>.
+The backing_planes member is set to indicate (with bits set to 1) which bit 
+planes of the window hold dynamic data that must be preserved in backing_stores 
+and during save_unders.
+The backing_pixel member is set to indicate what values to use 
+for planes not set in backing_planes.
+</para>
+<para>
+<!-- .LP -->
+The save_under member is set to 
+<symbol>True</symbol>
+or
+<symbol>False</symbol>.
+The colormap member is set to the colormap for the specified window and can be
+a colormap ID or 
+<symbol>None</symbol>.
+The map_installed member is set to indicate whether the colormap is 
+currently installed and can be 
+<symbol>True</symbol>
+or
+<symbol>False</symbol>.
+The map_state member is set to indicate the state of the window and can be
+<symbol>IsUnmapped</symbol>,
+<symbol>IsUnviewable</symbol>,
+or
+<symbol>IsViewable</symbol>.
+<symbol>IsUnviewable</symbol>
+is used if the window is mapped but some ancestor is unmapped.
+</para>
+<para>
+<!-- .LP -->
+The all_event_masks member is set to the bitwise inclusive OR of all event 
+masks selected on the window by all clients.
+The your_event_mask member is set to the bitwise inclusive OR of all event 
+masks selected by the querying client.
+The do_not_propagate_mask member is set to the bitwise inclusive OR of the 
+set of events that should not propagate.
+</para>
+<para>
+<!-- .LP -->
+The override_redirect member is set to indicate whether this window overrides
+structure control facilities and can be 
+<symbol>True</symbol>
+or
+<symbol>False</symbol>.
+Window manager clients should ignore the window if this member is
+<symbol>True</symbol>.
+</para>
+<para>
+<!-- .LP -->
+The screen member is set to a screen pointer that gives you a back pointer 
+to the correct screen.
+This makes it easier to obtain the screen information without
+having to loop over the root window fields to see which field matches.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetWindowAttributes' xrefstyle='select: title'/>
+can generate
+<errorname>BadDrawable</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To obtain the current geometry of a given drawable, use 
+<xref linkend='XGetGeometry' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetGeometry</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetGeometry'>
+<funcprototype>
+  <funcdef>Status <function>XGetGeometry</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>Window *<parameter>root_return</parameter></paramdef>
+  <paramdef>int *<parameter>x_return</parameter></paramdef>
+  <paramdef>int *<parameter>y_return</parameter></paramdef>
+  <paramdef>unsigned int *<parameter>width_return</parameter></paramdef>
+  <paramdef>unsigned int *<parameter>height_return</parameter></paramdef>
+  <paramdef>unsigned int *<parameter>border_width_return</parameter></paramdef>
+  <paramdef>unsigned int *<parameter>depth_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable, which can be a window or a pixmap.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>root_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the root window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Return the x and y coordinates that define the location of the drawable.
+For a window, 
+these coordinates specify the upper-left outer corner relative to
+its parent's origin.
+For pixmaps, these coordinates are always zero.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Return the drawable's dimensions (width and height).
+For a window, 
+these dimensions specify the inside size, not including the border.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>border_width_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the border width in pixels. 
+If the drawable is a pixmap, it returns zero.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>depth_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the depth of the drawable (bits per pixel for the object).
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGetGeometry' xrefstyle='select: title'/>
+function returns the root window and the current geometry of the drawable.
+The geometry of the drawable includes the x and y coordinates, width and height,
+border width, and depth.
+These are described in the argument list.
+It is legal to pass to this function a window whose class is
+<symbol>InputOnly</symbol>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetGeometry' xrefstyle='select: title'/>
+can generate a
+<errorname>BadDrawable</errorname>
+error.
+</para>
+</sect1>
+<sect1 id="Translating_Screen_Coordinates">
+<title>Translating Screen Coordinates</title>
+<!-- .XS -->
+<!-- (SN Translating Screen Coordinates  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Applications sometimes
+need to perform a coordinate transformation from the coordinate
+space of one window to another window or need to determine which
+window the pointing device is in.
+<xref linkend='XTranslateCoordinates' xrefstyle='select: title'/>
+and
+<xref linkend='XQueryPointer' xrefstyle='select: title'/>
+fulfill these needs (and avoid any race conditions) by
+asking the X server to perform these operations.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To translate a coordinate in one window to the coordinate
+space of another window, use
+<xref linkend='XTranslateCoordinates' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XTranslateCoordinates</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XTranslateCoordinates'>
+<funcprototype>
+  <funcdef>Bool <function>XTranslateCoordinates</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>src_w</parameter></paramdef>
+  <paramdef>Window <parameter>dest_w</parameter></paramdef>
+  <paramdef>int <parameter>src_x</parameter></paramdef>
+  <paramdef>int <parameter>src_y</parameter></paramdef>
+  <paramdef>int *<parameter>dest_x_return</parameter></paramdef>
+  <paramdef>int *<parameter>dest_y_return</parameter></paramdef>
+  <paramdef>Window *<parameter>child_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>src_w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the source window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>dest_w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the destination window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>src_x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>src_y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates within the source window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>dest_x_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>dest_y_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Return the x and y coordinates within the destination window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>child_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the child if the coordinates are contained in a mapped child of the
+destination window.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+If
+<xref linkend='XTranslateCoordinates' xrefstyle='select: title'/>
+returns
+<symbol>True</symbol>,
+it takes the src_x and src_y coordinates relative
+to the source window's origin and returns these coordinates to 
+dest_x_return and dest_y_return
+relative to the destination window's origin.
+If
+<xref linkend='XTranslateCoordinates' xrefstyle='select: title'/>
+returns 
+<symbol>False</symbol>,
+src_w and dest_w are on different screens,
+and dest_x_return and dest_y_return are zero.
+If the coordinates are contained in a mapped child of dest_w,
+that child is returned to child_return.
+Otherwise, child_return is set to
+<symbol>None</symbol>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XTranslateCoordinates' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To obtain the screen coordinates of the pointer
+or to determine the pointer coordinates relative to a specified window, use 
+<xref linkend='XQueryPointer' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XQueryPointer</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XQueryPointer'>
+<funcprototype>
+  <funcdef>Bool <function>XQueryPointer</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>Window *<parameter>root_return</parameter></paramdef>
+  <paramdef>Window *<parameter>child_return</parameter></paramdef>
+  <paramdef>int *<parameter>root_x_return</parameter></paramdef>
+  <paramdef>int *<parameter>root_y_return</parameter></paramdef>
+  <paramdef>int *<parameter>win_x_return</parameter></paramdef>
+  <paramdef>int *<parameter>win_y_return</parameter></paramdef>
+  <paramdef>unsigned int *<parameter>mask_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>root_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the root window that the pointer is in.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>child_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the child window that the pointer is located in, if any.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>root_x_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>root_y_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Return the pointer coordinates relative to the root window's origin.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>win_x_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>win_y_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Return the pointer coordinates relative to the specified window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>mask_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the current state of the modifier keys and pointer buttons.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XQueryPointer' xrefstyle='select: title'/>
+function returns the root window the pointer is logically on and the pointer
+coordinates relative to the root window's origin.
+If
+<xref linkend='XQueryPointer' xrefstyle='select: title'/>
+returns 
+<symbol>False</symbol>,
+the pointer is not on the same screen as the specified window, and
+<xref linkend='XQueryPointer' xrefstyle='select: title'/>
+returns 
+<symbol>None</symbol>
+to child_return and zero to win_x_return and win_y_return.
+If 
+<xref linkend='XQueryPointer' xrefstyle='select: title'/>
+returns 
+<symbol>True</symbol>,
+the pointer coordinates returned to win_x_return and win_y_return
+are relative to the origin of the specified window.
+In this case, 
+<xref linkend='XQueryPointer' xrefstyle='select: title'/>
+returns the child that contains the pointer, if any,
+or else
+<symbol>None</symbol>
+to child_return.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XQueryPointer' xrefstyle='select: title'/>
+returns the current logical state of the keyboard buttons 
+and the modifier keys in mask_return.
+It sets mask_return to the bitwise inclusive OR of one or more
+of the button or modifier key bitmasks to match 
+the current state of the mouse buttons and the modifier keys.
+</para>
+<para>
+<!-- .LP -->
+Note that the logical state of a device (as seen through Xlib)
+may lag the physical state if device event processing is frozen
+(see <link linkend='Pointer_Grabbing'>section 12.1</link>).
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XQueryPointer' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+</sect1>
+<sect1 id="Properties_and_Atoms">
+<title>Properties and Atoms</title>
+<!-- .XS -->
+<!-- (SN Properties and Atoms  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+A property is a collection of named, typed data.
+The window system has a set of predefined properties
+<indexterm><primary>Atom</primary><secondary>predefined</secondary></indexterm>
+(for example, the name of a window, size hints, and so on), and users can
+define any other arbitrary information and associate it with windows.
+Each property has a name,
+which is an ISO Latin-1 string.
+For each named property,
+a unique identifier (atom) is associated with it. 
+A property also has a type, for example, string or integer.
+These types are also indicated using atoms, so arbitrary new
+types can be defined.
+Data of only one type may be associated with a single
+property name.
+Clients can store and retrieve properties associated with windows.
+For efficiency reasons,
+an atom is used rather than a character string.
+<xref linkend='XInternAtom' xrefstyle='select: title'/>
+can be used to obtain the atom for property names.
+<indexterm><primary>Atom</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+A property is also stored in one of several possible formats.
+The X server can store the information as 8-bit quantities, 16-bit
+quantities, or 32-bit quantities.
+This permits the X server to present the data in the byte order that the
+client expects.
+<!-- .NT Note -->
+If you define further properties of complex type, 
+you must encode and decode them yourself.
+These functions must be carefully written if they are to be portable.
+For further information about how to write a library extension,
+see <link linkend="extensions">appendix C</link>.
+<!-- .NE -->
+The type of a property is defined by an atom, which allows for
+arbitrary extension in this type scheme.
+<indexterm><primary>Atom</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+Certain property names are
+predefined in the server for commonly used functions.
+The atoms for these properties are defined in 
+<filename class="headerfile">&lt;X11/Xatom.h&gt;</filename>.
+<indexterm type="file"><primary><filename class="headerfile">X11/Xatom.h</filename></primary></indexterm>
+<indexterm><primary>Files</primary><secondary><filename class="headerfile">&lt;X11/Xatom.h&gt;</filename></secondary></indexterm>
+<indexterm><primary>Headers</primary><secondary><filename class="headerfile">&lt;X11/Xatom.h&gt;</filename></secondary></indexterm>
+To avoid name clashes with user symbols, the 
+<code>#define</code>
+name for each atom has the XA_ prefix.
+For an explanation of the functions that let you get and set
+much of the information stored in these predefined properties,
+see <link linkend='Inter_Client_Communication_Functions'>chapter 14</link>.
+</para>
+<para>
+<!-- .LP -->
+The core protocol imposes no semantics on these property names,
+but semantics are specified in other X Consortium standards,
+such as the <citetitle>Inter-Client Communication Conventions Manual</citetitle>
+and the <citetitle>X Logical Font Description Conventions</citetitle>.
+</para>
+<para>
+<!-- .LP -->
+You can use properties to communicate other information between
+applications.
+The functions described in this section let you define new properties 
+and get the unique atom IDs in your applications.
+</para>
+<para>
+<!-- .LP -->
+Although any particular atom can have some client interpretation 
+within each of the name spaces, 
+atoms occur in five distinct name spaces within the protocol: 
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Selections
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Property names
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Property types
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Font properties 
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Type of a 
+<symbol>ClientMessage</symbol>
+event (none are built into the X server)
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+</para>
+<para>
+<!-- .LP -->
+The built-in selection property names are:
+<simplelist type="vert" columns="2">
+  <member><property>PRIMARY</property></member>
+  <member><property>SECONDARY</property></member>
+</simplelist>
+</para>
+<para>
+<!-- .LP -->
+The built-in property names are: 
+  <simplelist type="vert" columns="2">
+    <member><property>CUT_BUFFER0</property></member>
+    <member><property>CUT_BUFFER1</property></member>
+    <member><property>CUT_BUFFER2</property></member>
+    <member><property>CUT_BUFFER3</property></member>
+    <member><property>CUT_BUFFER4</property></member>
+    <member><property>CUT_BUFFER5</property></member>
+    <member><property>CUT_BUFFER6</property></member>
+    <member><property>CUT_BUFFER7</property></member>
+    <member><property>RGB_BEST_MAP</property></member>
+    <member><property>RGB_BLUE_MAP</property></member>
+    <member><property>RGB_DEFAULT_MAP</property></member>
+    <member><property>RGB_GRAY_MAP</property></member>
+    <member><property>RGB_GREEN_MAP</property></member>
+    <member><property>RGB_RED_MAP</property></member>
+
+    <member><property>RESOURCE_MANAGER</property></member>
+    <member><property>WM_CLASS</property></member>
+    <member><property>WM_CLIENT_MACHINE</property></member>
+    <member><property>WM_COLORMAP_WINDOWS</property></member>
+    <member><property>WM_COMMAND</property></member>
+    <member><property>WM_HINTS</property></member>
+    <member><property>WM_ICON_NAME</property></member>
+    <member><property>WM_ICON_SIZE</property></member>
+    <member><property>WM_NAME</property></member>
+    <member><property>WM_NORMAL_HINTS</property></member>
+    <member><property>WM_PROTOCOLS</property></member>
+    <member><property>WM_STATE</property></member>
+    <member><property>WM_TRANSIENT_FOR</property></member>
+    <member><property>WM_ZOOM_HINTS</property></member>
+  </simplelist>
+</para>
+<para>
+The built-in property types are: 
+  <simplelist type="vert" columns="2">
+    <member><property>ARC</property></member>
+    <member><property>ATOM</property></member>
+    <member><property>BITMAP</property></member>
+    <member><property>CARDINAL</property></member>
+    <member><property>COLORMAP</property></member>
+    <member><property>CURSOR</property></member>
+    <member><property>DRAWABLE</property></member>
+    <member><property>FONT</property></member>
+    <member><property>INTEGER</property></member>
+    <member><property>PIXMAP</property></member>
+    <member><property>POINT</property></member>
+    <member><property>RGB_COLOR_MAP</property></member>
+    <member><property>RECTANGLE</property></member>
+    <member><property>STRING</property></member>
+    <member><property>VISUALID</property></member>
+    <member><property>WINDOW</property></member>
+    <member><property>WM_HINTS</property></member>
+    <member><property>WM_SIZE_HINTS</property></member>
+  </simplelist>
+</para>
+<para>
+The built-in font property names are: 
+  <simplelist type="vert" columns="2">
+    <member><property>MIN_SPACE</property></member>
+    <member><property>NORM_SPACE</property></member>
+    <member><property>MAX_SPACE</property></member>
+    <member><property>END_SPACE</property></member>
+    <member><property>SUPERSCRIPT_X</property></member>
+    <member><property>SUPERSCRIPT_Y</property></member>
+    <member><property>SUBSCRIPT_X</property></member>
+    <member><property>SUBSCRIPT_Y</property></member>
+    <member><property>UNDERLINE_POSITION</property></member>
+    <member><property>UNDERLINE_THICKNESS</property></member>
+    <member><property>FONT_NAME</property></member>
+    <member><property>FULL_NAME</property></member>
+
+    <member><property>STRIKEOUT_DESCENT</property></member>
+    <member><property>STRIKEOUT_ASCENT</property></member>
+    <member><property>ITALIC_ANGLE</property></member>
+    <member><property>X_HEIGHT</property></member>
+    <member><property>QUAD_WIDTH</property></member>
+    <member><property>WEIGHT</property></member>
+    <member><property>POINT_SIZE</property></member>
+    <member><property>RESOLUTION</property></member>
+    <member><property>COPYRIGHT</property></member>
+    <member><property>NOTICE</property></member>
+    <member><property>FAMILY_NAME</property></member>
+    <member><property>CAP_HEIGHT</property></member>
+  </simplelist>
+</para>
+<para>
+<!-- .LP -->
+For further information about font properties,
+see <link linkend="Font_Metrics">section 8.5</link>.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To return an atom for a given name, use 
+<xref linkend='XInternAtom' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Atom</primary><secondary>interning</secondary></indexterm>
+<indexterm significance="preferred"><primary>XInternAtom</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XInternAtom'>
+<funcprototype>
+  <funcdef>Atom <function>XInternAtom</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>char *<parameter>atom_name</parameter></paramdef>
+  <paramdef>Bool <parameter>only_if_exists</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>atom_name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the name associated with the atom you want returned.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>only_if_exists</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a Boolean value that indicates whether the atom must be created.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XInternAtom' xrefstyle='select: title'/>
+function returns the atom identifier associated with the specified atom_name
+string.
+If only_if_exists is 
+<symbol>False</symbol>,
+the atom is created if it does not exist.
+Therefore,
+<xref linkend='XInternAtom' xrefstyle='select: title'/>
+can return
+<symbol>None</symbol>.
+If the atom name is not in the Host Portable Character Encoding, 
+the result is implementation-dependent.
+Uppercase and lowercase matter;
+the strings ``thing'', ``Thing'', and ``thinG'' 
+all designate different atoms.  
+The atom will remain defined even after the client's connection closes.
+It will become undefined only when the last connection to
+the X server closes.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XInternAtom' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>
+and
+<errorname>BadValue</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To return atoms for an array of names, use 
+<xref linkend='XInternAtoms' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Atom</primary><secondary>interning</secondary></indexterm>
+<indexterm significance="preferred"><primary>XInternAtoms</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XInternAtoms'>
+<funcprototype>
+  <funcdef>Status <function>XInternAtoms</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>char **<parameter>names</parameter></paramdef>
+  <paramdef>int <parameter>count</parameter></paramdef>
+  <paramdef>Bool <parameter>only_if_exists</parameter></paramdef>
+  <paramdef>Atom *<parameter>atoms_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>names</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the array of atom names.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of atom names in the array.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>only_if_exists</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a Boolean value that indicates whether the atom must be created.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>atoms_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the atoms.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XInternAtoms' xrefstyle='select: title'/>
+function returns the atom identifiers associated with the specified names.
+The atoms are stored in the atoms_return array supplied by the caller.
+Calling this function is equivalent to calling
+<xref linkend='XInternAtom' xrefstyle='select: title'/>
+for each of the names in turn with the specified value of only_if_exists,
+but this function minimizes the number of round-trip protocol exchanges
+between the client and the X server.
+</para>
+<para>
+<!-- .LP -->
+This function returns a nonzero status if atoms are returned for
+all of the names;
+otherwise, it returns zero.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XInternAtoms' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>
+and
+<errorname>BadValue</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To return a name for a given atom identifier, use 
+<xref linkend='XGetAtomName' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Atom</primary><secondary>getting name</secondary></indexterm>
+<indexterm significance="preferred"><primary>XGetAtomName</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetAtomName'>
+<funcprototype>
+  <funcdef>char *<function>XGetAtomName</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Atom <parameter>atom</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>atom</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the atom for the property name you want returned.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGetAtomName' xrefstyle='select: title'/>
+function returns the name associated with the specified atom.
+If the data returned by the server is in the Latin Portable Character Encoding,
+then the returned string is in the Host Portable Character Encoding.
+Otherwise, the result is implementation-dependent.
+To free the resulting string,
+call
+<xref linkend='XFree' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetAtomName' xrefstyle='select: title'/>
+can generate a
+<errorname>BadAtom</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To return the names for an array of atom identifiers, use 
+<xref linkend='XGetAtomNames' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Atom</primary><secondary>getting name</secondary></indexterm>
+<indexterm significance="preferred"><primary>XGetAtomNames</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetAtomNames'>
+<funcprototype>
+  <funcdef>Status <function>XGetAtomNames</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Atom *<parameter>atoms</parameter></paramdef>
+  <paramdef>int <parameter>count</parameter></paramdef>
+  <paramdef>char **<parameter>names_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>atoms</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the array of atoms.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of atoms in the array.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>names_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the atom names.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGetAtomNames' xrefstyle='select: title'/>
+function returns the names associated with the specified atoms.
+The names are stored in the names_return array supplied by the caller.
+Calling this function is equivalent to calling
+<xref linkend='XGetAtomName' xrefstyle='select: title'/>
+for each of the atoms in turn,
+but this function minimizes the number of round-trip protocol exchanges
+between the client and the X server.
+</para>
+<para>
+<!-- .LP -->
+This function returns a nonzero status if names are returned for
+all of the atoms;
+otherwise, it returns zero.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetAtomNames' xrefstyle='select: title'/>
+can generate a
+<errorname>BadAtom</errorname>
+error.
+</para>
+</sect1>
+<sect1 id="Obtaining_and_Changing_Window_Properties">
+<title>Obtaining and Changing Window Properties</title>
+<!-- .XS -->
+<!-- (SN Obtaining and Changing Window Properties  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+You can attach a property list to every window.
+Each property has a name, a type, and a value
+(see <link linkend="Properties_and_Atoms">section 4.3</link>).
+The value is an array of 8-bit, 16-bit, or 32-bit quantities,
+whose interpretation is left to the clients.  The type
+<type>char</type>
+is used to represent 8-bit quantities, the type
+<type>short</type>
+is used to represent 16-bit quantities, and the type
+<type>long</type>
+is used to represent 32-bit quantities.
+</para>
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to obtain, 
+change, update, or interchange window properties.
+In addition, Xlib provides other utility functions for inter-client
+communication
+(see <link linkend='Inter_Client_Communication_Functions'>chapter 14</link>).
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To obtain the type, format, and value of a property of a given window, use 
+<xref linkend='XGetWindowProperty' xrefstyle='select: title'/>.
+<indexterm><primary>Property</primary><secondary>getting</secondary></indexterm>
+</para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XGetWindowProperty</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetWindowProperty'>
+<funcprototype>
+  <funcdef>int <function>XGetWindowProperty</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window  <parameter>w</parameter></paramdef>
+  <paramdef>Atom <parameter>property</parameter></paramdef>
+  <paramdef>long <parameter>long_offset</parameter></paramdef>
+  <paramdef>long <parameter>long_length</parameter></paramdef>
+  <paramdef>Bool <parameter>delete</parameter></paramdef>
+  <paramdef>Atom <parameter>req_type</parameter></paramdef>
+  <paramdef>Atom *<parameter>actual_type_return</parameter></paramdef>
+  <paramdef>int *<parameter>actual_format_return</parameter></paramdef>
+  <paramdef>unsigned long *<parameter>nitems_return</parameter></paramdef>
+  <paramdef>unsigned long *<parameter>bytes_after_return</parameter></paramdef>
+  <paramdef>unsigned char **<parameter>prop_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window whose property you want to obtain.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>property</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the property name.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>long_offset</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the offset in the specified property (in 32-bit quantities) 
+where the data is to be retrieved.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>long_length</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the length in 32-bit multiples of the data to be retrieved.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>delete</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a Boolean value that determines whether the property is deleted.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>req_type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the atom identifier associated with the property type or
+<symbol>AnyPropertyType</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>actual_type_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the atom identifier  that defines the actual type of the property.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>actual_format_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the actual format of the property.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nitems_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the actual number of 8-bit, 16-bit, or 32-bit items 
+stored in the prop_return data.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>bytes_after_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of bytes remaining to be read in the property if 
+a partial read was performed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>prop_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the data in the specified format.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGetWindowProperty' xrefstyle='select: title'/>
+function returns the actual type of the property; the actual format of the property;
+the number of 8-bit, 16-bit, or 32-bit items transferred; the number of bytes remaining
+to be read in the property; and a pointer to the data actually returned.
+<xref linkend='XGetWindowProperty' xrefstyle='select: title'/>
+sets the return arguments as follows:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+If the specified property does not exist for the specified window,
+<xref linkend='XGetWindowProperty' xrefstyle='select: title'/>
+returns 
+<symbol>None</symbol>
+to actual_type_return and the value zero to 
+actual_format_return and bytes_after_return.
+The nitems_return argument is empty.
+In this case, the delete argument is ignored.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the specified property exists 
+but its type does not match the specified type,
+<xref linkend='XGetWindowProperty' xrefstyle='select: title'/>
+returns the actual property type to actual_type_return, 
+the actual property format (never zero) to actual_format_return, 
+and the property length in bytes
+(even if the actual_format_return is 16 or 32) 
+to bytes_after_return.
+It also ignores the delete argument.
+The nitems_return argument is empty.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the specified property exists and either you assign 
+<symbol>AnyPropertyType</symbol>
+to the req_type argument or the specified type matches the actual property type,
+<xref linkend='XGetWindowProperty' xrefstyle='select: title'/>
+returns the actual property type to actual_type_return and the actual
+property format (never zero) to actual_format_return. 
+It also returns a value to bytes_after_return and nitems_return, by 
+defining the following
+values:
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<!-- .nf -->
+     N = actual length of the stored property in bytes
+          (even if the format is 16 or 32)
+     I = 4 * long_offset
+     T = N - I
+     L = MINIMUM(T, 4 * long_length)
+     A = N - (I + L)
+<!-- .fi -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The returned value starts at byte index I in the property (indexing
+from zero), and its length in bytes is L.
+If the value for long_offset causes L to be negative,
+a
+<errorname>BadValue</errorname>
+error results. 
+The value of bytes_after_return is A, 
+giving the number of trailing unread bytes in the stored property.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+If the returned format is 8, the returned data is represented as a
+<type>char</type>
+array.
+If the returned format is 16, the returned data is represented as a
+<type>short</type>
+array and should be cast to that type to obtain the elements.
+If the returned format is 32, the returned data is represented as a
+<type>long</type>
+array and should be cast to that type to obtain the elements.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetWindowProperty' xrefstyle='select: title'/>
+always allocates one extra byte in prop_return 
+(even if the property is zero length) 
+and sets it to zero so that simple properties consisting of characters
+do not have to be copied into yet another string before use.
+</para>
+<para>
+<!-- .LP -->
+If delete is 
+<symbol>True</symbol>
+and bytes_after_return is zero, 
+<xref linkend='XGetWindowProperty' xrefstyle='select: title'/>
+deletes the property 
+from the window and generates a 
+<symbol>PropertyNotify</symbol>
+event on the window.
+</para>
+<para>
+<!-- .LP -->
+The function returns
+<symbol>Success</symbol>
+if it executes successfully.
+To free the resulting data,
+use
+<xref linkend='XFree' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetWindowProperty' xrefstyle='select: title'/>
+can generate
+<errorname>BadAtom</errorname>,
+<errorname>BadValue</errorname>,
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To obtain a given window's property list, use 
+<xref linkend='XListProperties' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Property</primary><secondary>listing</secondary></indexterm>
+<indexterm significance="preferred"><primary>XListProperties</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XListProperties'>
+<funcprototype>
+  <funcdef>Atom *<function>XListProperties</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>int *<parameter>num_prop_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window whose property list you want to obtain.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_prop_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the length of the properties array.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XListProperties' xrefstyle='select: title'/>
+function returns a pointer to an array of atom properties that are defined for 
+the specified window or returns NULL if no properties were found.
+To free the memory allocated by this function, use
+<xref linkend='XFree' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XListProperties' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To change a property of a given window, use
+<xref linkend='XChangeProperty' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Property</primary><secondary>changing</secondary></indexterm>
+<indexterm><primary>Property</primary><secondary>appending</secondary></indexterm>
+<indexterm><primary>Property</primary><secondary>prepending</secondary></indexterm>
+<indexterm><primary>Property</primary><secondary>replacing</secondary></indexterm>
+<indexterm><primary>Property</primary><secondary>format</secondary></indexterm>
+<indexterm><primary>Property</primary><secondary>type</secondary></indexterm>
+<indexterm significance="preferred"><primary>XChangeProperty</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XChangeProperty'>
+<funcprototype>
+  <funcdef><function>XChangeProperty</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>Atom <parameter>property</parameter></paramdef>
+  <paramdef>Atom <parameter>type</parameter></paramdef>
+  <paramdef>int <parameter>format</parameter></paramdef>
+  <paramdef>int <parameter>mode</parameter></paramdef>
+  <paramdef>unsignedchar *<parameter>data</parameter></paramdef>
+  <paramdef>int <parameter>nelements</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window whose property you want to change.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>property</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the property name.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the type of the property.
+The X server does not interpret the type but simply
+passes it back to an application that later calls 
+<xref linkend='XGetWindowProperty' xrefstyle='select: title'/>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>format</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies whether the data should be viewed as a list
+of 8-bit, 16-bit, or 32-bit quantities.
+Possible values are 8, 16, and 32.
+This information allows the X server to correctly perform
+byte-swap operations as necessary.
+If the format is 16-bit or 32-bit,
+you must explicitly cast your data pointer to an (unsigned char *) in the call
+to 
+<xref linkend='XChangeProperty' xrefstyle='select: title'/>.
+<!-- .\" Changed name of this file to prop_mode.a on 1/13/87 -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the mode of the operation.
+You can pass
+<symbol>PropModeReplace</symbol>,
+<symbol>PropModePrepend</symbol>,
+or
+<symbol>PropModeAppend</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the property data.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nelements</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of elements of the specified data format.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XChangeProperty' xrefstyle='select: title'/>
+function alters the property for the specified window and
+causes the X server to generate a
+<symbol>PropertyNotify</symbol>
+event on that window.
+<xref linkend='XChangeProperty' xrefstyle='select: title'/>
+performs the following:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+If mode is
+<symbol>PropModeReplace</symbol>,
+<xref linkend='XChangeProperty' xrefstyle='select: title'/>
+discards the previous property value and stores the new data.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If mode is
+<symbol>PropModePrepend</symbol>
+or
+<symbol>PropModeAppend</symbol>,
+<xref linkend='XChangeProperty' xrefstyle='select: title'/>
+inserts the specified data before the beginning of the existing data
+or onto the end of the existing data, respectively.
+The type and format must match the existing property value,
+or a
+<errorname>BadMatch</errorname>
+error results.
+If the property is undefined, 
+it is treated as defined with the correct type and
+format with zero-length data.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+If the specified format is 8, the property data must be a
+<type>char</type>
+array.
+If the specified format is 16, the property data must be a
+<type>short</type>
+array.
+If the specified format is 32, the property data must be a
+<type>long</type>
+array.
+</para>
+<para>
+<!-- .LP -->
+The lifetime of a property is not tied to the storing client.
+Properties remain until explicitly deleted, until the window is destroyed,
+or until the server resets.
+For a discussion of what happens when the connection to the X server is closed,
+see <link linkend='Using_X_Server_Connection_Close_Operations'>section 2.6</link>.
+The maximum size of a property is server dependent and can vary dynamically
+depending on the amount of memory the server has available.
+(If there is insufficient space, a
+<errorname>BadAlloc</errorname>
+error results.)
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XChangeProperty' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>,
+<errorname>BadAtom</errorname>,
+<errorname>BadMatch</errorname>,
+<errorname>BadValue</errorname>,
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To rotate a window's property list, use
+<xref linkend='XRotateWindowProperties' xrefstyle='select: title'/>.
+</para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XRotateWindowProperties</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XRotateWindowProperties'>
+<funcprototype>
+  <funcdef><function>XRotateWindowProperties</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>Atom <parameter>properties[]</parameter></paramdef>
+  <paramdef>int <parameter>num_prop</parameter></paramdef>
+  <paramdef>int <parameter>npositions</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>properties</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the array of properties that are to be rotated.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_prop</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the length of the properties array.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>npositions</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the rotation amount.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XRotateWindowProperties' xrefstyle='select: title'/>
+function allows you to rotate properties on a window and causes
+the X server to generate
+<symbol>PropertyNotify</symbol>
+events.
+If the property names in the properties array are viewed as being numbered 
+starting from zero and if there are num_prop property names in the list,
+then the value associated with property name I becomes the value associated 
+with property name (I + npositions) mod N for all I from zero to N &minus; 1.
+The effect is to rotate the states by npositions places around the virtual ring
+of property names (right for positive npositions, 
+left for negative npositions).
+If npositions mod N is nonzero,
+the X server generates a
+<symbol>PropertyNotify</symbol>
+event for each property in the order that they are listed in the array.
+If an atom occurs more than once in the list or no property with that 
+name is defined for the window,
+a 
+<errorname>BadMatch</errorname>
+error results.
+If a 
+<errorname>BadAtom</errorname>
+or 
+<errorname>BadMatch</errorname>
+error results,
+no properties are changed.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XRotateWindowProperties' xrefstyle='select: title'/>
+can generate
+<errorname>BadAtom</errorname>,
+<errorname>BadMatch</errorname>,
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To delete a property on a given window, use 
+<xref linkend='XDeleteProperty' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Property</primary><secondary>deleting</secondary></indexterm>
+<indexterm significance="preferred"><primary>XDeleteProperty</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XDeleteProperty'>
+<funcprototype>
+  <funcdef><function>XDeleteProperty</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>Atom <parameter>property</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window whose property you want to delete.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>property</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the property name.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XDeleteProperty' xrefstyle='select: title'/>
+function deletes the specified property only if the
+property was defined on the specified window
+and causes the X server to generate a
+<symbol>PropertyNotify</symbol>
+event on the window unless the property does not exist.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XDeleteProperty' xrefstyle='select: title'/>
+can generate
+<errorname>BadAtom</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+</sect1>
+<sect1 id="Selections">
+<title>Selections</title>
+<!-- .XS -->
+<!-- (SN Selections -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Selection</primary></indexterm>
+Selections are one method used by applications to exchange data.
+By using the property mechanism,
+applications can exchange data of arbitrary types and can negotiate
+the type of the data.
+A selection can be thought of as an indirect property with a dynamic type.
+That is, rather than having the property stored in the X server,
+the property is maintained by some client (the owner).
+A selection is global in nature (considered to belong to the user 
+but be maintained by clients) rather than being private to a particular 
+window subhierarchy or a particular set of clients.
+</para>
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to set, get, or request conversion
+of selections.
+This allows applications to implement the notion of current selection,
+which requires that notification be sent to applications when they no 
+longer own the selection.
+Applications that support selection often highlight the current selection
+and so must be informed when another application has
+acquired the selection so that they can unhighlight the selection.
+</para>
+<para>
+<!-- .LP -->
+When a client asks for the contents of
+a selection, it specifies a selection target type.
+This target type
+can be used to control the transmitted representation of the contents.
+For example, if the selection is ``the last thing the user clicked on''
+and that is currently an image, then the target type might specify
+whether the contents of the image should be sent in XY format or Z format.
+</para>
+<para>
+<!-- .LP -->
+The target type can also be used to control the class of
+contents transmitted, for example, 
+asking for the ``looks'' (fonts, line
+spacing, indentation, and so forth) of a paragraph selection, not the
+text of the paragraph.
+The target type can also be used for other
+purposes.
+The protocol does not constrain the semantics.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To set the selection owner, use 
+<xref linkend='XSetSelectionOwner' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Selection</primary><secondary>setting the owner</secondary></indexterm>
+<indexterm significance="preferred"><primary>XSetSelectionOwner</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetSelectionOwner'>
+<funcprototype>
+  <funcdef><function>XSetSelectionOwner</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Atom <parameter>selection</parameter></paramdef>
+  <paramdef>Window <parameter>owner</parameter></paramdef>
+  <paramdef>Time <parameter>time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the selection atom.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>owner</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the owner of the specified selection atom.
+You can pass a window or
+<symbol>None</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the time.
+You can pass either a timestamp or
+<symbol>CurrentTime</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XSetSelectionOwner' xrefstyle='select: title'/>
+function changes the owner and last-change time for the specified selection
+and has no effect if the specified time is earlier than the current
+last-change time of the specified selection 
+or is later than the current X server time.
+Otherwise, the last-change time is set to the specified time,
+with
+<symbol>CurrentTime</symbol>
+replaced by the current server time.
+If the owner window is specified as
+<symbol>None</symbol>,
+then the owner of the selection becomes 
+<symbol>None</symbol>
+(that is, no owner).
+Otherwise, the owner of the selection becomes the client executing
+the request.
+</para>
+<para>
+<!-- .LP  -->
+If the new owner (whether a client or
+<symbol>None</symbol>)
+is not
+the same as the current owner of the selection and the current
+owner is not
+<symbol>None</symbol>,
+the current owner is sent a 
+<symbol>SelectionClear</symbol>
+event.
+If the client that is the owner of a selection is later
+terminated (that is, its connection is closed)
+or if the owner window it has specified in the request is later
+destroyed,
+the owner of the selection automatically
+reverts to
+<symbol>None</symbol>,
+but the last-change time is not affected.
+The selection atom is uninterpreted by the X server.
+<xref linkend='XGetSelectionOwner' xrefstyle='select: title'/>
+returns the owner window, which is reported in 
+<symbol>SelectionRequest</symbol>
+and
+<symbol>SelectionClear</symbol>
+events.
+Selections are global to the X server.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetSelectionOwner' xrefstyle='select: title'/>
+can generate
+<errorname>BadAtom</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To return the selection owner, use 
+<xref linkend='XGetSelectionOwner' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Selection</primary><secondary>getting the owner</secondary></indexterm>
+<indexterm significance="preferred"><primary>XGetSelectionOwner</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetSelectionOwner'>
+<funcprototype>
+  <funcdef>Window <function>XGetSelectionOwner</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Atom <parameter>selection</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the selection atom whose owner you want returned.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGetSelectionOwner' xrefstyle='select: title'/>
+function
+returns the window ID associated with the window that currently owns the
+specified selection.
+If no selection was specified, the function returns the constant
+<symbol>None</symbol>.
+If
+<symbol>None</symbol>
+is returned,
+there is no owner for the selection.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetSelectionOwner' xrefstyle='select: title'/>
+can generate a
+<errorname>BadAtom</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To request conversion of a selection, use 
+<xref linkend='XConvertSelection' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Selection</primary><secondary>converting</secondary></indexterm>
+<indexterm significance="preferred"><primary>XConvertSelection</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XConvertSelection'>
+<funcprototype>
+  <funcdef><function>XConvertSelection</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Atom <parameter>selection</parameter></paramdef>
+  <paramdef>Atom <parameter>target</parameter></paramdef>
+  <paramdef>Atom <parameter>property</parameter></paramdef>
+  <paramdef>Window <parameter>requestor</parameter></paramdef>
+  <paramdef>Time <parameter>time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the selection atom.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>target</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the target atom.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>property</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the property name.
+You also can pass 
+<symbol>None</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>requestor</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the requestor.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the time.
+You can pass either a timestamp or
+<symbol>CurrentTime</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XConvertSelection' xrefstyle='select: title'/>
+requests that the specified selection be converted to the specified target
+type:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+If the specified selection has an owner, the X server sends a
+<symbol>SelectionRequest</symbol>
+event to that owner.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If no owner for the specified
+selection exists, the X server generates a
+<symbol>SelectionNotify</symbol>
+event to the
+requestor with property
+<symbol>None</symbol>.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+The arguments are passed on unchanged in either of the events.
+There are two predefined selection atoms: PRIMARY and SECONDARY.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XConvertSelection' xrefstyle='select: title'/>
+can generate
+<errorname>BadAtom</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+<!-- .bp -->
+
+
+</para>
+</sect1>
+</chapter>
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH06.xml
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH06.xml	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH06.xml	(revision 5)
@@ -0,0 +1,7406 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+                   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+<chapter id='Color_Management_Functions'>
+<title>Color Management Functions</title>
+<!-- .sp 2 -->
+<!-- .nr H1 6 -->
+<!-- .nr H2 0 -->
+<!-- .nr H3 0 -->
+<!-- .nr H4 0 -->
+<!-- .nr H5 0 -->
+<!-- .na -->
+<para>
+<!-- .LP -->
+<!-- .XS -->
+<!-- Chapter 6: Color Management Functions  -->
+<!-- .XE -->
+Each X window always has an associated colormap that
+provides a level of indirection between pixel values and colors displayed
+on the screen.
+Xlib provides functions that you can use to manipulate a colormap.
+The X protocol defines colors using values in the <acronym>RGB</acronym> color space.
+The <acronym>RGB</acronym> color space is device dependent;
+rendering an <acronym>RGB</acronym> value on differing output devices typically results
+in different colors.
+Xlib also provides a means for clients to specify color using
+device-independent color spaces for consistent results across devices.
+Xlib supports device-independent color spaces derivable from the <acronym>CIE</acronym> XYZ
+color space.
+This includes the <acronym>CIE</acronym> XYZ, xyY, L*u*v*, and L*a*b* color spaces as well as
+the TekHVC color space.
+</para>
+<para>
+<!-- .LP -->
+This chapter discusses how to:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Create, copy, and destroy a colormap
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Specify colors by name or value
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Allocate, modify, and free color cells
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Read entries in a colormap
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Convert between color spaces
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Control aspects of color conversion
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Query the color gamut of a screen
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Add new color spaces
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+All functions, types, and symbols in this chapter with the prefix ``Xcms''
+are defined in
+<filename class="headerfile">&lt;X11/Xcms.h&gt;</filename>.
+<indexterm type="file"><primary><filename class="headerfile">X11/Xcms.h</filename></primary></indexterm>
+<indexterm><primary>Files</primary><secondary><filename class="headerfile">&lt;X11/Xcms.h&gt;</filename></secondary></indexterm>
+<indexterm><primary>Headers</primary><secondary><filename class="headerfile">&lt;X11/Xcms.h&gt;</filename></secondary></indexterm>
+The remaining functions and types are defined in
+<filename class="headerfile">&lt;X11/Xlib.h&gt;</filename>.
+<indexterm type="file"><primary><filename class="headerfile">X11/Xlib.h</filename></primary></indexterm>
+<indexterm><primary>Files</primary><secondary><filename class="headerfile">&lt;X11/Xlib.h&gt;</filename></secondary></indexterm>
+<indexterm><primary>Headers</primary><secondary><filename class="headerfile">&lt;X11/Xlib.h&gt;</filename></secondary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+Functions in this chapter manipulate the representation of color on the
+screen.
+For each possible value that a pixel can take in a window,
+there is a color cell in the colormap.
+For example, 
+if a window is 4 bits deep, pixel values 0 through 15 are defined. 
+A colormap is a collection of color cells.
+A color cell consists of a triple of red, green, and blue (<acronym>RGB</acronym>) values.
+The hardware imposes limits on the number of significant
+bits in these values.
+As each pixel is read out of display memory, the pixel
+is looked up in a colormap.
+The <acronym>RGB</acronym> value of the cell determines what color is displayed on the screen.
+On a grayscale display with a black-and-white monitor, 
+the values are combined to determine the brightness on the screen.
+</para>
+<para>
+<!-- .LP -->
+Typically, an application allocates color cells or sets of color cells
+to obtain the desired colors.
+The client can allocate read-only cells.
+In which case, 
+the pixel values for these colors can be shared among multiple applications, 
+and the <acronym>RGB</acronym> value of the cell cannot be changed.
+If the client allocates read/write cells,
+they are exclusively owned by the client,
+and the color associated with the pixel value can be changed at will.
+Cells must be allocated (and, if read/write, initialized with an <acronym>RGB</acronym> value)
+by a client to obtain desired colors.
+The use of pixel value for an
+unallocated cell results in an undefined color.
+</para>
+<para>
+<!-- .LP -->
+Because colormaps are associated with windows, X supports displays
+with multiple colormaps and, indeed, different types of colormaps.
+If there are insufficient colormap resources in the display,
+some windows will display in their true colors, and others
+will display with incorrect colors.
+A window manager usually controls which windows are displayed
+in their true colors if more than one colormap is required for
+the color resources the applications are using.
+At any time, there is a set of installed colormaps for a screen.
+Windows using one of the installed colormaps display with true colors, and
+windows using other colormaps generally display with incorrect colors.
+You can control the set of installed colormaps by using
+<xref linkend='XInstallColormap' xrefstyle='select: title'/>
+and
+<xref linkend='XUninstallColormap' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+Colormaps are local to a particular screen.
+Screens always have a default colormap,
+and programs typically allocate cells out of this colormap.
+Generally, you should not write applications that monopolize 
+color resources.
+Although some hardware supports multiple colormaps installed at one time,
+many of the hardware displays
+built today support only a single installed colormap, so the primitives
+are written to encourage sharing of colormap entries between applications.
+</para>
+<para>
+<!-- .LP -->
+The 
+<function>DefaultColormap</function>
+macro returns the default colormap.
+The 
+<function>DefaultVisual</function>
+macro
+returns the default visual type for the specified screen.
+<indexterm><primary>Color map</primary></indexterm>
+Possible visual types are 
+<symbol>StaticGray</symbol>,
+<symbol>GrayScale</symbol>,
+<symbol>StaticColor</symbol>,
+<symbol>PseudoColor</symbol>,
+<symbol>TrueColor</symbol>,
+or 
+<symbol>DirectColor</symbol>
+(see <link linkend="Visual_Types">section 3.1</link>).
+</para>
+<sect1 id="Color_Structures">
+<title>Color Structures</title>
+<!-- .XS -->
+<!-- (SN Color Structures -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Functions that operate only on <acronym>RGB</acronym> color space values use an
+<structname>XColor</structname>
+structure, which contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XColor</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 2.5i -->
+<!-- .ta .5i 2.5i -->
+typedef struct {
+	unsigned long pixel;	/* pixel value */
+	unsigned short red, green, blue;	/* rgb values */
+	char flags;	/* DoRed, DoGreen, DoBlue */	
+	char pad;
+} XColor;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The red, green, and blue values are always in the range 0 to 65535
+inclusive, independent of the number of bits actually used in the
+display hardware.
+The server scales these values down to the range used by the hardware.
+Black is represented by (0,0,0), 
+and white is represented by (65535,65535,65535).
+<indexterm><primary>Color</primary></indexterm>
+In some functions,
+the flags member controls which of the red, green, and blue members is used 
+and can be the inclusive OR of zero or more of
+<symbol>DoRed</symbol>,
+<symbol>DoGreen</symbol>,
+and 
+<symbol>DoBlue</symbol>.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+Functions that operate on all color space values use an
+<structname>XcmsColor</structname>
+structure.
+This structure contains a union of substructures,
+each supporting color specification encoding for a particular color space.
+Like the
+<structname>XColor</structname>
+structure, the
+<structname>XcmsColor</structname>
+structure contains pixel
+and color specification information (the spec member in the 
+<structname>XcmsColor</structname>
+structure).
+<indexterm significance="preferred"><primary>XcmsColor</primary></indexterm>
+<!-- .sM -->
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i 1i 2.5i -->
+<!-- .ta .5i 1i 2.5i -->
+typedef unsigned long XcmsColorFormat;			/* Color Specification Format */
+
+typedef struct {
+	union {
+		XcmsRGB RGB;
+		XcmsRGBi RGBi;
+		XcmsCIEXYZ CIEXYZ;
+		XcmsCIEuvY CIEuvY;
+		XcmsCIExyY CIExyY;
+		XcmsCIELab CIELab;
+		XcmsCIELuv CIELuv;
+		XcmsTekHVC TekHVC;
+		XcmsPad Pad;
+	} spec;
+	unsigned long pixel;
+	XcmsColorFormat format;
+} XcmsColor;			/* Xcms Color Structure */
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Because the color specification can be encoded for the various color spaces, 
+encoding for the spec member is identified by the format member,
+which is of type
+<type>XcmsColorFormat</type>.
+The following macros define standard formats.
+<!-- .sM -->
+</para>
+
+<literallayout class="monospaced">
+#define          XcmsUndefinedFormat   0x00000000
+#define          XcmsCIEXYZFormat      0x00000001  /* CIE XYZ */
+#define          XcmsCIEuvYFormat      0x00000002  /* CIE u'v'Y */
+#define          XcmsCIExyYFormat      0x00000003  /* CIE xyY */
+#define          XcmsCIELabFormat      0x00000004  /* CIE L*a*b* */
+#define          XcmsCIELuvFormat      0x00000005  /* CIE L*u*v* */
+#define          XcmsTekHVCFormat      0x00000006  /* TekHVC */
+#define          XcmsRGBFormat         0x80000000  /* RGB Device */
+#define          XcmsRGBiFormat        0x80000001  /* RGB Intensity */
+</literallayout>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Formats for device-independent color spaces are
+distinguishable from those for device-dependent spaces by the 32nd bit.
+If this bit is set,
+it indicates that the color specification is in a device-dependent form;
+otherwise, it is in a device-independent form.
+If the 31st bit is set,
+this indicates that the color space has been added to Xlib at run time
+(see <link linkend="Creating_Additional_Color_Spaces">section 6.12.4</link>).
+The format value for a color space added at run time may be different each
+time the program is executed.
+If references to such a color space must be made outside the client
+(for example, storing a color specification in a file),
+then reference should be made by color space string prefix
+(see 
+<xref linkend='XcmsFormatOfPrefix' xrefstyle='select: title'/>
+and
+<xref linkend='XcmsPrefixOfFormat' xrefstyle='select: title'/>).
+</para>
+<para>
+<!-- .LP -->
+Data types that describe the color specification encoding for the various
+color spaces are defined as follows:
+<!-- .sM -->
+<indexterm significance="preferred"><primary>XcmsRGB</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i 2.5i -->
+<!-- .ta .5i 2.5i -->
+typedef double XcmsFloat;
+
+typedef struct {
+	unsigned short red;	/* 0x0000 to 0xffff */
+	unsigned short green;	/* 0x0000 to 0xffff */
+	unsigned short blue;	/* 0x0000 to 0xffff */
+} XcmsRGB;		/* RGB Device */
+</literallayout>
+<indexterm significance="preferred"><primary>XcmsRGBi</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i 2.5i -->
+<!-- .ta .5i 2.5i -->
+typedef struct {
+	XcmsFloat red;	/* 0.0 to 1.0 */
+	XcmsFloat green;	/* 0.0 to 1.0 */
+	XcmsFloat blue;	/* 0.0 to 1.0 */
+} XcmsRGBi;		/* RGB Intensity */
+</literallayout>
+<indexterm significance="preferred"><primary>XcmsCIEXYZ</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i 2.5i -->
+<!-- .ta .5i 2.5i -->
+typedef struct {
+	XcmsFloat X;
+	XcmsFloat Y;	/* 0.0 to 1.0 */
+	XcmsFloat Z;
+} XcmsCIEXYZ;		/* CIE XYZ */
+</literallayout>
+<indexterm significance="preferred"><primary>XcmsCIEuvY</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i 2.5i -->
+<!-- .ta .5i 2.5i -->
+typedef struct {
+	XcmsFloat u_prime;	/* 0.0 to ~0.6 */
+	XcmsFloat v_prime;	/* 0.0 to ~0.6 */
+	XcmsFloat Y; 	/* 0.0 to 1.0 */
+} XcmsCIEuvY;		/* CIE u'v'Y */
+</literallayout>
+<indexterm significance="preferred"><primary>XcmsCIExyY</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i 2.5i -->
+<!-- .ta .5i 2.5i -->
+typedef struct {
+	XcmsFloat x; 	/* 0.0 to ~.75 */
+	XcmsFloat y; 	/* 0.0 to ~.85 */
+	XcmsFloat Y; 	/* 0.0 to 1.0 */
+} XcmsCIExyY;		/* CIE xyY */
+</literallayout>
+<indexterm significance="preferred"><primary>XcmsCIELab</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i 2.5i -->
+<!-- .ta .5i 2.5i -->
+typedef struct {
+	XcmsFloat L_star; 	/* 0.0 to 100.0 */
+	XcmsFloat a_star;
+	XcmsFloat b_star;
+} XcmsCIELab;		/* CIE L*a*b* */
+</literallayout>
+<indexterm significance="preferred"><primary>XcmsCIELuv</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i 2.5i -->
+<!-- .ta .5i 2.5i -->
+typedef struct {
+	XcmsFloat L_star; 	/* 0.0 to 100.0 */
+	XcmsFloat u_star;
+	XcmsFloat v_star;
+} XcmsCIELuv;		/* CIE L*u*v* */
+</literallayout>
+<indexterm significance="preferred"><primary>XcmsTekHVC</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i 2.5i -->
+<!-- .ta .5i 2.5i -->
+typedef struct {
+	XcmsFloat H; 	/* 0.0 to 360.0 */
+	XcmsFloat V; 	/* 0.0 to 100.0 */
+	XcmsFloat C; 	/* 0.0 to 100.0 */
+} XcmsTekHVC;		/* TekHVC */
+</literallayout>
+<indexterm significance="preferred"><primary>XcmsPad</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i 2.5i -->
+<!-- .ta .5i 2.5i -->
+typedef struct {
+	XcmsFloat pad0;
+	XcmsFloat pad1;
+	XcmsFloat pad2;
+	XcmsFloat pad3;
+} XcmsPad;		/* four doubles */
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The device-dependent formats provided allow color specification in:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+<acronym>RGB</acronym> Intensity
+(<structname>XcmsRGBi</structname>)
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Red, green, and blue linear intensity values,
+floating-point values from 0.0 to 1.0,
+where 1.0 indicates full intensity, 0.5 half intensity, and so on.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<acronym>RGB</acronym> Device
+(<structname>XcmsRGB</structname>)
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Red, green, and blue values appropriate for the specified output device.
+<structname>XcmsRGB</structname>
+values are of type unsigned short,
+scaled from 0 to 65535 inclusive,
+and are interchangeable with the red, green, and blue values in an 
+<structname>XColor</structname>
+structure. 
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+It is important to note that <acronym>RGB</acronym> Intensity values are not gamma corrected
+values.
+In contrast,
+<acronym>RGB</acronym> Device values generated as a result of converting color specifications 
+are always gamma corrected, and
+<acronym>RGB</acronym> Device values acquired as a result of querying a colormap
+or passed in by the client are assumed by Xlib to be gamma corrected.
+The term <emphasis remap='I'><acronym>RGB</acronym> value</emphasis> in this manual always refers to an <acronym>RGB</acronym> Device value.
+</para>
+</sect1>
+<sect1 id="Color_Strings">
+<title>Color Strings</title>
+<!-- .XS -->
+<!-- (SN Color Strings -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides a mechanism for using string names for colors.
+A color string may either contain an abstract color name
+or a numerical color specification.
+Color strings are case-insensitive.
+</para>
+<para>
+<!-- .LP -->
+Color strings are used in the following functions:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+<xref linkend='XAllocNamedColor' xrefstyle='select: title'/>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XcmsAllocNamedColor' xrefstyle='select: title'/>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XLookupColor' xrefstyle='select: title'/>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XcmsLookupColor' xrefstyle='select: title'/>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XParseColor' xrefstyle='select: title'/>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XStoreNamedColor' xrefstyle='select: title'/>
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+Xlib supports the use of abstract color names, for example, red or blue.
+A value for this abstract name is obtained by searching one or more color
+name databases.
+Xlib first searches zero or more client-side databases;
+the number, location, and content of these databases is
+implementation-dependent and might depend on the current locale.
+If the name is not found, Xlib then looks for the color in the
+X server's database.
+If the color name is not in the Host Portable Character Encoding,
+the result is implementation-dependent.
+</para>
+<para>
+<!-- .LP -->
+A numerical color specification
+consists of a color space name and a set of values in the following syntax:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<emphasis remap='I'>&lt;color_space_name&gt;</emphasis>:<emphasis remap='I'>&lt;value&gt;/.../&lt;value&gt;</emphasis>
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The following are examples of valid color strings.
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+"CIEXYZ:0.3227/0.28133/0.2493"
+"RGBi:1.0/0.0/0.0"
+"rgb:00/ff/00"
+"CIELuv:50.0/0.0/0.0"
+</literallayout>
+The syntax and semantics of numerical specifications are given
+for each standard color space in the following sections.
+</para>
+<sect2 id="RGB_Device_String_Specification">
+<title><acronym>RGB</acronym> Device String Specification</title>
+<!-- .XS -->
+<!-- (SN <acronym>RGB</acronym> Device String Specification -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+An <acronym>RGB</acronym> Device specification is identified by
+the prefix ``rgb:'' and conforms to the following syntax:
+</para>
+<para>
+<!-- .LP -->
+<!-- .\" Start marker code here -->
+<literallayout class="monospaced">
+rgb:<emphasis remap='I'>&lt;red&gt;/&lt;green&gt;/&lt;blue&gt;</emphasis>
+
+    <emphasis remap='I'>&lt;red&gt;</emphasis>, <emphasis remap='I'>&lt;green&gt;</emphasis>, <emphasis remap='I'>&lt;blue&gt;</emphasis> := <emphasis remap='I'>h</emphasis> | <emphasis remap='I'>hh</emphasis> | <emphasis remap='I'>hhh</emphasis> | <emphasis remap='I'>hhhh</emphasis>
+    <emphasis remap='I'>h</emphasis> := single hexadecimal digits (case insignificant)
+</literallayout>
+<!-- .\" End marker code here -->
+</para>
+<para>
+<!-- .LP -->
+Note that <emphasis remap='I'>h</emphasis> indicates the value scaled in 4 bits, 
+<emphasis remap='I'>hh</emphasis> the value scaled in 8 bits,
+<emphasis remap='I'>hhh</emphasis> the value scaled in 12 bits,
+and <emphasis remap='I'>hhhh</emphasis> the value scaled in 16 bits, respectively.
+</para>
+<para>
+<!-- .LP -->
+Typical examples are the strings ``rgb:ea/75/52'' and ``rgb:ccc/320/320'',
+but mixed numbers of hexadecimal digit strings 
+(``rgb:ff/a5/0'' and ``rgb:ccc/32/0'')
+are also allowed.
+</para>
+<para>
+<!-- .LP -->
+For backward compatibility, an older syntax for <acronym>RGB</acronym> Device is
+supported, but its continued use is not encouraged.
+The syntax is an initial sharp sign character followed by
+a numeric specification, in one of the following formats:
+</para>
+<para>
+<!-- .LP -->
+<!-- .\" Start marker code here -->
+<literallayout class="monospaced">
+<!-- .TA 2i -->
+<!-- .ta 2i -->
+#RGB	(4 bits each)
+#RRGGBB	(8 bits each)
+#RRRGGGBBB	(12 bits each)
+#RRRRGGGGBBBB	(16 bits each)
+</literallayout>
+<!-- .\" End marker code here -->
+</para>
+<para>
+<!-- .LP -->
+The R, G, and B represent single hexadecimal digits.
+When fewer than 16 bits each are specified, 
+they represent the most significant bits of the value
+(unlike the ``rgb:'' syntax, in which values are scaled).
+For example, the string ``#3a7'' is the same as ``#3000a0007000''.
+</para>
+</sect2>
+<sect2 id="RGB_Intensity_String_Specification">
+<title><acronym>RGB</acronym> Intensity String Specification</title>
+<!-- .XS -->
+<!-- (SN RGB Intensity String Specification -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+An <acronym>RGB</acronym> intensity specification is identified
+by the prefix ``rgbi:'' and conforms to the following syntax:
+</para>
+<para>
+<!-- .LP -->
+<!-- .\" Start marker code here -->
+<literallayout class="monospaced">
+rgbi:<emphasis remap='I'>&lt;red&gt;/&lt;green&gt;/&lt;blue&gt;</emphasis>
+</literallayout>
+<!-- .\" End marker code here -->
+</para>
+<para>
+<!-- .LP -->
+Note that red, green, and blue are floating-point values
+between 0.0 and 1.0, inclusive.
+The input format for these values is an optional sign,
+a string of numbers possibly containing a decimal point,
+and an optional exponent field containing an E or e 
+followed by a possibly signed integer string.
+</para>
+</sect2>
+<sect2 id="Device_Independent_String_Specifications">
+<title>Device-Independent String Specifications</title>
+<!-- .XS -->
+<!-- (SN Device-Independent String Specifications -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The standard device-independent string specifications have
+the following syntax:
+</para>
+<para>
+<!-- .LP -->
+<!-- .\" Start marker code here -->
+<literallayout class="monospaced">
+CIEXYZ:<emphasis remap='I'>&lt;X&gt;/&lt;Y&gt;/&lt;Z&gt;</emphasis>
+CIEuvY:<emphasis remap='I'>&lt;u&gt;/&lt;v&gt;/&lt;Y&gt;</emphasis>
+CIExyY:<emphasis remap='I'>&lt;x&gt;/&lt;y&gt;/&lt;Y&gt;</emphasis>
+CIELab:<emphasis remap='I'>&lt;L&gt;/&lt;a&gt;/&lt;b&gt;</emphasis>
+CIELuv:<emphasis remap='I'>&lt;L&gt;/&lt;u&gt;/&lt;v&gt;</emphasis>
+TekHVC:<emphasis remap='I'>&lt;H&gt;/&lt;V&gt;/&lt;C&gt;</emphasis>
+</literallayout>
+<!-- .\" End marker code here -->
+</para>
+<para>
+<!-- .LP -->
+All of the values (C, H, V, X, Y, Z, a, b, u, v, y, x) are
+floating-point values.
+The syntax for these values is an optional plus or minus sign,
+a string of digits possibly containing a decimal point,
+and an optional exponent field consisting of an ``E'' or ``e''
+followed by an optional plus or minus followed by a string of digits.
+</para>
+</sect2>
+</sect1>
+<sect1 id="Color_Conversion_Contexts_and_Gamut_Mapping">
+<title>Color Conversion Contexts and Gamut Mapping</title>
+<!-- .XS -->
+<!-- (SN Color Conversion Contexts and Gamut Mapping -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+When Xlib converts device-independent color specifications
+into device-dependent specifications and vice versa,
+it uses knowledge about the color limitations of the screen hardware.
+This information, typically called the device profile,
+<indexterm><primary>Device profile</primary></indexterm>
+is available in a Color Conversion Context (CCC).
+<indexterm><primary>Color Conversion Context</primary></indexterm>
+<indexterm><primary>CCC</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+Because a specified color may be outside the color gamut of the target screen
+and the white point associated with the color specification may differ
+from the white point inherent to the screen,
+Xlib applies gamut mapping when it encounters certain conditions:
+<indexterm><primary>White point</primary></indexterm>
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Gamut compression occurs when conversion of device-independent
+color specifications to device-dependent color specifications
+results in a color out of the target screen's gamut.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+White adjustment occurs when the inherent white point of the screen
+differs from the white point assumed by the client.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+Gamut handling methods are stored as callbacks in the CCC,
+which in turn are used by the color space conversion routines.
+Client data is also stored in the CCC for each callback.
+The CCC also contains the white point the client assumes to be
+associated with color specifications (that is, the Client White Point).
+<indexterm><primary>Client White Point</primary></indexterm>
+<indexterm><primary>Gamut compression</primary></indexterm>
+<indexterm><primary>Gamut handling</primary></indexterm>
+<indexterm><primary>White point adjustment</primary></indexterm>
+The client can specify the gamut handling callbacks and client data
+as well as the Client White Point.
+Xlib does not preclude the X client from performing other
+forms of gamut handling (for example, gamut expansion); 
+however, Xlib does not provide direct support for gamut handling
+other than white adjustment and gamut compression.
+</para>
+<para>
+<!-- .LP -->
+Associated with each colormap is an initial CCC transparently generated by
+Xlib.
+<indexterm><primary>Color Conversion Context</primary><secondary>creation</secondary></indexterm>
+Therefore,
+when you specify a colormap as an argument to an Xlib function,
+you are indirectly specifying a CCC.
+<indexterm><primary>CCC</primary><secondary>of colormap</secondary></indexterm>
+<indexterm><primary>Color Conversion Context</primary><secondary>of colormap</secondary></indexterm>
+There is a default CCC associated with each screen.
+Newly created CCCs inherit attributes from the default CCC,
+so the default CCC attributes can be modified to affect new CCCs.
+<indexterm><primary>CCC</primary><secondary>default</secondary></indexterm>
+<indexterm><primary>Color Conversion Context</primary><secondary>default</secondary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+Xcms functions in which gamut mapping can occur return
+<type>Status</type>
+and have specific status values defined for them, 
+as follows:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+<symbol>XcmsFailure</symbol>
+indicates that the function failed.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>XcmsSuccess</symbol>
+indicates that the function succeeded.
+In addition,
+if the function performed any color conversion,
+the colors did not need to be compressed.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>XcmsSuccessWithCompression</symbol>
+indicates the function performed color conversion
+and at least one of the colors needed to be compressed.
+The gamut compression method is determined by the gamut compression
+procedure in the CCC that is specified directly as a function argument
+or in the CCC indirectly specified by means of the colormap argument.
+    </para>
+  </listitem>
+</itemizedlist>
+</sect1>
+<sect1 id="Creating_Copying_and_Destroying_Colormaps">
+<title>Creating, Copying, and Destroying Colormaps</title>
+<!-- .XS -->
+<!-- (SN Creating, Copying, and Destroying Colormaps -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To create a colormap for a screen, use
+<xref linkend='XCreateColormap' xrefstyle='select: title'/>.</para>
+<indexterm significance="preferred"><primary>XCreateColormap</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XCreateColormap'>
+<funcprototype>
+  <funcdef>Colormap <function>XCreateColormap</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>Visual *<parameter>visual</parameter></paramdef>
+  <paramdef>int <parameter>alloc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window on whose screen you want to create a colormap.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>visual</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a visual type supported on the screen.
+If the visual type is not one supported by the screen, 
+a
+<errorname>BadMatch</errorname>
+error results.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>alloc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the colormap entries to be allocated.
+You can pass 
+<symbol>AllocNone</symbol>
+or 
+<symbol>AllocAll</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XCreateColormap' xrefstyle='select: title'/>
+function creates a colormap of the specified visual type for the screen 
+on which the specified window resides and returns the colormap ID 
+associated with it.
+Note that the specified window is only used to determine the screen.
+</para>
+<para>
+<!-- .LP -->
+The initial values of the colormap entries are undefined for the 
+visual classes
+<symbol>GrayScale</symbol>,
+<symbol>PseudoColor</symbol>,
+and
+<symbol>DirectColor</symbol>.
+For
+<symbol>StaticGray</symbol>,
+<symbol>StaticColor</symbol>,
+and
+<symbol>TrueColor</symbol>,
+the entries have defined values,
+but those values are specific to the visual and are not defined by X.
+For
+<symbol>StaticGray</symbol>,
+<symbol>StaticColor</symbol>,
+and
+<symbol>TrueColor</symbol>,
+alloc must be
+<symbol>AllocNone</symbol>,
+or a
+<errorname>BadMatch</errorname>
+error results.
+For the other visual classes,
+if alloc is
+<symbol>AllocNone</symbol>,
+the colormap initially has no allocated entries,
+and clients can allocate them.
+For information about the visual types,
+see <link linkend="Visual_Types">section 3.1</link>.
+</para>
+<para>
+<!-- .LP -->
+If alloc is
+<symbol>AllocAll</symbol>,
+the entire colormap is allocated writable.
+The initial values of all allocated entries are undefined.
+For
+<symbol>GrayScale</symbol>
+and
+<symbol>PseudoColor</symbol>,
+the effect is as if an
+<xref linkend='XAllocColorCells' xrefstyle='select: title'/>
+call returned all pixel values from zero to N - 1,
+where N is the colormap entries value in the specified visual.
+For
+<symbol>DirectColor</symbol>,
+the effect is as if an
+<xref linkend='XAllocColorPlanes' xrefstyle='select: title'/>
+call returned a pixel value of zero and red_mask, green_mask, 
+and blue_mask values containing the same bits as the corresponding
+masks in the specified visual.
+However, in all cases,
+none of these entries can be freed by using
+<xref linkend='XFreeColors' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XCreateColormap' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>,
+<errorname>BadMatch</errorname>,
+<errorname>BadValue</errorname>,
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To create a new colormap when the allocation out of a previously
+shared colormap has failed because of resource exhaustion, use
+<xref linkend='XCopyColormapAndFree' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XCopyColormapAndFree</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XCopyColormapAndFree'>
+<funcprototype>
+  <funcdef>Colormap <function>XCopyColormapAndFree</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XCopyColormapAndFree' xrefstyle='select: title'/>
+function creates a colormap of the same visual type and for the same screen
+as the specified colormap and returns the new colormap ID.
+It also moves all of the client's existing allocation from the specified
+colormap to the new colormap with their color values intact 
+and their read-only or writable characteristics intact and frees those entries 
+in the specified colormap.
+Color values in other entries in the new colormap are undefined.
+If the specified colormap was created by the client with alloc set to
+<symbol>AllocAll</symbol>,
+the new colormap is also created with 
+<symbol>AllocAll</symbol>,
+all color values for all entries are copied from the specified colormap,
+and then all entries in the specified colormap are freed.
+If the specified colormap was not created by the client with
+<symbol>AllocAll</symbol>,
+the allocations to be moved are all those pixels and planes
+that have been allocated by the client using
+<xref linkend='XAllocColor' xrefstyle='select: title'/>,
+<xref linkend='XAllocNamedColor' xrefstyle='select: title'/>,
+<xref linkend='XAllocColorCells' xrefstyle='select: title'/>,
+or
+<xref linkend='XAllocColorPlanes' xrefstyle='select: title'/>
+and that have not been freed since they were allocated.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XCopyColormapAndFree' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>
+and
+<errorname>BadColor</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To destroy a colormap, use 
+<xref linkend='XFreeColormap' xrefstyle='select: title'/>.
+<indexterm significance="preferred"><primary>XFreeColormap</primary></indexterm>
+</para>
+<!-- .sM -->
+<funcsynopsis id='XFreeColormap'>
+<funcprototype>
+  <funcdef><function>XFreeColormap</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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 that you want to destroy.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XFreeColormap' xrefstyle='select: title'/>
+function deletes the association between the colormap resource ID 
+and the colormap and frees the colormap storage.
+However, this function has no effect on the default colormap for a screen.
+If the specified colormap is an installed map for a screen,
+it is uninstalled (see
+<xref linkend='XUninstallColormap' xrefstyle='select: title'/>).
+If the specified colormap is defined as the colormap for a window (by
+<xref linkend='XCreateWindow' xrefstyle='select: title'/>,
+<xref linkend='XSetWindowColormap' xrefstyle='select: title'/>,
+or
+<xref linkend='XChangeWindowAttributes' xrefstyle='select: title'/>),
+<xref linkend='XFreeColormap' xrefstyle='select: title'/>
+changes the colormap associated with the window to
+<symbol>None</symbol>
+and generates a
+<symbol>ColormapNotify</symbol>
+event.
+X does not define the colors displayed for a window with a colormap of
+<symbol>None</symbol>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XFreeColormap' xrefstyle='select: title'/>
+can generate a
+<errorname>BadColor</errorname>
+error.
+</para>
+</sect1>
+<sect1 id="Mapping_Color_Names_to_Values">
+<title>Mapping Color Names to Values</title>
+<!-- .XS -->
+<!-- (SN Mapping Color Names to Values -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To map a color name to an <acronym>RGB</acronym> value, use
+<xref linkend='XLookupColor' xrefstyle='select: title'/>.
+<indexterm><primary>Color</primary><secondary>naming</secondary></indexterm>
+<indexterm significance="preferred"><primary>XLookupColor</primary></indexterm>
+<!-- .sM -->
+</para>
+<funcsynopsis id='XLookupColor'>
+<funcprototype>
+  <funcdef>Status <function>XLookupColor</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+  <paramdef>char *<parameter>color_name</parameter></paramdef>
+  <paramdef>XColor *<parameter>exact_def_return</parameter></paramdef>
+  <paramdef>XColor *<parameter>screen_def_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>color_name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the color name string (for example, red) whose color 
+definition structure you want returned.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>exact_def_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the exact <acronym>RGB</acronym> values.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen_def_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the closest <acronym>RGB</acronym> values provided by the hardware.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XLookupColor' xrefstyle='select: title'/>
+function looks up the string name of a color with respect to the screen
+associated with the specified colormap.
+It returns both the exact color values and
+the closest values provided by the screen 
+with respect to the visual type of the specified colormap.
+If the color name is not in the Host Portable Character Encoding, 
+the result is implementation-dependent.
+Use of uppercase or lowercase does not matter.
+<xref linkend='XLookupColor' xrefstyle='select: title'/>
+returns nonzero if the name is resolved;
+otherwise, it returns zero.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XLookupColor' xrefstyle='select: title'/>
+can generate a
+<errorname>BadColor</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To map a color name to the exact <acronym>RGB</acronym> value, use
+<xref linkend='XParseColor' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Color</primary><secondary>naming</secondary></indexterm>
+<indexterm significance="preferred"><primary>XParseColor</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XParseColor'>
+<funcprototype>
+  <funcdef>Status <function>XParseColor</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+  <paramdef>char *<parameter>spec</parameter></paramdef>
+  <paramdef>XColor *<parameter>exact_def_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>spec</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the color name string;
+case is ignored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>exact_def_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the exact color value for later use and sets the
+<symbol>DoRed</symbol>,
+<symbol>DoGreen</symbol>,
+and
+<symbol>DoBlue</symbol>
+flags.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM  -->
+The
+<xref linkend='XParseColor' xrefstyle='select: title'/>
+function looks up the string name of a color with respect to the screen
+associated with the specified colormap.
+It returns the exact color value.
+If the color name is not in the Host Portable Character Encoding, 
+the result is implementation-dependent.
+Use of uppercase or lowercase does not matter.
+<xref linkend='XParseColor' xrefstyle='select: title'/>
+returns nonzero if the name is resolved;
+otherwise, it returns zero.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XParseColor' xrefstyle='select: title'/>
+can generate a
+<errorname>BadColor</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To map a color name to a value in an arbitrary color space, use
+<xref linkend='XcmsLookupColor' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Color</primary><secondary>naming</secondary></indexterm>
+<indexterm significance="preferred"><primary>XcmsLookupColor</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsLookupColor'>
+<funcprototype>
+  <funcdef>Status <function>XcmsLookupColor</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+  <paramdef>char *<parameter>color_string</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_exact_return</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_screen_return</parameter></paramdef>
+  <paramdef>XcmsColorFormat <parameter>result_format</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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.
+<!-- .ds St -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_string</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the color string(St.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_exact_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the color specification parsed from the color string
+or parsed from the corresponding string found in a color-name database.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_screen_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the color that can be reproduced on the screen.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>result_format</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the color format for the returned color
+specifications (color_screen_return and color_exact_return arguments).
+If the format is
+<symbol>XcmsUndefinedFormat</symbol>
+and the color string contains a
+numerical color specification,
+the specification is returned in the format used in that numerical
+color specification.
+If the format is
+<symbol>XcmsUndefinedFormat</symbol>
+and the color string contains a color name,
+the specification is returned in the format used 
+to store the color in the database.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XcmsLookupColor' xrefstyle='select: title'/>
+function looks up the string name of a color with respect to the screen
+associated with the specified colormap.
+It returns both the exact color values and
+the closest values provided by the screen 
+with respect to the visual type of the specified colormap.
+The values are returned in the format specified by result_format.
+If the color name is not in the Host Portable Character Encoding, 
+the result is implementation-dependent.
+Use of uppercase or lowercase does not matter.
+<xref linkend='XcmsLookupColor' xrefstyle='select: title'/>
+returns
+<symbol>XcmsSuccess</symbol>
+or
+<symbol>XcmsSuccessWithCompression</symbol>
+if the name is resolved; otherwise, it returns
+<symbol>XcmsFailure</symbol>.
+If
+<symbol>XcmsSuccessWithCompression</symbol>
+is returned, the color specification returned in 
+color_screen_return is the result of gamut compression.
+</para>
+</sect1>
+
+<sect1 id="Allocating_and_Freeing_Color_Cells">
+<title>Allocating and Freeing Color Cells</title>
+<!-- .XS -->
+<!-- (SN Allocating and Freeing Color Cells -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+There are two ways of allocating color cells: 
+explicitly as read-only entries, one pixel value at a time,
+or read/write,
+where you can allocate a number of color cells and planes simultaneously.
+<indexterm><primary>Read-only colormap cells</primary></indexterm>
+A read-only cell has its <acronym>RGB</acronym> value set by the server.
+<indexterm><primary>Read/write colormap cells</primary></indexterm>
+Read/write cells do not have defined colors initially;
+functions described in the next section must be used to store values into them.
+Although it is possible for any client to store values into a read/write
+cell allocated by another client,
+read/write cells normally should be considered private to the client
+that allocated them.
+</para>
+<para>
+<!-- .LP -->
+Read-only colormap cells are shared among clients.
+The server counts each allocation and freeing of the cell by clients.
+When the last client frees a shared cell, the cell is finally deallocated.
+If a single client allocates the same read-only cell multiple
+times, the server counts each such allocation, not just the first one.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To allocate a read-only color cell with an <acronym>RGB</acronym> value, use
+<xref linkend='XAllocColor' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Allocation</primary><secondary>read-only colormap cells</secondary></indexterm>
+<indexterm><primary>Read-only colormap cells</primary><secondary>allocating</secondary></indexterm>
+<indexterm><primary>Color</primary><secondary>allocation</secondary></indexterm>
+<indexterm significance="preferred"><primary>XAllocColor</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XAllocColor'>
+<funcprototype>
+  <funcdef>Status <function>XAllocColor</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+  <paramdef>XColor *<parameter>screen_in_out</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>screen_in_out</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies and returns the values actually used in the colormap.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XAllocColor' xrefstyle='select: title'/>
+function allocates a read-only colormap entry corresponding to the closest
+<acronym>RGB</acronym> value supported by the hardware.
+<xref linkend='XAllocColor' xrefstyle='select: title'/>
+returns the pixel value of the color closest to the specified
+<acronym>RGB</acronym> elements supported by the hardware
+and returns the <acronym>RGB</acronym> value actually used.
+The corresponding colormap cell is read-only.
+In addition,
+<xref linkend='XAllocColor' xrefstyle='select: title'/>
+returns nonzero if it succeeded or zero if it failed.
+<indexterm><primary>Color map</primary></indexterm>
+<indexterm><primary>Color</primary><secondary>allocation</secondary></indexterm>
+<indexterm><primary>Allocation</primary><secondary>colormap</secondary></indexterm>
+<indexterm><primary>read-only colormap cells</primary></indexterm>
+Multiple clients that request the same effective <acronym>RGB</acronym> value can be assigned
+the same read-only entry, thus allowing entries to be shared.
+When the last client deallocates a shared cell, it is deallocated.
+<xref linkend='XAllocColor' xrefstyle='select: title'/>
+does not use or affect the flags in the
+<structname>XColor</structname>
+structure.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XAllocColor' xrefstyle='select: title'/>
+can generate a
+<errorname>BadColor</errorname>
+error.
+<!-- .EQ -->
+delim %%
+<!-- .EN -->
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To allocate a read-only color cell with a color in arbitrary format, use
+<xref linkend='XcmsAllocColor' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Allocation</primary><secondary>read-only colormap cells</secondary></indexterm>
+<indexterm><primary>Read-only colormap cells</primary><secondary>allocating</secondary></indexterm>
+<indexterm><primary>Color</primary><secondary>allocation</secondary></indexterm>
+<indexterm significance="preferred"><primary>XcmsAllocColor</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsAllocColor'>
+<funcprototype>
+  <funcdef>Status <function>XcmsAllocColor</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_in_out</parameter></paramdef>
+  <paramdef>XcmsColorFormat <parameter>result_format</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>color_in_out</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the color to allocate and returns the pixel and color 
+that is actually used in the colormap.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>result_format</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the color format for the returned color specification.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XcmsAllocColor' xrefstyle='select: title'/>
+function is similar to
+<xref linkend='XAllocColor' xrefstyle='select: title'/>
+except the color can be specified in any format.
+The
+<xref linkend='XcmsAllocColor' xrefstyle='select: title'/>
+function ultimately calls 
+<xref linkend='XAllocColor' xrefstyle='select: title'/>
+to allocate a read-only color cell (colormap entry) with the specified color.
+<xref linkend='XcmsAllocColor' xrefstyle='select: title'/>
+first converts the color specified
+to an <acronym>RGB</acronym> value and then passes this to
+<xref linkend='XAllocColor' xrefstyle='select: title'/>.
+<xref linkend='XcmsAllocColor' xrefstyle='select: title'/>
+returns the pixel value of the color cell and the color specification
+actually allocated.
+This returned color specification is the result of converting the <acronym>RGB</acronym> value
+returned by 
+<xref linkend='XAllocColor' xrefstyle='select: title'/>
+into the format specified with the result_format argument.
+If there is no interest in a returned color specification, 
+unnecessary computation can be bypassed if result_format is set to
+<symbol>XcmsRGBFormat</symbol>.
+The corresponding colormap cell is read-only.
+If this routine returns 
+<symbol>XcmsFailure</symbol>,
+the color_in_out color specification is left unchanged.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XcmsAllocColor' xrefstyle='select: title'/>
+can generate a
+<errorname>BadColor</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To allocate a read-only color cell using a color name and return the closest
+color supported by the hardware in <acronym>RGB</acronym> format, use
+<xref linkend='XAllocNamedColor' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Allocation</primary><secondary>read-only colormap cells</secondary></indexterm>
+<indexterm><primary>Read-only colormap cells</primary><secondary>allocating</secondary></indexterm>
+<indexterm><primary>Color</primary><secondary>naming</secondary></indexterm>
+<indexterm><primary>Color</primary><secondary>allocation</secondary></indexterm>
+<indexterm significance="preferred"><primary>XAllocNamedColor</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XAllocNamedColor'>
+<funcprototype>
+  <funcdef>Status <function>XAllocNamedColor</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+  <paramdef>char *<parameter>color_name</parameter></paramdef>
+  <paramdef>XColor *<parameter>screen_def_return</parameter></paramdef>
+  <paramdef>XColor *<parameter>exact_def_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>color_name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the color name string (for example, red) whose color 
+definition structure you want returned.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen_def_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the closest <acronym>RGB</acronym> values provided by the hardware.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>exact_def_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the exact <acronym>RGB</acronym> values.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM  -->
+The
+<xref linkend='XAllocNamedColor' xrefstyle='select: title'/>
+function looks up the named color with respect to the screen that is
+associated with the specified colormap.
+It returns both the exact database definition and
+the closest color supported by the screen.
+The allocated color cell is read-only.
+The pixel value is returned in screen_def_return.
+If the color name is not in the Host Portable Character Encoding, 
+the result is implementation-dependent.
+Use of uppercase or lowercase does not matter.
+If screen_def_return and exact_def_return
+point to the same structure, the pixel field will be set correctly,
+but the color values are undefined.
+<xref linkend='XAllocNamedColor' xrefstyle='select: title'/>
+returns nonzero if a cell is allocated;
+otherwise, it returns zero.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XAllocNamedColor' xrefstyle='select: title'/>
+can generate a
+<errorname>BadColor</errorname>
+error. 
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To allocate a read-only color cell using a color name and return the closest
+color supported by the hardware in an arbitrary format, use
+<xref linkend='XcmsAllocNamedColor' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Allocation</primary><secondary>read-only colormap cells</secondary></indexterm>
+<indexterm><primary>Read-only colormap cells</primary><secondary>allocating</secondary></indexterm>
+<indexterm><primary>Color</primary><secondary>naming</secondary></indexterm>
+<indexterm><primary>Color</primary><secondary>allocation</secondary></indexterm>
+<indexterm significance="preferred"><primary>XcmsAllocNamedColor</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsAllocNamedColor'>
+<funcprototype>
+  <funcdef>Status <function>XcmsAllocNamedColor</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+  <paramdef>char *<parameter>color_string</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_screen_return</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_exact_return</parameter></paramdef>
+  <paramdef>XcmsColorFormat <parameter>result_format</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>color_string</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the color string whose color definition structure is to be
+returned.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_screen_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the pixel value of the color cell and color specification 
+that actually is stored for that cell.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_exact_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the color specification parsed from the color string
+or parsed from the corresponding string found in a color-name database.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>result_format</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the color format for the returned color
+specifications (color_screen_return and color_exact_return arguments).
+If the format is
+<symbol>XcmsUndefinedFormat</symbol>
+and the color string contains a
+numerical color specification,
+the specification is returned in the format used in that numerical
+color specification.
+If the format is
+<symbol>XcmsUndefinedFormat</symbol>
+and the color string contains a color name,
+the specification is returned in the format used 
+to store the color in the database.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XcmsAllocNamedColor' xrefstyle='select: title'/>
+function is similar to
+<xref linkend='XAllocNamedColor' xrefstyle='select: title'/>
+except that the color returned can be in any format specified.
+This function
+ultimately calls
+<xref linkend='XAllocColor' xrefstyle='select: title'/>
+to allocate a read-only color cell with
+the color specified by a color string.
+The color string is parsed into an
+<structname>XcmsColor</structname>
+structure (see
+<xref linkend='XcmsLookupColor' xrefstyle='select: title'/>),
+converted
+to an <acronym>RGB</acronym> value, and finally passed to
+<xref linkend='XAllocColor' xrefstyle='select: title'/>.
+If the color name is not in the Host Portable Character Encoding, 
+the result is implementation-dependent.
+Use of uppercase or lowercase does not matter.
+</para>
+<para>
+<!-- .LP -->
+This function returns both the color specification as a result
+of parsing (exact specification) and the actual color specification
+stored (screen specification).
+This screen specification is the result of converting the <acronym>RGB</acronym> value
+returned by
+<xref linkend='XAllocColor' xrefstyle='select: title'/>
+into the format specified in result_format.
+If there is no interest in a returned color specification,
+unnecessary computation can be bypassed if result_format is set to
+<symbol>XcmsRGBFormat</symbol>.
+If color_screen_return and color_exact_return
+point to the same structure, the pixel field will be set correctly,
+but the color values are undefined.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XcmsAllocNamedColor' xrefstyle='select: title'/>
+can generate a
+<errorname>BadColor</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To allocate read/write color cell and color plane combinations for a
+<symbol>PseudoColor</symbol>
+model, use
+<xref linkend='XAllocColorCells' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Read/write colormap cells</primary><secondary>allocating</secondary></indexterm>
+<indexterm><primary>Allocation</primary><secondary>read/write colormap cells</secondary></indexterm>
+<indexterm><primary>Color</primary><secondary>allocation</secondary></indexterm>
+<indexterm significance="preferred"><primary>XAllocColorCells</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XAllocColorCells'>
+<funcprototype>
+  <funcdef>Status <function>XAllocColorCells</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+  <paramdef>Bool <parameter>contig</parameter></paramdef>
+  <paramdef>unsigned long <parameter>plane_masks_return[]</parameter></paramdef>
+  <paramdef>unsigned int <parameter>nplanes</parameter></paramdef>
+  <paramdef>unsigned long <parameter>pixels_return[]</parameter></paramdef>
+  <paramdef>unsigned int <parameter>npixels</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>contig</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a Boolean value that indicates whether the planes must be contiguous.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>plane_mask_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns an array of plane masks.
+<!-- .\" *** JIM: NEED MORE INFO FOR THIS. *** -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nplanes</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of plane masks that are to be returned in the plane masks 
+array. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>pixels_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns an array of pixel values. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>npixels</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of pixel values that are to be returned in the 
+pixels_return array. 
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XAllocColorCells' xrefstyle='select: title'/>
+function allocates read/write color cells.
+The number of colors must be positive and the number of planes nonnegative,
+or a
+<errorname>BadValue</errorname>
+error results.
+If ncolors and nplanes are requested, 
+then ncolors pixels
+and nplane plane masks are returned.
+No mask will have any bits set to 1 in common with
+any other mask or with any of the pixels.
+By ORing together each pixel with zero or more masks,
+ncolors &times; 2<superscript><emphasis>nplanes</emphasis></superscript>
+distinct pixels can be produced.
+All of these are
+allocated writable by the request.
+For 
+<symbol>GrayScale</symbol>
+or 
+<symbol>PseudoColor</symbol>,
+each mask has exactly one bit set to 1. 
+For 
+<symbol>DirectColor</symbol>,
+each has exactly three bits set to 1.
+If contig is 
+<symbol>True</symbol>
+and if all masks are ORed
+together, a single contiguous set of bits set to 1 will be formed for 
+<symbol>GrayScale</symbol>
+or 
+<symbol>PseudoColor</symbol>
+and three contiguous sets of bits set to 1 (one within each
+pixel subfield) for 
+<symbol>DirectColor</symbol>.
+The <acronym>RGB</acronym> values of the allocated
+entries are undefined.
+<xref linkend='XAllocColorCells' xrefstyle='select: title'/>
+returns nonzero if it succeeded or zero if it failed.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XAllocColorCells' xrefstyle='select: title'/>
+can generate
+<errorname>BadColor</errorname>
+and
+<errorname>BadValue</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To allocate read/write color resources for a
+<symbol>DirectColor</symbol>
+model, use
+<xref linkend='XAllocColorPlanes' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Read/write colormap planes</primary><secondary>allocating</secondary></indexterm>
+<indexterm><primary>Allocation</primary><secondary>read/write colormap planes</secondary></indexterm>
+<indexterm><primary>Color</primary><secondary>allocation</secondary></indexterm>
+<indexterm significance="preferred"><primary>XAllocColorPlanes</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XAllocColorPlanes'>
+<funcprototype>
+  <funcdef>Status <function>XAllocColorPlanes</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+  <paramdef>Bool <parameter>contig</parameter></paramdef>
+  <paramdef>unsigned long <parameter>pixels_return[]</parameter></paramdef>
+  <paramdef>int <parameter>ncolors</parameter></paramdef>
+  <paramdef>int <parameter>nreds</parameter></paramdef>
+  <paramdef>int <parameter>ngreens</parameter></paramdef>
+  <paramdef>int <parameter>nblues</parameter></paramdef>
+  <paramdef>unsigned long *<parameter>rmask_return</parameter></paramdef>
+  <paramdef>unsigned long *<parameter>gmask_return</parameter></paramdef>
+  <paramdef>unsigned long *<parameter>bmask_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>contig</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a Boolean value that indicates whether the planes must be contiguous.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>pixels_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns an array of pixel values. 
+<xref linkend='XAllocColorPlanes' xrefstyle='select: title'/>
+returns the pixel values in this array.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ncolors</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of pixel values that are to be returned in the 
+pixels_return array. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nreds</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ngreens</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nblues</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+Specify the number of red, green, and blue planes.
+The value you pass must be nonnegative. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>rmask_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gmask_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>bmask_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Return bit masks for the red, green, and blue planes.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The specified ncolors must be positive; 
+and nreds, ngreens, and nblues must be nonnegative,
+or a
+<errorname>BadValue</errorname>
+error results.
+If ncolors colors, nreds reds, ngreens greens, and nblues blues are requested, 
+ncolors pixels are returned; and the masks have nreds, ngreens, and 
+nblues bits set to 1, respectively.
+If contig is 
+<symbol>True</symbol>,
+each mask will have
+a contiguous set of bits set to 1.
+No mask will have any bits set to 1 in common with
+any other mask or with any of the pixels.
+For 
+<symbol>DirectColor</symbol>,
+each mask
+will lie within the corresponding pixel subfield.
+By ORing together
+subsets of masks with each pixel value, 
+ncolors &times; 2<superscript><emphasis>(nreds+ngreens+nblues)</emphasis></superscript>
+distinct pixel values can be produced.
+All of these are allocated by the request.
+However, in the
+colormap, there are only
+ncolors &times; 2<superscript><emphasis>nreds</emphasis></superscript>
+independent red entries,
+ncolors &times; 2<superscript><emphasis>ngreens</emphasis></superscript>
+independent green entries, and
+ncolors &times; 2<superscript><emphasis>nblues</emphasis></superscript>
+independent blue entries.
+This is true even for 
+<symbol>PseudoColor</symbol>.
+When the colormap entry of a pixel
+value is changed (using 
+<xref linkend='XStoreColors' xrefstyle='select: title'/>,
+<xref linkend='XStoreColor' xrefstyle='select: title'/>,
+or 
+<xref linkend='XStoreNamedColor' xrefstyle='select: title'/>),
+the pixel is decomposed according to the masks, 
+and the corresponding independent entries are updated.
+<xref linkend='XAllocColorPlanes' xrefstyle='select: title'/>
+returns nonzero if it succeeded or zero if it failed.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XAllocColorPlanes' xrefstyle='select: title'/>
+can generate
+<errorname>BadColor</errorname>
+and
+<errorname>BadValue</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<indexterm><primary>Freeing</primary><secondary>colors</secondary></indexterm>
+To free colormap cells, use
+<xref linkend='XFreeColors' xrefstyle='select: title'/>.
+<indexterm significance="preferred"><primary>XFreeColors</primary></indexterm>
+<indexterm><primary>Color</primary><secondary>deallocation</secondary></indexterm>
+<!-- .sM -->
+</para>
+<funcsynopsis id='XFreeColors'>
+<funcprototype>
+  <funcdef><function>XFreeColors</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+  <paramdef>unsigned long <parameter>pixels[]</parameter></paramdef>
+  <paramdef>int <parameter>npixels</parameter></paramdef>
+  <paramdef>unsigned long <parameter>planes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>pixels</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an array of pixel values that map to the cells in the specified
+colormap.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>npixels</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of pixels. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>planes</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the planes you want to free.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XFreeColors' xrefstyle='select: title'/>
+function frees the cells represented by pixels whose values are in the
+pixels array.
+The planes argument should not have any bits set to 1 in common with any of the
+pixels. 
+The set of all pixels is produced by ORing together subsets of
+the planes argument with the pixels.
+The request frees all of these pixels that
+were allocated by the client (using 
+<indexterm><primary>XAllocColor</primary></indexterm>
+<indexterm><primary>XAllocNamedColor</primary></indexterm>
+<indexterm><primary>XAllocColorCells</primary></indexterm>
+<indexterm><primary>XAllocColorPlanes</primary></indexterm>
+<xref linkend='XAllocColor' xrefstyle='select: title'/>,
+<xref linkend='XAllocNamedColor' xrefstyle='select: title'/>,
+<xref linkend='XAllocColorCells' xrefstyle='select: title'/>,
+and 
+<xref linkend='XAllocColorPlanes' xrefstyle='select: title'/>).
+Note that freeing an
+individual pixel obtained from 
+<xref linkend='XAllocColorPlanes' xrefstyle='select: title'/>
+may not actually allow
+it to be reused until all of its related pixels are also freed.
+Similarly,
+a read-only entry is not actually freed until it has been freed by all clients,
+and if a client allocates the same read-only entry multiple times,
+it must free the entry that many times before the entry is actually freed.
+</para>
+<para>
+<!-- .LP -->
+All specified pixels that are allocated by the client in the colormap are
+freed, even if one or more pixels produce an error. 
+If a specified pixel is not a valid index into the colormap, a 
+<errorname>BadValue</errorname>
+error results.
+If a specified pixel is not allocated by the
+client (that is, is unallocated or is only allocated by another client)
+or if the colormap was created with all entries writable (by passing
+<symbol>AllocAll</symbol>
+to
+<xref linkend='XCreateColormap' xrefstyle='select: title'/>),
+a
+<errorname>BadAccess</errorname>
+error results. 
+If more than one pixel is in error, 
+the one that gets reported is arbitrary.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XFreeColors' xrefstyle='select: title'/>
+can generate
+<errorname>BadAccess</errorname>,
+<errorname>BadColor</errorname>,
+and
+<errorname>BadValue</errorname>
+errors.
+</para>
+</sect1>
+<sect1 id="Modifying_and_Querying_Colormap_Cells">
+<title>Modifying and Querying Colormap Cells</title>
+<!-- .XS -->
+<!-- (SN Modifying and Querying Colormap Cells  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To store an <acronym>RGB</acronym> value in a single colormap cell, use
+<xref linkend='XStoreColor' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Color</primary><secondary>storing</secondary></indexterm>
+<indexterm significance="preferred"><primary>XStoreColor</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XStoreColor'>
+<funcprototype>
+  <funcdef><function>XStoreColor</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+  <paramdef>XColor *<parameter>color</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>color</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the pixel and <acronym>RGB</acronym> values.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XStoreColor' xrefstyle='select: title'/>
+function changes the colormap entry of the pixel value specified in the
+pixel member of the
+<structname>XColor</structname>
+structure.
+You specified this value in the
+pixel member of the
+<structname>XColor</structname>
+structure.
+This pixel value must be a read/write cell and a valid index into the colormap.
+If a specified pixel is not a valid index into the colormap,
+a
+<errorname>BadValue</errorname>
+error results.
+<xref linkend='XStoreColor' xrefstyle='select: title'/>
+also changes the red, green, and/or blue color components.
+You specify which color components are to be changed by setting
+<symbol>DoRed</symbol>,
+<symbol>DoGreen</symbol>,
+and/or
+<symbol>DoBlue</symbol>
+in the flags member of the
+<structname>XColor</structname>
+structure.
+If the colormap is an installed map for its screen, 
+the changes are visible immediately.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XStoreColor' xrefstyle='select: title'/>
+can generate
+<errorname>BadAccess</errorname>,
+<errorname>BadColor</errorname>,
+and
+<errorname>BadValue</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To store multiple <acronym>RGB</acronym> values in multiple colormap cells, use
+<xref linkend='XStoreColors' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Color</primary><secondary>storing</secondary></indexterm>
+<indexterm significance="preferred"><primary>XStoreColors</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XStoreColors'>
+<funcprototype>
+  <funcdef><function>XStoreColors</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+  <paramdef>XColor <parameter>color[]</parameter></paramdef>
+  <paramdef>int <parameter>ncolors</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>color</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an array of color definition structures to be stored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ncolors</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .\"Specifies the number of color definition structures.  -->
+Specifies the number of 
+<structname>XColor</structname>
+structures in the color definition array.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XStoreColors' xrefstyle='select: title'/>
+function changes the colormap entries of the pixel values
+specified in the pixel members of the
+<structname>XColor</structname>
+structures.
+You specify which color components are to be changed by setting 
+<symbol>DoRed</symbol>,
+<symbol>DoGreen</symbol>,
+and/or
+<symbol>DoBlue</symbol>
+in the flags member of the
+<structname>XColor</structname>
+structures.
+If the colormap is an installed map for its screen, the
+changes are visible immediately.
+<xref linkend='XStoreColors' xrefstyle='select: title'/>
+changes the specified pixels if they are allocated writable in the colormap 
+by any client, even if one or more pixels generates an error.
+If a specified pixel is not a valid index into the colormap, a
+<errorname>BadValue</errorname>
+error results.
+If a specified pixel either is unallocated or is allocated read-only, a
+<errorname>BadAccess</errorname>
+error results.
+If more than one pixel is in error, 
+the one that gets reported is arbitrary.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XStoreColors' xrefstyle='select: title'/>
+can generate
+<errorname>BadAccess</errorname>,
+<errorname>BadColor</errorname>,
+and
+<errorname>BadValue</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To store a color of arbitrary format in a single colormap cell, use
+<xref linkend='XcmsStoreColor' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Color</primary><secondary>storing</secondary></indexterm>
+<indexterm significance="preferred"><primary>XcmsStoreColor</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsStoreColor'>
+<funcprototype>
+  <funcdef>Status <function>XcmsStoreColor</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>color</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the color cell and the color to store.
+Values specified in this
+<structname>XcmsColor</structname>
+structure remain unchanged on return.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XcmsStoreColor' xrefstyle='select: title'/>
+function converts the color specified in the
+<structname>XcmsColor</structname>
+structure into <acronym>RGB</acronym> values.
+It then uses this <acronym>RGB</acronym> specification in an
+<structname>XColor</structname>
+structure, whose three flags 
+(<symbol>DoRed</symbol>,
+<symbol>DoGreen</symbol>,
+and
+<symbol>DoBlue</symbol>)
+are set, in a call to
+<xref linkend='XStoreColor' xrefstyle='select: title'/>
+to change the color cell specified by the pixel member of the
+<structname>XcmsColor</structname>
+structure.
+This pixel value must be a valid index for the specified colormap,
+and the color cell specified by the pixel value must be a read/write cell.
+If the pixel value is not a valid index, a
+<errorname>BadValue</errorname>
+error results.
+If the color cell is unallocated or is allocated read-only, a
+<errorname>BadAccess</errorname>
+error results.
+If the colormap is an installed map for its screen, 
+the changes are visible immediately.
+</para>
+<para>
+<!-- .LP -->
+Note that 
+<xref linkend='XStoreColor' xrefstyle='select: title'/>
+has no return value; therefore, an
+<symbol>XcmsSuccess</symbol>
+return value from this function indicates that the conversion 
+to <acronym>RGB</acronym> succeeded and the call to
+<xref linkend='XStoreColor' xrefstyle='select: title'/>
+was made.
+To obtain the actual color stored, use
+<xref linkend='XcmsQueryColor' xrefstyle='select: title'/>.
+Because of the screen's hardware limitations or gamut compression,
+the color stored in the colormap may not be identical
+to the color specified.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XcmsStoreColor' xrefstyle='select: title'/>
+can generate
+<errorname>BadAccess</errorname>,
+<errorname>BadColor</errorname>,
+and
+<errorname>BadValue</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To store multiple colors of arbitrary format in multiple colormap cells, use
+<xref linkend='XcmsStoreColors' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Color</primary><secondary>storing</secondary></indexterm>
+<indexterm significance="preferred"><primary>XcmsStoreColors</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsStoreColors'>
+<funcprototype>
+  <funcdef>Status <function>XcmsStoreColors</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+  <paramdef>XcmsColor <parameter>colors[]</parameter></paramdef>
+  <paramdef>int <parameter>ncolors</parameter></paramdef>
+  <paramdef>Bool <parameter>compression_flags_return[]</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the color specification array of
+<structname>XcmsColor</structname>
+structures, each specifying a color cell and the color to store in that
+cell.
+Values specified in the array remain unchanged upon return.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ncolors</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of 
+<structname>XcmsColor</structname>
+structures in the color-specification array.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>compression_flags_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns an array of Boolean values indicating compression status.
+If a non-NULL pointer is supplied,
+each element of the array is set to
+<symbol>True</symbol>
+if the corresponding color was compressed and
+<symbol>False</symbol>
+otherwise.
+Pass NULL if the compression status is not useful.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XcmsStoreColors' xrefstyle='select: title'/>
+function converts the colors specified in the array of
+<structname>XcmsColor</structname>
+structures into <acronym>RGB</acronym> values and then uses these <acronym>RGB</acronym> specifications in
+<structname>XColor</structname>
+structures, whose three flags 
+(<symbol>DoRed</symbol>,
+<symbol>DoGreen</symbol>,
+and
+<symbol>DoBlue</symbol>)
+are set, in a call to
+<xref linkend='XStoreColors' xrefstyle='select: title'/>
+to change the color cells specified by the pixel member of the corresponding
+<structname>XcmsColor</structname>
+structure.
+Each pixel value must be a valid index for the specified colormap,
+and the color cell specified by each pixel value must be a read/write cell.
+If a pixel value is not a valid index, a
+<errorname>BadValue</errorname>
+error results.
+If a color cell is unallocated or is allocated read-only, a
+<errorname>BadAccess</errorname>
+error results.
+If more than one pixel is in error,
+the one that gets reported is arbitrary.
+If the colormap is an installed map for its screen, 
+the changes are visible immediately.
+</para>
+<para>
+<!-- .LP -->
+Note that 
+<xref linkend='XStoreColors' xrefstyle='select: title'/>
+has no return value; therefore, an
+<symbol>XcmsSuccess</symbol>
+return value from this function indicates that conversions 
+to <acronym>RGB</acronym> succeeded and the call to
+<xref linkend='XStoreColors' xrefstyle='select: title'/>
+was made.
+To obtain the actual colors stored, use
+<xref linkend='XcmsQueryColors' xrefstyle='select: title'/>.
+Because of the screen's hardware limitations or gamut compression,
+the colors stored in the colormap may not be identical
+to the colors specified.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XcmsStoreColors' xrefstyle='select: title'/>
+can generate
+<errorname>BadAccess</errorname>,
+<errorname>BadColor</errorname>,
+and
+<errorname>BadValue</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To store a color specified by name in a single colormap cell, use
+<xref linkend='XStoreNamedColor' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Color</primary><secondary>storing</secondary></indexterm>
+<indexterm><primary>Color</primary><secondary>naming</secondary></indexterm>
+<indexterm significance="preferred"><primary>XStoreNamedColor</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XStoreNamedColor'>
+<funcprototype>
+  <funcdef><function>XStoreNamedColor</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+  <paramdef>char *<parameter>color</parameter></paramdef>
+  <paramdef>unsigned long <parameter>pixel</parameter></paramdef>
+  <paramdef>int <parameter>flags</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>color</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the color name string (for example, red). 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>pixel</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the entry in the colormap. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>flags</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies which red, green, and blue components are set.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM  -->
+The
+<xref linkend='XStoreNamedColor' xrefstyle='select: title'/>
+function looks up the named color with respect to the screen associated with
+the colormap and stores the result in the specified colormap.
+The pixel argument determines the entry in the colormap.
+The flags argument determines which of the red, green, and blue components 
+are set. 
+You can set this member to the
+bitwise inclusive OR of the bits 
+<symbol>DoRed</symbol>,
+<symbol>DoGreen</symbol>,
+and 
+<symbol>DoBlue</symbol>.
+If the color name is not in the Host Portable Character Encoding, 
+the result is implementation-dependent.
+Use of uppercase or lowercase does not matter.
+If the specified pixel is not a valid index into the colormap, a
+<errorname>BadValue</errorname>
+error results.
+If the specified pixel either is unallocated or is allocated read-only, a
+<errorname>BadAccess</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XStoreNamedColor' xrefstyle='select: title'/>
+can generate
+<errorname>BadAccess</errorname>,
+<errorname>BadColor</errorname>,
+<errorname>BadName</errorname>,
+and 
+<errorname>BadValue</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+The
+<xref linkend='XQueryColor' xrefstyle='select: title'/>
+and
+<xref linkend='XQueryColors' xrefstyle='select: title'/>
+functions take pixel values in the pixel member of
+<structname>XColor</structname>
+structures and store in the structures the <acronym>RGB</acronym> values for those
+pixels from the specified colormap.
+The values returned for an unallocated entry are undefined.
+These functions also set the flags member in the
+<structname>XColor</structname>
+structure to all three colors.
+If a pixel is not a valid index into the specified colormap, a
+<errorname>BadValue</errorname>
+error results.
+If more than one pixel is in error,
+the one that gets reported is arbitrary.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To query the <acronym>RGB</acronym> value of a single colormap cell, use
+<xref linkend='XQueryColor' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Color</primary><secondary>querying</secondary></indexterm>
+<indexterm significance="preferred"><primary>XQueryColor</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XQueryColor'>
+<funcprototype>
+  <funcdef><function>XQueryColor</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+  <paramdef>XColor *<parameter>def_in_out</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>def_in_out</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies and returns the <acronym>RGB</acronym> values for the pixel specified in the structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XQueryColor' xrefstyle='select: title'/>
+function returns the current <acronym>RGB</acronym> value for the pixel in the
+<structname>XColor</structname>
+structure and sets the
+<symbol>DoRed</symbol>,
+<symbol>DoGreen</symbol>,
+and
+<symbol>DoBlue</symbol>
+flags.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XQueryColor' xrefstyle='select: title'/>
+can generate
+<errorname>BadColor</errorname>
+and
+<errorname>BadValue</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To query the <acronym>RGB</acronym> values of multiple colormap cells, use
+<xref linkend='XQueryColors' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Color</primary><secondary>querying</secondary></indexterm>
+<indexterm significance="preferred"><primary>XQueryColors</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XQueryColors'>
+<funcprototype>
+  <funcdef><function>XQueryColors</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+  <paramdef>XColor <parameter>defs_in_out[]</parameter></paramdef>
+  <paramdef>int <parameter>ncolors</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>defs_in_out</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies and returns an array of color definition structures for the pixel
+specified in the structure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ncolors</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .\"Specifies the number of color definition structures.  -->
+Specifies the number of 
+<structname>XColor</structname>
+structures in the color definition array.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XQueryColors' xrefstyle='select: title'/>
+function returns the <acronym>RGB</acronym> value for each pixel in each
+<structname>XColor</structname>
+structure and sets the
+<symbol>DoRed</symbol>,
+<symbol>DoGreen</symbol>,
+and
+<symbol>DoBlue</symbol>
+flags in each structure.
+
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XQueryColors' xrefstyle='select: title'/>
+can generate
+<errorname>BadColor</errorname>
+and
+<errorname>BadValue</errorname>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To query the color of a single colormap cell in an arbitrary format, use
+<xref linkend='XcmsQueryColor' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Color</primary><secondary>querying</secondary></indexterm>
+<indexterm significance="preferred"><primary>XcmsQueryColor</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsQueryColor'>
+<funcprototype>
+  <funcdef>Status <function>XcmsQueryColor</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_in_out</parameter></paramdef>
+  <paramdef>XcmsColorFormat <parameter>result_format</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>color_in_out</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the pixel member that indicates the color cell to query.
+The color specification stored for the color cell is returned in this
+<structname>XcmsColor</structname>
+structure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>result_format</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the color format for the returned color specification.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XcmsQueryColor' xrefstyle='select: title'/>
+function obtains the <acronym>RGB</acronym> value
+for the pixel value in the pixel member of the specified
+<structname>XcmsColor</structname>
+structure and then
+converts the value to the target format as
+specified by the result_format argument.
+If the pixel is not a valid index in the specified colormap, a
+<errorname>BadValue</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XcmsQueryColor' xrefstyle='select: title'/>
+can generate
+<errorname>BadColor</errorname>
+and
+<errorname>BadValue</errorname>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To query the color of multiple colormap cells in an arbitrary format, use
+<xref linkend='XcmsQueryColors' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Color</primary><secondary>querying</secondary></indexterm>
+<indexterm significance="preferred"><primary>XcmsQueryColors</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsQueryColors'>
+<funcprototype>
+  <funcdef>Status <function>XcmsQueryColors</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+  <paramdef>XcmsColor <parameter>colors_in_out[]</parameter></paramdef>
+  <paramdef>unsigned int <parameter>ncolors</parameter></paramdef>
+  <paramdef>XcmsColorFormat <parameter>result_format</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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 an array of
+<structname>XcmsColor</structname>
+structures, each pixel member indicating the color cell to query.
+The color specifications for the color cells are returned in these structures.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ncolors</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of 
+<structname>XcmsColor</structname>
+structures in the color-specification array.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>result_format</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the color format for the returned color specification.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XcmsQueryColors' xrefstyle='select: title'/>
+function obtains the <acronym>RGB</acronym> values
+for pixel values in the pixel members of
+<structname>XcmsColor</structname>
+structures and then
+converts the values to the target format as
+specified by the result_format argument.
+If a pixel is not a valid index into the specified colormap, a
+<errorname>BadValue</errorname>
+error results.
+If more than one pixel is in error,
+the one that gets reported is arbitrary.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XcmsQueryColors' xrefstyle='select: title'/>
+can generate
+<errorname>BadColor</errorname>
+and
+<errorname>BadValue</errorname>
+errors.
+</para>
+</sect1>
+<sect1 id="Color_Conversion_Context_Functions">
+<title>Color Conversion Context Functions</title>
+<!-- .XS -->
+<!-- (SN Color Conversion Context Functions -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+This section describes functions to create, modify,
+and query Color Conversion Contexts (CCCs).
+</para>
+<para>
+<!-- .LP -->
+Associated with each colormap is an initial CCC transparently generated by
+Xlib.
+<indexterm><primary>Color Conversion Context</primary><secondary>creation</secondary></indexterm>
+Therefore, when you specify a colormap as an argument to a function,
+you are indirectly specifying a CCC.
+<indexterm><primary>CCC</primary><secondary>of colormap</secondary></indexterm>
+<indexterm><primary>Color Conversion Context</primary><secondary>of colormap</secondary></indexterm>
+The CCC attributes that can be modified by the X client are:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Client White Point
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Gamut compression procedure and client data
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+White point adjustment procedure and client data
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+The initial values for these attributes are implementation specific.
+The CCC attributes for subsequently created CCCs can be defined
+by changing the CCC attributes of the default CCC.
+<indexterm><primary>CCC</primary><secondary>default</secondary></indexterm>
+<indexterm><primary>Color Conversion Context</primary><secondary>default</secondary></indexterm>
+There is a default CCC associated with each screen.
+</para>
+<sect2 id="Getting_and_Setting_the_Color_Conversion_Context_of_a_Colormap">
+<title>Getting and Setting the Color Conversion Context of a Colormap</title>
+<!-- .XS -->
+<!-- (SN Getting and Setting the Color Conversion Context of a Colormap -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To obtain the CCC associated with a colormap, use
+<xref linkend='XcmsCCCOfColormap' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XcmsCCCOfColormap</primary></indexterm>
+<indexterm><primary>Colormap</primary><secondary>CCC of</secondary></indexterm>
+<indexterm><primary>CCC</primary><secondary>of colormap</secondary></indexterm>
+<indexterm><primary>Color Conversion Context</primary><secondary>of colormap</secondary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsCCCOfColormap'>
+<funcprototype>
+  <funcdef>XcmsCCC <function>XcmsCCCOfColormap</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XcmsCCCOfColormap' xrefstyle='select: title'/>
+function returns the CCC associated with the specified colormap.
+Once obtained, 
+the CCC attributes can be queried or modified.
+Unless the CCC associated with the specified colormap is changed with
+<xref linkend='XcmsSetCCCOfColormap' xrefstyle='select: title'/>,
+this CCC is used when the specified colormap is used as an argument 
+to color functions.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To change the CCC associated with a colormap, use
+<xref linkend='XcmsSetCCCOfColormap' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XcmsSetCCCOfColormap</primary></indexterm>
+<indexterm><primary>Colormap</primary><secondary>CCC of</secondary></indexterm>
+<indexterm><primary>CCC</primary><secondary>of colormap</secondary></indexterm>
+<indexterm><primary>Color Conversion Context</primary><secondary>of colormap</secondary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsSetCCCOfColormap'>
+<funcprototype>
+  <funcdef>XcmsCCC <function>XcmsSetCCCOfColormap</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XcmsSetCCCOfColormap' xrefstyle='select: title'/>
+function changes the CCC associated with the specified colormap.
+It returns the CCC previously associated with the colormap.
+If they are not used again in the application,
+CCCs should be freed by calling
+<xref linkend='XcmsFreeCCC' xrefstyle='select: title'/>.
+Several colormaps may share the same CCC without restriction; this
+includes the CCCs generated by Xlib with each colormap.  Xlib, however,
+creates a new CCC with each new colormap.
+</para>
+</sect2>
+<sect2 id="Obtaining_the_Default_Color_Conversion_Context">
+<title>Obtaining the Default Color Conversion Context</title>
+<!-- .XS -->
+<!-- (SN Obtaining the Default Color Conversion Context -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+You can change the default CCC attributes for subsequently created CCCs
+by changing the CCC attributes of the default CCC.
+<indexterm><primary>CCC</primary><secondary>default</secondary></indexterm>
+<indexterm><primary>Color Conversion Context</primary><secondary>default</secondary></indexterm>
+A default CCC is associated with each screen.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To obtain the default CCC for a screen, use
+<xref linkend='XcmsDefaultCCC' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XcmsDefaultCCC</primary></indexterm>
+<indexterm><primary>Color Conversion Context</primary><secondary>default</secondary></indexterm>
+<indexterm><primary>CCC</primary><secondary>default</secondary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsDefaultCCC'>
+<funcprototype>
+  <funcdef>XcmsCCC <function>XcmsDefaultCCC</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>screen_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate screen number on the host server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XcmsDefaultCCC' xrefstyle='select: title'/>
+function returns the default CCC for the specified screen.
+Its visual is the default visual of the screen.
+Its initial gamut compression and white point
+adjustment procedures as well as the associated client data are implementation
+specific.
+</para>
+</sect2>
+<sect2 id="Color_Conversion_Context_Macros">
+<title>Color Conversion Context Macros</title>
+<!-- .XS -->
+<!-- (SN Color Conversion Context Macros -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Applications should not directly modify any part of the
+<structname>XcmsCCC</structname>.
+The following lists the C language macros, their corresponding function
+equivalents for other language bindings, and what data they both
+can return.
+<!-- .sp -->
+</para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>DisplayOfCCC</primary></indexterm>
+<indexterm significance="preferred"><primary>XcmsDisplayOfCCC</primary></indexterm>
+<!-- .sM -->
+
+<funcsynopsis id='DisplayOfCCC'>
+<funcprototype>
+  <funcdef><function>DisplayOfCCC</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<funcsynopsis id='XcmsDisplayOfCCC'>
+<funcprototype>
+  <funcdef>Display *<function>XcmsDisplayOfCCC</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Both return the display associated with the specified CCC.
+</para>
+<!-- .LP -->
+<!-- .sp -->
+<indexterm significance="preferred"><primary>VisualOfCCC</primary></indexterm>
+<indexterm significance="preferred"><primary>XcmsVisualOfCCC</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='VisualOfCCC'>
+<funcprototype>
+  <funcdef><function>VisualOfCCC</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<funcsynopsis id='XcmsVisualOfCCC'>
+<funcprototype>
+  <funcdef>Visual *<function>XcmsVisualOfCCC</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Both return the visual associated with the specified CCC.
+<!-- .sp -->
+</para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>ScreenNumberOfCCC</primary></indexterm>
+<indexterm significance="preferred"><primary>XcmsScreenNumberOfCCC</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='ScreenNumberOfCCC'>
+<funcprototype>
+  <funcdef><function>ScreenNumberOfCCC</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<funcsynopsis id='XcmsScreenNumberOfCCC'>
+<funcprototype>
+  <funcdef>int <function>XcmsScreenNumberOfCCC</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Both return the number of the screen associated with the specified CCC.
+<!-- .sp -->
+</para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>ScreenWhitePointOfCCC</primary></indexterm>
+<indexterm significance="preferred"><primary>XcmsScreenWhitePointOfCCC</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='ScreenWhitePointOfCCC'>
+<funcprototype>
+  <funcdef><function>ScreenWhitePointOfCCC</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<funcsynopsis id='XcmsScreenWhitePointOfCCC'>
+<funcprototype>
+  <funcdef>XcmsColor <function>XcmsScreenWhitePointOfCCC</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Both return the white point of the screen associated with the specified CCC.
+<!-- .sp -->
+</para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>ClientWhitePointOfCCC</primary></indexterm>
+<indexterm significance="preferred"><primary>XcmsClientWhitePointOfCCC</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='ClientWhitePointOfCCC'>
+<funcprototype>
+  <funcdef> <function>ClientWhitePointOfCCC</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<funcsynopsis id='XcmsClientWhitePointOfCCC'>
+<funcprototype>
+  <funcdef>XcmsColor *<function>XcmsClientWhitePointOfCCC</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Both return the Client White Point of the specified CCC.
+</para>
+</sect2>
+
+<sect2 id="Modifying_Attributes_of_a_Color_Conversion_Context">
+<title>Modifying Attributes of a Color Conversion Context</title>
+<!-- .XS -->
+<!-- (SN Modifying Attributes of a Color Conversion Context -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To set the Client White Point in the CCC, use
+<xref linkend='XcmsSetWhitePoint' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XcmsSetWhitePoint</primary></indexterm>
+<indexterm><primary>Client White Point</primary><secondary>of Color Conversion Context</secondary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsSetWhitePoint'>
+<funcprototype>
+  <funcdef>Status <function>XcmsSetWhitePoint</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the new Client White Point.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XcmsSetWhitePoint' xrefstyle='select: title'/>
+function changes the Client White Point in the specified CCC.
+Note that the pixel member is ignored 
+and that the color specification is left unchanged upon return.
+The format for the new white point must be
+<symbol>XcmsCIEXYZFormat</symbol>,
+<symbol>XcmsCIEuvYFormat</symbol>,
+<symbol>XcmsCIExyYFormat</symbol>,
+or
+<symbol>XcmsUndefinedFormat</symbol>.
+If the color argument is NULL, this function sets the format component of the
+Client White Point specification to
+<symbol>XcmsUndefinedFormat</symbol>,
+indicating that the Client White Point is assumed to be the same as the
+Screen White Point.
+</para>
+<para>
+<!-- .LP -->
+This function returns nonzero status
+if the format for the new white point is valid;
+otherwise, it returns zero.
+
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To set the gamut compression procedure and corresponding client data
+in a specified CCC, use
+<xref linkend='XcmsSetCompressionProc' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XcmsSetCompressionProc</primary></indexterm>
+<indexterm><primary>Gamut compression</primary><secondary>setting in Color Conversion Context</secondary></indexterm>
+<indexterm><primary>Gamut compression</primary><secondary>procedure</secondary></indexterm>
+<indexterm><primary>Gamut compression</primary><secondary>client data</secondary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsSetCompressionProc'>
+<funcprototype>
+  <funcdef>XcmsCompressionProc <function>XcmsSetCompressionProc</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsCompressionProc <parameter>compression_proc</parameter></paramdef>
+  <paramdef>XPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>compression_proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the gamut compression procedure that is to be applied 
+when a color lies outside the screen's color gamut.
+If NULL is specified and a function using this CCC must convert
+a color specification to a device-dependent format and encounters a color
+that lies outside the screen's color gamut, 
+that function will return
+<symbol>XcmsFailure</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies client data for gamut compression procedure or NULL.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XcmsSetCompressionProc' xrefstyle='select: title'/>
+function first sets the gamut compression procedure and client data 
+in the specified CCC with the newly specified procedure and client data
+and then returns the old procedure.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To set the white point adjustment procedure and corresponding client data
+in a specified CCC, use
+<xref linkend='XcmsSetWhiteAdjustProc' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XcmsSetWhiteAdjustProc</primary></indexterm>
+<indexterm><primary>White point adjustment</primary><secondary>setting in Color Conversion Context</secondary></indexterm>
+<indexterm><primary>White point adjustment</primary><secondary>procedure</secondary></indexterm>
+<indexterm><primary>White point adjustment</primary><secondary>client data</secondary></indexterm>
+<funcsynopsis id='XcmsSetWhiteAdjustProc'>
+<funcprototype>
+  <funcdef>XcmsWhiteAdjustProc <function>XcmsSetWhiteAdjustProc</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsWhiteAdjustProc <parameter>white_adjust_proc</parameter></paramdef>
+  <paramdef>XPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>white_adjust_proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the white point adjustment procedure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies client data for white point adjustment procedure or NULL.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XcmsSetWhiteAdjustProc' xrefstyle='select: title'/>
+function first sets the white point adjustment procedure and client data 
+in the specified CCC with the newly specified procedure and client data
+and then returns the old procedure.
+</para>
+</sect2>
+<sect2 id="Creating_and_Freeing_a_Color_Conversion_Context">
+<title>Creating and Freeing a Color Conversion Context</title>
+<!-- .XS -->
+<!-- (SN Creating and Freeing a Color Conversion Context -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+You can explicitly create a CCC within your application by calling
+<xref linkend='XcmsCreateCCC' xrefstyle='select: title'/>.
+These created CCCs can then be used by those functions that explicitly
+call for a CCC argument.
+Old CCCs that will not be used by the application should be freed using
+<xref linkend='XcmsFreeCCC' xrefstyle='select: title'/>.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To create a CCC, use
+<xref linkend='XcmsCreateCCC' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XcmsCreateCCC</primary></indexterm>
+<indexterm><primary>Color Conversion Context</primary><secondary>creation</secondary></indexterm>
+<indexterm><primary>CCC</primary><secondary>creation</secondary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsCreateCCC'>
+<funcprototype>
+  <funcdef>XcmsCCC <function>XcmsCreateCCC</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>screen_number</parameter></paramdef>
+  <paramdef>Visual *<parameter>visual</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>client_white_point</parameter></paramdef>
+  <paramdef>XcmsCompressionProc <parameter>compression_proc</parameter></paramdef>
+  <paramdef>XPointer <parameter>compression_client_data</parameter></paramdef>
+  <paramdef>XcmsWhiteAdjustProc <parameter>white_adjust_proc</parameter></paramdef>
+  <paramdef>XPointer <parameter>white_adjust_client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>screen_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate screen number on the host server.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>visual</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the visual type.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_white_point</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the Client White Point.
+If NULL is specified, 
+the Client White Point is to be assumed to be the same as the
+Screen White Point.
+Note that the pixel member is ignored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>compression_proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the gamut compression procedure that is to be applied 
+when a color lies outside the screen's color gamut.
+If NULL is specified and a function using this CCC must convert
+a color specification to a device-dependent format and encounters a color
+that lies outside the screen's color gamut, 
+that function will return
+<symbol>XcmsFailure</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>compression_client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies client data for use by the gamut compression procedure or NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>white_adjust_proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the white adjustment procedure that is to be applied
+when the Client White Point differs from the Screen White Point.
+NULL indicates that no white point adjustment is desired.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>white_adjust_client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies client data for use with the white point adjustment procedure or NULL.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XcmsCreateCCC' xrefstyle='select: title'/>
+function creates a CCC for the specified display, screen, and visual.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To free a CCC, use
+<xref linkend='XcmsFreeCCC' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XcmsFreeCCC</primary></indexterm>
+<indexterm><primary>Color Conversion Context</primary><secondary>freeing</secondary></indexterm>
+<indexterm><primary>CCC</primary><secondary>freeing</secondary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsFreeCCC'>
+<funcprototype>
+  <funcdef>void <function>XcmsFreeCCC</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XcmsFreeCCC' xrefstyle='select: title'/>
+function frees the memory used for the specified CCC.
+Note that default CCCs and those currently associated with colormaps
+are ignored.
+</para>
+</sect2>
+</sect1>
+<sect1 id="Converting_between_Color_Spaces">
+<title>Converting between Color Spaces</title>
+<!-- .XS -->
+<!-- (SN Converting between Color Spaces -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To convert an array of color specifications in arbitrary color formats
+to a single destination format, use
+<xref linkend='XcmsConvertColors' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Color conversion</primary></indexterm>
+<indexterm><primary>Color</primary><secondary>conversion</secondary></indexterm>
+<indexterm significance="preferred"><primary>XcmsConvertColors</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsConvertColors'>
+<funcprototype>
+  <funcdef>Status <function>XcmsConvertColors</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsColor <parameter>colors_in_out[]</parameter></paramdef>
+  <paramdef>unsigned int <parameter>ncolors</parameter></paramdef>
+  <paramdef>XcmsColorFormat <parameter>target_format</parameter></paramdef>
+  <paramdef>Bool <parameter>compression_flags_return[]</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+If conversion is between device-independent color spaces only
+(for example, TekHVC to CIELuv),
+the CCC is necessary only to specify the Client White Point.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>colors_in_out</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an array of color specifications.
+Pixel members are ignored and remain unchanged upon return.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ncolors</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of 
+<structname>XcmsColor</structname>
+structures in the color-specification array.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>target_format</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the target color specification format.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>compression_flags_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns an array of Boolean values indicating compression status.
+If a non-NULL pointer is supplied,
+each element of the array is set to
+<symbol>True</symbol>
+if the corresponding color was compressed and
+<symbol>False</symbol>
+otherwise.
+Pass NULL if the compression status is not useful.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XcmsConvertColors' xrefstyle='select: title'/>
+function converts the color specifications in the specified array of
+<structname>XcmsColor</structname>
+structures from their current format to a single target format,
+using the specified CCC.
+When the return value is
+<symbol>XcmsFailure</symbol>,
+the contents of the color specification array are left unchanged.
+</para>
+<para>
+<!-- .LP -->
+The array may contain a mixture of color specification formats
+(for example, 3 <acronym>CIE</acronym> XYZ, 2 <acronym>CIE</acronym> Luv, and so on).
+When the array contains both device-independent and
+device-dependent color specifications and the target_format argument specifies
+a device-dependent format (for example,
+<symbol>XcmsRGBiFormat</symbol>,
+<symbol>XcmsRGBFormat</symbol>),
+all specifications are converted to <acronym>CIE</acronym> XYZ format and then to the target
+device-dependent format.
+</para>
+</sect1>
+<sect1 id="Callback_Functions">
+<title>Callback Functions</title>
+<!-- .XS -->
+<!-- (SN Callback Functions -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+This section describes the gamut compression and white point
+adjustment callbacks.
+</para>
+<para>
+<!-- .LP -->
+The gamut compression procedure specified in the CCC
+is called when an attempt to convert a color specification from
+<structname>XcmsCIEXYZ</structname>
+to a device-dependent format (typically
+<structname>XcmsRGBi</structname>)
+results in a color that lies outside the screen's color gamut.
+If the gamut compression procedure requires client data, this data is passed
+via the gamut compression client data in the CCC.
+</para>
+<para>
+<!-- .LP -->
+During color specification conversion between device-independent
+and device-dependent color spaces,
+if a white point adjustment procedure is specified in the CCC,
+it is triggered when the Client White Point and Screen White Point differ.
+If required, the client data is obtained from the CCC.
+</para>
+<sect2 id="Prototype_Gamut_Compression_Procedure">
+<title>Prototype Gamut Compression Procedure</title>
+<!-- .XS -->
+<!-- (SN Prototype Gamut Compression Procedure -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The gamut compression callback interface must adhere to the
+following:
+</para>
+<indexterm significance="preferred"><primary>XcmsCompressionProc</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsCompressionProc'>
+<funcprototype>
+  <funcdef>typedef Status<function>(*XcmsCompressionProc</function>)</funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsColor <parameter>colors_in_out[]</parameter></paramdef>
+  <paramdef>unsigned int <parameter>ncolors</parameter></paramdef>
+  <paramdef>unsigned int <parameter>index</parameter></paramdef>
+  <paramdef>Bool <parameter>compression_flags_return[]</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>colors_in_out</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an array of color specifications.
+Pixel members should be ignored and must remain unchanged upon return.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ncolors</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of 
+<structname>XcmsColor</structname>
+structures in the color-specification array.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>index</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the index into the array of
+<structname>XcmsColor</structname>
+structures for the encountered color specification that lies outside the 
+screen's color gamut.
+Valid values are 0 (for the first element) to ncolors - 1.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>compression_flags_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns an array of Boolean values for indicating compression status.
+If a non-NULL pointer is supplied
+and a color at a given index is compressed, then
+<symbol>True</symbol>
+should be stored at the corresponding index in this array;
+otherwise, the array should not be modified.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+When implementing a gamut compression procedure, consider the following
+rules and assumptions:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+The gamut compression procedure can attempt to compress one or multiple
+specifications at a time.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+When called, elements 0 to index - 1 in the color specification
+array can be assumed to fall within the screen's color gamut.
+In addition, these color specifications are already in some device-dependent
+format (typically
+<structname>XcmsRGBi</structname>).
+If any modifications are made to these color specifications,
+they must be in their initial device-dependent format upon return.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+When called, the element in the color specification array specified
+by the index argument contains the color specification outside the 
+screen's color gamut encountered by the calling routine.
+In addition, this color specification can be assumed to be in
+<structname>XcmsCIEXYZ</structname>.
+Upon return, this color specification must be in
+<structname>XcmsCIEXYZ</structname>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+When called, elements from index to ncolors - 1 
+in the color specification array may or may not fall within the
+screen's color gamut.
+In addition, these color specifications can be assumed to be in
+<structname>XcmsCIEXYZ</structname>.
+If any modifications are made to these color specifications, 
+they must be in
+<structname>XcmsCIEXYZ</structname>
+upon return.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The color specifications passed to the gamut compression procedure
+have already been adjusted to the Screen White Point.
+This means that at this point the color specification's white point
+is the Screen White Point.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the gamut compression procedure uses a device-independent color space not
+initially accessible for use in the color management system, use 
+<xref linkend='XcmsAddColorSpace' xrefstyle='select: title'/>
+to ensure that it is added.
+    </para>
+  </listitem>
+</itemizedlist>
+</sect2>
+<sect2 id="Supplied_Gamut_Compression_Procedures">
+<title>Supplied Gamut Compression Procedures</title>
+<!-- .XS -->
+<!-- (SN Supplied Gamut Compression Procedures -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The following equations are useful in describing gamut compression
+functions:
+<!-- .EQ -->
+delim %%
+<!-- .EN -->
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+%CIELab~Psychometric~Chroma ~=~ sqrt(a_star sup 2 ~+~ b_star sup 2 )%
+
+%CIELab~Psychometric~Hue ~=~ tan sup -1 left [ b_star over a_star right ]%
+
+%CIELuv~Psychometric~Chroma ~=~ sqrt(u_star sup 2 ~+~ v_star sup 2 )%
+
+%CIELuv~Psychometric~Hue ~=~ tan sup -1 left [ v_star over u_star right ]%
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+The gamut compression callback procedures provided by Xlib are as follows:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+<function>XcmsCIELabClipL</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+This brings the encountered out-of-gamut color specification into the 
+screen's color gamut by reducing or increasing <acronym>CIE</acronym> metric lightness (L*) 
+in the <acronym>CIE</acronym> L*a*b* color space until the color is within the gamut.
+If the Psychometric Chroma of the color specification 
+is beyond maximum for the Psychometric Hue Angle,
+then while maintaining the same Psychometric Hue Angle,
+the color will be clipped to the <acronym>CIE</acronym> L*a*b* coordinates of maximum
+Psychometric Chroma.
+See
+<xref linkend='XcmsCIELabQueryMaxC' xrefstyle='select: title'/>.
+No client data is necessary.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>XcmsCIELabClipab</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+This brings the encountered out-of-gamut color specification into the 
+screen's color gamut by reducing Psychometric Chroma,
+while maintaining Psychometric Hue Angle,
+until the color is within the gamut.
+No client data is necessary.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>XcmsCIELabClipLab</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+This brings the encountered out-of-gamut color specification into the
+screen's color gamut by replacing it with <acronym>CIE</acronym> L*a*b* coordinates
+that fall within the color gamut while maintaining the original
+Psychometric Hue
+Angle and whose vector to the original coordinates is the shortest attainable.
+No client data is necessary.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>XcmsCIELuvClipL</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+This brings the encountered out-of-gamut color specification into the 
+screen's color gamut by reducing or increasing <acronym>CIE</acronym> metric lightness (L*)
+in the <acronym>CIE</acronym> L*u*v* color space until the color is within the gamut.
+If the Psychometric Chroma of the color specification
+is beyond maximum for the Psychometric Hue Angle,
+then, while maintaining the same Psychometric Hue Angle,
+the color will be clipped to the <acronym>CIE</acronym> L*u*v* coordinates of maximum
+Psychometric Chroma.
+See
+<xref linkend='XcmsCIELuvQueryMaxC' xrefstyle='select: title'/>.
+No client data is necessary.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>XcmsCIELuvClipuv</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+This brings the encountered out-of-gamut color specification into the
+screen's color gamut by reducing
+Psychometric Chroma, while maintaining Psychometric Hue Angle,
+until the color is within the gamut.
+No client data is necessary.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>XcmsCIELuvClipLuv</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+This brings the encountered out-of-gamut color specification into the
+screen's color gamut by replacing it with <acronym>CIE</acronym> L*u*v* coordinates
+that fall within the color gamut while maintaining the original
+Psychometric Hue
+Angle and whose vector to the original coordinates is the shortest attainable.
+No client data is necessary.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>XcmsTekHVCClipV</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+This brings the encountered out-of-gamut color specification into the
+screen's color gamut by reducing or increasing the Value dimension
+in the TekHVC color space until the color is within the gamut.
+If Chroma of the color specification is beyond maximum for the particular Hue,
+then, while maintaining the same Hue,
+the color will be clipped to the Value and Chroma coordinates
+that represent maximum Chroma for that particular Hue.
+No client data is necessary.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>XcmsTekHVCClipC</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+This brings the encountered out-of-gamut color specification into the
+screen's color gamut by reducing the Chroma dimension
+in the TekHVC color space until the color is within the gamut.
+No client data is necessary.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>XcmsTekHVCClipVC</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+This brings the encountered out-of-gamut color specification into the
+screen's color gamut by replacing it with TekHVC coordinates
+that fall within the color gamut while maintaining the original Hue
+and whose vector to the original coordinates is the shortest attainable.
+No client data is necessary.
+    </para>
+  </listitem>
+</itemizedlist>
+</sect2>
+<sect2 id="Prototype_White_Point_Adjustment_Procedure">
+<title>Prototype White Point Adjustment Procedure</title>
+<!-- .XS -->
+<!-- (SN Prototype White Point Adjustment Procedure -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The white point adjustment procedure interface must adhere to the following:
+</para>
+<indexterm significance="preferred"><primary>XcmsWhiteAdjustProc</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsWhiteAdjustProc'>
+<funcprototype>
+  <funcdef>typedef Status <function>(*XcmsWhiteAdjustProc</function>)</funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>initial_white_point</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>target_white_point</parameter></paramdef>
+  <paramdef>XcmsColorFormat <parameter>target_format</parameter></paramdef>
+  <paramdef>XcmsColor <parameter>colors_in_out[]</parameter></paramdef>
+  <paramdef>unsigned int <parameter>ncolors</parameter></paramdef>
+  <paramdef>Bool <parameter>compression_flags_return[]</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>initial_white_point</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the initial white point.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>target_white_point</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the target white point.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>target_format</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the target color specification format.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>colors_in_out</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an array of color specifications.
+Pixel members should be ignored and must remain unchanged upon return.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ncolors</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of 
+<structname>XcmsColor</structname>
+structures in the color-specification array.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>compression_flags_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns an array of Boolean values for indicating compression status.
+If a non-NULL pointer is supplied
+and a color at a given index is compressed, then
+<symbol>True</symbol>
+should be stored at the corresponding index in this array;
+otherwise, the array should not be modified.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+</para>
+</sect2>
+<sect2 id="Supplied_White_Point_Adjustment_Procedures">
+<title>Supplied White Point Adjustment Procedures</title>
+<!-- .XS -->
+<!-- (SN Supplied White Point Adjustment Procedures -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+White point adjustment procedures provided by Xlib are as follows:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+<function>XcmsCIELabWhiteShiftColors</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+This uses the <acronym>CIE</acronym> L*a*b* color space for adjusting the chromatic character
+of colors to compensate for the chromatic differences between the source
+and destination white points.
+This procedure simply converts the color specifications to 
+<structname>XcmsCIELab</structname>
+using the source white point and then converts to the target specification
+format using the destination's white point.
+No client data is necessary.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>XcmsCIELuvWhiteShiftColors</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+This uses the <acronym>CIE</acronym> L*u*v* color space for adjusting the chromatic character
+of colors to compensate for the chromatic differences between the source
+and destination white points.
+This procedure simply converts the color specifications to 
+<structname>XcmsCIELuv</structname>
+using the source white point and then converts to the target specification
+format using the destination's white point.
+No client data is necessary.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>XcmsTekHVCWhiteShiftColors</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+This uses the TekHVC color space for adjusting the chromatic character
+of colors to compensate for the chromatic differences between the source
+and destination white points.
+This procedure simply converts the color specifications to
+<structname>XcmsTekHVC</structname>
+using the source white point and then converts to the target specification
+format using the destination's white point.
+An advantage of this procedure over those previously described
+is an attempt to minimize hue shift.
+No client data is necessary.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+From an implementation point of view,
+these white point adjustment procedures convert the color specifications
+to a device-independent but white-point-dependent color space 
+(for example, <acronym>CIE</acronym> L*u*v*, <acronym>CIE</acronym> L*a*b*, TekHVC) using one white point
+and then converting those specifications to the target color space 
+using another white point.
+In other words,
+the specification goes in the color space with one white point 
+but comes out with another white point, 
+resulting in a chromatic shift based on the chromatic displacement
+between the initial white point and target white point.
+The <acronym>CIE</acronym> color spaces that are assumed to be white-point-independent
+are <acronym>CIE</acronym> u'v'Y, <acronym>CIE</acronym> XYZ, and <acronym>CIE</acronym> xyY.
+When developing a custom white point adjustment procedure that uses a
+device-independent color space not initially accessible for use in the
+color management system, use
+<xref linkend='XcmsAddColorSpace' xrefstyle='select: title'/>
+to ensure that it is added.
+</para>
+<para>
+<!-- .LP -->
+As an example, 
+if the CCC specifies a white point adjustment procedure
+and if the Client White Point and Screen White Point differ, the
+<xref linkend='XcmsAllocColor' xrefstyle='select: title'/>
+function will use the white point adjustment
+procedure twice: 
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Once to convert to
+<structname>XcmsRGB</structname>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A second time to convert from
+<structname>XcmsRGB</structname>
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+For example, assume the specification is in
+<structname>XcmsCIEuvY</structname>
+and the adjustment procedure is
+<function>XcmsCIELuvWhiteShiftColors</function>.
+During conversion to
+<structname>XcmsRGB</structname>,
+the call to 
+<xref linkend='XcmsAllocColor' xrefstyle='select: title'/>
+results in the following series of color specification conversions:
+<!-- .\" Do these need to be font coded? -->
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+From 
+<structname>XcmsCIEuvY</structname>
+to
+<structname>XcmsCIELuv</structname>
+using the Client White Point
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+From 
+<structname>XcmsCIELuv</structname>
+to
+<structname>XcmsCIEuvY</structname>
+using the Screen White Point
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+From
+<structname>XcmsCIEuvY</structname>
+to
+<structname>XcmsCIEXYZ</structname>
+(<acronym>CIE</acronym> u'v'Y and XYZ are white-point-independent color spaces)
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+From 
+<structname>XcmsCIEXYZ</structname>
+to 
+<structname>XcmsRGBi</structname>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+From 
+<structname>XcmsRGBi</structname>
+to
+<structname>XcmsRGB</structname>
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+The resulting <acronym>RGB</acronym> specification is passed to
+<xref linkend='XAllocColor' xrefstyle='select: title'/>,
+and the <acronym>RGB</acronym>
+specification returned by
+<xref linkend='XAllocColor' xrefstyle='select: title'/>
+is converted back to 
+<structname>XcmsCIEuvY</structname>
+by reversing the color conversion sequence.
+</para>
+</sect2>
+</sect1>
+<sect1 id="Gamut_Querying_Functions">
+<title>Gamut Querying Functions</title>
+<!-- .XS -->
+<!-- (SN Gamut Querying Functions -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+This section describes the gamut querying functions that Xlib provides.
+These functions allow the client to query the boundary 
+of the screen's color gamut in terms of the <acronym>CIE</acronym> L*a*b*, <acronym>CIE</acronym> L*u*v*, 
+and TekHVC color spaces.
+<indexterm><primary>Gamut querying</primary></indexterm>
+Functions are also provided that allow you to query 
+the color specification of:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+White (full-intensity red, green, and blue)
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Red (full-intensity red while green and blue are zero)
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Green (full-intensity green while red and blue are zero)
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Blue (full-intensity blue while red and green are zero)
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Black (zero-intensity red, green, and blue)
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+The white point associated with color specifications passed to 
+and returned from these gamut querying
+functions is assumed to be the Screen White Point.
+<indexterm><primary>Screen White Point</primary></indexterm>
+This is a reasonable assumption,
+because the client is trying to query the screen's color gamut.
+</para>
+<para>
+<!-- .LP -->
+The following naming convention is used for the Max and Min functions:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+Xcms<emphasis remap='I'>&lt;color_space&gt;</emphasis>QueryMax<emphasis remap='I'>&lt;dimensions&gt;</emphasis>
+
+Xcms<emphasis remap='I'>&lt;color_space&gt;</emphasis>QueryMin<emphasis remap='I'>&lt;dimensions&gt;</emphasis>
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+The &lt;dimensions&gt; consists of a letter or letters 
+that identify the dimensions of the color space 
+that are not fixed.
+For example, 
+<xref linkend='XcmsTekHVCQueryMaxC' xrefstyle='select: title'/>
+is given a fixed Hue and Value for which maximum Chroma is found.
+</para>
+<sect2 id="Red_Green_and_Blue_Queries">
+<title>Red, Green, and Blue Queries</title>
+<!-- .XS -->
+<!-- (SN Red, Green, and Blue Queries -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To obtain the color specification for black 
+(zero-intensity red, green, and blue), use
+<xref linkend='XcmsQueryBlack' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XcmsQueryBlack</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsQueryBlack'>
+<funcprototype>
+  <funcdef>Status <function>XcmsQueryBlack</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsColorFormat <parameter>target_format</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+The CCC's Client White Point and white point adjustment procedures
+are ignored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>target_format</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the target color specification format.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the color specification in the specified target format
+for zero-intensity red, green, and blue.
+The white point associated with the returned
+color specification is the Screen White Point.
+The value returned in the pixel member is undefined.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM  -->
+The
+<xref linkend='XcmsQueryBlack' xrefstyle='select: title'/>
+function returns the color specification in the specified target format
+for zero-intensity red, green, and blue.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To obtain the color specification for blue 
+(full-intensity blue while red and green are zero), use
+<xref linkend='XcmsQueryBlue' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XcmsQueryBlue</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsQueryBlue'>
+<funcprototype>
+  <funcdef>Status <function>XcmsQueryBlue</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsColorFormat <parameter>target_format</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+The CCC's Client White Point and white point adjustment procedures
+are ignored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>target_format</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the target color specification format.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the color specification in the specified target format
+for full-intensity blue while red and green are zero.
+The white point associated with the returned
+color specification is the Screen White Point.
+The value returned in the pixel member is undefined.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM  -->
+The
+<xref linkend='XcmsQueryBlue' xrefstyle='select: title'/>
+function returns the color specification in the specified target format
+for full-intensity blue while red and green are zero.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To obtain the color specification for green
+(full-intensity green while red and blue are zero), use
+<xref linkend='XcmsQueryGreen' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XcmsQueryGreen</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsQueryGreen'>
+<funcprototype>
+  <funcdef>Status <function>XcmsQueryGreen</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsColorFormat <parameter>target_format</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+The CCC's Client White Point and white point adjustment procedures
+are ignored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>target_format</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the target color specification format.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the color specification in the specified target format
+for full-intensity green while red and blue are zero.
+The white point associated with the returned
+color specification is the Screen White Point.
+The value returned in the pixel member is undefined.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM  -->
+The
+<xref linkend='XcmsQueryGreen' xrefstyle='select: title'/>
+function returns the color specification in the specified target format
+for full-intensity green while red and blue are zero.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To obtain the color specification for red
+(full-intensity red while green and blue are zero), use
+<xref linkend='XcmsQueryRed' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XcmsQueryRed</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsQueryRed'>
+<funcprototype>
+  <funcdef>Status <function>XcmsQueryRed</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsColorFormat <parameter>target_format</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+The CCC's Client White Point and white point adjustment procedures
+are ignored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>target_format</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the target color specification format.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the color specification in the specified target format
+for full-intensity red while green and blue are zero.
+The white point associated with the returned
+color specification is the Screen White Point.
+The value returned in the pixel member is undefined.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM  -->
+The
+<xref linkend='XcmsQueryRed' xrefstyle='select: title'/>
+function returns the color specification in the specified target format
+for full-intensity red while green and blue are zero.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To obtain the color specification for white
+(full-intensity red, green, and blue), use
+<xref linkend='XcmsQueryWhite' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XcmsQueryWhite</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsQueryWhite'>
+<funcprototype>
+  <funcdef>Status <function>XcmsQueryWhite</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsColorFormat <parameter>target_format</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+The CCC's Client White Point and white point adjustment procedures
+are ignored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>target_format</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the target color specification format.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the color specification in the specified target format
+for full-intensity red, green, and blue.
+The white point associated with the returned
+color specification is the Screen White Point.
+The value returned in the pixel member is undefined.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM  -->
+The
+<xref linkend='XcmsQueryWhite' xrefstyle='select: title'/>
+function returns the color specification in the specified target format
+for full-intensity red, green, and blue.
+</para>
+</sect2>
+<sect2 id="CIELab_Queries">
+<title>CIELab Queries</title>
+<!-- .XS -->
+<!-- (SN CIELab Queries -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The following equations are useful in describing the CIELab query functions:
+<!-- .EQ -->
+delim %%
+<!-- .EN -->
+</para>
+<para>
+<!-- .LP -->
+<indexterm><primary>Psychometric Hue Angle</primary></indexterm>
+<indexterm><primary><acronym>CIE</acronym> metric lightness</primary></indexterm>
+<indexterm><primary>Psychometric Chroma</primary></indexterm>
+<indexterm><primary>Psychometric Chroma</primary><secondary>maximum</secondary></indexterm>
+<literallayout class="monospaced">
+%CIELab~Psychometric~Chroma ~=~ sqrt(a_star sup 2 ~+~ b_star sup 2 )%
+
+%CIELab~Psychometric~Hue ~=~ tan sup -1 left [ b_star over a_star right ]%
+</literallayout>
+<!-- .sp -->
+To obtain the <acronym>CIE</acronym> L*a*b* coordinates of maximum Psychometric Chroma
+for a given Psychometric Hue Angle and <acronym>CIE</acronym> metric lightness (L*), use
+<xref linkend='XcmsCIELabQueryMaxC' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XcmsCIELabQueryMaxC</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsCIELabQueryMaxC'>
+<funcprototype>
+  <funcdef>Status <function>XcmsCIELabQueryMaxC</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsFloat <parameter>hue_angle</parameter></paramdef>
+  <paramdef>XcmsFloat <parameter>L_star</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+The CCC's Client White Point and white point adjustment procedures
+are ignored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>hue_angle</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the hue angle (in degrees) at which to find maximum chroma.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>L_star</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the lightness (L*) at which to find maximum chroma.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the <acronym>CIE</acronym> L*a*b* coordinates of maximum chroma
+displayable by the screen for the given hue angle and lightness.
+The white point associated with the returned
+color specification is the Screen White Point.
+The value returned in the pixel member is undefined.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM  -->
+The
+<xref linkend='XcmsCIELabQueryMaxC' xrefstyle='select: title'/>
+function, given a hue angle and lightness,
+finds the point of maximum chroma displayable by the screen.
+It returns this point in <acronym>CIE</acronym> L*a*b* coordinates.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To obtain the <acronym>CIE</acronym> L*a*b* coordinates of maximum <acronym>CIE</acronym> metric lightness (L*)
+for a given Psychometric Hue Angle and Psychometric Chroma, use
+<xref linkend='XcmsCIELabQueryMaxL' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Psychometric Hue Angle</primary></indexterm>
+<indexterm><primary><acronym>CIE</acronym> metric lightness</primary></indexterm>
+<indexterm><primary><acronym>CIE</acronym> metric lightness</primary><secondary>maximum</secondary></indexterm>
+<indexterm significance="preferred"><primary>XcmsCIELabQueryMaxL</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsCIELabQueryMaxL'>
+<funcprototype>
+  <funcdef>Status <function>XcmsCIELabQueryMaxL</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsFloat <parameter>hue_angle</parameter></paramdef>
+  <paramdef>XcmsFloat <parameter>chroma</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+The CCC's Client White Point and white point adjustment procedures
+are ignored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>hue_angle</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the hue angle (in degrees) at which to find maximum lightness.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>chroma</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the chroma at which to find maximum lightness.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the <acronym>CIE</acronym> L*a*b* coordinates of maximum lightness
+displayable by the screen for the given hue angle and chroma.
+The white point associated with the returned
+color specification is the Screen White Point.
+The value returned in the pixel member is undefined.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM  -->
+The
+<xref linkend='XcmsCIELabQueryMaxL' xrefstyle='select: title'/>
+function, given a hue angle and chroma,
+finds the point in <acronym>CIE</acronym> L*a*b* color space of maximum 
+lightness (L*) displayable by the screen.
+It returns this point in <acronym>CIE</acronym> L*a*b* coordinates.
+An 
+<symbol>XcmsFailure</symbol>
+return value usually indicates that the given chroma
+is beyond maximum for the given hue angle.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To obtain the <acronym>CIE</acronym> L*a*b* coordinates of maximum Psychometric Chroma
+for a given Psychometric Hue Angle, use
+<xref linkend='XcmsCIELabQueryMaxLC' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Psychometric Hue Angle</primary></indexterm>
+<indexterm><primary>Psychometric Chroma</primary></indexterm>
+<indexterm><primary><acronym>CIE</acronym> metric lightness</primary></indexterm>
+<indexterm><primary>Psychometric Chroma</primary><secondary>maximum</secondary></indexterm>
+<indexterm><primary><acronym>CIE</acronym> metric lightness</primary><secondary>maximum</secondary></indexterm>
+<indexterm significance="preferred"><primary>XcmsCIELabQueryMaxLC</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsCIELabQueryMaxLC'>
+<funcprototype>
+  <funcdef>Status <function>XcmsCIELabQueryMaxLC</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsFloat <parameter>hue_angle</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+The CCC's Client White Point and white point adjustment procedures
+are ignored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>hue_angle</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the hue angle (in degrees) at which to find maximum chroma.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the <acronym>CIE</acronym> L*a*b* coordinates of maximum chroma
+displayable by the screen for the given hue angle.
+The white point associated with the returned
+color specification is the Screen White Point.
+The value returned in the pixel member is undefined.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM  -->
+The
+<xref linkend='XcmsCIELabQueryMaxLC' xrefstyle='select: title'/>
+function, given a hue angle,
+finds the point of maximum chroma displayable by the screen.
+It returns this point in <acronym>CIE</acronym> L*a*b* coordinates.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To obtain the <acronym>CIE</acronym> L*a*b* coordinates of minimum <acronym>CIE</acronym> metric lightness (L*)
+for a given Psychometric Hue Angle and Psychometric Chroma, use
+<xref linkend='XcmsCIELabQueryMinL' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Psychometric Hue Angle</primary></indexterm>
+<indexterm><primary><acronym>CIE</acronym> metric lightness</primary></indexterm>
+<indexterm><primary><acronym>CIE</acronym> metric lightness</primary><secondary>minimum</secondary></indexterm>
+<indexterm significance="preferred"><primary>XcmsCIELabQueryMinL</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsCIELabQueryMinL'>
+<funcprototype>
+  <funcdef>Status <function>XcmsCIELabQueryMinL</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsFloat <parameter>hue_angle</parameter></paramdef>
+  <paramdef>XcmsFloat <parameter>chroma</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+The CCC's Client White Point and white point adjustment procedures
+are ignored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>hue_angle</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the hue angle (in degrees) at which to find minimum lightness.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>chroma</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the chroma at which to find minimum lightness.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the <acronym>CIE</acronym> L*a*b* coordinates of minimum lightness
+displayable by the screen for the given hue angle and chroma.
+The white point associated with the returned
+color specification is the Screen White Point.
+The value returned in the pixel member is undefined.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM  -->
+The
+<xref linkend='XcmsCIELabQueryMinL' xrefstyle='select: title'/>
+function, given a hue angle and chroma,
+finds the point of minimum lightness (L*) displayable by the screen.
+It returns this point in <acronym>CIE</acronym> L*a*b* coordinates.
+An 
+<symbol>XcmsFailure</symbol>
+return value usually indicates that the given chroma
+is beyond maximum for the given hue angle.
+</para>
+</sect2>
+<sect2 id="CIELuv_Queries">
+<title>CIELuv Queries</title>
+<!-- .XS -->
+<!-- (SN CIELuv Queries -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The following equations are useful in describing the CIELuv query functions:
+<!-- .EQ -->
+delim %%
+<!-- .EN -->
+</para>
+<para>
+<!-- .LP -->
+<indexterm><primary>Psychometric Hue Angle</primary></indexterm>
+<indexterm><primary><acronym>CIE</acronym> metric lightness</primary></indexterm>
+<indexterm><primary>Psychometric Chroma</primary></indexterm>
+<indexterm><primary>Psychometric Chroma</primary><secondary>maximum</secondary></indexterm>
+<literallayout class="monospaced">
+%CIELuv~Psychometric~Chroma ~=~ sqrt(u_star sup 2 ~+~ v_star sup 2 )%
+
+%CIELuv~Psychometric~Hue ~=~ tan sup -1 left [ v_star over u_star right ]%
+</literallayout>
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To obtain the <acronym>CIE</acronym> L*u*v* coordinates of maximum Psychometric Chroma
+for a given Psychometric Hue Angle and <acronym>CIE</acronym> metric lightness (L*), use
+<xref linkend='XcmsCIELuvQueryMaxC' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XcmsCIELuvQueryMaxC</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsCIELuvQueryMaxC'>
+<funcprototype>
+  <funcdef>Status <function>XcmsCIELuvQueryMaxC</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsFloat <parameter>hue_angle</parameter></paramdef>
+  <paramdef>XcmsFloat <parameter>L_star</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+The CCC's Client White Point and white point adjustment procedures
+are ignored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>hue_angle</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the hue angle (in degrees) at which to find maximum chroma.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>L_star</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the lightness (L*) at which to find maximum chroma.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the <acronym>CIE</acronym> L*u*v* coordinates of maximum chroma
+displayable by the screen for the given hue angle and lightness.
+The white point associated with the returned
+color specification is the Screen White Point.
+The value returned in the pixel member is undefined.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM  -->
+The
+<xref linkend='XcmsCIELuvQueryMaxC' xrefstyle='select: title'/>
+function, given a hue angle and lightness,
+finds the point of maximum chroma displayable by the screen.
+It returns this point in <acronym>CIE</acronym> L*u*v* coordinates.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To obtain the <acronym>CIE</acronym> L*u*v* coordinates of maximum <acronym>CIE</acronym> metric lightness (L*)
+for a given Psychometric Hue Angle and Psychometric Chroma, use
+<xref linkend='XcmsCIELuvQueryMaxL' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Psychometric Hue Angle</primary></indexterm>
+<indexterm><primary><acronym>CIE</acronym> metric lightness</primary></indexterm>
+<indexterm><primary><acronym>CIE</acronym> metric lightness</primary><secondary>maximum</secondary></indexterm>
+<indexterm significance="preferred"><primary>XcmsCIELuvQueryMaxL</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsCIELuvQueryMaxL'>
+<funcprototype>
+  <funcdef>Status <function>XcmsCIELuvQueryMaxL</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsFloat <parameter>hue_angle</parameter></paramdef>
+  <paramdef>XcmsFloat <parameter>chroma</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+The CCC's Client White Point and white point adjustment procedures
+are ignored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>hue_angle</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the hue angle (in degrees) at which to find maximum lightness.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>L_star</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the lightness (L*) at which to find maximum lightness.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the <acronym>CIE</acronym> L*u*v* coordinates of maximum lightness
+displayable by the screen for the given hue angle and chroma.
+The white point associated with the returned
+color specification is the Screen White Point.
+The value returned in the pixel member is undefined.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM  -->
+The
+<xref linkend='XcmsCIELuvQueryMaxL' xrefstyle='select: title'/>
+function, given a hue angle and chroma,
+finds the point in <acronym>CIE</acronym> L*u*v* color space of maximum 
+lightness (L*) displayable by the screen.
+It returns this point in <acronym>CIE</acronym> L*u*v* coordinates.
+An 
+<symbol>XcmsFailure</symbol>
+return value usually indicates that the given chroma
+is beyond maximum for the given hue angle.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To obtain the <acronym>CIE</acronym> L*u*v* coordinates of maximum Psychometric Chroma
+for a given Psychometric Hue Angle, use
+<xref linkend='XcmsCIELuvQueryMaxLC' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Psychometric Hue Angle</primary></indexterm>
+<indexterm><primary>Psychometric Chroma</primary></indexterm>
+<indexterm><primary><acronym>CIE</acronym> metric lightness</primary></indexterm>
+<indexterm><primary>Psychometric Chroma</primary><secondary>maximum</secondary></indexterm>
+<indexterm><primary><acronym>CIE</acronym> metric lightness</primary><secondary>maximum</secondary></indexterm>
+<indexterm significance="preferred"><primary>XcmsCIELuvQueryMaxLC</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsCIELuvQueryMaxLC'>
+<funcprototype>
+  <funcdef>Status <function>XcmsCIELuvQueryMaxLC</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsFloat <parameter>hue_angle</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+The CCC's Client White Point and white point adjustment procedures
+are ignored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>hue_angle</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the hue angle (in degrees) at which to find maximum chroma.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the <acronym>CIE</acronym> L*u*v* coordinates of maximum chroma
+displayable by the screen for the given hue angle.
+The white point associated with the returned
+color specification is the Screen White Point.
+The value returned in the pixel member is undefined.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM  -->
+The
+<xref linkend='XcmsCIELuvQueryMaxLC' xrefstyle='select: title'/>
+function, given a hue angle,
+finds the point of maximum chroma displayable by the screen.
+It returns this point in <acronym>CIE</acronym> L*u*v* coordinates.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To obtain the <acronym>CIE</acronym> L*u*v* coordinates of minimum <acronym>CIE</acronym> metric lightness (L*)
+for a given Psychometric Hue Angle and Psychometric Chroma, use
+<xref linkend='XcmsCIELuvQueryMinL' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Psychometric Hue Angle</primary></indexterm>
+<indexterm><primary><acronym>CIE</acronym> metric lightness</primary></indexterm>
+<indexterm><primary><acronym>CIE</acronym> metric lightness</primary><secondary>minimum</secondary></indexterm>
+<indexterm significance="preferred"><primary>XcmsCIELuvQueryMinL</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsCIELuvQueryMinL'>
+<funcprototype>
+  <funcdef>Status <function>XcmsCIELuvQueryMinL</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsFloat <parameter>hue_angle</parameter></paramdef>
+  <paramdef>XcmsFloat <parameter>chroma</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+The CCC's Client White Point and white point adjustment procedures
+are ignored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>hue_angle</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the hue angle (in degrees) at which to find minimum lightness.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>chroma</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the chroma at which to find minimum lightness.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the <acronym>CIE</acronym> L*u*v* coordinates of minimum lightness
+displayable by the screen for the given hue angle and chroma.
+The white point associated with the returned
+color specification is the Screen White Point.
+The value returned in the pixel member is undefined.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XcmsCIELuvQueryMinL' xrefstyle='select: title'/>
+function, given a hue angle and chroma,
+finds the point of minimum lightness (L*) displayable by the screen.
+It returns this point in <acronym>CIE</acronym> L*u*v* coordinates.
+An 
+<symbol>XcmsFailure</symbol>
+return value usually indicates that the given chroma
+is beyond maximum for the given hue angle.
+</para>
+</sect2>
+<sect2 id="TekHVC_Queries">
+<title>TekHVC Queries</title>
+<!-- .XS -->
+<!-- (SN TekHVC Queries -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To obtain the maximum Chroma for a given Hue and Value, use
+<xref linkend='XcmsTekHVCQueryMaxC' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Chroma</primary></indexterm>
+<indexterm><primary>Chroma</primary><secondary>maximum</secondary></indexterm>
+<indexterm significance="preferred"><primary>XcmsTekHVCQueryMaxC</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsTekHVCQueryMaxC'>
+<funcprototype>
+  <funcdef>Status <function>XcmsTekHVCQueryMaxC</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsFloat <parameter>hue</parameter></paramdef>
+  <paramdef>XcmsFloat <parameter>value</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+The CCC's Client White Point and white point adjustment procedures
+are ignored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>hue</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the Hue in which to find the maximum Chroma.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>value</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the Value in which to find the maximum Chroma.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the maximum Chroma along with the actual Hue and Value	at which
+the maximum Chroma was found.
+The white point associated with the returned
+color specification is the Screen White Point.
+The value returned in the pixel member is undefined.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM  -->
+The
+<xref linkend='XcmsTekHVCQueryMaxC' xrefstyle='select: title'/>
+function, given a Hue and Value,
+determines the maximum Chroma in TekHVC color space
+displayable by the screen.
+It returns the maximum Chroma along with the actual Hue
+and Value at which the maximum Chroma was found.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To obtain the maximum Value for a given Hue and Chroma, use
+<xref linkend='XcmsTekHVCQueryMaxV' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Value</primary></indexterm>
+<indexterm><primary>Value</primary><secondary>maximum</secondary></indexterm>
+<indexterm significance="preferred"><primary>XcmsTekHVCQueryMaxV</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsTekHVCQueryMaxV'>
+<funcprototype>
+  <funcdef>Status <function>XcmsTekHVCQueryMaxV</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsFloat <parameter>hue</parameter></paramdef>
+  <paramdef>XcmsFloat <parameter>chroma</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+The CCC's Client White Point and white point adjustment procedures
+are ignored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>hue</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the Hue in which to find the maximum Value.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>chroma</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the chroma at which to find maximum Value.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the maximum Value along with the Hue and Chroma at which the
+maximum Value
+was found.
+The white point associated with the returned
+color specification is the Screen White Point.
+The value returned in the pixel member is undefined.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM  -->
+The
+<xref linkend='XcmsTekHVCQueryMaxV' xrefstyle='select: title'/>
+function, given a Hue and Chroma,
+determines the maximum Value in TekHVC color space
+displayable by the screen.
+It returns the maximum Value and the actual Hue and Chroma
+at which the maximum Value was found.
+<!-- .sp -->
+</para>
+
+<para>
+<!-- .LP -->
+To obtain the maximum Chroma and Value at which it is reached
+for a specified Hue, use
+<xref linkend='XcmsTekHVCQueryMaxVC' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Chroma</primary></indexterm>
+<indexterm><primary>Value</primary></indexterm>
+<indexterm><primary>Chroma</primary><secondary>maximum</secondary></indexterm>
+<indexterm><primary>Value</primary><secondary>maximum</secondary></indexterm>
+<indexterm significance="preferred"><primary>XcmsTekHVCQueryMaxVC</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsTekHVCQueryMaxVC'>
+<funcprototype>
+  <funcdef>Status <function>XcmsTekHVCQueryMaxVC</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsFloat <parameter>hue</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+The CCC's Client White Point and white point adjustment procedures
+are ignored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>hue</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the Hue in which to find the maximum Chroma.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the color specification in XcmsTekHVC for the maximum Chroma, the
+Value at which that maximum Chroma is reached, and the actual Hue at which
+the maximum Chroma was found.
+The white point associated with the returned
+color specification is the Screen White Point.
+The value returned in the pixel member is undefined.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM  -->
+The
+<xref linkend='XcmsTekHVCQueryMaxVC' xrefstyle='select: title'/>
+function, given a Hue,
+determines the maximum Chroma in TekHVC color space displayable by the screen
+and the Value at which that maximum Chroma is reached.
+It returns the maximum Chroma,
+the Value at which that maximum Chroma is reached,
+and the actual Hue for which the maximum Chroma was found.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To obtain a specified number of TekHVC specifications such that they
+contain maximum Values for a specified Hue and the
+Chroma at which the maximum Values are reached, use
+<xref linkend='XcmsTekHVCQueryMaxVSamples' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Chroma</primary></indexterm>
+<indexterm><primary>Value</primary></indexterm>
+<indexterm><primary>Chroma</primary><secondary>maximum</secondary></indexterm>
+<indexterm><primary>Value</primary><secondary>maximum</secondary></indexterm>
+<indexterm significance="preferred"><primary>XcmsTekHVCQueryMaxVSamples</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsTekHVCQueryMaxVSamples'>
+<funcprototype>
+  <funcdef>Status <function>XcmsTekHVCQueryMaxVSamples</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsFloat <parameter>hue</parameter></paramdef>
+  <paramdef>XcmsColor <parameter>colors_return[]</parameter></paramdef>
+  <paramdef>unsigned int <parameter>nsamples</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+The CCC's Client White Point and white point adjustment procedures
+are ignored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>hue</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the Hue for maximum Chroma/Value samples.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nsamples</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of samples.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>colors_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns nsamples of color specifications in XcmsTekHVC
+such that the Chroma is the maximum attainable for the Value and Hue.
+The white point associated with the returned
+color specification is the Screen White Point.
+The value returned in the pixel member is undefined.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM  -->
+The
+<xref linkend='XcmsTekHVCQueryMaxVSamples' xrefstyle='select: title'/>
+returns nsamples of maximum Value, the Chroma at which that maximum Value
+is reached, and the actual Hue for which the maximum Chroma was found.
+These sample points may then be used to plot the maximum Value/Chroma
+boundary of the screen's color gamut for the specified Hue in TekHVC color
+space.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To obtain the minimum Value for a given Hue and Chroma, use
+<xref linkend='XcmsTekHVCQueryMinV' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Value</primary></indexterm>
+<indexterm><primary>Value</primary><secondary>minimum</secondary></indexterm>
+<indexterm significance="preferred"><primary>XcmsTekHVCQueryMinV</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsTekHVCQueryMinV'>
+<funcprototype>
+  <funcdef>Status <function>XcmsTekHVCQueryMinV</function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsFloat <parameter>hue</parameter></paramdef>
+  <paramdef>XcmsFloat <parameter>chroma</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+The CCC's Client White Point and white point adjustment procedures
+are ignored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>hue</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the Hue in which to find the minimum Value.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>value</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the Value in which to find the minimum Value.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the minimum Value and the actual Hue and Chroma at which the
+minimum Value
+was found.
+The white point associated with the returned
+color specification is the Screen White Point.
+The value returned in the pixel member is undefined.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM  -->
+The
+<xref linkend='XcmsTekHVCQueryMinV' xrefstyle='select: title'/>
+function, given a Hue and Chroma,
+determines the minimum Value in TekHVC color space displayable by the screen.
+It returns the minimum Value and the actual Hue and Chroma at which
+the minimum Value was found.
+</para>
+
+</sect2>
+</sect1>
+<sect1 id="Color_Management_Extensions">
+<title>Color Management Extensions</title>
+<!-- .XS -->
+<!-- (SN Color Management Extensions -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The Xlib color management facilities can be extended in two ways:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Device-Independent Color Spaces
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Device-independent color spaces that are derivable to <acronym>CIE</acronym> XYZ
+space can be added using the
+<xref linkend='XcmsAddColorSpace' xrefstyle='select: title'/>
+function.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Color Characterization Function Set
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A Color Characterization Function Set consists of
+device-dependent color spaces and their functions that
+convert between these color spaces and the <acronym>CIE</acronym> XYZ
+color space, bundled together for a specific class of output devices.
+A function set can be added using the
+<xref linkend='XcmsAddFunctionSet' xrefstyle='select: title'/>
+function.
+    </para>
+  </listitem>
+</itemizedlist>
+<sect2 id="Color_Spaces">
+<title>Color Spaces</title>
+<!-- .XS -->
+<!-- (SN Color Spaces -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The <acronym>CIE</acronym> XYZ color space serves as the hub for all
+conversions between device-independent and device-dependent color spaces.
+Therefore, the knowledge to convert an 
+<structname>XcmsColor</structname>
+structure to and from <acronym>CIE</acronym> XYZ format is associated with each color space.
+For example, conversion from <acronym>CIE</acronym> L*u*v* to <acronym>RGB</acronym> requires the knowledge
+to convert from <acronym>CIE</acronym> L*u*v* to <acronym>CIE</acronym> XYZ and from <acronym>CIE</acronym> XYZ to <acronym>RGB</acronym>.
+This knowledge is stored as an array of functions that,
+when applied in series, will convert the 
+<structname>XcmsColor</structname>
+structure to or from <acronym>CIE</acronym> XYZ format.
+This color specification conversion mechanism facilitates
+the addition of color spaces.
+</para>
+<para>
+<!-- .LP -->
+Of course, when converting between only device-independent color spaces
+or only device-dependent color spaces,
+shortcuts are taken whenever possible.
+For example, conversion from TekHVC to <acronym>CIE</acronym> L*u*v* is performed 
+by intermediate conversion to <acronym>CIE</acronym> u*v*Y and then to <acronym>CIE</acronym> L*u*v*, 
+thus bypassing conversion between <acronym>CIE</acronym> u*v*Y and <acronym>CIE</acronym> XYZ.
+</para>
+</sect2>
+<sect2 id="Adding_Device_Independent_Color_Spaces">
+<title>Adding Device-Independent Color Spaces</title>
+<!-- .XS -->
+<!-- (SN Adding Device-Independent Color Spaces -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To add a device-independent color space, use
+<xref linkend='XcmsAddColorSpace' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XcmsAddColorSpace</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsAddColorSpace'>
+<funcprototype>
+  <funcdef>Status <function>XcmsAddColorSpace</function></funcdef>
+  <paramdef>XcmsColorSpace *<parameter>color_space</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_space</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the device-independent color space to add.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XcmsAddColorSpace' xrefstyle='select: title'/>
+function makes a device-independent color space (actually an
+<structname>XcmsColorSpace</structname>
+structure) accessible by the color management system.
+Because format values for unregistered color spaces are assigned at run time,
+they should be treated as private to the client.
+If references to an unregistered color space must be made
+outside the client (for example, storing color specifications 
+in a file using the unregistered color space), 
+then reference should be made by color space prefix
+(see
+<xref linkend='XcmsFormatOfPrefix' xrefstyle='select: title'/>
+and
+<xref linkend='XcmsPrefixOfFormat' xrefstyle='select: title'/>).
+</para>
+<para>
+<!-- .LP -->
+If the 
+<structname>XcmsColorSpace</structname>
+structure is already accessible in the color management system, 
+<xref linkend='XcmsAddColorSpace' xrefstyle='select: title'/>
+returns 
+<symbol>XcmsSuccess</symbol>.
+</para>
+<para>
+<!-- .LP -->
+Note that added 
+<structname>XcmsColorSpace</structname>s
+must be retained for reference by Xlib.
+</para>
+</sect2>
+<sect2 id="Querying_Color_Space_Format_and_Prefix">
+<title>Querying Color Space Format and Prefix</title>
+<!-- .XS -->
+<!-- (SN Querying Color Space Format and Prefix -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To obtain the format associated with the color space
+associated with a specified color string prefix, use
+<xref linkend='XcmsFormatOfPrefix' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XcmsFormatOfPrefix</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsFormatOfPrefix'>
+<funcprototype>
+  <funcdef>XcmsColorFormat <function>XcmsFormatOfPrefix</function></funcdef>
+  <paramdef>char *<parameter>prefix</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>prefix</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the string that contains the color space prefix.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XcmsFormatOfPrefix' xrefstyle='select: title'/>
+function returns the format for the specified color space prefix
+(for example, the string ``CIEXYZ'').
+The prefix is case-insensitive.
+If the color space is not accessible in the color management system,
+<xref linkend='XcmsFormatOfPrefix' xrefstyle='select: title'/>
+returns 
+<symbol>XcmsUndefinedFormat</symbol>.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To obtain the color string prefix associated with the color space
+specified by a color format, use
+<xref linkend='XcmsPrefixOfFormat' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XcmsPrefixOfFormat</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsPrefixOfFormat'>
+<funcprototype>
+  <funcdef>char *<function>XcmsPrefixOfFormat</function></funcdef>
+  <paramdef>XcmsColorFormat <parameter>format</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>format</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the color specification format.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XcmsPrefixOfFormat' xrefstyle='select: title'/>
+function returns the string prefix associated with the color specification
+encoding specified by the format argument.
+Otherwise, if no encoding is found, it returns NULL.
+The returned string must be treated as read-only.
+</para>
+</sect2>
+<sect2 id="Creating_Additional_Color_Spaces">
+<title>Creating Additional Color Spaces</title>
+<!-- .XS -->
+<!-- (SN Creating Additional Color Spaces -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Color space specific information necessary 
+for color space conversion and color string parsing is stored in an
+<structname>XcmsColorSpace</structname>
+structure.
+Therefore, a new structure containing this information is required
+for each additional color space.
+In the case of device-independent color spaces,
+a handle to this new structure (that is, by means of a global variable)
+is usually made accessible to the client program for use with the
+<xref linkend='XcmsAddColorSpace' xrefstyle='select: title'/>
+function.
+</para>
+<para>
+<!-- .LP -->
+If a new 
+<structname>XcmsColorSpace</structname>
+structure specifies a color space not registered with the X Consortium,
+they should be treated as private to the client
+because format values for unregistered color spaces are assigned at run time.
+If references to an unregistered color space must be made outside the
+client (for example, storing color specifications in a file using the
+unregistered color space), then reference should be made by color space prefix
+(see
+<xref linkend='XcmsFormatOfPrefix' xrefstyle='select: title'/>
+and
+<xref linkend='XcmsPrefixOfFormat' xrefstyle='select: title'/>).
+<!-- .sM -->
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i 2.5i -->
+<!-- .ta .5i 2.5i -->
+typedef (*XcmsConversionProc)();
+typedef XcmsConversionProc *XcmsFuncListPtr;
+		/* A NULL terminated list of function pointers*/
+
+typedef struct _XcmsColorSpace {
+	char *prefix;
+	XcmsColorFormat format;
+	XcmsParseStringProc parseString;
+	XcmsFuncListPtr to_CIEXYZ;
+	XcmsFuncListPtr from_CIEXYZ;
+	int inverse_flag;
+} XcmsColorSpace;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The prefix member specifies the prefix that indicates a color string 
+is in this color space's string format.
+For example, the strings ``ciexyz'' or ``CIEXYZ'' for <acronym>CIE</acronym> XYZ,
+and ``rgb'' or ``<acronym>RGB</acronym>'' for <acronym>RGB</acronym>.
+The prefix is case insensitive.
+The format member specifies the color specification format.
+Formats for unregistered color spaces are assigned at run time.
+The parseString member contains a pointer to the function 
+that can parse a color string into an 
+<structname>XcmsColor</structname>
+structure.
+This function returns an integer (int): nonzero if it succeeded
+and zero otherwise.
+The to_CIEXYZ and from_CIEXYZ members contain pointers,
+each to a NULL terminated list of function pointers.
+When the list of functions is executed in series,
+it will convert the color specified in an 
+<structname>XcmsColor</structname>
+structure from/to the current color space format to/from the <acronym>CIE</acronym> XYZ format.
+Each function returns an integer (int): nonzero if it succeeded
+and zero otherwise.
+The white point to be associated with the colors is specified
+explicitly, even though white points can be found in the CCC.
+The inverse_flag member, if nonzero, specifies that for each function listed 
+in to_CIEXYZ,
+its inverse function can be found in from_CIEXYZ such that:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+Given:  n = number of functions in each list
+
+for each i, such that 0 &lt;= i &lt; n
+    from_CIEXYZ[n - i - 1] is the inverse of to_CIEXYZ[i].
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+This allows Xlib to use the shortest conversion path,
+thus bypassing <acronym>CIE</acronym> XYZ if possible (for example, TekHVC to <acronym>CIE</acronym> L*u*v*).
+</para>
+</sect2>
+<sect2 id="Parse_String_Callback">
+<title>Parse String Callback</title>
+<!-- .XS -->
+<!-- (SN Parse String Callback -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The callback in the
+<structname>XcmsColorSpace</structname>
+structure for parsing a color string for the particular color space must
+adhere to the following software interface specification:
+</para>
+<indexterm significance="preferred"><primary>XcmsParseStringProc</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsParseStringProc'>
+<funcprototype>
+  <funcdef>Status <function>XcmsParseStringProc</function></funcdef>
+  <paramdef>char *<parameter>color_string</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>color_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_string</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the color string to parse.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>color_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the color specification in the color space's format.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+</para>
+</sect2>
+<sect2 id="Color_Specification_Conversion_Callback">
+<title>Color Specification Conversion Callback</title>
+<!-- .XS -->
+<!-- (SN Color Specification Conversion Callback -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Callback functions in the
+<structname>XcmsColorSpace</structname>
+structure for converting a color specification between device-independent
+spaces must adhere to the
+following software interface specification:
+</para>
+<!-- .sM -->
+<funcsynopsis id='ConversionProc'>
+<funcprototype>
+  <funcdef>Status <function><replaceable>ConversionProc</replaceable></function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>white_point</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>colors_in_out</parameter></paramdef>
+  <paramdef>unsigned int <parameter>ncolors</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>white_point</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the white point associated with color specifications.
+The pixel member should be ignored,
+and the entire structure remain unchanged upon return.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>colors_in_out</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an array of color specifications.
+Pixel members should be ignored and must remain unchanged upon return.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ncolors</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of 
+<structname>XcmsColor</structname>
+structures in the color-specification array.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<!-- .sp -->
+Callback functions in the
+<structname>XcmsColorSpace</structname>
+structure for converting a color specification to or from a device-dependent
+space must adhere to the
+following software interface specification:
+</para>
+<!-- .sM -->
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Status <function><replaceable>ConversionProc</replaceable></function></funcdef>
+  <paramdef>XcmsCCC <parameter>ccc</parameter></paramdef>
+  <paramdef>XcmsColor *<parameter>colors_in_out</parameter></paramdef>
+  <paramdef>unsigned int <parameter>ncolors</parameter></paramdef>
+  <paramdef>Bool <parameter>compression_flags_return[]</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ccc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the CCC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>colors_in_out</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an array of color specifications.
+Pixel members should be ignored and must remain unchanged upon return.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ncolors</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of 
+<structname>XcmsColor</structname>
+structures in the color-specification array.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>compression_flags_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns an array of Boolean values for indicating compression status.
+If a non-NULL pointer is supplied
+and a color at a given index is compressed, then
+<symbol>True</symbol>
+should be stored at the corresponding index in this array;
+otherwise, the array should not be modified.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Conversion functions are available globally for use by other color
+spaces.
+The conversion functions provided by Xlib are:
+</para>
+<informaltable frame='topbot'>
+  <?dbfo keep-together="auto" ?>
+  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth='1.0*'/>
+  <colspec colname='c2' colwidth='1.0*'/>
+  <colspec colname='c3' colwidth='1.0*'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Function</entry>
+      <entry>Converts from</entry>
+      <entry>Converts to</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry><function>XcmsCIELabToCIEXYZ</function></entry>
+      <entry><symbol>XcmsCIELabFormat</symbol></entry>
+      <entry><symbol>XcmsCIEXYZFormat</symbol></entry>
+    </row>
+    <row>
+      <entry><function>XcmsCIELuvToCIEuvY</function></entry>
+      <entry><symbol>XcmsCIELuvFormat</symbol></entry>
+      <entry><symbol>XcmsCIEuvYFormat</symbol></entry>
+    </row>
+    <row>
+      <entry><function>XcmsCIEXYZToCIELab</function></entry>
+      <entry><symbol>XcmsCIEXYZFormat</symbol></entry>
+      <entry><symbol>XcmsCIELabFormat</symbol></entry>
+    </row>
+    <row>
+      <entry><function>XcmsCIEXYZToCIEuvY</function></entry>
+      <entry><symbol>XcmsCIEXYZFormat</symbol></entry>
+      <entry><symbol>XcmsCIEuvYFormat</symbol></entry>
+    </row>
+    <row>
+      <entry><function>XcmsCIEXYZToCIExyY</function></entry>
+      <entry><symbol>XcmsCIEXYZFormat</symbol></entry>
+      <entry><symbol>XcmsCIExyYFormat</symbol></entry>
+    </row>
+    <row>
+      <entry><function>XcmsCIEXYZToRGBi</function></entry>
+      <entry><symbol>XcmsCIEXYZFormat</symbol></entry>
+      <entry><symbol>XcmsRGBiFormat</symbol></entry>
+    </row>
+    <row>
+      <entry><function>XcmsCIEuvYToCIELuv</function></entry>
+      <entry><symbol>XcmsCIEuvYFormat</symbol></entry>
+      <entry><symbol>XcmsCIELabFormat</symbol></entry>
+    </row>
+    <row>
+      <entry><function>XcmsCIEuvYToCIEXYZ</function></entry>
+      <entry><symbol>XcmsCIEuvYFormat</symbol></entry>
+      <entry><symbol>XcmsCIEXYZFormat</symbol></entry>
+    </row>
+    <row>
+      <entry><function>XcmsCIEuvYToTekHVC</function></entry>
+      <entry><symbol>XcmsCIEuvYFormat</symbol></entry>
+      <entry><symbol>XcmsTekHVCFormat</symbol></entry>
+    </row>
+    <row>
+      <entry><function>XcmsCIExyYToCIEXYZ</function></entry>
+      <entry><symbol>XcmsCIExyYFormat</symbol></entry>
+      <entry><symbol>XcmsCIEXYZFormat</symbol></entry>
+    </row>
+    <row>
+      <entry><function>XcmsRGBToRGBi</function></entry>
+      <entry><symbol>XcmsRGBFormat</symbol></entry>
+      <entry><symbol>XcmsRGBiFormat</symbol></entry>
+    </row>
+    <row>
+      <entry><function>XcmsRGBiToCIEXYZ</function></entry>
+      <entry><symbol>XcmsRGBiFormat</symbol></entry>
+      <entry><symbol>XcmsCIEXYZFormat</symbol></entry>
+    </row>
+    <row>
+      <entry><function>XcmsRGBiToRGB</function></entry>
+      <entry><symbol>XcmsRGBiFormat</symbol></entry>
+      <entry><symbol>XcmsRGBFormat</symbol></entry>
+    </row>
+    <row>
+      <entry><function>XcmsTekHVCToCIEuvY</function></entry>
+      <entry><symbol>XcmsTekHVCFormat</symbol></entry>
+      <entry><symbol>XcmsCIEuvYFormat</symbol></entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+</sect2>
+<sect2 id="Function_Sets">
+<title>Function Sets</title>
+<!-- .XS -->
+<!-- (SN Function Sets -->
+<!-- .XE -->
+<indexterm><primary>Function set</primary></indexterm>
+<indexterm><primary>Function set</primary><secondary>LINEAR_RGB</secondary></indexterm>
+<para>
+<!-- .LP -->
+Functions to convert between device-dependent color spaces
+and <acronym>CIE</acronym> XYZ may differ for different classes of output devices
+(for example, color versus gray monitors).
+Therefore, the notion of a Color Characterization Function Set
+has been developed.
+A function set consists of device-dependent color spaces
+and the functions that convert color specifications 
+between these device-dependent color spaces and the <acronym>CIE</acronym> XYZ color space
+appropriate for a particular class of output devices.
+The function set also contains a function that reads
+color characterization data off root window properties.
+It is this characterization data that will differ between devices within
+a class of output devices.
+<indexterm><primary>Device Color Characterization</primary></indexterm>
+For details about how color characterization data is
+stored in root window properties,
+see the
+section on Device Color Characterization in the
+<citetitle>Inter-Client Communication Conventions Manual</citetitle>.
+The LINEAR_RGB function set is provided by Xlib
+and will support most color monitors.
+Function sets may require data that differs
+from those needed for the LINEAR_RGB function set.
+In that case, 
+its corresponding data may be stored on different root window properties.
+</para>
+</sect2>
+<sect2 id="Adding_Function_Sets">
+<title>Adding Function Sets</title>
+<!-- .XS -->
+<!-- (SN Adding Function Sets -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To add a function set, use
+<xref linkend='XcmsAddFunctionSet' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XcmsAddFunctionSet</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XcmsAddFunctionSet'>
+<funcprototype>
+  <funcdef>Status <function>XcmsAddFunctionSet</function></funcdef>
+  <paramdef>XcmsFunctionSet *<parameter>function_set</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>function_set</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the function set to add.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XcmsAddFunctionSet' xrefstyle='select: title'/>
+function adds a function set to the color management system.
+If the function set uses device-dependent 
+<structname>XcmsColorSpace</structname>
+structures not accessible in the color management system,
+<xref linkend='XcmsAddFunctionSet' xrefstyle='select: title'/>
+adds them.
+If an added
+<structname>XcmsColorSpace</structname>
+structure is for a device-dependent color space not registered
+with the X Consortium,
+they should be treated as private to the client
+because format values for unregistered color spaces are assigned at run time.
+If references to an unregistered color space must be made outside the
+client (for example, storing color specifications in a file
+using the unregistered color space),
+then reference should be made by color space prefix
+(see 
+<xref linkend='XcmsFormatOfPrefix' xrefstyle='select: title'/>
+and
+<xref linkend='XcmsPrefixOfFormat' xrefstyle='select: title'/>).
+</para>
+<para>
+<!-- .LP -->
+Additional function sets should be added before any calls to other
+Xlib routines are made.
+If not, the 
+<structname>XcmsPerScrnInfo</structname>
+member of a previously created 
+<structname>XcmsCCC</structname>
+does not have the opportunity to initialize
+with the added function set.
+</para>
+</sect2>
+<sect2 id="Creating_Additional_Function_Sets">
+<title>Creating Additional Function Sets</title>
+<!-- .XS -->
+<!-- (SN Creating Additional Function Sets -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The creation of additional function sets should be
+required only when an output device does not conform to existing 
+function sets or when additional device-dependent color spaces are necessary.
+A function set consists primarily of a collection of device-dependent
+<structname>XcmsColorSpace</structname>
+structures and a means to read and store a 
+screen's color characterization data.
+This data is stored in an
+<structname>XcmsFunctionSet</structname>
+structure.
+A handle to this structure (that is, by means of global variable)
+is usually made accessible to the client program for use with
+<xref linkend='XcmsAddFunctionSet' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+If a function set uses new device-dependent 
+<structname>XcmsColorSpace</structname>
+structures,
+they will be transparently processed into the color management system.
+Function sets can share an 
+<structname>XcmsColorSpace</structname>
+structure for a device-dependent color space.
+In addition, multiple 
+<structname>XcmsColorSpace</structname>
+structures are allowed for a device-dependent color space;
+however, a function set can reference only one of them.
+These 
+<structname>XcmsColorSpace</structname>
+structures will differ in the functions to convert to and from <acronym>CIE</acronym> XYZ,
+thus tailored for the specific function set.
+<!-- .sM -->
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i 2.5i -->
+<!-- .ta .5i 2.5i -->
+typedef struct _XcmsFunctionSet {
+	XcmsColorSpace **DDColorSpaces;
+	XcmsScreenInitProc screenInitProc;
+	XcmsScreenFreeProc screenFreeProc;
+} XcmsFunctionSet;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The DDColorSpaces member is a pointer to a NULL terminated list
+of pointers to 
+<structname>XcmsColorSpace</structname>
+structures for the device-dependent color spaces that are supported
+by the function set.
+The screenInitProc member is set to the callback procedure (see the following
+interface specification) that initializes the 
+<structname>XcmsPerScrnInfo</structname>
+structure for a particular screen.
+</para>
+<para>
+<!-- .LP -->
+The screen initialization callback must adhere to the following software
+interface specification:
+<indexterm significance="preferred"><primary>XcmsScreenInitProc</primary></indexterm>
+<!-- .sM -->
+</para>
+<funcsynopsis>
+<funcprototype>
+  <funcdef>typedef Status <function>(*XcmsScreenInitProc</function>)</funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>screen_number</parameter></paramdef>
+  <paramdef>ScmsPerScrnInfo *<parameter>screen_info</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<!-- .FN -->
+<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'>screen_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate screen number on the host server.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen_info</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the 
+<structname>XcmsPerScrnInfo</structname>
+structure, which contains the per screen information.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The screen initialization callback in the
+<structname>XcmsFunctionSet</structname>
+structure fetches the color characterization data (device profile) for
+the specified screen,
+typically off properties on the 
+screen's root window.
+It then initializes the specified
+<structname>XcmsPerScrnInfo</structname>
+structure.
+<indexterm><primary>Device profile</primary></indexterm>
+<indexterm><primary>Color Characterization Data</primary></indexterm>
+If successful, the procedure fills in the 
+<structname>XcmsPerScrnInfo</structname>
+structure as follows:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+It sets the screenData member to the address 
+of the created device profile data structure 
+(contents known only by the function set).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It next sets the screenWhitePoint member.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It next sets the functionSet member to the address of the
+<structname>XcmsFunctionSet</structname>
+structure.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It then sets the state member to 
+<symbol>XcmsInitSuccess</symbol>
+and finally returns
+<symbol>XcmsSuccess</symbol>.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+If unsuccessful, the procedure sets the state member to 
+<symbol>XcmsInitFailure</symbol>
+and returns
+<symbol>XcmsFailure</symbol>.
+</para>
+<para>
+<!-- .LP -->
+The
+<structname>XcmsPerScrnInfo</structname>
+structure contains:
+<!-- .sM -->
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i 2.5i -->
+<!-- .ta .5i 2.5i -->
+typedef struct _XcmsPerScrnInfo {
+	XcmsColor screenWhitePoint;
+	XPointer functionSet;
+	XPointer screenData;
+	unsigned char state;
+	char pad[3];
+} XcmsPerScrnInfo;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The screenWhitePoint member specifies the white point inherent to
+the screen.
+The functionSet member specifies the appropriate function set.
+The screenData member specifies the device profile.
+The state member is set to one of the following:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+<symbol>XcmsInitNone</symbol>
+indicates initialization has not been previously attempted.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>XcmsInitFailure</symbol>
+indicates initialization has been previously attempted but failed.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>XcmsInitSuccess</symbol>
+indicates initialization has been previously attempted and succeeded.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+The screen free callback must adhere to the following software
+interface specification:
+</para>
+<funcsynopsis>
+<funcprototype>
+  <funcdef>typedef void (*XcmsScreenFreeProc)</funcdef>
+  <paramdef>XPointer <parameter>screenData</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screenData</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the data to be freed.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+This function is called to free the screenData stored in an
+<structname>XcmsPerScrnInfo</structname>
+structure.
+<!-- .bp -->
+
+</para>
+</sect2>
+</sect1>
+</chapter>
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH08.xml
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH08.xml	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH08.xml	(revision 5)
@@ -0,0 +1,5990 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+	  "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+<chapter id='Graphics_Functions'>
+<title>Graphics Functions</title>
+<para>
+Once you have established a connection to a display, you can use the Xlib graphics functions to:
+</para>
+<itemizedlist>
+  <listitem><para>Clear and copy areas</para></listitem>
+  <listitem><para>Draw points, lines, rectangles, and arcs</para></listitem>
+  <listitem><para>Fill areas</para></listitem>
+  <listitem><para>Manipulate fonts</para></listitem>
+  <listitem><para>Draw text</para></listitem>
+  <listitem><para>Transfer images between clients and the server</para></listitem>
+</itemizedlist>
+<para>
+If the same drawable and GC is used for each call, Xlib batches back-to-back
+calls to XDrawPoint, XDrawLine, XDrawRectangle, XFillArc, and XFillRectangle.
+Note that this reduces the total number of requests sent to the server.
+</para>
+<sect1 id="Clearing_Areas">
+<title>Clearing Areas</title>
+<!-- .XS -->
+<!-- (SN Clearing Areas  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to clear an area or the entire window.
+Because pixmaps do not have defined backgrounds, 
+they cannot be filled by using the functions described in this section.
+Instead, to accomplish an analogous operation on a pixmap,
+you should use 
+<xref linkend='XFillRectangle' xrefstyle='select: title'/>,
+which sets the pixmap to a known value.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To clear a rectangular area of a given window, use
+<xref linkend='XClearArea' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Areas</primary><secondary>clearing</secondary></indexterm>
+<indexterm><primary>Clearing</primary><secondary>areas</secondary></indexterm>
+<indexterm significance="preferred"><primary>XClearArea</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XClearArea'>
+<funcprototype>
+  <funcdef><function>XClearArea</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>int <parameter>x</parameter></paramdef>
+  <paramdef>int <parameter>y</parameter></paramdef>
+  <paramdef>unsigned int <parameter>width</parameter></paramdef>
+  <paramdef>unsigned int <parameter>height</parameter></paramdef>
+  <paramdef>Bool <parameter>exposures</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, which are relative to the origin of the
+window and specify the upper-left corner of the rectangle.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the width and height, which are the dimensions of the rectangle.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>exposures</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a Boolean value that indicates if
+<symbol>Expose</symbol>
+events are to be generated.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XClearArea' xrefstyle='select: title'/>
+function paints a rectangular area in the specified window according to the
+specified dimensions with the window's background pixel or pixmap.
+The subwindow-mode effectively is
+<symbol>ClipByChildren</symbol>.
+If width is zero, it
+is replaced with the current width of the window minus x.
+If height is
+zero, it is replaced with the current height of the window minus y.
+If the window has a defined background tile, 
+the rectangle clipped by any children is filled with this tile.
+If the window has
+background 
+<symbol>None</symbol>,
+the contents of the window are not changed.  
+In either
+case, if exposures is 
+<symbol>True</symbol>,
+one or more 
+<symbol>Expose</symbol>
+events are generated for regions of the rectangle that are either visible or are
+being retained in a backing store.
+If you specify a window whose class is
+<symbol>InputOnly</symbol>,
+a
+<errorname>BadMatch</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XClearArea' xrefstyle='select: title'/>
+can generate
+<errorname>BadMatch</errorname>,
+<errorname>BadValue</errorname>,
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To clear the entire area in a given window, use
+<xref linkend='XClearWindow' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Window</primary><secondary>clearing</secondary></indexterm>
+<indexterm><primary>Clearing</primary><secondary>windows</secondary></indexterm>
+<indexterm significance="preferred"><primary>XClearWindow</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XClearWindow'>
+<funcprototype>
+  <funcdef><function>XClearWindow</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XClearWindow' xrefstyle='select: title'/>
+function clears the entire area in the specified window and is
+equivalent to
+<xref linkend='XClearArea' xrefstyle='select: title'/>
+(display, w, 0, 0, 0, 0, 
+<symbol>False</symbol>).
+If the window has a defined background tile, the rectangle is tiled with a
+plane-mask of all ones and 
+<symbol>GXcopy</symbol>
+function.
+If the window has
+background 
+<symbol>None</symbol>,
+the contents of the window are not changed.  
+If you specify a window whose class is
+<symbol>InputOnly</symbol>,
+a
+<errorname>BadMatch</errorname>
+error results. 
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XClearWindow' xrefstyle='select: title'/>
+can generate
+<errorname>BadMatch</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+</sect1>
+<sect1 id="Copying_Areas">
+<title>Copying Areas</title>
+<!-- .XS -->
+<!-- (SN Copying Areas  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to copy an area or a bit plane.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To copy an area between drawables of the same
+root and depth, use
+<xref linkend='XCopyArea' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Areas</primary><secondary>copying</secondary></indexterm>
+<indexterm><primary>Copying</primary><secondary>areas</secondary></indexterm>
+<indexterm significance="preferred"><primary>XCopyArea</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XCopyArea'>
+<funcprototype>
+  <funcdef><function>XCopyArea</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>src</parameter></paramdef>
+  <paramdef>Drawable <parameter>dest</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>int <parameter>src_x</parameter></paramdef>
+  <paramdef>int <parameter>src_y</parameter></paramdef>
+  <paramdef>unsigned int <parameter>width</parameter></paramdef>
+  <paramdef>unsigned int <parameter>height</parameter></paramdef>
+  <paramdef>int <parameter>dest_x</parameter></paramdef>
+  <paramdef>int <parameter>dest_y</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>src</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>dest</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the source and destination rectangles to be combined. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>src_x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>src_y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, 
+which are relative to the origin of the source rectangle
+and specify its upper-left corner.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the width and height, which are the dimensions of both the source
+and destination rectangles.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>dest_x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>dest_y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, which are relative to the origin of the
+destination rectangle and specify its upper-left corner.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XCopyArea' xrefstyle='select: title'/>
+function combines the specified rectangle of src with the specified rectangle 
+of dest.
+The drawables must have the same root and depth,
+or a
+<errorname>BadMatch</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+If regions of the source rectangle are obscured and have not been
+retained in backing store 
+or if regions outside the boundaries of the source drawable are specified, 
+those regions are not copied. 
+Instead, the 
+following occurs on all corresponding destination regions that are either
+visible or are retained in backing store.  
+If the destination is a window with a background other than 
+<symbol>None</symbol>,
+corresponding regions
+of the destination are tiled with that background
+(with plane-mask of all ones and
+<symbol>GXcopy</symbol>
+function).
+Regardless of tiling or whether the destination is a window or a pixmap,
+if graphics-exposures is 
+<symbol>True</symbol>,
+then
+<symbol>GraphicsExpose</symbol>
+events for all corresponding destination regions are generated.
+If graphics-exposures is 
+<symbol>True</symbol>
+but no
+<symbol>GraphicsExpose</symbol>
+events are generated, a
+<symbol>NoExpose</symbol>
+event is generated.
+Note that by default graphics-exposures is
+<symbol>True</symbol>
+in new GCs.
+</para>
+<para>
+<!-- .LP -->
+This function uses these GC components: function, plane-mask, 
+subwindow-mode, graphics-exposures, clip-x-origin,
+clip-y-origin, and clip-mask.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XCopyArea' xrefstyle='select: title'/>
+can generate
+<errorname>BadDrawable</errorname>,
+<errorname>BadGC</errorname>,
+and
+<errorname>BadMatch</errorname>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To copy a single bit plane of a given drawable, use
+<xref linkend='XCopyPlane' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Plane</primary><secondary>copying</secondary></indexterm>
+<indexterm><primary>Copying</primary><secondary>planes</secondary></indexterm>
+<indexterm significance="preferred"><primary>XCopyPlane</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XCopyPlane'>
+<funcprototype>
+  <funcdef><function>XCopyPlane</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>src</parameter></paramdef>
+  <paramdef>Drawable <parameter>dest</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>int <parameter>src_x</parameter></paramdef>
+  <paramdef>int <parameter>src_y</parameter></paramdef>
+  <paramdef>unsigned int <parameter>width</parameter></paramdef>
+  <paramdef>unsigned int <parameter>height</parameter></paramdef>
+  <paramdef>int <parameter>dest_x</parameter></paramdef>
+  <paramdef>int <parameter>dest_y</parameter></paramdef>
+  <paramdef>unsigned long <parameter>plane</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>src</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>dest</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the source and destination rectangles to be combined. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>src_x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>src_y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, 
+which are relative to the origin of the source rectangle
+and specify its upper-left corner.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the width and height, which are the dimensions of both the source
+and destination rectangles.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>dest_x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>dest_y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, which are relative to the origin of the
+destination rectangle and specify its upper-left corner.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>plane</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the bit plane.
+You must set exactly one bit to 1.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XCopyPlane' xrefstyle='select: title'/>
+function uses a single bit plane of the specified source rectangle
+combined with the specified GC to modify the specified rectangle of dest.
+The drawables must have the same root but need not have the same depth.
+If the drawables do not have the same root, a
+<errorname>BadMatch</errorname>
+error results.
+If plane does not have exactly one bit set to 1 and the value of plane
+is not less than %2 sup n%, where <emphasis remap='I'>n</emphasis> is the depth of src, a
+<errorname>BadValue</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+Effectively, 
+<xref linkend='XCopyPlane' xrefstyle='select: title'/>
+forms a pixmap of the same depth as the rectangle of dest and with a
+size specified by the source region. 
+It uses the foreground/background pixels in the GC (foreground
+everywhere the bit plane in src contains a bit set to 1,
+background everywhere the bit plane in src contains a bit set to 0)
+and the equivalent of a 
+<systemitem>CopyArea</systemitem>
+protocol request is performed with all the same exposure semantics.
+This can also be thought of as using the specified region of the source 
+bit plane as a stipple with a fill-style of
+<symbol>FillOpaqueStippled</symbol>
+for filling a rectangular area of the destination.
+</para>
+<para>
+<!-- .LP -->
+This function uses these GC components: function, plane-mask, foreground,
+background, subwindow-mode, graphics-exposures, clip-x-origin, clip-y-origin,
+and clip-mask.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XCopyPlane' xrefstyle='select: title'/>
+can generate
+<errorname>BadDrawable</errorname>,
+<errorname>BadGC</errorname>,
+<errorname>BadMatch</errorname>,
+and 
+<errorname>BadValue</errorname>
+errors.
+</para>
+</sect1>
+<sect1 id="Drawing_Points_Lines_Rectangles_and_Arcs">
+<title>Drawing Points, Lines, Rectangles, and Arcs</title>
+<!-- .XS -->
+<!-- (SN Drawing Points, Lines, Rectangles, and Arcs  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to draw:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+A single point or multiple points
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A single line or multiple lines
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A single rectangle or multiple rectangles
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A single arc or multiple arcs
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+Some of the functions described in the following sections
+use these structures:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XSegment</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     short x1, y1, x2, y2;
+} XSegment;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>XPoint</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     short x, y;
+} XPoint;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>XRectangle</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     short x, y;
+     unsigned short width, height;
+} XRectangle;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<indexterm significance="preferred"><primary>XArc</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     short x, y;
+     unsigned short width, height;
+     short angle1, angle2;             /* Degrees * 64 */
+} XArc;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+All x and y members are signed integers.
+The width and height members are 16-bit unsigned integers.
+You should be careful not to generate coordinates and sizes
+out of the 16-bit ranges, because the protocol only has 16-bit fields
+for these values.
+</para>
+<sect2 id="Drawing_Single_and_Multiple_Points">
+<title>Drawing Single and Multiple Points</title>
+<!-- .XS -->
+<!-- (SN Drawing Single and Multiple Points  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Points</primary><secondary>drawing</secondary></indexterm>
+<indexterm><primary>Drawing</primary><secondary>points</secondary></indexterm>
+<indexterm><primary>XDrawPoints</primary></indexterm>
+<indexterm><primary>XDrawPoint</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+To draw a single point in a given drawable, use
+<xref linkend='XDrawPoint' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XDrawPoint</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XDrawPoint'>
+<funcprototype>
+  <funcdef><function>XDrawPoint</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>int <parameter>x</parameter></paramdef>
+  <paramdef>int <parameter>y</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates where you want the point drawn.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<!-- .sp -->
+To draw multiple points in a given drawable, use
+<xref linkend='XDrawPoints' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XDrawPoints</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XDrawPoints'>
+<funcprototype>
+  <funcdef><function>XDrawPoints</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>XPoint *<parameter>points</parameter></paramdef>
+  <paramdef>int <parameter>npoints</parameter></paramdef>
+  <paramdef>int <parameter>mode</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>points</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an array of points.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>npoints</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of points in the array.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the coordinate mode. 
+You can pass
+<symbol>CoordModeOrigin</symbol>
+or
+<symbol>CoordModePrevious</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XDrawPoint' xrefstyle='select: title'/>
+function uses the foreground pixel and function components of the
+GC to draw a single point into the specified drawable; 
+<xref linkend='XDrawPoints' xrefstyle='select: title'/>
+draws multiple points this way.
+<symbol>CoordModeOrigin</symbol>
+treats all coordinates as relative to the origin,
+and
+<symbol>CoordModePrevious</symbol>
+treats all coordinates after the first as relative to the previous point.
+<xref linkend='XDrawPoints' xrefstyle='select: title'/>
+draws the points in the order listed in the array.
+</para>
+<para>
+<!-- .LP -->
+Both functions use these GC components: function, plane-mask,
+foreground, subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XDrawPoint' xrefstyle='select: title'/>
+can generate
+<errorname>BadDrawable</errorname>,
+<errorname>BadGC</errorname>,
+and 
+<errorname>BadMatch</errorname>
+errors.
+<xref linkend='XDrawPoints' xrefstyle='select: title'/>
+can generate
+<errorname>BadDrawable</errorname>,
+<errorname>BadGC</errorname>,
+<errorname>BadMatch</errorname>,
+and
+<errorname>BadValue</errorname>
+errors.
+</para>
+</sect2>
+<sect2 id="Drawing_Single_and_Multiple_Lines">
+<title>Drawing Single and Multiple Lines</title>
+<!-- .XS -->
+<!-- (SN Drawing Single and Multiple Lines -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Lines</primary><secondary>drawing</secondary></indexterm>
+<indexterm><primary>Drawing</primary><secondary>lines</secondary></indexterm>
+<indexterm><primary>XDrawLine</primary></indexterm>
+<indexterm><primary>XDrawLines</primary></indexterm>
+<indexterm><primary>Polygons</primary><secondary>drawing</secondary></indexterm>
+<indexterm><primary>Drawing</primary><secondary>polygons</secondary></indexterm>
+<indexterm><primary>XDrawSegments</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+To draw a single line between two points in a given drawable, use
+<xref linkend='XDrawLine' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XDrawLine</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XDrawLine'>
+<funcprototype>
+  <funcdef><function>XDrawLine</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>int <parameter>x1</parameter></paramdef>
+  <paramdef>int <parameter>y1</parameter></paramdef>
+  <paramdef>int <parameter>x2</parameter></paramdef>
+  <paramdef>int <parameter>y2</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x1</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y1</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x2</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y2</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the points (x1, y1) and (x2, y2) to be connected.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<!-- .sp -->
+To draw multiple lines in a given drawable, use
+<xref linkend='XDrawLines' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XDrawLines</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XDrawLines'>
+<funcprototype>
+  <funcdef><function>XDrawLines</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>XPoint *<parameter>points</parameter></paramdef>
+  <paramdef>int <parameter>npoints</parameter></paramdef>
+  <paramdef>int <parameter>mode</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>points</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an array of points.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>npoints</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of points in the array.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the coordinate mode. 
+You can pass
+<symbol>CoordModeOrigin</symbol>
+or
+<symbol>CoordModePrevious</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<!-- .sp -->
+To draw multiple, unconnected lines in a given drawable,
+use
+<xref linkend='XDrawSegments' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XDrawSegments</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XDrawSegments'>
+<funcprototype>
+  <funcdef><function>XDrawSegments</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>XSegment *<parameter>segments</parameter></paramdef>
+  <paramdef>int <parameter>nsegments</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>segments</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an array of segments.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nsegments</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of segments in the array.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XDrawLine' xrefstyle='select: title'/>
+function uses the components of the specified GC to
+draw a line between the specified set of points (x1, y1) and (x2, y2).
+It does not perform joining at coincident endpoints.
+For any given line, 
+<xref linkend='XDrawLine' xrefstyle='select: title'/>
+does not draw a pixel more than once.
+If lines intersect, the intersecting pixels are drawn multiple times.  
+</para>
+<para>
+<!-- .LP -->
+The
+<xref linkend='XDrawLines' xrefstyle='select: title'/>
+function uses the components of the specified GC to draw 
+npoints-1 lines between each pair of points (point[i], point[i+1]) 
+in the array of
+<structname>XPoint</structname>
+structures.
+It draws the lines in the order listed in the array.
+The lines join correctly at all intermediate points, and if the first and last
+points coincide, the first and last lines also join correctly.
+For any given line, 
+<xref linkend='XDrawLines' xrefstyle='select: title'/>
+does not draw a pixel more than once.
+If thin (zero line-width) lines intersect, 
+the intersecting pixels are drawn multiple times.
+If wide lines intersect, the intersecting pixels are drawn only once, as though
+the entire 
+<systemitem>PolyLine</systemitem>
+protocol request were a single, filled shape.
+<symbol>CoordModeOrigin</symbol>
+treats all coordinates as relative to the origin,
+and
+<symbol>CoordModePrevious</symbol>
+treats all coordinates after the first as relative to the previous point.
+</para>
+<para>
+<!-- .LP -->
+The
+<xref linkend='XDrawSegments' xrefstyle='select: title'/>
+function draws multiple, unconnected lines. 
+For each segment, 
+<xref linkend='XDrawSegments' xrefstyle='select: title'/>
+draws a
+line between (x1, y1) and (x2, y2).
+It draws the lines in the order listed in the array of
+<structname>XSegment</structname>
+structures and does not perform joining at coincident endpoints.
+For any given line, 
+<xref linkend='XDrawSegments' xrefstyle='select: title'/>
+does not draw a pixel more than once.  
+If lines intersect, the intersecting pixels are drawn multiple times.  
+</para>
+<para>
+<!-- .LP -->
+All three functions use these GC components:
+function, plane-mask, line-width,
+line-style, cap-style, fill-style, subwindow-mode,
+clip-x-origin, clip-y-origin, and clip-mask.
+The
+<xref linkend='XDrawLines' xrefstyle='select: title'/>
+function also uses the join-style GC component.
+All three functions also use these GC mode-dependent components:
+foreground, background, tile, stipple, tile-stipple-x-origin, 
+tile-stipple-y-origin, dash-offset, and dash-list.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XDrawLine' xrefstyle='select: title'/>,
+<xref linkend='XDrawLines' xrefstyle='select: title'/>,
+and
+<xref linkend='XDrawSegments' xrefstyle='select: title'/>
+can generate
+<errorname>BadDrawable</errorname>,
+<errorname>BadGC</errorname>,
+and
+<errorname>BadMatch</errorname>
+errors.
+<xref linkend='XDrawLines' xrefstyle='select: title'/>
+also can generate
+<errorname>BadValue</errorname>
+errors.
+</para>
+</sect2>
+<sect2 id='Drawing_Single_and_Multiple_Rectangles'>
+<title>Drawing Single and Multiple Rectangles</title>
+<!-- .XS -->
+<!-- (SN Drawing Single and Multiple Rectangles  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Rectangles</primary><secondary>drawing</secondary></indexterm>
+<indexterm><primary>Drawing</primary><secondary>rectangles</secondary></indexterm>
+<indexterm><primary>XDrawRectangle</primary></indexterm>
+<indexterm><primary>XDrawRectangles</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+To draw the outline of a single rectangle in a given drawable, use
+<xref linkend='XDrawRectangle' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XDrawRectangle</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XDrawRectangle'>
+<funcprototype>
+  <funcdef><function>XDrawRectangle</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>int <parameter>x</parameter></paramdef>
+  <paramdef>int <parameter>y</parameter></paramdef>
+  <paramdef>unsigned int <parameter>width</parameter></paramdef>
+  <paramdef>unsigned int <parameter>height</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, which specify the upper-left corner of the
+rectangle.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the width and height, which specify the dimensions of the
+rectangle.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<!-- .sp -->
+To draw the outline of multiple rectangles
+in a given drawable, use
+<xref linkend='XDrawRectangles' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XDrawRectangles</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XDrawRectangles'>
+<funcprototype>
+  <funcdef><function>XDrawRectangles</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>XRectangle <parameter>rectangles[]</parameter></paramdef>
+  <paramdef>int <parameter>nrectangles</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>rectangles</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an array of rectangles.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nrectangles</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of rectangles in the array.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XDrawRectangle' xrefstyle='select: title'/>
+and
+<xref linkend='XDrawRectangles' xrefstyle='select: title'/>
+functions draw the outlines of the specified rectangle or rectangles as
+if a five-point 
+<systemitem>PolyLine</systemitem>
+protocol request were specified for each rectangle:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+[x,y] [x+width,y] [x+width,y+height] [x,y+height] [x,y]
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP  -->
+For the specified rectangle or rectangles, 
+these functions do not draw a pixel more than once.
+<xref linkend='XDrawRectangles' xrefstyle='select: title'/>
+draws the rectangles in the order listed in the array.
+If rectangles intersect,
+the intersecting pixels are drawn multiple times.
+</para>
+<para>
+<!-- .LP -->
+Both functions use these GC components: 
+function, plane-mask, line-width,
+line-style, cap-style, join-style, fill-style, 
+subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask.
+They also use these GC mode-dependent components: 
+foreground, background, tile, stipple, tile-stipple-x-origin, 
+tile-stipple-y-origin, dash-offset, and dash-list.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XDrawRectangle' xrefstyle='select: title'/>
+and
+<xref linkend='XDrawRectangles' xrefstyle='select: title'/>
+can generate
+<errorname>BadDrawable</errorname>,
+<errorname>BadGC</errorname>,
+and
+<errorname>BadMatch</errorname>
+errors.
+</para>
+</sect2>
+<sect2 id="Drawing_Single_and_Multiple_Arcs">
+<title>Drawing Single and Multiple Arcs</title>
+<!-- .XS -->
+<!-- (SN Drawing Single and Multiple Arcs  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Drawing</primary><secondary>arcs</secondary></indexterm>
+<indexterm><primary>XDrawArc</primary></indexterm>
+<indexterm><primary>Arcs</primary><secondary>drawing</secondary></indexterm>
+<indexterm><primary>XDrawArcs</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To draw a single arc in a given drawable, use
+<xref linkend='XDrawArc' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XDrawArc</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XDrawArc'>
+<funcprototype>
+  <funcdef><function>XDrawArc</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>int <parameter>x</parameter></paramdef>
+  <paramdef>int <parameter>y</parameter></paramdef>
+  <paramdef>unsigned int <parameter>width</parameter></paramdef>
+  <paramdef>unsigned int <parameter>height</parameter></paramdef>
+  <paramdef>int <parameter>angle1</parameter></paramdef>
+  <paramdef>int <parameter>angle2</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, which are relative to the origin of the
+drawable and specify the upper-left corner of the bounding rectangle.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the width and height, which are the major and minor axes of the
+arc.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>angle1</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the start of the arc relative to the three-o'clock position
+from the center, in units of degrees * 64.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>angle2</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the path and extent of the arc relative to the start of the
+arc, in units of degrees * 64.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<!-- .sp -->
+To draw multiple arcs in a given drawable, use
+<xref linkend='XDrawArcs' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XDrawArcs</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XDrawArcs'>
+<funcprototype>
+  <funcdef><function>XDrawArcs</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>XArc *<parameter>arcs</parameter></paramdef>
+  <paramdef>int <parameter>narcs</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>arcs</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an array of arcs.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>narcs</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of arcs in the array.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<!-- .EQ -->
+delim %%
+<!-- .EN -->
+<xref linkend='XDrawArc' xrefstyle='select: title'/>
+draws a single circular or elliptical arc, and 
+<xref linkend='XDrawArcs' xrefstyle='select: title'/>
+draws multiple circular or elliptical arcs.
+Each arc is specified by a rectangle and two angles.  
+The center of the circle or ellipse is the center of the
+rectangle, and the major and minor axes are specified by the width and height.
+Positive angles indicate counterclockwise motion, 
+and negative angles indicate clockwise motion.  
+If the magnitude of angle2 is greater than 360 degrees, 
+<xref linkend='XDrawArc' xrefstyle='select: title'/>
+or 
+<xref linkend='XDrawArcs' xrefstyle='select: title'/>
+truncates it to 360 degrees.
+</para>
+<para>
+<!-- .LP -->
+For an arc specified as %[ ~x, ~y, ~width , ~height, ~angle1, ~angle2 ]%, 
+the origin of the major and minor axes is at 
+% [ x +^ {width over 2} , ~y +^ {height over 2}  ]%, 
+and the infinitely thin path describing the entire circle or ellipse 
+intersects the horizontal axis at % [ x, ~y +^ {height over 2}  ]% and 
+% [ x +^ width , ~y +^ { height over 2 }] %
+and intersects the vertical axis at % [ x +^ { width over 2 } , ~y ]% and 
+% [ x +^ { width over 2 }, ~y +^ height ]%.
+These coordinates can be fractional
+and so are not truncated to discrete coordinates.
+The path should be defined by the ideal mathematical path.  
+For a wide line with line-width lw, 
+the bounding outlines for filling are given        
+by the two infinitely thin paths consisting of all points whose perpendicular
+distance from the path of the circle/ellipse is equal to lw/2
+(which may be a fractional value).
+The cap-style and join-style are applied the same as for a line
+corresponding to the tangent of the circle/ellipse at the endpoint.
+</para>
+<para>
+<!-- .LP -->
+For an arc specified as % [ ~x, ~y, ~width, ~height, ~angle1, ~angle2  ]%,
+the angles must be specified
+in the effectively skewed coordinate system of the ellipse (for a
+circle, the angles and coordinate systems are identical).  The
+relationship between these angles and angles expressed in the normal
+coordinate system of the screen (as measured with a protractor) is as
+follows:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+% roman "skewed-angle" ~ = ~ atan left ( tan ( roman "normal-angle" )
+ * width over height right ) +^ adjust%
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+The skewed-angle and normal-angle are expressed in radians (rather
+than in degrees scaled by 64) in the range % [ 0 , ~2 pi  ]% and where atan
+returns a value in the range % [ - pi over 2 , ~pi over 2  ] %
+and adjust is:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA 1i 2i -->
+<!-- .ta 1i 2i -->
+%0%     for normal-angle in the range % [ 0 , ~pi over 2  ]%
+%pi%     for normal-angle in the range % [ pi over 2 , ~{3 pi} over 2  ]%
+%2 pi%     for normal-angle in the range % [ {3 pi} over 2 , ~2 pi  ]%
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+For any given arc, 
+<xref linkend='XDrawArc' xrefstyle='select: title'/>
+and
+<xref linkend='XDrawArcs' xrefstyle='select: title'/>
+do not draw a pixel more than once.  
+If two arcs join correctly and if the line-width is greater than zero 
+and the arcs intersect, 
+<xref linkend='XDrawArc' xrefstyle='select: title'/>
+and
+<xref linkend='XDrawArcs' xrefstyle='select: title'/>
+do not draw a pixel more than once.
+Otherwise, 
+the intersecting pixels of intersecting arcs are drawn multiple times.
+Specifying an arc with one endpoint and a clockwise extent draws the same pixels
+as specifying the other endpoint and an equivalent counterclockwise extent,
+except as it affects joins.
+</para>
+<para>
+<!-- .LP -->
+If the last point in one arc coincides with the first point in the following 
+arc, the two arcs will join correctly.  
+If the first point in the first arc coincides with the last point in the last 
+arc, the two arcs will join correctly.
+By specifying one axis to be zero, a horizontal or vertical line can be
+drawn.
+Angles are computed based solely on the coordinate system and ignore the
+aspect ratio.
+</para>
+<para>
+<!-- .LP -->
+Both functions use these GC components: 
+function, plane-mask, line-width, line-style, cap-style, join-style, 
+fill-style, subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask.
+They also use these GC mode-dependent components: 
+foreground, background, tile, stipple, tile-stipple-x-origin, 
+tile-stipple-y-origin, dash-offset, and dash-list.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XDrawArc' xrefstyle='select: title'/>
+and
+<xref linkend='XDrawArcs' xrefstyle='select: title'/>
+can generate
+<errorname>BadDrawable</errorname>,
+<errorname>BadGC</errorname>,
+and
+<errorname>BadMatch</errorname>
+errors.
+</para>
+</sect2>
+</sect1>
+<sect1 id="Filling_Areas">
+<title>Filling Areas</title>
+<!-- .XS -->
+<!-- (SN Filling Areas  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to fill:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+A single rectangle or multiple rectangles
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A single polygon
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A single arc or multiple arcs
+    </para>
+  </listitem>
+</itemizedlist>
+<sect2 id="Filling_Single_and_Multiple_Rectangles">
+<title>Filling Single and Multiple Rectangles</title>
+<!-- .XS -->
+<!-- (SN Filling Single and Multiple Rectangles  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Filling</primary><secondary>rectangles</secondary></indexterm>
+<indexterm><primary>XFillRectangle</primary></indexterm>
+<indexterm><primary>Rectangle</primary><secondary>filling</secondary></indexterm>
+<indexterm><primary>XFillRectangles</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To fill a single rectangular area in a given drawable, use
+<xref linkend='XFillRectangle' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XFillRectangle</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XFillRectangle'>
+<funcprototype>
+  <funcdef><function>XFillRectangle</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>int <parameter>x</parameter></paramdef>
+  <paramdef>int <parameter>y</parameter></paramdef>
+  <paramdef>unsigned int <parameter>width</parameter></paramdef>
+  <paramdef>unsigned int <parameter>height</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, which are relative to the origin of the
+drawable and specify the upper-left corner of the rectangle.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the width and height, which are the dimensions of the rectangle to
+be filled.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<!-- .sp -->
+To fill multiple rectangular areas in a given drawable, use
+<xref linkend='XFillRectangles' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XFillRectangles</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XFillRectangles'>
+<funcprototype>
+  <funcdef><function>XFillRectangles</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>XRectangle *<parameter>rectangles</parameter></paramdef>
+  <paramdef>int <parameter>nrectangles</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>rectangles</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an array of rectangles.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nrectangles</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of rectangles in the array.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XFillRectangle' xrefstyle='select: title'/>
+and
+<xref linkend='XFillRectangles' xrefstyle='select: title'/>
+functions fill the specified rectangle or rectangles
+as if a four-point 
+<systemitem>FillPolygon</systemitem>
+protocol request were specified for each rectangle:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+[x,y] [x+width,y] [x+width,y+height] [x,y+height]
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+Each function uses the x and y coordinates,
+width and height dimensions, and GC you specify.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XFillRectangles' xrefstyle='select: title'/>
+fills the rectangles in the order listed in the array.  
+For any given rectangle,
+<xref linkend='XFillRectangle' xrefstyle='select: title'/>
+and
+<xref linkend='XFillRectangles' xrefstyle='select: title'/>
+do not draw a pixel more than once.  
+If rectangles intersect, the intersecting pixels are
+drawn multiple times.
+</para>
+<para>
+<!-- .LP -->
+Both functions use these GC components: 
+function, plane-mask, fill-style, subwindow-mode, 
+clip-x-origin, clip-y-origin, and clip-mask.
+They also use these GC mode-dependent components: 
+foreground, background, tile, stipple, tile-stipple-x-origin, 
+and tile-stipple-y-origin.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XFillRectangle' xrefstyle='select: title'/>
+and
+<xref linkend='XFillRectangles' xrefstyle='select: title'/>
+can generate
+<errorname>BadDrawable</errorname>,
+<errorname>BadGC</errorname>,
+and
+<errorname>BadMatch</errorname>
+errors.
+</para>
+</sect2>
+<sect2 id="Filling_a_Single_Polygon">
+<title>Filling a Single Polygon</title>
+<!-- .XS -->
+<!-- (SN Filling a Single Polygon  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To fill a polygon area in a given drawable, use
+<xref linkend='XFillPolygon' xrefstyle='select: title'/>.
+<indexterm><primary>Polygons</primary><secondary>filling</secondary></indexterm>
+<indexterm><primary>Filling</primary><secondary>polygon</secondary></indexterm>
+</para>
+<indexterm significance="preferred"><primary>XFillPolygon</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XFillPolygon'>
+<funcprototype>
+  <funcdef><function>XFillPolygon</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>XPoint *<parameter>points</parameter></paramdef>
+  <paramdef>int <parameter>npoints</parameter></paramdef>
+  <paramdef>int <parameter>shape</parameter></paramdef>
+  <paramdef>int <parameter>mode</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>points</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an array of points.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>npoints</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of points in the array.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>shape</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a shape that helps the server to improve performance.
+You can pass 
+<symbol>Complex</symbol>,
+<symbol>Convex</symbol>,
+or 
+<symbol>Nonconvex</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the coordinate mode. 
+You can pass
+<symbol>CoordModeOrigin</symbol>
+or
+<symbol>CoordModePrevious</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XFillPolygon' xrefstyle='select: title'/>
+fills the region closed by the specified path.
+The path is closed
+automatically if the last point in the list does not coincide with the
+first point.
+<xref linkend='XFillPolygon' xrefstyle='select: title'/>
+does not draw a pixel of the region more than once.
+<symbol>CoordModeOrigin</symbol>
+treats all coordinates as relative to the origin,
+and
+<symbol>CoordModePrevious</symbol>
+treats all coordinates after the first as relative to the previous point.
+</para>
+<para>
+<!-- .LP -->
+Depending on the specified shape, the following occurs: 
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+If shape is
+<symbol>Complex</symbol>,
+the path may self-intersect. 
+Note that contiguous coincident points in the path are not treated 
+as self-intersection.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If shape is
+<symbol>Convex</symbol>,
+for every pair of points inside the polygon,
+the line segment connecting them does not intersect the path.
+If known by the client,
+specifying 
+<symbol>Convex</symbol>
+can improve performance.  
+If you specify
+<symbol>Convex</symbol>
+for a path that is not convex, 
+the graphics results are undefined.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If shape is
+<symbol>Nonconvex</symbol>,
+the path does not self-intersect, but the shape is not
+wholly convex. 
+If known by the client, 
+specifying 
+<symbol>Nonconvex</symbol>
+instead of
+<symbol>Complex</symbol>
+may improve performance.  
+If you specify
+<symbol>Nonconvex</symbol>
+for a self-intersecting path, the graphics results are undefined.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+The fill-rule of the GC controls the filling behavior of 
+self-intersecting polygons.
+</para>
+<para>
+<!-- .LP -->
+This function uses these GC components: 
+function, plane-mask, fill-style, fill-rule, subwindow-mode, clip-x-origin, 
+clip-y-origin, and clip-mask.
+It also uses these GC mode-dependent components: 
+foreground, background, tile, stipple, tile-stipple-x-origin, 
+and tile-stipple-y-origin.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XFillPolygon' xrefstyle='select: title'/>
+can generate
+<errorname>BadDrawable</errorname>,
+<errorname>BadGC</errorname>,
+<errorname>BadMatch</errorname>,
+and
+<errorname>BadValue</errorname>
+errors.
+</para>
+</sect2>
+<sect2 id="Filling_Single_and_Multiple_Arcs">
+<title>Filling Single and Multiple Arcs</title>
+<!-- .XS -->
+<!-- (SN Filling Single and Multiple Arcs  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>XFillArc</primary></indexterm>
+<indexterm><primary>Arcs</primary><secondary>filling</secondary></indexterm>
+<indexterm><primary>Filling</primary><secondary>arcs</secondary></indexterm>
+To fill a single arc in a given drawable, use
+<xref linkend='XFillArc' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XFillArc</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XFillArc'>
+<funcprototype>
+  <funcdef><function>XFillArc</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>int <parameter>x</parameter></paramdef>
+  <paramdef>int <parameter>y</parameter></paramdef>
+  <paramdef>unsigned int <parameter>width</parameter></paramdef>
+  <paramdef>unsigned int <parameter>height</parameter></paramdef>
+  <paramdef>int <parameter>angle1</parameter></paramdef>
+  <paramdef>int <parameter>angle2</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, which are relative to the origin of the
+drawable and specify the upper-left corner of the bounding rectangle.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the width and height, which are the major and minor axes of the
+arc.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>angle1</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the start of the arc relative to the three-o'clock position
+from the center, in units of degrees * 64.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>angle2</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the path and extent of the arc relative to the start of the
+arc, in units of degrees * 64.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<!-- .sp -->
+To fill multiple arcs in a given drawable, use
+<xref linkend='XFillArcs' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XFillArcs</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XFillArcs'>
+<funcprototype>
+  <funcdef><function>XFillArcs</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>XArc *<parameter>arcs</parameter></paramdef>
+  <paramdef>int <parameter>narcs</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>arcs</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an array of arcs.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>narcs</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of arcs in the array.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+For each arc, 
+<xref linkend='XFillArc' xrefstyle='select: title'/>
+or
+<xref linkend='XFillArcs' xrefstyle='select: title'/>
+fills the region closed by the infinitely thin path
+described by the specified arc and, depending on the 
+arc-mode specified in the GC, one or two line segments. 
+For 
+<symbol>ArcChord</symbol>,
+the single line segment joining the endpoints of the arc is used.  
+For 
+<symbol>ArcPieSlice</symbol>,
+the two line segments joining the endpoints of the arc with the center
+point are used.  
+<xref linkend='XFillArcs' xrefstyle='select: title'/>
+fills the arcs in the order listed in the array.  
+For any given arc,  
+<xref linkend='XFillArc' xrefstyle='select: title'/>
+and
+<xref linkend='XFillArcs' xrefstyle='select: title'/>
+do not draw a pixel more than once.  
+If regions intersect, 
+the intersecting pixels are drawn multiple times.
+</para>
+<para>
+<!-- .LP -->
+Both functions use these GC components: 
+function, plane-mask, fill-style, arc-mode, subwindow-mode, clip-x-origin, 
+clip-y-origin, and clip-mask.
+They also use these GC mode-dependent components: 
+foreground, background, tile, stipple, tile-stipple-x-origin, 
+and tile-stipple-y-origin.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XFillArc' xrefstyle='select: title'/>
+and
+<xref linkend='XFillArcs' xrefstyle='select: title'/>
+can generate
+<errorname>BadDrawable</errorname>,
+<errorname>BadGC</errorname>,
+and
+<errorname>BadMatch</errorname>
+errors.
+</para>
+</sect2>
+</sect1>
+<sect1 id="Font_Metrics">
+<title>Font Metrics</title>
+<!-- .XS -->
+<!-- (SN Font Metrics  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Font</primary></indexterm>
+A font is a graphical description of a set of characters that are used to 
+increase efficiency whenever a set of small, similar sized patterns are 
+repeatedly used.
+</para>
+<para>
+<!-- .LP -->
+This section discusses how to:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Load and free fonts
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Obtain and free font names
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Compute character string sizes
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Compute logical extents
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Query character string sizes
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+The X server loads fonts whenever a program requests a new font.
+The server can cache fonts for quick lookup.
+Fonts are global across all screens in a server.
+Several levels are possible when dealing with fonts.
+Most applications simply use 
+<xref linkend='XLoadQueryFont' xrefstyle='select: title'/>
+to load a font and query the font metrics.
+</para>
+<para>
+<!-- .LP -->
+Characters in fonts are regarded as masks.
+Except for image text requests,
+the only pixels modified are those in which bits are set to 1 in the character.
+This means that it makes sense to draw text using stipples or tiles
+(for example, many menus gray-out unusable entries).
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+The
+<structname>XFontStruct</structname>
+structure contains all of the information for the font
+and consists of the font-specific information as well as
+a pointer to an array of
+<structname>XCharStruct</structname>
+structures for the
+characters contained in the font.
+The
+<structname>XFontStruct</structname>,
+<structname>XFontProp</structname>,
+and
+<structname>XCharStruct</structname>
+structures contain:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XCharStruct</primary></indexterm>
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     short lbearing;               /* origin to left edge of raster */
+     short rbearing;               /* origin to right edge of raster */
+     short width;                  /* advance to next char's origin */
+     short ascent;                 /* baseline to top edge of raster */
+     short descent;                /* baseline to bottom edge of raster */
+     unsigned short attributes;    /* per char flags (not predefined) */
+} XCharStruct;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XFontProp</primary></indexterm>
+<literallayout class="monospaced">
+<!-- .TA .5i 1i 3i -->
+<!-- .ta .5i 1i 3i -->
+typedef struct {
+     Atom     name;
+     unsigned long card32;
+} XFontProp;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XChar2b</primary></indexterm>
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {     /* normal 16 bit characters are two bytes */
+    unsigned char byte1;
+    unsigned char byte2;
+} XChar2b;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XFontStruct</primary></indexterm>
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     XExtData *ext_data;               /* hook for extension to hang data */
+     Font fid;                         /* Font id for this font */
+     unsigned direction;               /* hint about the direction font is painted */
+     unsigned min_char_or_byte2;       /* first character */
+     unsigned max_char_or_byte2;       /* last character */
+     unsigned min_byte1;               /* first row that exists */
+     unsigned max_byte1;               /* last row that exists */
+     Bool all_chars_exist;             /* flag if all characters have nonzero size */
+     unsigned default_char;            /* char to print for undefined character */
+     int n_properties;                 /* how many properties there are */
+     XFontProp *properties;            /* pointer to array of additional properties */
+     XCharStruct min_bounds;           /* minimum bounds over all existing char */
+     XCharStruct max_bounds;           /* maximum bounds over all existing char */
+     XCharStruct *per_char;            /* first_char to last_char information */
+     int ascent;                       /* logical extent above baseline for spacing */
+     int descent;                      /* logical descent below baseline for spacing */
+} XFontStruct;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+X supports single byte/character, two bytes/character matrix,
+and 16-bit character text operations.
+Note that any of these forms can be used with a font, but a
+single byte/character text request can only specify a single byte
+(that is, the first row of a 2-byte font).
+You should view 2-byte fonts as a two-dimensional matrix of defined
+characters: byte1 specifies the range of defined rows and
+byte2 defines the range of defined columns of the font.
+Single byte/character fonts have one row defined, and the byte2 range
+specified in the structure defines a range of characters.
+</para>
+<para>
+<!-- .LP -->
+The bounding box of a character is defined by the 
+<structname>XCharStruct</structname>
+of that character.
+When characters are absent from a font,
+the default_char is used.
+When fonts have all characters of the same size,
+only the information in the
+<structname>XFontStruct</structname>
+min and max bounds are used.
+</para>
+<para>
+<!-- .LP -->
+The members of the 
+<structname>XFontStruct</structname>
+have the following semantics:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+The direction member can be either 
+<symbol>FontLeftToRight</symbol>
+or 
+<symbol>FontRightToLeft</symbol>.
+It is just a hint as to whether most 
+<structname>XCharStruct</structname>
+elements 
+have a positive 
+(<symbol>FontLeftToRight</symbol>)
+or a negative 
+(<symbol>FontRightToLeft</symbol>)
+character width 
+metric.
+The core protocol defines no support for vertical text.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the min_byte1 and max_byte1 members are both zero, min_char_or_byte2
+specifies the linear character index corresponding to the first element
+of the per_char array, and max_char_or_byte2 specifies the linear character
+index of the last element.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If either min_byte1 or max_byte1 are nonzero, both
+min_char_or_byte2 and max_char_or_byte2 are less than 256, 
+and the 2-byte character index values corresponding to the
+per_char array element N (counting from 0) are:
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<!-- .nf -->
+     byte1 = N/D + min_byte1
+<!-- .br -->
+     byte2 = N\\D + min_char_or_byte2
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<!-- .fi -->
+where:
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<!-- .nf -->
+        D = max_char_or_byte2 - min_char_or_byte2 + 1
+        / = integer division
+        \\ = integer modulus
+<!-- .fi -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the per_char pointer is NULL, 
+all glyphs between the first and last character indexes
+inclusive have the same information,
+as given by both min_bounds and max_bounds.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If all_chars_exist is 
+<symbol>True</symbol>,
+all characters in the per_char array have nonzero bounding boxes.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The default_char member specifies the character that will be used when an
+undefined or nonexistent character is printed.  
+The default_char is a 16-bit character (not a 2-byte character).
+For a font using 2-byte matrix format, 
+the default_char has byte1 in the most-significant byte
+and byte2 in the least significant byte.
+If the default_char itself specifies an undefined or nonexistent character, 
+no printing is performed for an undefined or nonexistent character.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The min_bounds and max_bounds members contain the most extreme values of
+each individual 
+<structname>XCharStruct</structname>
+component over all elements of this array
+(and ignore nonexistent characters).
+The bounding box of the font (the smallest
+rectangle enclosing the shape obtained by superimposing all of the
+characters at the same origin [x,y]) has its upper-left coordinate at:
+<literallayout class="monospaced">
+     [x + min_bounds.lbearing, y - max_bounds.ascent]
+</literallayout>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Its width is:
+<literallayout class="monospaced">
+     max_bounds.rbearing - min_bounds.lbearing
+</literallayout>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Its height is:
+<literallayout class="monospaced">
+     max_bounds.ascent + max_bounds.descent
+</literallayout>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The ascent member is the logical extent of the font above the baseline that is
+used for determining line spacing.
+Specific characters may extend beyond
+this.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The descent member is the logical extent of the font at or below the
+baseline that is used for determining line spacing.
+Specific characters may extend beyond this.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the baseline is at Y-coordinate y,
+the logical extent of the font is inclusive between the Y-coordinate 
+values (y - font.ascent) and (y + font.descent - 1).
+Typically,
+the minimum interline spacing between rows of text is given
+by ascent + descent.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+For a character origin at [x,y],
+the bounding box of a character (that is, 
+the smallest rectangle that encloses the character's shape)
+described in terms of 
+<structname>XCharStruct</structname>
+components is a rectangle with its upper-left corner at:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+[x + lbearing, y - ascent]
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+Its width is:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+rbearing - lbearing
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+Its height is:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+ascent + descent
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+The origin for the next character is defined to be:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+[x + width, y]
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+The lbearing member defines the extent of the left edge of the character ink
+from the origin.
+The rbearing member defines the extent of the right edge of the character ink
+from the origin.
+The ascent member defines the extent of the top edge of the character ink
+from the origin.
+The descent member defines the extent of the bottom edge of the character ink
+from the origin.
+The width member defines the logical width of the character.
+</para>
+<para>
+<!-- .LP -->
+Note that the baseline (the y position of the character origin) 
+is logically viewed as being the scanline just below nondescending characters. 
+When descent is zero,
+only pixels with Y-coordinates less than y are drawn,
+and the origin is logically viewed as being coincident with the left edge of
+a nonkerned character. 
+When lbearing is zero,
+no pixels with X-coordinate less than x are drawn.
+Any of the
+<structname>XCharStruct</structname>
+metric members could be negative.
+If the width is negative,
+the next character will be placed to the left of the current origin.
+</para>
+<para>
+<!-- .LP -->
+The X protocol does not define the interpretation of the attributes member 
+in the
+<structname>XCharStruct</structname>
+structure.
+A nonexistent character is represented with all members of its
+<structname>XCharStruct</structname>
+set to zero.
+</para>
+<para>
+<!-- .LP -->
+A font is not guaranteed to have any properties.
+The interpretation of the property value (for example, long or unsigned long)
+must be derived from <emphasis remap='I'>a priori</emphasis> knowledge of the property. 
+A basic set of font properties is specified in the X Consortium standard
+<citetitle>X Logical Font Description Conventions</citetitle>.
+</para>
+<sect2 id="Loading_and_Freeing_Fonts">
+<title>Loading and Freeing Fonts</title>
+<!-- .XS -->
+<!-- (SN Loading and Freeing Fonts  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to load fonts, get font information,
+unload fonts, and free font information.
+<indexterm><primary>Fonts</primary><secondary>getting information</secondary></indexterm>
+<indexterm><primary>Fonts</primary><secondary>unloading</secondary></indexterm>
+<indexterm><primary>Fonts</primary><secondary>freeing font information</secondary></indexterm>
+A few font functions use a 
+<type>GContext</type>
+resource ID or a font ID interchangeably.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To load a given font, use
+<xref linkend='XLoadFont' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XLoadFont</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XLoadFont'>
+<funcprototype>
+  <funcdef>Font <function>XLoadFont</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>char *<parameter>name</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the name of the font,
+which is a null-terminated string.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XLoadFont' xrefstyle='select: title'/>
+function loads the specified font and returns its associated font ID.
+If the font name is not in the Host Portable Character Encoding,
+the result is implementation-dependent.
+Use of uppercase or lowercase does not matter.
+When the characters ``?'' and ``*'' are used in a font name, a
+pattern match is performed and any matching font is used.
+In the pattern, 
+the ``?'' character will match any single character, 
+and the ``*'' character will match any number of characters.
+A structured format for font names is specified in the X Consortium standard 
+<citetitle>X Logical Font Description Conventions</citetitle>.
+If 
+<xref linkend='XLoadFont' xrefstyle='select: title'/>
+was unsuccessful at loading the specified font, 
+a 
+<errorname>BadName</errorname>
+error results.
+Fonts are not associated with a particular screen 
+and can be stored as a component
+of any GC.
+When the font is no longer needed, call 
+<xref linkend='XUnloadFont' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XLoadFont' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>
+and
+<errorname>BadName</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To return information about an available font, use
+<xref linkend='XQueryFont' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XQueryFont</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XQueryFont'>
+<funcprototype>
+  <funcdef>XFontStruct *<function>XQueryFont</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XID <parameter>font_ID</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>font_ID</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the font ID or the 
+<type>GContext</type>
+ID.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XQueryFont' xrefstyle='select: title'/>
+function returns a pointer to the
+<structname>XFontStruct</structname>
+structure, which contains information associated with the font.
+You can query a font or the font stored in a GC.
+The font ID stored in the 
+<structname>XFontStruct</structname>
+structure will be the 
+<type>GContext</type>
+ID, and you need to be careful when using this ID in other functions
+(see
+<xref linkend='XGContextFromGC' xrefstyle='select: title'/>).
+If the font does not exist,
+<xref linkend='XQueryFont' xrefstyle='select: title'/>
+returns NULL.
+To free this data, use
+<xref linkend='XFreeFontInfo' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To perform a
+<xref linkend='XLoadFont' xrefstyle='select: title'/>
+and
+<xref linkend='XQueryFont' xrefstyle='select: title'/>
+in a single operation, use
+<xref linkend='XLoadQueryFont' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XLoadQueryFont</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XLoadQueryFont'>
+<funcprototype>
+  <funcdef>XFontStruct *<function>XLoadQueryFont</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>char *<parameter>name</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the name of the font,
+which is a null-terminated string.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XLoadQueryFont' xrefstyle='select: title'/>
+function provides the most common way for accessing a font.
+<xref linkend='XLoadQueryFont' xrefstyle='select: title'/>
+both opens (loads) the specified font and returns a pointer to the
+appropriate
+<structname>XFontStruct</structname>
+structure.
+If the font name is not in the Host Portable Character Encoding,
+the result is implementation-dependent.
+If the font does not exist,
+<xref linkend='XLoadQueryFont' xrefstyle='select: title'/>
+returns NULL.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XLoadQueryFont' xrefstyle='select: title'/>
+can generate a
+<errorname>BadAlloc</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To unload the font and free the storage used by the font structure
+that was allocated by
+<xref linkend='XQueryFont' xrefstyle='select: title'/>
+or
+<xref linkend='XLoadQueryFont' xrefstyle='select: title'/>,
+use
+<xref linkend='XFreeFont' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XFreeFont</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XFreeFont'>
+<funcprototype>
+  <funcdef><function>XFreeFont</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XFontStruct *<parameter>font_struct</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>font_struct</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the storage associated with the font.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM  -->
+The
+<xref linkend='XFreeFont' xrefstyle='select: title'/>
+function deletes the association between the font resource ID and the specified 
+font and frees the
+<structname>XFontStruct</structname>
+structure.
+The font itself will be freed when no other resource references it.
+The data and the font should not be referenced again.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XFreeFont' xrefstyle='select: title'/>
+can generate a
+<errorname>BadFont</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To return a given font property, use
+<xref linkend='XGetFontProperty' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetFontProperty</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetFontProperty'>
+<funcprototype>
+  <funcdef>Bool <function>XGetFontProperty</function></funcdef>
+  <paramdef>XFontStruct *<parameter>font_struct</parameter></paramdef>
+  <paramdef>Atom <parameter>atom</parameter></paramdef>
+  <paramdef>unsigned long *<parameter>value_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>font_struct</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the storage associated with the font.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>atom</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the atom for the property name you want returned.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>value_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the value of the font property.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Given the atom for that property,
+the
+<xref linkend='XGetFontProperty' xrefstyle='select: title'/>
+function returns the value of the specified font property. 
+<xref linkend='XGetFontProperty' xrefstyle='select: title'/>
+also returns 
+<symbol>False</symbol>
+if the property was not defined or 
+<symbol>True</symbol>
+if it was defined.
+A set of predefined atoms exists for font properties,
+which can be found in
+<filename class="headerfile">&lt;X11/Xatom.h&gt;</filename>.
+<indexterm type="file"><primary><filename class="headerfile">X11/Xatom.h</filename></primary></indexterm>
+<indexterm><primary>Files</primary><secondary><filename class="headerfile">&lt;X11/Xatom.h&gt;</filename></secondary></indexterm>
+<indexterm><primary>Headers</primary><secondary><filename class="headerfile">&lt;X11/Xatom.h&gt;</filename></secondary></indexterm>
+This set contains the standard properties associated with
+a font.
+Although it is not guaranteed,
+it is likely that the predefined font properties will be present.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To unload a font that was loaded by
+<xref linkend='XLoadFont' xrefstyle='select: title'/>,
+use
+<xref linkend='XUnloadFont' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XUnloadFont</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XUnloadFont'>
+<funcprototype>
+  <funcdef><function>XUnloadFont</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Font <parameter>font</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>font</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the font.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XUnloadFont' xrefstyle='select: title'/>
+function deletes the association between the font resource ID and the specified font.
+The font itself will be freed when no other resource references it.
+The font should not be referenced again.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XUnloadFont' xrefstyle='select: title'/>
+can generate a
+<errorname>BadFont</errorname>
+error.
+</para>
+</sect2>
+<sect2 id="Obtaining_and_Freeing_Font_Names_and_Information">
+<title>Obtaining and Freeing Font Names and Information</title>
+<!-- .XS -->
+<!-- (SN Obtaining and Freeing Font Names and Information -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+You obtain font names and information by matching a wildcard specification
+when querying a font type for a list of available sizes and so on.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To return a list of the available font names, use
+<xref linkend='XListFonts' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XListFonts</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XListFonts'>
+<funcprototype>
+  <funcdef>char **<function>XListFonts</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>char *<parameter>pattern</parameter></paramdef>
+  <paramdef>int <parameter>maxnames</parameter></paramdef>
+  <paramdef>int *<parameter>actual_count_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>pattern</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the null-terminated pattern string that can contain wildcard 
+characters.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>maxnames</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the maximum number of names to be returned.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>actual_count_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the actual number of font names.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XListFonts' xrefstyle='select: title'/>
+function returns an array of available font names 
+(as controlled by the font search path; see
+<xref linkend='XSetFontPath' xrefstyle='select: title'/>)
+that match the string you passed to the pattern argument.
+The pattern string can contain any characters,
+but each asterisk (*) is a wildcard for any number of characters,
+and each question mark (?) is a wildcard for a single character.
+If the pattern string is not in the Host Portable Character Encoding,
+the result is implementation-dependent.
+Use of uppercase or lowercase does not matter.
+Each returned string is null-terminated.
+If the data returned by the server is in the Latin Portable Character Encoding,
+then the returned strings are in the Host Portable Character Encoding.
+Otherwise, the result is implementation-dependent.
+If there are no matching font names,
+<xref linkend='XListFonts' xrefstyle='select: title'/>
+returns NULL.
+The client should call
+<xref linkend='XFreeFontNames' xrefstyle='select: title'/>
+when finished with the result to free the memory.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To free a font name array, use
+<xref linkend='XFreeFontNames' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XFreeFontNames</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XFreeFontNames'>
+<funcprototype>
+  <funcdef><function>XFreeFontNames</function></funcdef>
+  <paramdef>char *<parameter>list[]</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>list</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the array of strings you want to free.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XFreeFontNames' xrefstyle='select: title'/>
+function frees the array and strings returned by
+<xref linkend='XListFonts' xrefstyle='select: title'/>
+or
+<xref linkend='XListFontsWithInfo' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To obtain the names and information about available fonts, use
+<xref linkend='XListFontsWithInfo' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XListFontsWithInfo</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XListFontsWithInfo'>
+<funcprototype>
+  <funcdef>char **<function>XListFontsWithInfo</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>char *<parameter>pattern</parameter></paramdef>
+  <paramdef>int <parameter>maxnames</parameter></paramdef>
+  <paramdef>int *<parameter>count_return</parameter></paramdef>
+  <paramdef>XFontStruct **<parameter>info_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>pattern</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the null-terminated pattern string that can contain wildcard 
+characters.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>maxnames</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the maximum number of names to be returned.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the actual number of matched font names.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>info_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the font information.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XListFontsWithInfo' xrefstyle='select: title'/>
+function returns a list of font names that match the specified pattern and their
+associated font information.
+The list of names is limited to size specified by maxnames.
+The information returned for each font is identical to what
+<xref linkend='XLoadQueryFont' xrefstyle='select: title'/>
+would return except that the per-character metrics are not returned.
+The pattern string can contain any characters,
+but each asterisk (*) is a wildcard for any number of characters,
+and each question mark (?) is a wildcard for a single character.
+If the pattern string is not in the Host Portable Character Encoding,
+the result is implementation-dependent.
+Use of uppercase or lowercase does not matter.
+Each returned string is null-terminated.
+If the data returned by the server is in the Latin Portable Character Encoding,
+then the returned strings are in the Host Portable Character Encoding.
+Otherwise, the result is implementation-dependent.
+If there are no matching font names,
+<xref linkend='XListFontsWithInfo' xrefstyle='select: title'/>
+returns NULL.
+</para>
+<para>
+<!-- .LP -->
+To free only the allocated name array,
+the client should call
+<xref linkend='XFreeFontNames' xrefstyle='select: title'/>.
+To free both the name array and the font information array
+or to free just the font information array,
+the client should call
+<xref linkend='XFreeFontInfo' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To free font structures and font names, use
+<xref linkend='XFreeFontInfo' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XFreeFontInfo</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XFreeFontInfo'>
+<funcprototype>
+  <funcdef><function>XFreeFontInfo</function></funcdef>
+  <paramdef>char **<parameter>names</parameter></paramdef>
+  <paramdef>XFontStruct *<parameter>free_info</parameter></paramdef>
+  <paramdef>int <parameter>actual_count</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>names</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the list of font names.
+
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>free_info</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the font information.
+
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>actual_count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the actual number of font names.
+
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XFreeFontInfo' xrefstyle='select: title'/>
+function frees a font structure or an array of font structures
+and optionally an array of font names.
+If NULL is passed for names, no font names are freed.
+If a font structure for an open font (returned by
+<xref linkend='XLoadQueryFont' xrefstyle='select: title'/>)
+is passed, the structure is freed,
+but the font is not closed; use
+<xref linkend='XUnloadFont' xrefstyle='select: title'/>
+to close the font.
+</para>
+</sect2>
+<sect2 id="Computing_Character_String_Sizes">
+<title>Computing Character String Sizes</title>
+<!-- .XS -->
+<!-- (SN Computing Character String Sizes  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to compute the width,
+the logical extents, 
+and the server information about 8-bit and 2-byte text strings.
+<indexterm><primary>XTextWidth</primary></indexterm>
+<indexterm><primary>XTextWidth16</primary></indexterm>
+The width is computed by adding the character widths of all the characters.
+It does not matter if the font is an 8-bit or 2-byte font.
+These functions return the sum of the character metrics in pixels.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To determine the width of an 8-bit character string, use
+<xref linkend='XTextWidth' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XTextWidth</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XTextWidth'>
+<funcprototype>
+  <funcdef>int <function>XTextWidth</function></funcdef>
+  <paramdef>XFontStruct *<parameter>font_struct</parameter></paramdef>
+  <paramdef>char *<parameter>string</parameter></paramdef>
+  <paramdef>int <parameter>count</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>font_struct</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the font used for the width computation.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>string</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the character string.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the character count in the specified string.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<!-- .sp -->
+To determine the width of a 2-byte character string, use
+<xref linkend='XTextWidth16' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XTextWidth16</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XTextWidth16'>
+<funcprototype>
+  <funcdef>int <function>XTextWidth16</function></funcdef>
+  <paramdef>XFontStruct *<parameter>font_struct</parameter></paramdef>
+  <paramdef>XChar2b *<parameter>string</parameter></paramdef>
+  <paramdef>int <parameter>count</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>font_struct</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the font used for the width computation.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>string</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the character string.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the character count in the specified string.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+</para>
+</sect2>
+<sect2 id="Computing_Logical_Extents">
+<title>Computing Logical Extents</title>
+<!-- .XS -->
+<!-- (SN Computing Logical Extents  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To compute the bounding box of an 8-bit character string in a given font, use
+<xref linkend='XTextExtents' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XTextExtents</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XTextExtents'>
+<funcprototype>
+  <funcdef><function>XTextExtents</function></funcdef>
+  <paramdef>XFontStruct *<parameter>font_struct</parameter></paramdef>
+  <paramdef>char *<parameter>string</parameter></paramdef>
+  <paramdef>int <parameter>nchars</parameter></paramdef>
+  <paramdef>int *<parameter>direction_return</parameter></paramdef>
+  <paramdef>int *<parameter>font_ascent_return</parameter></paramdef>
+  <paramdef>int *<parameter>font_descent_return</parameter></paramdef>
+  <paramdef>XCharStruct *<parameter>overall_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>font_struct</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the 
+<structname>XFontStruct</structname>
+structure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>string</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the character string.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nchars</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of characters in the character string.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>direction_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the value of the direction hint
+(<symbol>FontLeftToRight</symbol>
+or
+<symbol>FontRightToLeft</symbol>).
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>font_ascent_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the font ascent.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>font_descent_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the font descent.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>overall_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the overall size in the specified
+<structname>XCharStruct</structname>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<!-- .sp -->
+To compute the bounding box of a 2-byte character string in a given font, use
+<xref linkend='XTextExtents16' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XTextExtents16</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XTextExtents16'>
+<funcprototype>
+  <funcdef><function>XTextExtents16</function></funcdef>
+  <paramdef>XFontStruct *<parameter>font_struct</parameter></paramdef>
+  <paramdef>XChar2b *<parameter>string</parameter></paramdef>
+  <paramdef>int <parameter>nchars</parameter></paramdef>
+  <paramdef>int *<parameter>direction_return</parameter></paramdef>
+  <paramdef>int *<parameter>font_ascent_return</parameter></paramdef>
+  <paramdef>int *<parameter>font_descent_return</parameter></paramdef>
+  <paramdef>XCharStruct *<parameter>overall_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>font_struct</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the 
+<structname>XFontStruct</structname>
+structure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>string</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the character string.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nchars</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of characters in the character string.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>direction_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the value of the direction hint
+(<symbol>FontLeftToRight</symbol>
+or
+<symbol>FontRightToLeft</symbol>).
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>font_ascent_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the font ascent.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>font_descent_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the font descent.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>overall_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the overall size in the specified
+<structname>XCharStruct</structname>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XTextExtents' xrefstyle='select: title'/>
+and
+<xref linkend='XTextExtents16' xrefstyle='select: title'/>
+functions 
+perform the size computation locally and, thereby,
+avoid the round-trip overhead of
+<xref linkend='XQueryTextExtents' xrefstyle='select: title'/>
+and
+<xref linkend='XQueryTextExtents16' xrefstyle='select: title'/>.
+Both functions return an
+<structname>XCharStruct</structname>
+structure, whose members are set to the values as follows.
+</para>
+<para>
+<!-- .LP -->
+The ascent member is set to the maximum of the ascent metrics of all
+characters in the string.
+The descent member is set to the maximum of the descent metrics.
+The width member is set to the sum of the character-width metrics of all
+characters in the string.
+For each character in the string,
+let W be the sum of the character-width metrics of all characters preceding 
+it in the string.
+Let L be the left-side-bearing metric of the character plus W.
+Let R be the right-side-bearing metric of the character plus W.
+The lbearing member is set to the minimum L of all characters in the string.
+The rbearing member is set to the maximum R.
+</para>
+<para>
+<!-- .LP -->
+For fonts defined with linear indexing rather than 2-byte matrix indexing,
+each 
+<structname>XChar2b</structname>
+structure is interpreted as a 16-bit number with byte1 as the 
+most significant byte.
+If the font has no defined default character,
+undefined characters in the string are taken to have all zero metrics.
+</para>
+</sect2>
+<sect2 id="Querying_Character_String_Sizes">
+<title>Querying Character String Sizes</title>
+<!-- .XS -->
+<!-- (SN Querying Character String Sizes  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To query the server for the bounding box of an 8-bit character string in a 
+given font, use 
+<xref linkend='XQueryTextExtents' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XQueryTextExtents</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XQueryTextExtents'>
+<funcprototype>
+  <funcdef><function>XQueryTextExtents</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XID <parameter>font_ID</parameter></paramdef>
+  <paramdef>char *<parameter>string</parameter></paramdef>
+  <paramdef>int <parameter>nchars</parameter></paramdef>
+  <paramdef>int *<parameter>direction_return</parameter></paramdef>
+  <paramdef>int *<parameter>font_ascent_return</parameter></paramdef>
+  <paramdef>int *<parameter>font_descent_return</parameter></paramdef>
+  <paramdef>XCharStruct *<parameter>overall_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>font_ID</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies either the font ID or the 
+<type>GContext</type>
+ID that contains the font.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>string</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the character string.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nchars</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of characters in the character string.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>direction_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the value of the direction hint
+(<symbol>FontLeftToRight</symbol>
+or
+<symbol>FontRightToLeft</symbol>).
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>font_ascent_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the font ascent.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>font_descent_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the font descent.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>overall_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the overall size in the specified
+<structname>XCharStruct</structname>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<!-- .sp -->
+To query the server for the bounding box of a 2-byte character string
+in a given font, use
+<xref linkend='XQueryTextExtents16' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XQueryTextExtents16</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XQueryTextExtents16'>
+<funcprototype>
+  <funcdef><function>XQueryTextExtents16</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XID <parameter>font_ID</parameter></paramdef>
+  <paramdef>XChar2b *<parameter>string</parameter></paramdef>
+  <paramdef>int <parameter>nchars</parameter></paramdef>
+  <paramdef>int *<parameter>direction_return</parameter></paramdef>
+  <paramdef>int *<parameter>font_ascent_return</parameter></paramdef>
+  <paramdef>int *<parameter>font_descent_return</parameter></paramdef>
+  <paramdef>XCharStruct *<parameter>overall_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>font_ID</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies either the font ID or the 
+<type>GContext</type>
+ID that contains the font.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>string</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the character string.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nchars</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of characters in the character string.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>direction_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the value of the direction hint
+(<symbol>FontLeftToRight</symbol>
+or
+<symbol>FontRightToLeft</symbol>).
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>font_ascent_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the font ascent.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>font_descent_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the font descent.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>overall_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the overall size in the specified
+<structname>XCharStruct</structname>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XQueryTextExtents' xrefstyle='select: title'/>
+and
+<xref linkend='XQueryTextExtents16' xrefstyle='select: title'/>
+functions return the bounding box of the specified 8-bit and 16-bit
+character string in the specified font or the font contained in the
+specified GC.
+These functions query the X server and, therefore, suffer the round-trip
+overhead that is avoided by
+<xref linkend='XTextExtents' xrefstyle='select: title'/>
+and 
+<xref linkend='XTextExtents16' xrefstyle='select: title'/>.
+Both functions return a
+<structname>XCharStruct</structname>
+structure, whose members are set to the values as follows.
+</para>
+<para>
+<!-- .LP -->
+The ascent member is set to the maximum of the ascent metrics 
+of all characters in the string.
+The descent member is set to the maximum of the descent metrics.
+The width member is set to the sum of the character-width metrics 
+of all characters in the string.
+For each character in the string,
+let W be the sum of the character-width metrics of all characters preceding
+it in the string.
+Let L be the left-side-bearing metric of the character plus W.
+Let R be the right-side-bearing metric of the character plus W.
+The lbearing member is set to the minimum L of all characters in the string.
+The rbearing member is set to the maximum R.
+</para>
+<para>
+<!-- .LP -->
+For fonts defined with linear indexing rather than 2-byte matrix indexing,
+each 
+<structname>XChar2b</structname>
+structure is interpreted as a 16-bit number with byte1 as the 
+most significant byte.
+If the font has no defined default character,
+undefined characters in the string are taken to have all zero metrics.
+</para>
+<para>
+<!-- .LP -->
+Characters with all zero metrics are ignored.
+If the font has no defined default_char,
+the undefined characters in the string are also ignored.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XQueryTextExtents' xrefstyle='select: title'/>
+and
+<xref linkend='XQueryTextExtents16' xrefstyle='select: title'/>
+can generate
+<errorname>BadFont</errorname>
+and
+<errorname>BadGC</errorname>
+errors.
+</para>
+</sect2>
+</sect1>
+<sect1 id="Drawing_Text">
+<title>Drawing Text</title>
+<!-- .XS -->
+<!-- (SN Drawing Text -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+This section discusses how to draw:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Complex text 
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Text characters
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Image text characters
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+The fundamental text functions
+<xref linkend='XDrawText' xrefstyle='select: title'/>
+and
+<xref linkend='XDrawText16' xrefstyle='select: title'/>
+use the following structures:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XTextItem</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     char *chars;     /* pointer to string */
+     int nchars;      /* number of characters */
+     int delta;       /* delta between strings */
+     Font font;       /* Font to print it in, None don't change */
+} XTextItem;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XTextItem16</primary></indexterm>
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     XChar2b *chars;     /* pointer to two-byte characters */
+     int nchars;         /* number of characters */
+     int delta;         /* delta between strings */
+     Font font;         /* font to print it in, None don't change */
+} XTextItem16;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+If the font member is not
+<symbol>None</symbol>,
+the font is changed before printing and also is stored in the GC.
+If an error was generated during text drawing,
+the previous items may have been drawn.
+The baseline of the characters are drawn starting at the x and y
+coordinates that you pass in the text drawing functions.
+</para>
+<para>
+<!-- .LP -->
+For example, consider the background rectangle drawn by
+<xref linkend='XDrawImageString' xrefstyle='select: title'/>.
+If you want the upper-left corner of the background rectangle
+to be at pixel coordinate (x,y), pass the (x,y + ascent)
+as the baseline origin coordinates to the text functions.
+The ascent is the font ascent, as given in the
+<structname>XFontStruct</structname>
+structure.
+If you want the lower-left corner of the background rectangle
+to be at pixel coordinate (x,y), pass the (x,y - descent + 1)
+as the baseline origin coordinates to the text functions.
+The descent is the font descent, as given in the
+<structname>XFontStruct</structname>
+structure.
+</para>
+<sect2 id="Drawing_Complex_Text">
+<title>Drawing Complex Text</title>
+<!-- .XS -->
+<!-- (SN Drawing Complex Text  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Text</primary><secondary>drawing</secondary></indexterm>
+<indexterm><primary>Drawing</primary><secondary>text items</secondary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+To draw 8-bit characters in a given drawable, use
+<xref linkend='XDrawText' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XDrawText</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XDrawText'>
+<funcprototype>
+  <funcdef><function>XDrawText</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>int <parameter>x</parameter></paramdef>
+  <paramdef>int <parameter>y</parameter></paramdef>
+  <paramdef>XTextItem *<parameter>items</parameter></paramdef>
+  <paramdef>int <parameter>nitems</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, which are relative to the origin of the
+specified drawable and define the origin of the first character.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>items</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an array of text items.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nitems</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of text items in the array.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<!-- .sp -->
+To draw 2-byte characters in a given drawable, use
+<xref linkend='XDrawText16' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XDrawText16</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XDrawText16'>
+<funcprototype>
+  <funcdef><function>XDrawText16</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>int <parameter>x</parameter></paramdef>
+  <paramdef>int <parameter>y</parameter></paramdef>
+  <paramdef>XTextItem16 *<parameter>items</parameter></paramdef>
+  <paramdef>int <parameter>nitems</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, which are relative to the origin of the
+specified drawable and define the origin of the first character.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>items</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an array of text items.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nitems</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of text items in the array.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XDrawText16' xrefstyle='select: title'/>
+function is similar to
+<xref linkend='XDrawText' xrefstyle='select: title'/>
+except that it uses 2-byte or 16-bit characters.
+Both functions allow complex spacing and font shifts between counted strings.
+</para>
+<para>
+<!-- .LP -->
+Each text item is processed in turn.
+A font member other than 
+<symbol>None</symbol>
+in an item causes the font to be stored in the GC
+and used for subsequent text.  
+A text element delta specifies an additional change
+in the position along the x axis before the string is drawn. 
+The delta is always added to the character origin
+and is not dependent on any characteristics of the font.
+Each character image, as defined by the font in the GC, is treated as an
+additional mask for a fill operation on the drawable.
+The drawable is modified only where the font character has a bit set to 1.
+If a text item generates a
+<errorname>BadFont</errorname>
+error, the previous text items may have been drawn.
+</para>
+<para>
+<!-- .LP -->
+For fonts defined with linear indexing rather than 2-byte matrix indexing,
+each 
+<structname>XChar2b</structname>
+structure is interpreted as a 16-bit number with byte1 as the 
+most significant byte.
+</para>
+<para>
+<!-- .LP -->
+Both functions use these GC components:
+function, plane-mask, fill-style, font, subwindow-mode, 
+clip-x-origin, clip-y-origin, and clip-mask.
+They also use these GC mode-dependent components: 
+foreground, background, tile, stipple, tile-stipple-x-origin, 
+and tile-stipple-y-origin.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XDrawText' xrefstyle='select: title'/>
+and
+<xref linkend='XDrawText16' xrefstyle='select: title'/>
+can generate
+<errorname>BadDrawable</errorname>,
+<errorname>BadFont</errorname>,
+<errorname>BadGC</errorname>,
+and
+<errorname>BadMatch</errorname>
+errors.
+</para>
+</sect2>
+<sect2 id="Drawing_Text_Characters">
+<title>Drawing Text Characters</title>
+<!-- .XS -->
+<!-- (SN Drawing Text Characters  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Strings</primary><secondary>drawing</secondary></indexterm>
+<indexterm><primary>Drawing</primary><secondary>strings</secondary></indexterm>
+To draw 8-bit characters in a given drawable, use
+<xref linkend='XDrawString' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XDrawString</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XDrawString'>
+<funcprototype>
+  <funcdef><function>XDrawString</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>int <parameter>x</parameter></paramdef>
+  <paramdef>int <parameter>y</parameter></paramdef>
+  <paramdef>char *<parameter>string</parameter></paramdef>
+  <paramdef>int <parameter>length</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, which are relative to the origin of the
+specified drawable and define the origin of the first character.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>string</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the character string.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>length</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of characters in the string argument.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<!-- .sp -->
+To draw 2-byte characters in a given drawable, use
+<xref linkend='XDrawString16' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XDrawString16</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XDrawString16'>
+<funcprototype>
+  <funcdef><function>XDrawString16</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>int <parameter>x</parameter></paramdef>
+  <paramdef>int <parameter>y</parameter></paramdef>
+  <paramdef>XChar2b *<parameter>string</parameter></paramdef>
+  <paramdef>int <parameter>length</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, which are relative to the origin of the
+specified drawable and define the origin of the first character.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>string</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the character string.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>length</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of characters in the string argument.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Each character image, as defined by the font in the GC, is treated as an
+additional mask for a fill operation on the drawable.
+The drawable is modified only where the font character has a bit set to 1.
+For fonts defined with 2-byte matrix indexing
+and used with
+<xref linkend='XDrawString16' xrefstyle='select: title'/>,
+each byte is used as a byte2 with a byte1 of zero.
+</para>
+<para>
+<!-- .LP -->
+Both functions use these GC components: 
+function, plane-mask, fill-style, font, subwindow-mode, clip-x-origin, 
+clip-y-origin, and clip-mask.
+They also use these GC mode-dependent components: 
+foreground, background, tile, stipple, tile-stipple-x-origin, 
+and tile-stipple-y-origin.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XDrawString' xrefstyle='select: title'/>
+and
+<xref linkend='XDrawString16' xrefstyle='select: title'/>
+can generate
+<errorname>BadDrawable</errorname>,
+<errorname>BadGC</errorname>,
+and
+<errorname>BadMatch</errorname>
+errors.
+</para>
+</sect2>
+<sect2 id="Drawing_Image_Text_Characters">
+<title>Drawing Image Text Characters</title>
+<!-- .XS -->
+<!-- (SN Drawing Image Text Characters  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Image text</primary><secondary>drawing</secondary></indexterm>
+<indexterm><primary>Drawing</primary><secondary>image text</secondary></indexterm>
+Some applications, in particular terminal emulators, need to
+print image text in which both the foreground and background bits of
+each character are painted.
+This prevents annoying flicker on many displays.
+<indexterm><primary>XDrawImageString</primary></indexterm>
+<indexterm><primary>XDrawImageString16</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To draw 8-bit image text characters in a given drawable, use
+<xref linkend='XDrawImageString' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XDrawImageString</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XDrawImageString'>
+<funcprototype>
+  <funcdef><function>XDrawImageString</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>int <parameter>x</parameter></paramdef>
+  <paramdef>int <parameter>y</parameter></paramdef>
+  <paramdef>char *<parameter>string</parameter></paramdef>
+  <paramdef>int <parameter>length</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, which are relative to the origin of the
+specified drawable and define the origin of the first character.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>string</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the character string.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>length</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of characters in the string argument.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<!-- .sp -->
+To draw 2-byte image text characters in a given drawable, use
+<xref linkend='XDrawImageString16' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XDrawImageString16</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XDrawImageString16'>
+<funcprototype>
+  <funcdef><function>XDrawImageString16</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>GC <parameter>gc</parameter></paramdef>
+  <paramdef>int <parameter>x</parameter></paramdef>
+  <paramdef>int <parameter>y</parameter></paramdef>
+  <paramdef>XChar2b *<parameter>string</parameter></paramdef>
+  <paramdef>int <parameter>length</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, which are relative to the origin of the
+specified drawable and define the origin of the first character.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>string</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the character string.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>length</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of characters in the string argument.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XDrawImageString16' xrefstyle='select: title'/>
+function is similar to
+<xref linkend='XDrawImageString' xrefstyle='select: title'/>
+except that it uses 2-byte or 16-bit characters.
+Both functions also use both the foreground and background pixels 
+of the GC in the destination.
+</para>
+<para>
+<!-- .LP -->
+The effect is first to fill a
+destination rectangle with the background pixel defined in the GC and then
+to paint the text with the foreground pixel.
+The upper-left corner of the filled rectangle is at:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+[x, y - font-ascent]
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+The width is:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+overall-width
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+The height is:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+font-ascent + font-descent
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+The overall-width, font-ascent, and font-descent
+are as would be returned by 
+<xref linkend='XQueryTextExtents' xrefstyle='select: title'/>
+using gc and string.
+The function and fill-style defined in the GC are ignored for these functions. 
+The effective function is 
+<symbol>GXcopy</symbol>,
+and the effective fill-style is
+<symbol>FillSolid</symbol>.
+</para>
+<para>
+<!-- .LP -->
+For fonts defined with 2-byte matrix indexing
+and used with
+<xref linkend='XDrawImageString' xrefstyle='select: title'/>,
+each byte is used as a byte2 with a byte1 of zero.
+</para>
+<para>
+<!-- .LP -->
+Both functions use these GC components: 
+plane-mask, foreground, background, font, subwindow-mode, clip-x-origin, 
+clip-y-origin, and clip-mask.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XDrawImageString' xrefstyle='select: title'/>
+and
+<xref linkend='XDrawImageString16' xrefstyle='select: title'/>
+can generate
+<errorname>BadDrawable</errorname>,
+<errorname>BadGC</errorname>,
+and
+<errorname>BadMatch</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+</para>
+</sect2>
+</sect1>
+<sect1 id="Transferring_Images_between_Client_and_Server">
+<title>Transferring Images between Client and Server</title>
+<!-- .XS -->
+<!-- (SN Transferring Images between Client and Server  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to transfer images between a client 
+and the server.
+Because the server may require diverse data formats, 
+Xlib provides an image object that fully describes the data in memory 
+and that provides for basic operations on that data.  
+You should reference the data 
+through the image object rather than referencing the data directly.
+However, some implementations of the Xlib library may efficiently deal with 
+frequently used data formats by replacing
+functions in the procedure vector with special case functions.
+Supported operations include destroying the image, getting a pixel,
+storing a pixel, extracting a subimage of an image, and adding a constant
+to an image (see <link linkend="Manipulating_Images">section 16.8</link>).
+</para>
+<para>
+<!-- .LP -->
+All the image manipulation functions discussed in this section make use of 
+the 
+<structname>XImage</structname>
+structure,
+which describes an image as it exists in the client's memory.
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XImage</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 1i 3i -->
+<!-- .ta .5i 1i 3i -->
+typedef struct _XImage {
+     int width, height;         /* size of image */
+     int xoffset;               /* number of pixels offset in X direction */
+     int format;                /* XYBitmap, XYPixmap, ZPixmap */
+     char *data;                /* pointer to image data */
+     int byte_order;            /* data byte order, LSBFirst, MSBFirst */
+     int bitmap_unit;           /* quant. of scanline 8, 16, 32 */
+     int bitmap_bit_order;      /* LSBFirst, MSBFirst */
+     int bitmap_pad;            /* 8, 16, 32 either XY or ZPixmap */
+     int depth;                 /* depth of image */
+     int bytes_per_line;        /* accelerator to next scanline */
+     int bits_per_pixel;        /* bits per pixel (ZPixmap) */
+     unsigned long red_mask;    /* bits in z arrangement */
+     unsigned long green_mask;
+     unsigned long blue_mask;
+     XPointer obdata;           /* hook for the object routines to hang on */
+     struct funcs {             /* image manipulation routines */
+          struct _XImage *(*create_image)();
+          int             (*destroy_image)();
+          unsigned long   (*get_pixel)();
+          int             (*put_pixel)();
+          struct _XImage  *(*sub_image)();
+          int            (*add_pixel)();
+     } f;
+} XImage;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<!-- .sp -->
+To initialize the image manipulation routines of an image structure, use
+<xref linkend='XInitImage' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XInitImage</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XInitImage'>
+<funcprototype>
+  <funcdef>Status <function>XInitImage</function></funcdef>
+  <paramdef>XImage *<parameter>image</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ximage</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the image.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XInitImage' xrefstyle='select: title'/>
+function initializes the internal image manipulation routines of an
+image structure, based on the values of the various structure members.
+All fields other than the manipulation routines must already be initialized.
+If the bytes_per_line member is zero,
+<xref linkend='XInitImage' xrefstyle='select: title'/>
+will assume the image data is contiguous in memory and set the
+bytes_per_line member to an appropriate value based on the other
+members; otherwise, the value of bytes_per_line is not changed.
+All of the manipulation routines are initialized to functions
+that other Xlib image manipulation functions need to operate on the
+type of image specified by the rest of the structure.
+</para>
+<para>
+<!-- .LP -->
+This function must be called for any image constructed by the client
+before passing it to any other Xlib function.
+Image structures created or returned by Xlib do not need to be
+initialized in this fashion.
+</para>
+<para>
+<!-- .LP -->
+This function returns a nonzero status if initialization of the
+structure is successful.  It returns zero if it detected some error
+or inconsistency in the structure, in which case the image is not changed.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To combine an image with a rectangle of a drawable on the display,
+use
+<xref linkend='XPutImage' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XPutImage</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XPutImage'>
+<funcprototype>
+  <funcdef><function>XPutImage</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>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the GC.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>image</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the image you want combined with the rectangle. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>src_x</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the offset in X from the left edge of the image defined
+by the 
+<structname>XImage</structname>
+structure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>src_y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the offset in Y from the top edge of the image defined
+by the 
+<structname>XImage</structname>
+structure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>dest_x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>dest_y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, which are relative to the origin of the
+drawable and are the coordinates of the subimage.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the width and height of the subimage, which define the dimensions
+of the rectangle.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XPutImage' xrefstyle='select: title'/>
+function
+combines an image with a rectangle of the specified drawable.
+The section of the image defined by the src_x, src_y, width, and height 
+arguments is drawn on the specified part of the drawable.
+If 
+<symbol>XYBitmap</symbol>
+format is used, the depth of the image must be one,
+or a
+<errorname>BadMatch</errorname>
+error results.
+The foreground pixel in the GC defines the source for the one bits in the image,
+and the background pixel defines the source for the zero bits.
+For 
+<symbol>XYPixmap</symbol>
+and 
+<symbol>ZPixmap</symbol>,
+the depth of the image must match the depth of the drawable,
+or a
+<errorname>BadMatch</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+If the characteristics of the image (for example, byte_order and bitmap_unit)
+differ from what the server requires,
+<xref linkend='XPutImage' xrefstyle='select: title'/>
+automatically makes the appropriate
+conversions.
+</para>
+<para>
+<!-- .LP -->
+This function uses these GC components: 
+function, plane-mask, subwindow-mode, clip-x-origin, clip-y-origin, 
+and clip-mask.
+It also uses these GC mode-dependent components:
+foreground and background.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XPutImage' xrefstyle='select: title'/>
+can generate
+<errorname>BadDrawable</errorname>,
+<errorname>BadGC</errorname>,
+<errorname>BadMatch</errorname>,
+and
+<errorname>BadValue</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To return the contents of a rectangle in a given drawable on the display,
+use
+<xref linkend='XGetImage' xrefstyle='select: title'/>.
+This function specifically supports rudimentary screen dumps.
+</para>
+<indexterm significance="preferred"><primary>XGetImage</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetImage'>
+<funcprototype>
+  <funcdef>XImage *<function>XGetImage</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>int <parameter>x</parameter></paramdef>
+  <paramdef>int <parameter>y</parameter></paramdef>
+  <paramdef>unsigned int <parameter>width</parameter></paramdef>
+  <paramdef>unsigned int <parameter>height</parameter></paramdef>
+  <paramdef>unsigned long <parameter>plane_mask</parameter></paramdef>
+  <paramdef>int <parameter>format</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, which are relative to the origin of the
+drawable and define the upper-left corner of the rectangle.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the width and height of the subimage, which define the dimensions
+of the rectangle.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>plane_mask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the plane mask.
+<!-- .\" *** JIM: NEED MORE INFO FOR THIS. *** -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>format</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the format for the image.
+You can pass
+<symbol>XYPixmap</symbol>
+or 
+<symbol>ZPixmap</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGetImage' xrefstyle='select: title'/>
+function returns a pointer to an
+<structname>XImage</structname>
+structure.
+This structure provides you with the contents of the specified rectangle of
+the drawable in the format you specify.
+If the format argument is 
+<symbol>XYPixmap</symbol>,
+the image contains only the bit planes you passed to the plane_mask argument.
+If the plane_mask argument only requests a subset of the planes of the
+display, the depth of the returned image will be the number of planes
+requested.
+If the format argument is 
+<symbol>ZPixmap</symbol>,
+<xref linkend='XGetImage' xrefstyle='select: title'/>
+returns as zero the bits in all planes not 
+specified in the plane_mask argument.
+The function performs no range checking on the values in plane_mask and ignores
+extraneous bits.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetImage' xrefstyle='select: title'/>
+returns the depth of the image to the depth member of the
+<structname>XImage</structname>
+structure.
+The depth of the image is as specified when the drawable was created,
+except when getting a subset of the planes in 
+<symbol>XYPixmap</symbol>
+format, when the depth is given by the number of bits set to 1 in plane_mask.
+</para>
+<para>
+<!-- .LP -->
+If the drawable is a pixmap, 
+the given rectangle must be wholly contained within the pixmap, 
+or a
+<errorname>BadMatch</errorname>
+error results.
+If the drawable is a window, 
+the window must be viewable, 
+and it must be the case that if there were no inferiors or overlapping windows,
+the specified rectangle of the window would be fully visible on the screen
+and wholly contained within the outside edges of the window,
+or a
+<errorname>BadMatch</errorname>
+error results.
+Note that the borders of the window can be included and read with
+this request.
+If the window has backing-store, the backing-store contents are
+returned for regions of the window that are obscured by noninferior
+windows. 
+If the window does not have backing-store,
+the returned contents of such obscured regions are undefined.
+The returned contents of visible regions of inferiors
+of a different depth than the specified window's depth are also undefined.
+The pointer cursor image is not included in the returned contents.
+If a problem occurs,
+<xref linkend='XGetImage' xrefstyle='select: title'/>
+returns NULL.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetImage' xrefstyle='select: title'/>
+can generate
+<errorname>BadDrawable</errorname>,
+<errorname>BadMatch</errorname>,
+and
+<errorname>BadValue</errorname>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To copy the contents of a rectangle on the display
+to a location within a preexisting image structure, use
+<xref linkend='XGetSubImage' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetSubImage</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetSubImage'>
+<funcprototype>
+  <funcdef>XImage *<function>XGetSubImage</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Drawable <parameter>d</parameter></paramdef>
+  <paramdef>int <parameter>x</parameter></paramdef>
+  <paramdef>int <parameter>y</parameter></paramdef>
+  <paramdef>unsigned int <parameter>width</parameter></paramdef>
+  <paramdef>unsigned int <parameter>height</parameter></paramdef>
+  <paramdef>unsigned long <parameter>plane_mask</parameter></paramdef>
+  <paramdef>int <parameter>format</parameter></paramdef>
+  <paramdef>XImage *<parameter>dest_image</parameter></paramdef>
+  <paramdef>int <parameter>dest_x</parameter></paramdef>
+  <paramdef>int <parameter>dest_y</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>d</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, which are relative to the origin of the
+drawable and define the upper-left corner of the rectangle.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the width and height of the subimage, which define the dimensions
+of the rectangle.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>plane_mask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the plane mask.
+<!-- .\" *** JIM: NEED MORE INFO FOR THIS. *** -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>format</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the format for the image.
+You can pass
+<symbol>XYPixmap</symbol>
+or 
+<symbol>ZPixmap</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>dest_image</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the destination image.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>dest_x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>dest_y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates, which are relative to the origin of the
+destination rectangle, specify its upper-left corner, and determine where
+the subimage is placed in the destination image.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XGetSubImage' xrefstyle='select: title'/>
+function updates dest_image with the specified subimage in the same manner as 
+<xref linkend='XGetImage' xrefstyle='select: title'/>.
+If the format argument is 
+<symbol>XYPixmap</symbol>,
+the image contains only the bit planes you passed to the plane_mask argument.
+If the format argument is 
+<symbol>ZPixmap</symbol>,
+<xref linkend='XGetSubImage' xrefstyle='select: title'/>
+returns as zero the bits in all planes not 
+specified in the plane_mask argument.
+The function performs no range checking on the values in plane_mask and ignores
+extraneous bits.
+As a convenience,
+<xref linkend='XGetSubImage' xrefstyle='select: title'/>
+returns a pointer to the same
+<structname>XImage</structname>
+structure specified by dest_image.
+</para>
+<para>
+<!-- .LP -->
+The depth of the destination
+<structname>XImage</structname>
+structure must be the same as that of the drawable.
+If the specified subimage does not fit at the specified location
+on the destination image, the right and bottom edges are clipped.
+If the drawable is a pixmap,
+the given rectangle must be wholly contained within the pixmap,
+or a
+<errorname>BadMatch</errorname>
+error results.
+If the drawable is a window, 
+the window must be viewable, 
+and it must be the case that if there were no inferiors or overlapping windows,
+the specified rectangle of the window would be fully visible on the screen
+and wholly contained within the outside edges of the window,
+or a
+<errorname>BadMatch</errorname>
+error results.
+If the window has backing-store, 
+then the backing-store contents are returned for regions of the window 
+that are obscured by noninferior windows. 
+If the window does not have backing-store, 
+the returned contents of such obscured regions are undefined.
+The returned contents of visible regions of inferiors
+of a different depth than the specified window's depth are also undefined.
+If a problem occurs,
+<xref linkend='XGetSubImage' xrefstyle='select: title'/>
+returns NULL.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetSubImage' xrefstyle='select: title'/>
+can generate
+<errorname>BadDrawable</errorname>,
+<errorname>BadGC</errorname>,
+<errorname>BadMatch</errorname>,
+and
+<errorname>BadValue</errorname>
+errors.
+<!-- .bp -->
+
+
+</para>
+</sect1>
+</chapter>
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH09.xml
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH09.xml	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH09.xml	(revision 5)
@@ -0,0 +1,2011 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+	  "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+<chapter id='Window_and_Session_Manager_Functions'>
+<title>Window and Session Manager Functions</title>
+
+<para>
+Although it is difficult to categorize functions as exclusively for an application,
+a window manager, or a session manager, the functions in this chapter are most
+often used by window managers and session managers. It is not expected that
+these functions will be used by most application programs. Xlib provides
+management functions to:
+</para>
+
+<itemizedlist>
+  <listitem><para>Change the parent of a window</para></listitem>
+  <listitem><para>Control the lifetime of a window</para></listitem>
+  <listitem><para>Manage installed colormaps</para></listitem>
+  <listitem><para>Set and retrieve the font search path</para></listitem>
+  <listitem><para>Grab the server</para></listitem>
+  <listitem><para>Kill a client</para></listitem>
+  <listitem><para>Control the screen saver</para></listitem>
+  <listitem><para>Control host access</para></listitem>
+</itemizedlist>
+
+<sect1 id="Changing_the_Parent_of_a_Window">
+<title>Changing the Parent of a Window</title>
+<!-- .XS -->
+<!-- (SN Changing the Parent of a Window  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To change a window's parent to another window on the same screen, use
+<xref linkend='XReparentWindow' xrefstyle='select: title'/>.
+There is no way to move a window between screens.
+</para>
+<indexterm significance="preferred"><primary>XReparentWindow</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XReparentWindow'>
+<funcprototype>
+  <funcdef><function>XReparentWindow</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>Window <parameter>parent</parameter></paramdef>
+  <paramdef>int <parameter>x</parameter></paramdef>
+  <paramdef>int <parameter>y</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>parent</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the parent window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates of the position in the new parent window.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+If the specified window is mapped,
+<xref linkend='XReparentWindow' xrefstyle='select: title'/>
+automatically performs an
+<systemitem>UnmapWindow</systemitem>
+request on it, removes it from its current position in the hierarchy,
+and inserts it as the child of the specified parent.
+The window is placed in the stacking order on top with respect to
+sibling windows.
+</para>
+<para>
+<!-- .LP -->
+After reparenting the specified window,
+<xref linkend='XReparentWindow' xrefstyle='select: title'/>
+causes the X server to generate a
+<symbol>ReparentNotify</symbol>
+event.
+The override_redirect member returned in this event is
+set to the window's corresponding attribute.
+Window manager clients usually should ignore this window if this member
+is set to
+<symbol>True</symbol>.
+Finally, if the specified window was originally mapped,
+the X server automatically performs a
+<systemitem>MapWindow</systemitem>
+request on it.
+</para>
+<para>
+<!-- .LP -->
+The X server performs normal exposure processing on formerly obscured
+windows.
+The X server might not generate 
+<symbol>Expose</symbol>
+events for regions from the initial
+<systemitem>UnmapWindow</systemitem>
+request that are immediately obscured by the final
+<systemitem>MapWindow</systemitem>
+request.
+A
+<errorname>BadMatch</errorname>
+error results if:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+The new parent window is not on the same screen as
+the old parent window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The new parent window is the specified window or an inferior of the
+specified window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The new parent is
+<symbol>InputOnly</symbol>,
+and the window is not.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The specified window has a
+<symbol>ParentRelative</symbol>
+background, and the new parent window is not the same depth as the
+specified window.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+<xref linkend='XReparentWindow' xrefstyle='select: title'/>
+can generate
+<errorname>BadMatch</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+</sect1>
+<sect1 id="Controlling_the_Lifetime_of_a_Window">
+<title>Controlling the Lifetime of a Window</title>
+<!-- .XS -->
+<!-- (SN Controlling the Lifetime of a Window  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The save-set of a client is a list of other clients' windows that,
+if they are inferiors of one of the client's windows at connection close,
+should not be destroyed and should be remapped if they are unmapped.
+For further information about close-connection processing,
+see <link linkend='Using_X_Server_Connection_Close_Operations'>section 2.6</link>.
+To allow an application's window to survive when a window manager that
+has reparented a window fails,
+Xlib provides the save-set functions that you can 
+use to control the longevity of subwindows
+that are normally destroyed when the parent is destroyed.
+For example, a window manager that wants to add decoration
+to a window by adding a frame might reparent an application's
+window. 
+When the frame is destroyed,
+the application's window should not be destroyed 
+but be returned to its previous place in the window hierarchy.
+</para>
+<para>
+<!-- .LP -->
+The X server automatically removes windows from the save-set
+when they are destroyed.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To add or remove a window from the client's save-set, use
+<xref linkend='XChangeSaveSet' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XChangeSaveSet</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XChangeSaveSet'>
+<funcprototype>
+  <funcdef><function>XChangeSaveSet</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>int <parameter>change_mode</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window that you want to add to or delete from the client's
+save-set.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>change_mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the mode.
+You can pass
+<symbol>SetModeInsert</symbol>
+or
+<symbol>SetModeDelete</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Depending on the specified mode,
+<xref linkend='XChangeSaveSet' xrefstyle='select: title'/>
+either inserts or deletes the specified window from the client's save-set. 
+The specified window must have been created by some other client,
+or a
+<errorname>BadMatch</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XChangeSaveSet' xrefstyle='select: title'/>
+can generate
+<errorname>BadMatch</errorname>,
+<errorname>BadValue</errorname>,
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To add a window to the client's save-set, use
+<xref linkend='XAddToSaveSet' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XAddToSaveSet</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XAddToSaveSet'>
+<funcprototype>
+  <funcdef><function>XAddToSaveSet</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window that you want to add to the client's save-set.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XAddToSaveSet' xrefstyle='select: title'/>
+function adds the specified window to the client's save-set.
+The specified window must have been created by some other client,
+or a
+<errorname>BadMatch</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XAddToSaveSet' xrefstyle='select: title'/>
+can generate
+<errorname>BadMatch</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To remove a window from the client's save-set, use
+<xref linkend='XRemoveFromSaveSet' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XRemoveFromSaveSet</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XRemoveFromSaveSet'>
+<funcprototype>
+  <funcdef><function>XRemoveFromSaveSet</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window that you want to delete from the client's save-set.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XRemoveFromSaveSet' xrefstyle='select: title'/>
+function removes the specified window from the client's save-set.
+The specified window must have been created by some other client,
+or a
+<errorname>BadMatch</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XRemoveFromSaveSet' xrefstyle='select: title'/>
+can generate
+<errorname>BadMatch</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+</sect1>
+<sect1 id="Managing_Installed_Colormaps">
+<title>Managing Installed Colormaps</title>
+<!-- .XS -->
+<!-- (SN Managing Installed Colormaps -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The X server maintains a list of installed colormaps.
+Windows using these colormaps are guaranteed to display with
+correct colors; windows using other colormaps may or may not display
+with correct colors.
+Xlib provides functions that you can use to install a colormap, 
+uninstall a colormap, and obtain a list of installed colormaps.
+</para>
+<para>
+<!-- .LP -->
+At any time,
+there is a subset of the installed maps that is viewed as an ordered list
+and is called the required list.
+The length of the required list is at most M,
+where M is the minimum number of installed colormaps specified for the screen
+in the connection setup.
+The required list is maintained as follows.
+When a colormap is specified to
+<xref linkend='XInstallColormap' xrefstyle='select: title'/>,
+it is added to the head of the list;
+the list is truncated at the tail, if necessary, to keep its length to 
+at most M.
+When a colormap is specified to
+<xref linkend='XUninstallColormap' xrefstyle='select: title'/>
+and it is in the required list,
+it is removed from the list.
+A colormap is not added to the required list when it is implicitly installed
+by the X server,
+and the X server cannot implicitly uninstall a colormap that is in the
+required list.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To install a colormap, use
+<xref linkend='XInstallColormap' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XInstallColormap</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XInstallColormap'>
+<funcprototype>
+  <funcdef><function>XInstallColormap</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XInstallColormap' xrefstyle='select: title'/>
+function installs the specified colormap for its associated screen.
+All windows associated with this colormap immediately display with
+true colors.
+You associated the windows with this colormap when you created them by calling
+<xref linkend='XCreateWindow' xrefstyle='select: title'/>,
+<xref linkend='XCreateSimpleWindow' xrefstyle='select: title'/>,
+<xref linkend='XChangeWindowAttributes' xrefstyle='select: title'/>,
+or
+<xref linkend='XSetWindowColormap' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+If the specified colormap is not already an installed colormap, 
+the X server generates a
+<symbol>ColormapNotify</symbol>
+event on each window that has that colormap.
+In addition, for every other colormap that is installed as 
+a result of a call to
+<xref linkend='XInstallColormap' xrefstyle='select: title'/>,
+the X server generates a
+<symbol>ColormapNotify</symbol>
+event on each window that has that colormap.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XInstallColormap' xrefstyle='select: title'/>
+can generate a
+<errorname>BadColor</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To uninstall a colormap, use
+<xref linkend='XUninstallColormap' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XUninstallColormap</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XUninstallColormap'>
+<funcprototype>
+  <funcdef><function>XUninstallColormap</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Colormap <parameter>colormap</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XUninstallColormap' xrefstyle='select: title'/>
+function removes the specified colormap from the required
+list for its screen.
+As a result,
+the specified colormap might be uninstalled, 
+and the X server might implicitly install or uninstall additional colormaps.
+Which colormaps get installed or uninstalled is server dependent
+except that the required list must remain installed.
+</para>
+<para>
+<!-- .LP -->
+If the specified colormap becomes uninstalled, 
+the X server generates a
+<symbol>ColormapNotify</symbol>
+event on each window that has that colormap.
+In addition, for every other colormap that is installed or uninstalled as a 
+result of a call to 
+<xref linkend='XUninstallColormap' xrefstyle='select: title'/>,
+the X server generates a
+<symbol>ColormapNotify</symbol>
+event on each window that has that colormap.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XUninstallColormap' xrefstyle='select: title'/>
+can generate a
+<errorname>BadColor</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To obtain a list of the currently installed colormaps for a given screen, use
+<xref linkend='XListInstalledColormaps' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XListInstalledColormaps</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XListInstalledColormaps'>
+<funcprototype>
+  <funcdef>Colormap *<function>XListInstalledColormaps</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>int *<parameter>num_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window that determines the screen.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of currently installed colormaps.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XListInstalledColormaps' xrefstyle='select: title'/>
+function returns a list of the currently installed colormaps for the screen 
+of the specified window.
+The order of the colormaps in the list is not significant
+and is no explicit indication of the required list.
+When the allocated list is no longer needed,
+free it by using
+<xref linkend='XFree' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XListInstalledColormaps' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+</sect1>
+<sect1 id="Setting_and_Retrieving_the_Font_Search_Path">
+<title>Setting and Retrieving the Font Search Path</title>
+<!-- .XS -->
+<!-- (SN Setting and Retrieving the Font Search Path  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The set of fonts available from a server depends on a font
+search path.  Xlib provides functions to set and retrieve the
+search path for a server.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To set the font search path, use
+<xref linkend='XSetFontPath' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetFontPath</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetFontPath'>
+<funcprototype>
+  <funcdef><function>XSetFontPath</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>char **<parameter>directories</parameter></paramdef>
+  <paramdef>int <parameter>ndirs</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>directories</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the directory path used to look for a font.
+Setting the path to the empty list restores the default path defined
+for the X server.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ndirs</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of directories in the path.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XSetFontPath' xrefstyle='select: title'/>
+function defines the directory search path for font lookup.
+There is only one search path per X server, not one per client.
+The encoding and interpretation of the strings are implementation-dependent,
+but typically they specify directories or font servers to be searched 
+in the order listed.
+An X server is permitted to cache font information internally;
+for example, it might cache an entire font from a file and not
+check on subsequent opens of that font to see if the underlying
+font file has changed.
+However,
+when the font path is changed,
+the X server is guaranteed to flush all cached information about fonts 
+for which there currently are no explicit resource IDs allocated.
+The meaning of an error from this request is implementation-dependent.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetFontPath' xrefstyle='select: title'/>
+can generate a
+<errorname>BadValue</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To get the current font search path, use
+<xref linkend='XGetFontPath' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetFontPath</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetFontPath'>
+<funcprototype>
+  <funcdef>char **<function>XGetFontPath</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int *<parameter>npaths_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>npaths_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of strings in the font path array.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGetFontPath' xrefstyle='select: title'/>
+function allocates and returns an array of strings containing the search path.
+The contents of these strings are implementation-dependent
+and are not intended to be interpreted by client applications.
+When it is no longer needed,
+the data in the font path should be freed by using
+<xref linkend='XFreeFontPath' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To free data returned by
+<xref linkend='XGetFontPath' xrefstyle='select: title'/>,
+use
+<xref linkend='XFreeFontPath' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XFreeFontPath</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XFreeFontPath'>
+<funcprototype>
+  <funcdef><function>XFreeFontPath</function></funcdef>
+  <paramdef>char **<parameter>list</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>list</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the array of strings you want to free.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XFreeFontPath' xrefstyle='select: title'/>
+function
+frees the data allocated by
+<xref linkend='XGetFontPath' xrefstyle='select: title'/>.
+</para>
+</sect1>
+<sect1 id='Grabbing_the_Server'>
+<title>Grabbing the Server</title>
+<!-- .XS -->
+<!-- (SN Grabbing the Server  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to grab and ungrab the server.
+These functions can be used to control processing of output on other
+connections by the window system server.
+While the server is grabbed,
+no processing of requests or close downs on any other connection will occur.
+A client closing its connection automatically ungrabs the server.
+<indexterm><primary>Menus</primary></indexterm>
+<indexterm><primary>Window</primary><secondary>managers</secondary></indexterm>
+Although grabbing the server is highly discouraged, it is sometimes necessary.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To grab the server, use
+<xref linkend='XGrabServer' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Server</primary><secondary>grabbing</secondary></indexterm>
+<indexterm><primary>Grabbing</primary><secondary>server</secondary></indexterm>
+<indexterm significance="preferred"><primary>XGrabServer</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGrabServer'>
+<funcprototype>
+  <funcdef><function>XGrabServer</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGrabServer' xrefstyle='select: title'/>
+function disables processing of requests and close downs on all other 
+connections than the one this request arrived on.
+You should not grab the X server any more than is absolutely necessary.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To ungrab the server, use
+<xref linkend='XUngrabServer' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XUngrabServer</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XUngrabServer'>
+<funcprototype>
+  <funcdef><function>XUngrabServer</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XUngrabServer' xrefstyle='select: title'/>
+function restarts processing of requests and close downs on other connections.
+You should avoid grabbing the X server as much as possible.
+</para>
+</sect1>
+<sect1 id="Killing_Clients">
+<title>Killing Clients</title>
+<!-- .XS -->
+<!-- (SN Killing Clients  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides a function to cause the connection to
+a client to be closed and its resources to be destroyed.
+To destroy a client, use
+<xref linkend='XKillClient' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XKillClient</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XKillClient'>
+<funcprototype>
+  <funcdef><function>XKillClient</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XID <parameter>resource</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>resource</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies any resource associated with the client that you want to destroy or
+<symbol>AllTemporary</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XKillClient' xrefstyle='select: title'/>
+function
+forces a close down of the client
+that created the resource
+if a valid resource is specified.
+If the client has already terminated in
+either 
+<symbol>RetainPermanent</symbol>
+or 
+<symbol>RetainTemporary</symbol>
+mode, all of the client's
+resources are destroyed.
+If 
+<symbol>AllTemporary</symbol>
+is specified, the resources of all clients that have terminated in
+<symbol>RetainTemporary</symbol>
+are destroyed (see <link linkend="Closing_the_Display">section 2.5</link>).
+This permits implementation of window manager facilities that aid debugging.
+A client can set its close-down mode to
+<symbol>RetainTemporary</symbol>.
+If the client then crashes,
+its windows would not be destroyed. 
+The programmer can then inspect the application's window tree 
+and use the window manager to destroy the zombie windows.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XKillClient' xrefstyle='select: title'/>
+can generate a
+<errorname>BadValue</errorname>
+error.
+</para>
+</sect1>
+<sect1 id='Controlling_the_Screen_Saver'>
+<title>Controlling the Screen Saver</title>
+<!-- .XS -->
+<!-- (SN Controlling the Screen Saver  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to set or reset the mode 
+of the screen saver, to force or activate the screen saver,
+or to obtain the current screen saver values.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To set the screen saver mode, use
+<xref linkend='XSetScreenSaver' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetScreenSaver</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetScreenSaver'>
+<funcprototype>
+  <funcdef><function>XSetScreenSaver</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>timeout</parameter></paramdef>
+  <paramdef>int <parameter>interval</parameter></paramdef>
+  <paramdef>int <parameter>prefer_blanking</parameter></paramdef>
+  <paramdef>int <parameter>allow_exposures</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>timeout</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the timeout, in seconds, until the screen saver turns on.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>interval</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the interval, in seconds, between screen saver alterations.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>prefer_blanking</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies how to enable screen blanking.
+You can pass
+<symbol>DontPreferBlanking</symbol>,
+<symbol>PreferBlanking</symbol>,
+or
+<symbol>DefaultBlanking</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>allow_exposures</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the screen save control values.
+You can pass
+<symbol>DontAllowExposures</symbol>,
+<symbol>AllowExposures</symbol>,
+or
+<symbol>DefaultExposures</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Timeout and interval are specified in seconds. 
+A timeout of 0 disables the screen saver 
+(but an activated screen saver is not deactivated),
+and a timeout of &minus;1 restores the default.
+Other negative values generate a
+<errorname>BadValue</errorname>
+error.
+If the timeout value is nonzero, 
+<xref linkend='XSetScreenSaver' xrefstyle='select: title'/>
+enables the screen saver.
+An interval of 0 disables the random-pattern motion.
+If no input from devices (keyboard, mouse, and so on) is generated 
+for the specified number of timeout seconds once the screen saver is enabled,
+the screen saver is activated.
+</para>
+<para>
+<!-- .LP -->
+For each screen, 
+if blanking is preferred and the hardware supports video blanking, 
+the screen simply goes blank.  
+Otherwise, if either exposures are allowed or the screen can be regenerated 
+without sending 
+<symbol>Expose</symbol>
+events to clients, 
+the screen is tiled with the root window background tile randomly 
+re-origined each interval seconds.
+Otherwise, the screens' state do not change, 
+and the screen saver is not activated.
+The screen saver is deactivated,
+and all screen states are restored at the next
+keyboard or pointer input or at the next call to
+<xref linkend='XForceScreenSaver' xrefstyle='select: title'/>
+with mode
+<symbol>ScreenSaverReset</symbol>.
+</para>
+<para>
+<!-- .LP -->
+If the server-dependent screen saver method supports periodic change,
+the interval argument serves as a hint about how long the change period
+should be, and zero hints that no periodic change should be made.
+Examples of ways to change the screen include scrambling the colormap
+periodically, moving an icon image around the screen periodically, or tiling
+the screen with the root window background tile, randomly re-origined
+periodically.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetScreenSaver' xrefstyle='select: title'/>
+can generate a
+<errorname>BadValue</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To force the screen saver on or off, use
+<xref linkend='XForceScreenSaver' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XForceScreenSaver</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XForceScreenSaver'>
+<funcprototype>
+  <funcdef><function>XForceScreenSaver</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>mode</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the mode that is to be applied.
+You can pass
+<symbol>ScreenSaverActive</symbol>
+or
+<symbol>ScreenSaverReset</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+If the specified mode is 
+<symbol>ScreenSaverActive</symbol>
+and the screen saver currently is deactivated,
+<xref linkend='XForceScreenSaver' xrefstyle='select: title'/>
+activates the screen saver even if the screen saver had been disabled
+with a timeout of zero.
+If the specified mode is 
+<symbol>ScreenSaverReset</symbol>
+and the screen saver currently is enabled,
+<xref linkend='XForceScreenSaver' xrefstyle='select: title'/>
+deactivates the screen saver if it was activated,
+and the activation timer is reset to its initial state 
+(as if device input had been received).
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XForceScreenSaver' xrefstyle='select: title'/>
+can generate a
+<errorname>BadValue</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To activate the screen saver, use
+<xref linkend='XActivateScreenSaver' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XActivateScreenSaver</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XActivateScreenSaver'>
+<funcprototype>
+  <funcdef><function>XActivateScreenSaver</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<!-- .sp -->
+To reset the screen saver, use
+<xref linkend='XResetScreenSaver' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XResetScreenSaver</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XResetScreenSaver'>
+<funcprototype>
+  <funcdef><function>XResetScreenSaver</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<!-- .sp -->
+To get the current screen saver values, use
+<xref linkend='XGetScreenSaver' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetScreenSaver</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetScreenSaver'>
+<funcprototype>
+  <funcdef><function>XGetScreenSaver</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int *<parameter>timeout_return</parameter></paramdef>
+  <paramdef>int *<parameter>interval_return</parameter></paramdef>
+  <paramdef>int *<parameter>prefer_blanking_return</parameter></paramdef>
+  <paramdef>int *<parameter>allow_exposures_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>timeout_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the timeout, in seconds, until the screen saver turns on.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>interval_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the interval between screen saver invocations.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>prefer_blanking_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the current screen blanking preference
+(<symbol>DontPreferBlanking</symbol>,
+<symbol>PreferBlanking</symbol>,
+or
+<symbol>DefaultBlanking</symbol>).
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>allow_exposures_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the current screen save control value
+(<symbol>DontAllowExposures</symbol>,
+<symbol>AllowExposures</symbol>,
+or
+<symbol>DefaultExposures</symbol>).
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+</para>
+</sect1>
+<sect1 id="Controlling_Host_Access">
+<title>Controlling Host Access</title>
+<!-- .XS -->
+<!-- (SN Controlling Host Access  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+This section discusses how to:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Add, get, or remove hosts from the access control list
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Change, enable, or disable access
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+<indexterm><primary>Access control list</primary></indexterm>
+<indexterm><primary>Authentication</primary></indexterm>
+X does not provide any protection on a per-window basis.
+If you find out the resource ID of a resource, you can manipulate it.
+To provide some minimal level of protection, however,
+connections are permitted only from machines you trust.
+This is adequate on single-user workstations but obviously
+breaks down on timesharing machines.
+Although provisions exist in the X protocol for proper connection
+authentication, the lack of a standard authentication server
+leaves host-level access control as the only common mechanism.
+</para>
+<para>
+<!-- .LP -->
+<indexterm><primary>Default Protection</primary></indexterm>
+The initial set of hosts allowed to open connections typically consists of:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+The host the window system is running on.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+On <acronym>POSIX</acronym>-conformant systems, each host listed in the
+<filename>/etc/X<replaceable>?</replaceable>.hosts</filename>
+file.
+The ? indicates the number of the
+display.
+<indexterm><primary>Files</primary><secondary><filename>/etc/X<replaceable>?</replaceable>.hosts</filename></secondary></indexterm>
+This file should consist of host names separated by newlines.
+DECnet nodes must terminate in :: to distinguish them from Internet hosts.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+If a host is not in the access control list when the access control 
+mechanism is enabled and if the host attempts to establish a connection,
+the server refuses the connection.
+To change the access list,
+the client must reside on the same host as the server and/or must
+have been granted permission in the initial authorization at connection
+setup.
+</para>
+<para>
+<!-- .LP -->
+Servers also can implement other access control policies in addition to
+or in place of this host access facility.
+For further information about other access control implementations,
+see <citetitle>X Window System Protocol</citetitle>.
+</para>
+<sect2 id="Adding_Getting_or_Removing_Hosts">
+<title>Adding, Getting, or Removing Hosts</title>
+<!-- .XS -->
+<!-- (SN Adding, Getting, or Removing Hosts  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to add, get, or remove hosts
+from the access control list.
+All the host access control functions use the 
+<structname>XHostAddress</structname>
+structure, which contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XHostAddress</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int family;        /* for example FamilyInternet */
+     int length;        /* length of address, in bytes */
+     char *address;     /* pointer to where to find the address */
+} XHostAddress;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The family member specifies which protocol address family to use 
+(for example, <acronym>TCP</acronym>/<acronym>IP</acronym> or DECnet) and can be
+<symbol>FamilyInternet</symbol>,
+<symbol>FamilyInternet6</symbol>,
+<symbol>FamilyServerInterpreted</symbol>,
+<symbol>FamilyDECnet</symbol>,
+or
+<symbol>FamilyChaos</symbol>.
+The length member specifies the length of the address in bytes.
+The address member specifies a pointer to the address.
+</para>
+<para>
+<!-- .LP -->
+For <acronym>TCP</acronym>/<acronym>IP</acronym>, the address should be in network byte order.
+For <acronym>IP</acronym> version 4 addresses, the family should be FamilyInternet
+and the length should be 4 bytes.  For <acronym>IP</acronym> version 6 addresses, the
+family should be FamilyInternet6 and the length should be 16 bytes.
+</para>
+<para>
+<!-- .LP -->
+For the DECnet family, 
+the server performs no automatic swapping on the address bytes.
+A Phase IV address is 2 bytes long.
+The first byte contains the least significant 8 bits of the node number.
+The second byte contains the most significant 2 bits of the
+node number in the least significant 2 bits of the byte
+and the area in the most significant 6 bits of the byte.
+</para>
+<para>
+<!-- .LP -->
+For the ServerInterpreted family, the length is ignored and the address 
+member is a pointer to a 
+<structname>XServerInterpretedAddress</structname>
+structure, which contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XServerInterpretedAddress</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int typelength;     /* length of type string, in bytes */
+     int valuelength;    /* length of value string, in bytes */
+     char *type;         /* pointer to where to find the type string */
+     char *value;        /* pointer to where to find the address */
+} XServerInterpretedAddress;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The type and value members point to strings representing the type and value of
+the server interpreted entry.  These strings may not be NULL-terminated so care
+should be used when accessing them.  The typelength and valuelength members
+specify the length in byte of the type and value strings.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To add a single host, use
+<xref linkend='XAddHost' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XAddHost</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XAddHost'>
+<funcprototype>
+  <funcdef><function>XAddHost</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XHostAddress *<parameter>host</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>host</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the host that is to be added.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XAddHost' xrefstyle='select: title'/>
+function adds the specified host to the access control list for that display.
+The server must be on the same host as the client issuing the command, or a
+<errorname>BadAccess</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XAddHost' xrefstyle='select: title'/>
+can generate
+<errorname>BadAccess</errorname>
+and
+<errorname>BadValue</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To add multiple hosts at one time, use
+<xref linkend='XAddHosts' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XAddHosts</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XAddHosts'>
+<funcprototype>
+  <funcdef><function>XAddHosts</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XHostAddress *<parameter>hosts</parameter></paramdef>
+  <paramdef>int <parameter>num_hosts</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>hosts</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies each host that is to be added.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_hosts</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of hosts.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XAddHosts' xrefstyle='select: title'/>
+function adds each specified host to the access control list for that display.
+The server must be on the same host as the client issuing the command, or a
+<errorname>BadAccess</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XAddHosts' xrefstyle='select: title'/>
+can generate
+<errorname>BadAccess</errorname>
+and
+<errorname>BadValue</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To obtain a host list, use
+<xref linkend='XListHosts' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XListHosts</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XListHosts'>
+<funcprototype>
+  <funcdef>XHostAddress *<function>XListHosts</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int *<parameter>nhosts_return</parameter></paramdef>
+  <paramdef>Bool *<parameter>state_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>nhosts_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of hosts currently in the access control list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>state_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the state of the access control.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XListHosts' xrefstyle='select: title'/>
+function returns the current access control list as well as whether the use 
+of the list at connection setup was enabled or disabled.
+<xref linkend='XListHosts' xrefstyle='select: title'/>
+allows a program to find out what machines can make connections.
+It also returns a pointer to a list of host structures that
+were allocated by the function. 
+When no longer needed,
+this memory should be freed by calling
+<xref linkend='XFree' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To remove a single host, use
+<xref linkend='XRemoveHost' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XRemoveHost</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XRemoveHost'>
+<funcprototype>
+  <funcdef><function>XRemoveHost</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XHostAddress *<parameter>host</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>host</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the host that is to be removed.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XRemoveHost' xrefstyle='select: title'/>
+function removes the specified host from the access control list 
+for that display.
+The server must be on the same host as the client process, or a
+<errorname>BadAccess</errorname>
+error results.
+If you remove your machine from the access list,
+you can no longer connect to that server,
+and this operation cannot be reversed unless you reset the server.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XRemoveHost' xrefstyle='select: title'/>
+can generate
+<errorname>BadAccess</errorname>
+and
+<errorname>BadValue</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To remove multiple hosts at one time, use
+<xref linkend='XRemoveHosts' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XRemoveHosts</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XRemoveHosts'>
+<funcprototype>
+  <funcdef><function>XRemoveHosts</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XHostAddress *<parameter>hosts</parameter></paramdef>
+  <paramdef>int <parameter>num_hosts</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>hosts</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies each host that is to be removed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_hosts</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of hosts.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XRemoveHosts' xrefstyle='select: title'/>
+function removes each specified host from the access control list for that 
+display.  
+The X server must be on the same host as the client process, or a
+<errorname>BadAccess</errorname>
+error results.
+If you remove your machine from the access list, 
+you can no longer connect to that server,
+and this operation cannot be reversed unless you reset the server.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XRemoveHosts' xrefstyle='select: title'/>
+can generate
+<errorname>BadAccess</errorname>
+and
+<errorname>BadValue</errorname>
+errors.
+</para>
+</sect2>
+<sect2 id="Changing_Enabling_or_Disabling_Access_Control">
+<title>Changing, Enabling, or Disabling Access Control</title>
+<!-- .XS -->
+<!-- (SN Changing, Enabling, or Disabling Access Control  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to enable, disable, 
+or change access control.
+</para>
+<para>
+<!-- .LP -->
+For these functions to execute successfully,
+the client application must reside on the same host as the X server
+and/or have been given permission in the initial authorization
+at connection setup.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To change access control, use
+<xref linkend='XSetAccessControl' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetAccessControl</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetAccessControl'>
+<funcprototype>
+  <funcdef><function>XSetAccessControl</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>mode</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the mode.
+You can pass
+<symbol>EnableAccess</symbol>
+or
+<symbol>DisableAccess</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XSetAccessControl' xrefstyle='select: title'/>
+function either enables or disables the use of the access control list 
+at each connection setup.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetAccessControl' xrefstyle='select: title'/>
+can generate
+<errorname>BadAccess</errorname>
+and
+<errorname>BadValue</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To enable access control, use
+<xref linkend='XEnableAccessControl' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XEnableAccessControl</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XEnableAccessControl'>
+<funcprototype>
+  <funcdef><function>XEnableAccessControl</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XEnableAccessControl' xrefstyle='select: title'/>
+function enables the use of the access control list at each connection setup.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XEnableAccessControl' xrefstyle='select: title'/>
+can generate a
+<errorname>BadAccess</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To disable access control, use
+<xref linkend='XDisableAccessControl' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XDisableAccessControl</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XDisableAccessControl'>
+<funcprototype>
+  <funcdef><function>XDisableAccessControl</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XDisableAccessControl' xrefstyle='select: title'/>
+function disables the use of the access control list at each connection setup.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XDisableAccessControl' xrefstyle='select: title'/>
+can generate a
+<errorname>BadAccess</errorname>
+error.
+<!-- .bp -->
+
+</para>
+</sect2>
+</sect1>
+</chapter>
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH10.xml
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH10.xml	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH10.xml	(revision 5)
@@ -0,0 +1,4719 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+	  "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+<chapter id='Events'>
+<title>Events</title>
+
+<para>
+A client application communicates with the X server through the connection you establish with
+the XOpenDisplay function. A client application sends requests to the X server over this
+connection. These requests are made by the Xlib functions that are called in the client application.
+Many Xlib functions cause the X server to generate events, and the user’s typing or moving the
+pointer can generate events asynchronously. The X server returns events to the client on the same
+connection.
+</para>
+<para>
+This chapter discusses the following topics associated with events:
+</para>
+
+<itemizedlist>
+  <listitem><para>Event types</para></listitem>
+  <listitem><para>Event structures</para></listitem>
+  <listitem><para>Event masks</para></listitem>
+  <listitem><para>Event processing</para></listitem>
+</itemizedlist>
+
+<para>
+Functions for handling events are dealt with in
+<link linkend='Event_Handling_Functions'>the next chapter</link>.
+</para>
+
+<sect1 id="Event_Types">
+<title>Event Types</title>
+<!-- .XS -->
+<!-- (SN Event Types  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Event</primary><secondary>types</secondary></indexterm>
+An event is data generated asynchronously by the X server as a result of some 
+device activity or as side effects of a request sent by an Xlib function.
+<indexterm><primary>Event</primary></indexterm>
+Device-related events propagate from the source window to ancestor windows
+until some client application has selected that event type 
+or until the event is explicitly discarded.
+The X server generally sends an event to a client application
+only if the client has specifically asked to be informed of that event type, 
+typically by setting the event-mask attribute of the window.
+The mask can also be set when you create a window
+or by changing the window's
+event-mask.
+You can also mask out events that would propagate to ancestor windows
+by manipulating the
+do-not-propagate mask of the window's attributes.
+However,
+<symbol>MappingNotify</symbol>
+events are always sent to all clients.
+<indexterm><primary>Input Control</primary></indexterm>
+<indexterm><primary>Output Control</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+An event type describes a specific event generated by the X server.
+For each event type, 
+a corresponding constant name is defined in
+<filename class="headerfile">&lt;X11/X.h&gt;</filename>,
+<indexterm type="file"><primary><filename class="headerfile">X11/X.h</filename></primary></indexterm>
+<indexterm><primary>Files</primary><secondary><filename class="headerfile">&lt;X11/X.h&gt;</filename></secondary></indexterm>
+<indexterm><primary>Headers</primary><secondary><filename class="headerfile">&lt;X11/X.h&gt;</filename></secondary></indexterm>
+which is used when referring to an event type.
+<indexterm><primary>Event</primary><secondary>categories</secondary></indexterm>
+The following table lists the event category 
+and its associated event type or types. 
+The processing associated with these events is discussed in section 10.5.
+</para>
+<para>
+<!-- .LP -->
+<!-- .\".CP T 1 -->
+<!-- .\"Event Categories and Event Types -->
+</para>
+<para>
+<!-- .LP -->
+<informaltable frame='topbot'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth='1.0*'/>
+  <colspec colname='c2' colwidth='4.0*'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Event Category</entry>
+      <entry>Event Type</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>Keyboard events</entry>
+      <entry><symbol>KeyPress</symbol>,
+      <symbol>KeyRelease</symbol></entry>
+    </row>
+    <row>
+      <entry>Pointer events</entry>
+      <entry><symbol>ButtonPress</symbol>,
+      <symbol>ButtonRelease</symbol>,
+      <symbol>MotionNotify</symbol></entry>
+    </row>
+    <row>
+      <entry>Window crossing events</entry>
+      <entry><symbol>EnterNotify</symbol>,
+      <symbol>LeaveNotify</symbol></entry>
+    </row>
+    <row>
+      <entry>Input focus events</entry>
+      <entry><symbol>FocusIn</symbol>,
+      <symbol>FocusOut</symbol></entry>
+    </row>
+    <row>
+      <entry>Keymap state notification event</entry>
+      <entry><symbol>KeymapNotify</symbol></entry>
+    </row>
+    <row>
+      <entry>Exposure events</entry>
+      <entry><symbol>Expose</symbol>,
+      <symbol>GraphicsExpose</symbol>,
+      <symbol>NoExpose</symbol></entry>
+    </row>
+    <row>
+      <entry>Structure control events</entry>
+      <entry><symbol>CirculateRequest</symbol>,
+      <symbol>ConfigureRequest</symbol>,
+      <symbol>MapRequest</symbol>,
+      <symbol>ResizeRequest</symbol></entry>
+    </row>
+    <row>
+      <entry>Window state notification events</entry>
+      <entry>
+      <symbol>CirculateNotify</symbol>,
+      <symbol>ConfigureNotify</symbol>,
+      <symbol>CreateNotify</symbol>,
+      <symbol>DestroyNotify</symbol>,
+      <symbol>GravityNotify</symbol>,
+      <symbol>MapNotify</symbol>,
+      <symbol>MappingNotify</symbol>,
+      <symbol>ReparentNotify</symbol>,
+      <symbol>UnmapNotify</symbol>,
+      <symbol>VisibilityNotify</symbol></entry>
+    </row>
+    <row>
+      <entry>Colormap state notification event</entry>
+      <entry><symbol>ColormapNotify</symbol></entry>
+    </row>
+    <row>
+      <entry>Client communication events</entry>
+      <entry><symbol>ClientMessage</symbol>,
+      <symbol>PropertyNotify</symbol>,
+      <symbol>SelectionClear</symbol>,
+      <symbol>SelectionNotify</symbol>,
+      <symbol>SelectionRequest</symbol></entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<!-- .\".LP -->
+<!-- .\"Table 8-1 lists the event types and the Xlib functions that could cause -->
+<!-- .\"the X server to generate that event type. -->
+<!-- .\"The event types are listed alphabetically. -->
+<!-- .\"Note that the error event is not listed in this table. -->
+<!-- .\"For a list of the constants associated with an error event, see the Handling -->
+<!-- .\"Errors section in this chapter. -->
+<!-- .\".LP -->
+<!-- .\".so eventtable -->
+</para>
+</sect1>
+<sect1 id="Event_Structures">
+<title>Event Structures</title>
+<!-- .XS -->
+<!-- (SN Event Structures  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+For each event type,
+a corresponding structure is declared in
+<filename class="headerfile">&lt;X11/Xlib.h&gt;</filename>.
+<indexterm type="file"><primary><filename class="headerfile">X11/Xlib.h</filename></primary></indexterm>
+<indexterm><primary>Files</primary><secondary><filename class="headerfile">&lt;X11/Xlib.h&gt;</filename></secondary></indexterm>
+<indexterm><primary>Headers</primary><secondary><filename class="headerfile">&lt;X11/Xlib.h&gt;</filename></secondary></indexterm>
+All the event structures have the following common members:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XAnyEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;
+     unsigned long serial;     /* # of last request processed by server */
+     Bool          send_event; /* true if this came from a SendEvent request */
+     Display       *display;   /* Display the event was read from */
+     Window        window;
+} XAnyEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The type member is set to the event type constant name that uniquely identifies
+it.
+For example, when the X server reports a
+<symbol>GraphicsExpose</symbol>
+event to a client application, it sends an
+<structname>XGraphicsExposeEvent</structname>
+structure with the type member set to
+<symbol>GraphicsExpose</symbol>.
+The display member is set to a pointer to the display the event was read on.
+The send_event member is set to
+<symbol>True</symbol>
+if the event came from a
+<systemitem>SendEvent</systemitem>
+protocol request.
+The serial member is set from the serial number reported in the protocol
+but expanded from the 16-bit least-significant bits to a full 32-bit value.
+The window member is set to the window that is most useful to toolkit
+dispatchers.
+</para>
+<para>
+<!-- .LP -->
+The X server can send events at any time in the input stream. 
+Xlib stores any events received while waiting for a reply in an event queue 
+for later use.
+Xlib also provides functions that allow you to check events in the event queue
+(see <link linkend="Event_Queue_Management">section 11.3</link>).
+</para>
+<para>
+<!-- .LP -->
+In addition to the individual structures declared for each event type, the
+<structname>XEvent</structname>
+structure is a union of the individual structures declared for each event type.
+Depending on the type,
+you should access members of each event by using the 
+<structname>XEvent</structname>
+union.
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XEvent</primary></indexterm>
+<!-- .sM -->
+</para>
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef union _XEvent {
+     int                            type;          /* must not be changed */
+     XAnyEvent                      xany;
+     XKeyEvent                      xkey;
+     XButtonEvent                   xbutton;
+     XMotionEvent                   xmotion;
+     XCrossingEvent                 xcrossing;
+     XFocusChangeEvent              xfocus;
+     XExposeEvent                   xexpose;
+     XGraphicsExposeEvent           xgraphicsexpose;
+     XNoExposeEvent                 xnoexpose;
+     XVisibilityEvent               xvisibility;
+     XCreateWindowEvent             xcreatewindow;
+     XDestroyWindowEvent            xdestroywindow;
+     XUnmapEvent                    xunmap;
+     XMapEvent                      xmap;
+     XMapRequestEvent               xmaprequest;
+     XReparentEvent                 xreparent;
+     XConfigureEvent                xconfigure;
+     XGravityEvent                  xgravity;
+     XResizeRequestEvent            xresizerequest;
+     XConfigureRequestEvent         xconfigurerequest;
+     XCirculateEvent                xcirculate;
+     XCirculateRequestEvent         xcirculaterequest;
+     XPropertyEvent                 xproperty;
+     XSelectionClearEvent           xselectionclear;
+     XSelectionRequestEvent         xselectionrequest;
+     XSelectionEvent                xselection;
+     XColormapEvent                 xcolormap;
+     XClientMessageEvent            xclient;
+     XMappingEvent                  xmapping;
+     XErrorEvent                    xerror;
+     XKeymapEvent                   xkeymap;
+     long                           pad[24];
+} XEvent;
+</literallayout>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+An
+<structname>XEvent</structname>
+structure's first entry always is the type member,
+which is set to the event type.
+The second member always is the serial number of the protocol request
+that generated the event.
+The third member always is send_event,
+which is a
+<type>Bool</type>
+that indicates if the event was sent by a different client.
+The fourth member always is a display,
+which is the display that the event was read from.
+Except for keymap events,
+the fifth member always is a window,
+which has been carefully selected to be useful to toolkit dispatchers.
+To avoid breaking toolkits,
+the order of these first five entries is not to change.
+Most events also contain a time member,
+which is the time at which an event occurred.
+In addition, a pointer to the generic event must be cast before it
+is used to access any other information in the structure.
+</para>
+</sect1>
+<sect1 id="Event_Masks">
+<title>Event Masks</title>
+<!-- .XS -->
+<!-- (SN Event Masks -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>Event mask</primary></indexterm>
+Clients select event reporting of most events relative to a window.
+To do this, pass an event mask to an Xlib event-handling
+function that takes an event_mask argument.
+The bits of the event mask are defined in
+<filename class="headerfile">&lt;X11/X.h&gt;</filename>.
+<indexterm type="file"><primary><filename class="headerfile">X11/X.h</filename></primary></indexterm>
+<indexterm><primary>Files</primary><secondary><filename class="headerfile">&lt;X11/X.h&gt;</filename></secondary></indexterm>
+<indexterm><primary>Headers</primary><secondary><filename class="headerfile">&lt;X11/X.h&gt;</filename></secondary></indexterm>
+Each bit in the event mask maps to an event mask name,
+which describes the event or events you want the X server to
+return to a client application.
+</para>
+<para>
+<!-- .LP -->
+Unless the client has specifically asked for them,
+most events are not reported to clients when they are generated. 
+Unless the client suppresses them by setting graphics-exposures in the GC to
+<symbol>False</symbol>,
+<symbol>GraphicsExpose</symbol>
+and 
+<symbol>NoExpose</symbol>
+are reported by default as a result of
+<xref linkend='XCopyPlane' xrefstyle='select: title'/>
+and
+<xref linkend='XCopyArea' xrefstyle='select: title'/>.
+<symbol>SelectionClear</symbol>,
+<symbol>SelectionRequest</symbol>,
+<symbol>SelectionNotify</symbol>,
+or
+<symbol>ClientMessage</symbol>
+cannot be masked.
+Selection-related events are only sent to clients cooperating
+with selections
+(see <link linkend="Obtaining_and_Changing_Window_Properties">section 4.5</link>).
+When the keyboard or pointer mapping is changed,
+<symbol>MappingNotify</symbol>
+is always sent to clients.
+</para>
+<para>
+<!-- .LP -->
+<!-- .\"Table 8-2  -->
+The following table 
+lists the event mask constants you can pass to
+the event_mask argument and
+the circumstances in which you would want to specify the
+event mask:
+</para>
+<!-- .LP -->
+<!-- .\" .CP T 2 -->
+<!-- .\"Event Mask Definitions -->
+<informaltable frame='topbot'>
+  <?dbfo keep-together="auto" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth='1.0*'/>
+  <colspec colname='c2' colwidth='2.5*'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Event Mask</entry>
+      <entry>Circumstances</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry><symbol>NoEventMask</symbol></entry>
+      <entry>No events wanted</entry>
+    </row>
+    <row>
+      <entry><symbol>KeyPressMask</symbol></entry>
+      <entry>Keyboard down events wanted</entry>
+    </row>
+    <row>
+      <entry><symbol>KeyReleaseMask</symbol></entry>
+      <entry>Keyboard up events wanted</entry>
+    </row>
+    <row>
+      <entry><symbol>ButtonPressMask</symbol></entry>
+      <entry>Pointer button down events wanted</entry>
+    </row>
+    <row>
+      <entry><symbol>ButtonReleaseMask</symbol></entry>
+      <entry>Pointer button up events wanted</entry>
+    </row>
+    <row>
+      <entry><symbol>EnterWindowMask</symbol></entry>
+      <entry>Pointer window entry events wanted</entry>
+    </row>
+    <row>
+      <entry><symbol>LeaveWindowMask</symbol></entry>
+      <entry>Pointer window leave events wanted</entry>
+    </row>
+    <row>
+      <entry><symbol>PointerMotionMask</symbol></entry>
+      <entry>Pointer motion events wanted</entry>
+    </row>
+    <row>
+      <entry><symbol>PointerMotionHintMask</symbol></entry>
+      <entry>Pointer motion hints wanted</entry>
+    </row>
+    <row>
+      <entry><symbol>Button1MotionMask</symbol></entry>
+      <entry>Pointer motion while button 1 down</entry>
+    </row>
+    <row>
+      <entry><symbol>Button2MotionMask</symbol></entry>
+      <entry>Pointer motion while button 2 down</entry>
+    </row>
+    <row>
+      <entry><symbol>Button3MotionMask</symbol></entry>
+      <entry>Pointer motion while button 3 down</entry>
+    </row>
+    <row>
+      <entry><symbol>Button4MotionMask</symbol></entry>
+      <entry>Pointer motion while button 4 down</entry>
+    </row>
+    <row>
+      <entry><symbol>Button5MotionMask</symbol></entry>
+      <entry>Pointer motion while button 5 down</entry>
+    </row>
+    <row>
+      <entry><symbol>ButtonMotionMask</symbol></entry>
+      <entry>Pointer motion while any button down</entry>
+    </row>
+    <row>
+      <entry><symbol>KeymapStateMask</symbol></entry>
+      <entry>Keyboard state wanted at window entry and focus in</entry>
+    </row>
+    <row>
+      <entry><symbol>ExposureMask</symbol></entry>
+      <entry>Any exposure wanted</entry>
+    </row>
+    <row>
+      <entry><symbol>VisibilityChangeMask</symbol></entry>
+      <entry>Any change in visibility wanted</entry>
+    </row>
+    <row>
+      <entry><symbol>StructureNotifyMask</symbol></entry>
+      <entry>Any change in window structure wanted</entry>
+    </row>
+    <row>
+      <entry><symbol>ResizeRedirectMask</symbol></entry>
+      <entry>Redirect resize of this window</entry>
+    </row>
+    <row>
+      <entry><symbol>SubstructureNotifyMask</symbol></entry>
+      <entry>Substructure notification wanted</entry>
+    </row>
+    <row>
+      <entry><symbol>SubstructureRedirectMask</symbol></entry>
+      <entry>Redirect structure requests on children</entry>
+    </row>
+    <row>
+      <entry><symbol>FocusChangeMask</symbol></entry>
+      <entry>Any change in input focus wanted</entry>
+    </row>
+    <row>
+      <entry><symbol>PropertyChangeMask</symbol></entry>
+      <entry>Any change in property wanted</entry>
+    </row>
+    <row>
+      <entry><symbol>ColormapChangeMask</symbol></entry>
+      <entry>Any change in colormap wanted</entry>
+    </row>
+    <row>
+      <entry><symbol>OwnerGrabButtonMask</symbol></entry>
+      <entry>Automatic grabs should activate with owner_events set to True</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+<!-- .LP -->
+</para>
+</sect1>
+<sect1 id="Event_Processing_Overview">
+<title>Event Processing Overview</title>
+<!-- .XS -->
+<!-- (SN Event Processing Overview -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The event reported to a client application during event processing
+depends on which event masks you provide as the event-mask attribute 
+for a window.
+For some event masks, there is a one-to-one correspondence between
+the event mask constant and the event type constant.
+For example, if you pass the event mask
+<symbol>ButtonPressMask</symbol>,
+the X server sends back only
+<symbol>ButtonPress</symbol>
+events.
+<indexterm><primary>CurrentTime</primary></indexterm>
+Most events contain a time member,
+which is the time at which an event occurred.
+</para>
+<para>
+<!-- .LP -->
+In other cases, one event mask constant can map to several event type constants.
+For example, if you pass the event mask
+<symbol>SubstructureNotifyMask</symbol>,
+the X server can send back
+<symbol>CirculateNotify</symbol>,
+<symbol>ConfigureNotify</symbol>,
+<symbol>CreateNotify</symbol>,
+<symbol>DestroyNotify</symbol>,
+<symbol>GravityNotify</symbol>,
+<symbol>MapNotify</symbol>,
+<symbol>ReparentNotify</symbol>,
+or
+<symbol>UnmapNotify</symbol>
+events.
+</para>
+<para>
+<!-- .LP -->
+In another case, 
+two event masks can map to one event type.
+For example, 
+if you pass either
+<symbol>PointerMotionMask</symbol>
+or
+<symbol>ButtonMotionMask</symbol>,
+the X server sends back
+a
+<symbol>MotionNotify</symbol>
+event.
+</para>
+<para>
+<!-- .LP -->
+The following table 
+lists the event mask, 
+its associated event type or types, 
+and the structure name associated with the event type.
+Some of these structures actually are typedefs to a generic structure
+that is shared between two event types.
+Note that N.A. appears in columns for which the information is not applicable.
+</para>
+<!-- .LP -->
+<!-- .ps 9 -->
+<!-- .nr PS 9 -->
+<informaltable frame='topbot'>
+  <?dbfo keep-together="auto" ?>
+  <tgroup cols='4' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth='1.2*'/>
+  <colspec colname='c2' colwidth='1.0*'/>
+  <colspec colname='c3' colwidth='1.2*'/>
+  <colspec colname='c4' colwidth='1.0*'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Event Mask</entry>
+      <entry>Event Type</entry>
+      <entry>Structure</entry>
+      <entry>Generic Structure</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>
+      <para>ButtonMotionMask</para>
+      <para>Button1MotionMask</para>
+      <para>Button2MotionMask</para>
+      <para>Button3MotionMask</para>
+      <para>Button4MotionMask</para>
+      <para>Button5MotionMask</para>
+      </entry>
+      <entry>MotionNotify</entry>
+      <entry>XPointerMovedEvent</entry>
+      <entry>XMotionEvent</entry>
+    </row>
+    <row>
+      <entry>ButtonPressMask</entry>
+      <entry>ButtonPress</entry>
+      <entry>XButtonPressedEvent</entry>
+      <entry>XButtonEvent</entry>
+    </row>
+    <row>
+      <entry>ButtonReleaseMask</entry>
+      <entry>ButtonRelease</entry>
+      <entry>XButtonReleasedEvent</entry>
+      <entry>XButtonEvent</entry>
+    </row>
+    <row>
+      <entry>ColormapChangeMask</entry>
+      <entry>ColormapNotify</entry>
+      <entry>XColormapEvent</entry>
+    </row>
+    <row>
+      <entry>EnterWindowMask</entry>
+      <entry>EnterNotify</entry>
+      <entry>XEnterWindowEvent</entry>
+      <entry>XCrossingEvent</entry>
+    </row>
+    <row>
+      <entry>LeaveWindowMask</entry>
+      <entry>LeaveNotify</entry>
+      <entry>XLeaveWindowEvent</entry>
+      <entry>XCrossingEvent</entry>
+    </row>
+    <row>
+      <entry>ExposureMask</entry>
+      <entry>Expose</entry>
+      <entry>XExposeEvent </entry>
+    </row>
+    <row>
+      <entry morerows='1'>GCGraphicsExposures in GC</entry>
+      <entry>GraphicsExpose</entry>
+      <entry>XGraphicsExposeEvent</entry>
+    </row>
+    <row>
+      <entry>NoExpose</entry>
+      <entry>XNoExposeEvent</entry>
+    </row>
+    <row>
+      <entry morerows='1'>FocusChangeMask</entry>
+      <entry>FocusIn</entry>
+      <entry>XFocusInEvent</entry>
+      <entry>XFocusChangeEvent</entry>
+    </row>
+    <row>
+      <entry>FocusOut</entry>
+      <entry>XFocusOutEvent</entry>
+      <entry>XFocusChangeEvent</entry>
+    </row>
+    <row>
+      <entry>KeymapStateMask</entry>
+      <entry>KeymapNotify</entry>
+      <entry>XKeymapEvent</entry>
+    </row>
+    <row>
+      <entry>KeyPressMask</entry>
+      <entry>KeyPress</entry>
+      <entry>XKeyPressedEvent</entry>
+      <entry>XKeyEvent</entry>
+    </row>
+    <row>
+      <entry>KeyReleaseMask</entry>
+      <entry>KeyRelease</entry>
+      <entry>XKeyReleasedEvent</entry>
+      <entry>XKeyEvent</entry>
+    </row>
+    <row>
+      <entry>OwnerGrabButtonMask</entry>
+      <entry>N.A.</entry>
+      <entry>N.A.</entry>
+    </row>
+    <row>
+      <entry>PointerMotionMask</entry>
+      <entry>MotionNotify</entry>
+      <entry>XPointerMovedEvent</entry>
+      <entry>XMotionEvent</entry>
+    </row>
+    <row>
+      <entry>PointerMotionHintMask</entry>
+      <entry>N.A.</entry>
+      <entry>N.A.</entry>
+    </row>
+    <row>
+      <entry>PropertyChangeMask</entry>
+      <entry>PropertyNotify</entry>
+      <entry>XPropertyEvent</entry>
+    </row>
+    <row>
+      <entry>ResizeRedirectMask</entry>
+      <entry>ResizeRequest</entry>
+      <entry>XResizeRequestEvent</entry>
+    </row>
+    <row>
+      <entry morerows='6'>StructureNotifyMask</entry>
+      <entry>CirculateNotify</entry>
+      <entry>XCirculateEvent</entry>
+    </row>
+    <row>
+      <entry>ConfigureNotify</entry>
+      <entry>XConfigureEvent</entry>
+    </row>
+    <row>
+      <entry>DestroyNotify</entry>
+      <entry>XDestroyWindowEvent</entry>
+    </row>
+    <row>
+      <entry>GravityNotify</entry>
+      <entry>XGravityEvent</entry>
+    </row>
+    <row>
+      <entry>MapNotify</entry>
+      <entry>XMapEvent</entry>
+    </row>
+    <row>
+      <entry>ReparentNotify</entry>
+      <entry>XReparentEvent</entry>
+    </row>
+    <row>
+      <entry>UnmapNotify</entry>
+      <entry>XUnmapEvent</entry>
+    </row>
+    <row>
+      <entry morerows='7'>SubstructureNotifyMask</entry>
+      <entry>CirculateNotify</entry>
+      <entry>XCirculateEvent</entry>
+    </row>
+    <row>
+      <entry>ConfigureNotify</entry>
+      <entry>XConfigureEvent</entry>
+    </row>
+    <row>
+      <entry>CreateNotify</entry>
+      <entry>XCreateWindowEvent</entry>
+    </row>
+    <row>
+      <entry>DestroyNotify</entry>
+      <entry>XDestroyWindowEvent</entry>
+    </row>
+    <row>
+      <entry>GravityNotify</entry>
+      <entry>XGravityEvent</entry>
+    </row>
+    <row>
+      <entry>MapNotify</entry>
+      <entry>XMapEvent</entry>
+    </row>
+    <row>
+      <entry>ReparentNotify</entry>
+      <entry>XReparentEvent</entry>
+    </row>
+    <row>
+      <entry>UnmapNotify</entry>
+      <entry>XUnmapEvent</entry>
+    </row>
+    <row>
+      <entry morerows='2'>SubstructureRedirectMask</entry>
+      <entry>CirculateRequest</entry>
+      <entry>XCirculateRequestEvent</entry>
+    </row>
+    <row>
+      <entry>ConfigureRequest</entry>
+      <entry>XConfigureRequestEvent</entry>
+    </row>
+    <row>
+      <entry>MapRequest</entry>
+      <entry>XMapRequestEvent</entry>
+    </row>
+    <row>
+      <entry>N.A.</entry>
+      <entry>ClientMessage</entry>
+      <entry>XClientMessageEvent</entry>
+    </row>
+    <row>
+      <entry>N.A.</entry>
+      <entry>MappingNotify</entry>
+      <entry>XMappingEvent</entry>
+    </row>
+    <row>
+      <entry>N.A.</entry>
+      <entry>SelectionClear</entry>
+      <entry>XSelectionClearEvent</entry>
+    </row>
+    <row>
+      <entry>N.A.</entry>
+      <entry>SelectionNotify</entry>
+      <entry>XSelectionEvent</entry>
+    </row>
+    <row>
+      <entry>N.A.</entry>
+      <entry>SelectionRequest</entry>
+      <entry>XSelectionRequestEvent</entry>
+    </row>
+    <row>
+      <entry>VisibilityChangeMask</entry>
+      <entry>VisibilityNotify</entry>
+      <entry>XVisibilityEvent</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+<!-- .LP -->
+The sections that follow describe the processing that occurs 
+when you select the different event masks.
+The sections are organized according to these processing categories:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Keyboard and pointer events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Window crossing events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Input focus events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Keymap state notification events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Exposure events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Window state notification events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Structure control events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Colormap state notification events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Client communication events
+    </para>
+  </listitem>
+</itemizedlist>
+
+</sect1>
+
+<sect1 id="Keyboard_and_Pointer_Events">
+<title>Keyboard and Pointer Events</title>
+<!-- .XS -->
+<!-- (SN Keyboard and Pointer Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+This section discusses:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Pointer button events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Keyboard and pointer events
+    </para>
+  </listitem>
+</itemizedlist>
+<sect2 id="Pointer_Button_Events">
+<title>Pointer Button Events</title>
+<!-- .XS -->
+<!-- (SN Pointer Button Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The following describes the event processing that occurs when a pointer button 
+press is processed with the pointer in some window w and 
+when no active pointer grab is in progress.
+</para>
+<para>
+<!-- .LP -->
+The X server searches the ancestors of w from the root down,
+looking for a passive grab to activate.
+If no matching passive grab on the button exists,
+the X server automatically starts an active grab for the client receiving
+the event and sets the last-pointer-grab time to the current server time.
+The effect is essentially equivalent to an
+<xref linkend='XGrabButton' xrefstyle='select: title'/>
+with these client passed arguments:
+</para>
+<informaltable frame='topbot'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth='1.0*'/>
+  <colspec colname='c2' colwidth='4.0*'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Argument</entry>
+      <entry>Value</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry><emphasis remap='I'>w</emphasis></entry>
+      <entry>The event window </entry>
+    </row>
+    <row>
+      <entry><emphasis remap='I'>event_mask</emphasis></entry>
+      <entry>The client's selected pointer events on the event window</entry>
+    </row>
+    <row>
+      <entry><emphasis remap='I'>pointer_mode</emphasis></entry>
+      <entry><symbol>GrabModeAsync</symbol></entry>
+    </row>
+    <row>
+      <entry><emphasis remap='I'>keyboard_mode</emphasis></entry>
+      <entry><symbol>GrabModeAsync</symbol></entry>
+    </row>
+    <row>
+      <entry><emphasis remap='I'>owner_events</emphasis></entry>
+      <entry><symbol>True</symbol>,
+      if the client has selected
+      <symbol>OwnerGrabButtonMask</symbol>
+      on the event window,
+      otherwise
+      <symbol>False</symbol></entry>
+    </row>
+    <row>
+      <entry><emphasis remap='I'>confine_to</emphasis></entry>
+      <entry><symbol>None</symbol></entry>
+    </row>
+    <row>
+      <entry><emphasis remap='I'>cursor</emphasis></entry>
+      <entry><symbol>None</symbol></entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+<!-- .LP -->
+The active grab is automatically terminated when 
+the logical state of the pointer has all buttons released.
+Clients can modify the active grab by calling
+<xref linkend='XUngrabPointer' xrefstyle='select: title'/>
+and
+<xref linkend='XChangeActivePointerGrab' xrefstyle='select: title'/>.
+</para>
+</sect2>
+
+<sect2 id="Keyboard_and_Pointer_Events_b">
+<title>Keyboard and Pointer Events</title>
+<!-- .XS -->
+<!-- (SN Keyboard and Pointer Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>ButtonPress</secondary></indexterm>
+<indexterm><primary>Events</primary><secondary>ButtonRelease</secondary></indexterm>
+<indexterm><primary>Events</primary><secondary>KeyPress</secondary></indexterm>
+<indexterm><primary>Events</primary><secondary>KeyRelease</secondary></indexterm>
+<indexterm><primary>Events</primary><secondary>MotionNotify</secondary></indexterm>
+This section discusses the processing that occurs for the
+keyboard events
+<symbol>KeyPress</symbol>
+and 
+<symbol>KeyRelease</symbol>
+and the pointer events
+<symbol>ButtonPress</symbol>,
+<symbol>ButtonRelease</symbol>,
+and
+<symbol>MotionNotify</symbol>.
+For information about the keyboard event-handling utilities,
+see <link linkend='Event_Handling_Functions'>chapter 11</link>.
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>KeyPress</primary></indexterm>
+<indexterm significance="preferred"><primary>KeyRelease</primary></indexterm>
+The X server reports
+<symbol>KeyPress</symbol>
+or
+<symbol>KeyRelease</symbol>
+events to clients wanting information about keys that logically change state.
+Note that these events are generated for all keys, 
+even those mapped to modifier bits.
+<indexterm significance="preferred"><primary>ButtonPress</primary></indexterm>
+<indexterm significance="preferred"><primary>ButtonRelease</primary></indexterm>
+The X server reports
+<symbol>ButtonPress</symbol>
+or
+<symbol>ButtonRelease</symbol>
+events to clients wanting information about buttons that logically change state.
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>MotionNotify</primary></indexterm>
+The X server reports
+<symbol>MotionNotify</symbol>
+events to clients wanting information about when the pointer logically moves.
+The X server generates this event whenever the pointer is moved 
+and the pointer motion begins and ends in the window.
+The granularity of
+<symbol>MotionNotify</symbol>
+events is not guaranteed, 
+but a client that selects this event type is guaranteed
+to receive at least one event when the pointer moves and then rests.
+</para>
+<para>
+<!-- .LP -->
+The generation of the logical changes lags the physical changes 
+if device event processing is frozen.
+</para>
+<para>
+<!-- .LP -->
+To receive
+<symbol>KeyPress</symbol>,
+<symbol>KeyRelease</symbol>,
+<symbol>ButtonPress</symbol>,
+and
+<symbol>ButtonRelease</symbol>
+events, set 
+<symbol>KeyPressMask</symbol>,
+<symbol>KeyReleaseMask</symbol>,
+<symbol>ButtonPressMask</symbol>,
+and
+<symbol>ButtonReleaseMask</symbol>
+bits in the event-mask attribute of the window.
+</para>
+<para>
+<!-- .LP -->
+To receive 
+<symbol>MotionNotify</symbol>
+events, set one or more of the following event 
+masks bits in the event-mask attribute of the window.
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+<symbol>Button1MotionMask</symbol> - <symbol>Button5MotionMask</symbol>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The client application receives
+<symbol>MotionNotify</symbol>
+events only when one or more of the specified buttons is pressed.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>ButtonMotionMask</symbol>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The client application receives
+<symbol>MotionNotify</symbol>
+events only when at least one button is pressed.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>PointerMotionMask</symbol>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The client application receives 
+<symbol>MotionNotify</symbol>
+events independent of the state of
+the pointer buttons.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>PointerMotionHintMask</symbol>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If
+<symbol>PointerMotionHintMask</symbol>
+is selected in combination with one or more of the above masks, 
+the X server is free to send only one
+<symbol>MotionNotify</symbol>
+event (with the is_hint member  of the
+<type>XPointerMovedEvent</type>
+structure set to
+<symbol>NotifyHint</symbol>)
+to the client for the event window, 
+until either the key or button state changes,
+the pointer leaves the event window, or the client calls
+<xref linkend='XQueryPointer' xrefstyle='select: title'/>
+or
+<xref linkend='XGetMotionEvents' xrefstyle='select: title'/>.
+The server still may send
+<symbol>MotionNotify</symbol>
+events without is_hint set to
+<symbol>NotifyHint</symbol>.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+The source of the event is the viewable window that the pointer is in.
+The window used by the X server to report these events depends on 
+the window's position in the window hierarchy 
+and whether any intervening window prohibits the generation of these events.
+Starting with the source window, 
+the X server searches up the window hierarchy until it locates the first 
+window specified by a client as having an interest in these events.
+If one of the intervening windows has its do-not-propagate-mask
+set to prohibit generation of the event type,
+the events of those types will be suppressed.
+Clients can modify the actual window used for reporting by performing
+active grabs and, in the case of keyboard events, by using the focus window.
+</para>
+<para>
+<!-- .LP -->
+The structures for these event types contain:
+</para>
+<literallayout class="monospaced">
+typedef struct {
+     int            type;            /* ButtonPress or ButtonRelease */
+     unsigned long  serial;          /* # of last request processed by server */
+     Bool           send_event;      /* true if this came from a SendEvent request */
+     Display        *display;        /* Display the event was read from */
+     Window         window;          /* ``event'' window it is reported relative to */
+     Window         root;            /* root window that the event occurred on */
+     Window         subwindow;       /* child window */
+     Time           time;            /* milliseconds */
+     int            x, y;            /* pointer x, y coordinates in event window */
+     int            x_root, y_root;  /* coordinates relative to root */
+     unsigned int   state;           /* key or button mask */
+     unsigned int   button;          /* detail */
+     Bool           same_screen;     /* same screen flag */
+} XButtonEvent;
+typedef XButtonEvent XButtonPressedEvent;
+typedef XButtonEvent XButtonReleasedEvent;
+</literallayout>
+
+<literallayout class="monospaced">
+typedef struct {
+     int            type;            /* KeyPress or KeyRelease */
+     unsigned long  serial;          /* # of last request processed by server */
+     Bool           send_event;      /* true if this came from a SendEvent request */
+     Display        *display;        /* Display the event was read from */
+     Window         window;          /* ``event'' window it is reported relative to */
+     Window         root;            /* root window that the event occurred on */
+     Window         subwindow;       /* child window */
+     Time           time;            /* milliseconds */
+     int            x, y;            /* pointer x, y coordinates in event window */
+     int            x_root, y_root;  /* coordinates relative to root */
+     unsigned int   state;           /* key or button mask */
+     unsigned int   keycode;         /* detail */
+     Bool           same_screen;     /* same screen flag */
+} XKeyEvent;
+typedef XKeyEvent XKeyPressedEvent;
+typedef XKeyEvent XKeyReleasedEvent;
+</literallayout>
+
+<literallayout class="monospaced">
+typedef struct {
+     int            type;              /* MotionNotify */
+     unsigned long  serial;            /* # of last request processed by server */
+     Bool           send_event;        /* true if this came from a SendEvent request */
+     Display        *display;          /* Display the event was read from */
+     Window         window;            /* ``event'' window reported relative to */
+     Window         root;              /* root window that the event occurred on */
+     Window         subwindow;         /* child window */
+     Time           time;              /* milliseconds */
+     int            x, y;              /* pointer x, y coordinates in event window */
+     int            x_root, y_root;    /* coordinates relative to root */
+     unsigned int   state;             /* key or button mask */
+     char           is_hint;           /* detail */
+     Bool           same_screen;       /* same screen flag */
+} XMotionEvent;
+typedef XMotionEvent XPointerMovedEvent;
+</literallayout>
+
+<para>
+These structures have the following common members:
+window, root, subwindow, time, x, y, x_root, y_root, state, and same_screen.
+The window member is set to the window on which the
+event was generated and is referred to as the event window. 
+As long as the conditions previously discussed are met,
+this is the window used by the X server to report the event.
+The root member is set to the source window's root window.
+The x_root and y_root members are set to the pointer's coordinates
+relative to the root window's origin at the time of the event.
+</para>
+
+<para>
+<!-- .LP -->
+The same_screen member is set to indicate whether the event 
+window is on the same screen
+as the root window and can be either
+<symbol>True</symbol>
+or
+<symbol>False</symbol>.
+If
+<symbol>True</symbol>,
+the event and root windows are on the same screen.
+If
+<symbol>False</symbol>,
+the event and root windows are not on the same screen.
+</para>
+<para>
+<!-- .LP -->
+If the source window is an inferior of the event window, 
+the subwindow member of the structure is set to the child of the event window
+that is the source window or the child of the event window that is
+an ancestor of the source window.
+Otherwise, the X server sets the subwindow member to
+<symbol>None</symbol>.
+The time member is set to the time when the event was generated 
+and is expressed in milliseconds.
+</para>
+<para>
+<!-- .LP -->
+If the event window is on the same screen as the root window, 
+the x and y members
+are set to the coordinates relative to the event window's origin.
+Otherwise, these members are set to zero.
+</para>
+<para>
+<!-- .LP -->
+The state member is set to indicate the logical state of the pointer buttons 
+and modifier keys just prior to the event,
+which is the bitwise inclusive OR of one or more of the
+button or modifier key masks:
+<symbol>Button1Mask</symbol>,
+<symbol>Button2Mask</symbol>,
+<symbol>Button3Mask</symbol>,
+<symbol>Button4Mask</symbol>,
+<symbol>Button5Mask</symbol>,
+<symbol>ShiftMask</symbol>,
+<symbol>LockMask</symbol>,
+<symbol>ControlMask</symbol>,
+<symbol>Mod1Mask</symbol>,
+<symbol>Mod2Mask</symbol>,
+<symbol>Mod3Mask</symbol>,
+<symbol>Mod4Mask</symbol>,
+and
+<symbol>Mod5Mask</symbol>.
+</para>
+<para>
+<!-- .LP -->
+Each of these structures also has a member that indicates the detail.
+For the
+<type>XKeyPressedEvent</type>
+and
+<type>XKeyReleasedEvent</type>
+structures, this member is called a keycode.
+It is set to a number that represents a physical key on the keyboard.
+The keycode is an arbitrary representation for any key on the keyboard
+(see sections <link linkend="Manipulating_the_Keyboard_Encoding">12.7</link>
+ and <link linkend="Using_Keyboard_Utility_Functions">16.1</link>).
+</para>
+<para>
+<!-- .LP -->
+For the
+<type>XButtonPressedEvent</type>
+and
+<type>XButtonReleasedEvent</type>
+structures, this member is called button.
+It represents the pointer button that changed state and can be the
+<symbol>Button1</symbol>,
+<symbol>Button2</symbol>,
+<symbol>Button3</symbol>,
+<symbol>Button4</symbol>,
+or
+<symbol>Button5</symbol>
+value.
+For the
+<type>XPointerMovedEvent</type>
+structure, this member is called is_hint.
+It can be set to 
+<symbol>NotifyNormal</symbol>
+or
+<symbol>NotifyHint</symbol>.
+</para>
+<para>
+<!-- .LP -->
+Some of the symbols mentioned in this section have fixed values, as
+follows:
+</para>
+<informaltable frame='topbot'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth='1.0*'/>
+  <colspec colname='c2' colwidth='3.0*'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Symbol</entry>
+      <entry>Value</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry><symbol>Button1MotionMask</symbol></entry>
+      <entry>(1L&lt;&lt;8)</entry>
+    </row>
+    <row>
+      <entry><symbol>Button2MotionMask</symbol></entry>
+      <entry>(1L&lt;&lt;9)</entry>
+    </row>
+    <row>
+      <entry><symbol>Button3MotionMask</symbol></entry>
+      <entry>(1L&lt;&lt;10)</entry>
+    </row>
+    <row>
+      <entry><symbol>Button4MotionMask</symbol></entry>
+      <entry>(1L&lt;&lt;11)</entry>
+    </row>
+    <row>
+      <entry><symbol>Button5MotionMask</symbol></entry>
+      <entry>(1L&lt;&lt;12)</entry>
+    </row>
+    <row>
+      <entry><symbol>Button1Mask</symbol></entry>
+      <entry>(1&lt;&lt;8)</entry>
+    </row>
+    <row>
+      <entry><symbol>Button2Mask</symbol></entry>
+      <entry>(1&lt;&lt;9)</entry>
+    </row>
+    <row>
+      <entry><symbol>Button3Mask</symbol></entry>
+      <entry>(1&lt;&lt;10)</entry>
+    </row>
+    <row>
+      <entry><symbol>Button4Mask</symbol></entry>
+      <entry>(1&lt;&lt;11)</entry>
+    </row>
+    <row>
+      <entry><symbol>Button5Mask</symbol></entry>
+      <entry>(1&lt;&lt;12)</entry>
+    </row>
+    <row>
+      <entry><symbol>ShiftMask</symbol></entry>
+      <entry>(1&lt;&lt;0)</entry>
+    </row>
+    <row>
+      <entry><symbol>LockMask</symbol></entry>
+      <entry>(1&lt;&lt;1)</entry>
+    </row>
+    <row>
+      <entry><symbol>ControlMask</symbol></entry>
+      <entry>(1&lt;&lt;2)</entry>
+    </row>
+    <row>
+      <entry><symbol>Mod1Mask</symbol></entry>
+      <entry>(1&lt;&lt;3)</entry>
+    </row>
+    <row>
+      <entry><symbol>Mod2Mask</symbol></entry>
+      <entry>(1&lt;&lt;4)</entry>
+    </row>
+    <row>
+      <entry><symbol>Mod3Mask</symbol></entry>
+      <entry>(1&lt;&lt;5)</entry>
+    </row>
+    <row>
+      <entry><symbol>Mod4Mask</symbol></entry>
+      <entry>(1&lt;&lt;6)</entry>
+    </row>
+    <row>
+      <entry><symbol>Mod5Mask</symbol></entry>
+      <entry>(1&lt;&lt;7)</entry>
+    </row>
+    <row>
+      <entry><symbol>Button1</symbol></entry>
+      <entry>1</entry>
+    </row>
+    <row>
+      <entry><symbol>Button2</symbol></entry>
+      <entry>2</entry>
+    </row>
+    <row>
+      <entry><symbol>Button3</symbol></entry>
+      <entry>3</entry>
+    </row>
+    <row>
+      <entry><symbol>Button4</symbol></entry>
+      <entry>4</entry>
+    </row>
+    <row>
+      <entry><symbol>Button5</symbol></entry>
+      <entry>5</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+</sect2>
+</sect1>
+<sect1 id='Window_EntryExit_Events'>
+<title>Window Entry/Exit Events</title>
+<!-- .XS -->
+<!-- (SN Window Entry/Exit Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>EnterNotify</secondary></indexterm>
+<indexterm><primary>Events</primary><secondary>LeaveNotify</secondary></indexterm>
+This section describes the processing that 
+occurs for the window crossing events
+<symbol>EnterNotify</symbol>
+and
+<symbol>LeaveNotify</symbol>.
+<indexterm significance="preferred"><primary>EnterNotify</primary></indexterm>
+<indexterm significance="preferred"><primary>LeaveNotify</primary></indexterm>
+If a pointer motion or a window hierarchy change causes the
+pointer to be in a different window than before, the X server reports
+<symbol>EnterNotify</symbol>
+or
+<symbol>LeaveNotify</symbol>
+events to clients who have selected for these events.
+All 
+<symbol>EnterNotify</symbol>
+and 
+<symbol>LeaveNotify</symbol>
+events caused by a hierarchy change are
+generated after any hierarchy event
+(<symbol>UnmapNotify</symbol>,
+<symbol>MapNotify</symbol>,
+<symbol>ConfigureNotify</symbol>,
+<symbol>GravityNotify</symbol>,
+<symbol>CirculateNotify</symbol>)
+caused by that change;
+however, the X protocol does not constrain the ordering of 
+<symbol>EnterNotify</symbol>
+and 
+<symbol>LeaveNotify</symbol>
+events with respect to
+<symbol>FocusOut</symbol>,
+<symbol>VisibilityNotify</symbol>,
+and 
+<symbol>Expose</symbol>
+events.
+</para>
+<para>
+<!-- .LP -->
+This contrasts with
+<symbol>MotionNotify</symbol>
+events, which are also generated when the pointer moves
+but only when the pointer motion begins and ends in a single window.
+An
+<symbol>EnterNotify</symbol>
+or
+<symbol>LeaveNotify</symbol>
+event also can be generated when some client application calls
+<xref linkend='XGrabPointer' xrefstyle='select: title'/>
+and
+<xref linkend='XUngrabPointer' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+To receive
+<symbol>EnterNotify</symbol>
+or
+<symbol>LeaveNotify</symbol>
+events, set the
+<symbol>EnterWindowMask</symbol>
+or
+<symbol>LeaveWindowMask</symbol>
+bits of the event-mask attribute of the window.
+</para>
+<para>
+<!-- .LP -->
+The structure for these event types contains:
+</para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XCrossingEvent</primary></indexterm>
+<indexterm significance="preferred"><primary>XEnterWindowEvent</primary></indexterm>
+<indexterm significance="preferred"><primary>XLeaveWindowEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;           /* EnterNotify or LeaveNotify */
+     unsigned long serial;         /* # of last request processed by server */
+     Bool          send_event;     /* true if this came from a SendEvent request */
+     Display       *display;       /* Display the event was read from */
+     Window        window;         /* ``event'' window reported relative to */
+     Window        root;           /* root window that the event occurred on */
+     Window        subwindow;      /* child window */
+     Time          time;           /* milliseconds */
+     int           x, y;           /* pointer x, y coordinates in event window */
+     int           x_root, y_root; /* coordinates relative to root */
+     int           mode;           /* NotifyNormal, NotifyGrab, NotifyUngrab */
+     int           detail;
+                   /*
+                    * NotifyAncestor, NotifyVirtual, NotifyInferior, 
+                    * NotifyNonlinear,NotifyNonlinearVirtual
+                    */
+     Bool          same_screen;    /* same screen flag */
+     Bool          focus;          /* boolean focus */
+     unsigned int  state;          /* key or button mask */
+} XCrossingEvent;
+typedef XCrossingEvent XEnterWindowEvent;
+typedef XCrossingEvent XLeaveWindowEvent;
+</literallayout>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The window member is set to the window on which the
+<symbol>EnterNotify</symbol>
+or
+<symbol>LeaveNotify</symbol>
+event was generated and is referred to as the event window. 
+This is the window used by the X server to report the event, 
+and is relative to the root
+window on which the event occurred. 
+The root member is set to the root window of the screen
+on which the event occurred.
+</para>
+<para>
+<!-- .LP -->
+For a
+<symbol>LeaveNotify</symbol>
+event,
+if a child of the event window contains the initial position of the pointer,
+the subwindow component is set to that child.
+Otherwise, the X server sets the subwindow member to
+<symbol>None</symbol>.
+For an
+<symbol>EnterNotify</symbol>
+event, if a child of the event window contains the final pointer position, 
+the subwindow component is set to that child or
+<symbol>None</symbol>.
+</para>
+<para>
+<!-- .LP -->
+The time member is set to the time when the event was generated
+and is expressed in milliseconds.
+The x and y members are set to the coordinates of the pointer position in 
+the event window.
+This position is always the pointer's final position,
+not its initial position.
+If the event window is on the same
+screen as the root window, x and y are the pointer coordinates
+relative to the event window's origin. 
+Otherwise, x and y are set to zero.
+The x_root and y_root members are set to the pointer's coordinates relative to the
+root window's origin at the time of the event.
+</para>
+<para>
+<!-- .LP -->
+The same_screen member is set to indicate whether the event window is on the same screen
+as the root window and can be either
+<symbol>True</symbol>
+or
+<symbol>False</symbol>.
+If
+<symbol>True</symbol>,
+the event and root windows are on the same screen.
+If
+<symbol>False</symbol>,
+the event and root windows are not on the same screen.
+</para>
+<para>
+<!-- .LP -->
+The focus member is set to indicate whether the event window is the focus window or an
+inferior of the focus window.
+The X server can set this member to either
+<symbol>True</symbol>
+or
+<symbol>False</symbol>.
+If
+<symbol>True</symbol>,
+the event window is the focus window or an inferior of the focus window.
+If
+<symbol>False</symbol>,
+the event window is not the focus window or an inferior of the focus window.
+</para>
+<para>
+<!-- .LP -->
+The state member is set to indicate the state of the pointer buttons and
+modifier keys just prior to the
+event.
+The X server can set this member to the bitwise inclusive OR of one 
+or more of the button or modifier key masks:
+<symbol>Button1Mask</symbol>,
+<symbol>Button2Mask</symbol>,
+<symbol>Button3Mask</symbol>,
+<symbol>Button4Mask</symbol>,
+<symbol>Button5Mask</symbol>,
+<symbol>ShiftMask</symbol>,
+<symbol>LockMask</symbol>,
+<symbol>ControlMask</symbol>,
+<symbol>Mod1Mask</symbol>,
+<symbol>Mod2Mask</symbol>,
+<symbol>Mod3Mask</symbol>,
+<symbol>Mod4Mask</symbol>,
+<symbol>Mod5Mask</symbol>.
+</para>
+<para>
+<!-- .LP -->
+The mode member is set to indicate whether the events are normal events, 
+pseudo-motion events
+when a grab activates, or pseudo-motion events when a grab deactivates.
+The X server can set this member to 
+<symbol>NotifyNormal</symbol>,
+<symbol>NotifyGrab</symbol>,
+or
+<symbol>NotifyUngrab</symbol>.
+</para>
+<para>
+<!-- .LP -->
+The detail member is set to indicate the notify detail and can be
+<symbol>NotifyAncestor</symbol>,
+<symbol>NotifyVirtual</symbol>,
+<symbol>NotifyInferior</symbol>,
+<symbol>NotifyNonlinear</symbol>,
+or
+<symbol>NotifyNonlinearVirtual</symbol>.
+</para>
+<sect2 id='Normal_EntryExit_Events'>
+<title>Normal Entry/Exit Events</title>
+<!-- .XS -->
+<!-- (SN Normal Entry/Exit Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<symbol>EnterNotify</symbol>
+and
+<symbol>LeaveNotify</symbol>
+events are generated when the pointer moves from
+one window to another window.
+Normal events are identified by
+<type>XEnterWindowEvent</type>
+or
+<type>XLeaveWindowEvent</type>
+structures whose mode member is set to
+<symbol>NotifyNormal</symbol>.
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+When the pointer moves from window A to window B and A is an inferior of B, 
+the X server does the following:
+<!-- .RS -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>LeaveNotify</symbol>
+event on window A, with the detail member of the
+<type>XLeaveWindowEvent</type>
+structure set to
+<symbol>NotifyAncestor</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>LeaveNotify</symbol>
+event on each window between window A and window B, exclusive,
+with the detail member of each
+<type>XLeaveWindowEvent</type>
+structure set to
+<symbol>NotifyVirtual</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates an
+<symbol>EnterNotify</symbol>
+event on window B, with the detail member of the 
+<type>XEnterWindowEvent</type>
+structure set to
+<symbol>NotifyInferior</symbol>.
+<!-- .RE -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+When the pointer moves from window A to window B and B is an inferior of A,
+the X server does the following:
+<!-- .RS -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>LeaveNotify</symbol>
+event on window A,
+with the detail member of the
+<type>XLeaveWindowEvent</type>
+structure set to
+<symbol>NotifyInferior</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates an
+<symbol>EnterNotify</symbol>
+event on each window between window A and window B, exclusive, with the 
+detail member of each 
+<type>XEnterWindowEvent</type>
+structure set to
+<symbol>NotifyVirtual</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates an
+<symbol>EnterNotify</symbol>
+event on window B, with the detail member of the 
+<type>XEnterWindowEvent</type>
+structure set to
+<symbol>NotifyAncestor</symbol>.
+<!-- .RE -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+When the pointer moves from window A to window B 
+and window C is their least common ancestor, 
+the X server does the following:
+<!-- .RS -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>LeaveNotify</symbol>
+event on window A,
+with the detail member of the
+<type>XLeaveWindowEvent</type>
+structure set to 
+<symbol>NotifyNonlinear</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>LeaveNotify</symbol>
+event on each window between window A and window C, exclusive,
+with the detail member of each
+<type>XLeaveWindowEvent</type>
+structure set to
+<symbol>NotifyNonlinearVirtual</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates an
+<symbol>EnterNotify</symbol>
+event on each window between window C and window B, exclusive, 
+with the detail member of each
+<type>XEnterWindowEvent</type>
+structure set to
+<symbol>NotifyNonlinearVirtual</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates an
+<symbol>EnterNotify</symbol>
+event on window B, with the detail member of the 
+<type>XEnterWindowEvent</type>
+structure set to 
+<symbol>NotifyNonlinear</symbol>.
+<!-- .RE -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+When the pointer moves from window A to window B on different screens, 
+the X server does the following:
+<!-- .RS -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>LeaveNotify</symbol>
+event on window A,
+with the detail member of the
+<type>XLeaveWindowEvent</type>
+structure set to 
+<symbol>NotifyNonlinear</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If window A is not a root window,
+it generates a
+<symbol>LeaveNotify</symbol>
+event on each window above window A up to and including its root,
+with the detail member of each
+<type>XLeaveWindowEvent</type>
+structure set to 
+<symbol>NotifyNonlinearVirtual</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If window B is not a root window,
+it generates an
+<symbol>EnterNotify</symbol>
+event on each window from window B's root down to but not including
+window B, with the detail member of each
+<type>XEnterWindowEvent</type>
+structure set to 
+<symbol>NotifyNonlinearVirtual</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates an
+<symbol>EnterNotify</symbol>
+event on window B, with the detail member of the
+<type>XEnterWindowEvent</type>
+structure set to 
+<symbol>NotifyNonlinear</symbol>.
+<!-- .RE -->
+<!-- .\".SH 3 -->
+    </para>
+  </listitem>
+</itemizedlist>
+</sect2>
+<sect2 id='Grab_and_Ungrab_EntryExit_Events'>
+<title>Grab and Ungrab Entry/Exit Events</title>
+<!-- .XS -->
+<!-- (SN Grab and Ungrab Entry/Exit Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Pseudo-motion mode
+<symbol>EnterNotify</symbol>
+and
+<symbol>LeaveNotify</symbol>
+events are generated when a pointer grab activates or deactivates.
+Events in which the pointer grab activates
+are identified by
+<type>XEnterWindowEvent</type>
+or
+<type>XLeaveWindowEvent</type>
+structures whose mode member is set to 
+<symbol>NotifyGrab</symbol>.
+Events in which the pointer grab deactivates
+are identified by
+<type>XEnterWindowEvent</type>
+or
+<type>XLeaveWindowEvent</type>
+structures whose mode member is set to 
+<symbol>NotifyUngrab</symbol>
+(see
+<xref linkend='XGrabPointer' xrefstyle='select: title'/>).
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+When a pointer grab activates after any initial warp into a confine_to
+window and before generating any actual
+<symbol>ButtonPress</symbol>
+event that activates the grab, 
+G is the grab_window for the grab, 
+and P is the window the pointer is in, 
+the X server does the following:
+<!-- .RS -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates
+<symbol>EnterNotify</symbol>
+and
+<symbol>LeaveNotify</symbol>
+events (see <link linkend='Normal_EntryExit_Events'>section 10.6.1</link>)
+with the mode members of the 
+<type>XEnterWindowEvent</type>
+and
+<type>XLeaveWindowEvent</type>
+structures set to 
+<symbol>NotifyGrab</symbol>.
+These events are generated
+as if the pointer were to suddenly warp from
+its current position in P to some position in G.
+However, the pointer does not warp, and the X server uses the pointer position 
+as both the initial and final positions for the events.
+<!-- .RE -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+When a pointer grab deactivates after generating any actual
+<symbol>ButtonRelease</symbol>
+event that deactivates the grab, 
+G is the grab_window for the grab,
+and P is the window the pointer is in, 
+the X server does the following:
+<!-- .RS -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates
+<symbol>EnterNotify</symbol>
+and
+<symbol>LeaveNotify</symbol>
+events (see <link linkend='Normal_EntryExit_Events'>section 10.6.1</link>)
+with the mode members of the
+<type>XEnterWindowEvent</type>
+and
+<type>XLeaveWindowEvent</type>
+structures set to 
+<symbol>NotifyUngrab</symbol>.
+These events are generated as if the pointer were to suddenly warp from
+some position in G to its current position in P.
+However, the pointer does not warp, and the X server uses the
+current pointer position as both the
+initial and final positions for the events.
+<!-- .RE -->
+    </para>
+  </listitem>
+</itemizedlist>
+</sect2>
+</sect1>
+<sect1 id="Input_Focus_Events">
+<title>Input Focus Events</title>
+<!-- .XS -->
+<!-- (SN Input Focus Events  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>FocusIn</secondary></indexterm>
+<indexterm><primary>Events</primary><secondary>FocusOut</secondary></indexterm>
+This section describes the processing that occurs for the input focus events
+<symbol>FocusIn</symbol>
+and
+<symbol>FocusOut</symbol>.
+<indexterm significance="preferred"><primary>FocusIn</primary></indexterm>
+<indexterm significance="preferred"><primary>FocusOut</primary></indexterm>
+The X server can report
+<symbol>FocusIn</symbol>
+or
+<symbol>FocusOut</symbol>
+events to clients wanting information about when the input focus changes.
+The keyboard is always attached to some window 
+(typically, the root window or a top-level window), 
+which is called the focus window.
+The focus window and the position of the pointer determine the window that
+receives keyboard input.
+Clients may need to know when the input focus changes
+to control highlighting of areas on the screen.
+</para>
+<para>
+<!-- .LP -->
+To receive
+<symbol>FocusIn</symbol>
+or
+<symbol>FocusOut</symbol>
+events, set the
+<symbol>FocusChangeMask</symbol>
+bit in the event-mask attribute of the window. 
+</para>
+<para>
+<!-- .LP -->
+The structure for these event types contains:
+</para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XFocusChangeEvent</primary></indexterm>
+<indexterm significance="preferred"><primary>XFocusInEvent</primary></indexterm>
+<indexterm significance="preferred"><primary>XFocusOutEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;       /* FocusIn or FocusOut */
+     unsigned long serial;     /* # of last request processed by server */
+     Bool          send_event; /* true if this came from a SendEvent request */
+     Display       *display;   /* Display the event was read from */
+     Window        window;     /* window of event */
+     int           mode;       /* NotifyNormal, NotifyGrab, NotifyUngrab */
+     int           detail;
+                   /*
+                    * NotifyAncestor, NotifyVirtual, NotifyInferior, 
+                    * NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer,
+                    * NotifyPointerRoot, NotifyDetailNone 
+                    */
+} XFocusChangeEvent;
+typedef XFocusChangeEvent XFocusInEvent;
+typedef XFocusChangeEvent XFocusOutEvent;
+</literallayout>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The window member is set to the window on which the
+<symbol>FocusIn</symbol>
+or
+<symbol>FocusOut</symbol>
+event was generated.
+This is the window used by the X server to report the event. 
+The mode member is set to indicate whether the focus events 
+are normal focus events, 
+focus events while grabbed,
+focus events
+when a grab activates, or focus events when a grab deactivates.
+The X server can set the mode member to 
+<symbol>NotifyNormal</symbol>,
+<symbol>NotifyWhileGrabbed</symbol>,
+<symbol>NotifyGrab</symbol>,
+or
+<symbol>NotifyUngrab</symbol>.
+</para>
+<para>
+<!-- .LP -->
+All 
+<symbol>FocusOut</symbol>
+events caused by a window unmap are generated after any
+<symbol>UnmapNotify</symbol>
+event; however, the X protocol does not constrain the ordering of 
+<symbol>FocusOut</symbol>
+events with respect to
+generated 
+<symbol>EnterNotify</symbol>,
+<symbol>LeaveNotify</symbol>,
+<symbol>VisibilityNotify</symbol>,
+and
+<symbol>Expose</symbol>
+events.
+</para>
+<para>
+<!-- .LP -->
+Depending on the event mode,
+the detail member is set to indicate the notify detail and can be
+<symbol>NotifyAncestor</symbol>,
+<symbol>NotifyVirtual</symbol>,
+<symbol>NotifyInferior</symbol>,
+<symbol>NotifyNonlinear</symbol>,
+<symbol>NotifyNonlinearVirtual</symbol>,
+<symbol>NotifyPointer</symbol>,
+<symbol>NotifyPointerRoot</symbol>,
+or
+<symbol>NotifyDetailNone</symbol>.
+</para>
+<sect2 id='Normal_Focus_Events_and_Focus_Events_While_Grabbed'>
+<title>Normal Focus Events and Focus Events While Grabbed</title>
+<!-- .XS -->
+<!-- (SN Normal Focus Events and Focus Events While Grabbed  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Normal focus events are identified by
+<type>XFocusInEvent</type>
+or
+<type>XFocusOutEvent</type>
+structures whose mode member is set to 
+<symbol>NotifyNormal</symbol>.
+Focus events while grabbed are identified by
+<type>XFocusInEvent</type>
+or
+<type>XFocusOutEvent</type>
+structures whose mode member is set to 
+<symbol>NotifyWhileGrabbed</symbol>.
+The X server processes normal focus and focus events while grabbed according to 
+the following:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+When the focus moves from window A to window B, A is an inferior of B, 
+and the pointer is in window P, 
+the X server does the following:
+<!-- .RS -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>FocusOut</symbol>
+event on window A, with the detail member of the
+<type>XFocusOutEvent</type>
+structure set to 
+<symbol>NotifyAncestor</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>FocusOut</symbol>
+event on each window between window A and window B, exclusive,
+with the detail member of each
+<type>XFocusOutEvent</type>
+structure set to 
+<symbol>NotifyVirtual</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>FocusIn</symbol>
+event on window B, with the detail member of the 
+<type>XFocusOutEvent</type>
+structure set to 
+<symbol>NotifyInferior</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If window P is an inferior of window B
+but window P is not window A or an inferior or ancestor of window A,
+it generates a
+<symbol>FocusIn</symbol>
+event on each window below window B, down to and including window P, 
+with the detail member of each 
+<type>XFocusInEvent</type>
+structure set to 
+<symbol>NotifyPointer</symbol>.
+<!-- .RE -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+When the focus moves from window A to window B, B is an inferior of A, 
+and the pointer is in window P, 
+the X server does the following:
+<!-- .RS -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If window P is an inferior of window A
+but P is not an inferior of window B or an ancestor of B,
+it generates a
+<symbol>FocusOut</symbol>
+event on each window from window P up to but not including window A,
+with the detail member of each 
+<type>XFocusOutEvent</type>
+structure set to  
+<symbol>NotifyPointer</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>FocusOut</symbol>
+event on window A,
+with the detail member of the
+<type>XFocusOutEvent</type>
+structure set to  
+<symbol>NotifyInferior</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>FocusIn</symbol>
+event on each window between window A and window B, exclusive, with the 
+detail member of each 
+<type>XFocusInEvent</type>
+structure set to  
+<symbol>NotifyVirtual</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>FocusIn</symbol>
+event on window B, with the detail member of the 
+<type>XFocusInEvent</type>
+structure set to  
+<symbol>NotifyAncestor</symbol>.
+<!-- .RE -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+When the focus moves from window A to window B, 
+window C is their least common ancestor, 
+and the pointer is in window P, 
+the X server does the following:
+<!-- .RS -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If window P is an inferior of window A,
+it generates a
+<symbol>FocusOut</symbol>
+event on each window from window P up to but not including window A, 
+with the detail member of the 
+<type>XFocusOutEvent</type>
+structure set to  
+<symbol>NotifyPointer</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>FocusOut</symbol>
+event on window A,
+with the detail member of the
+<type>XFocusOutEvent</type>
+structure set to  
+<symbol>NotifyNonlinear</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>FocusOut</symbol>
+event on each window between window A and window C, exclusive,
+with the detail member of each
+<type>XFocusOutEvent</type>
+structure set to  
+<symbol>NotifyNonlinearVirtual</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>FocusIn</symbol>
+event on each window between C and B, exclusive,
+with the detail member of each
+<type>XFocusInEvent</type>
+structure set to  
+<symbol>NotifyNonlinearVirtual</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>FocusIn</symbol>
+event on window B, with the detail member of the 
+<type>XFocusInEvent</type>
+structure set to  
+<symbol>NotifyNonlinear</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If window P is an inferior of window B, it generates a
+<symbol>FocusIn</symbol>
+event on each window below window B down to and including window P, 
+with the detail member of the 
+<type>XFocusInEvent</type>
+structure set to  
+<symbol>NotifyPointer</symbol>.
+<!-- .RE -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+When the focus moves from window A to window B on different screens 
+and the pointer is in window P, 
+the X server does the following:
+<!-- .RS -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If window P is an inferior of window A, it generates a
+<symbol>FocusOut</symbol>
+event on each window from window P up to but not including window A, 
+with the detail member of each 
+<type>XFocusOutEvent</type>
+structure set to  
+<symbol>NotifyPointer</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>FocusOut</symbol>
+event on window A,
+with the detail member of the
+<type>XFocusOutEvent</type>
+structure set to  
+<symbol>NotifyNonlinear</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If window A is not a root window,
+it generates a
+<symbol>FocusOut</symbol>
+event on each window above window A up to and including its root, 
+with the detail member of each
+<type>XFocusOutEvent</type>
+structure set to  
+<symbol>NotifyNonlinearVirtual</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If window B is not a root window,
+it generates a
+<symbol>FocusIn</symbol>
+event on each window from window B's root down to but not including
+window B, with the detail member of each
+<type>XFocusInEvent</type>
+structure set to  
+<symbol>NotifyNonlinearVirtual</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>FocusIn</symbol>
+event on window B, with the detail member of each 
+<type>XFocusInEvent</type>
+structure set to  
+<symbol>NotifyNonlinear</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If window P is an inferior of window B, it generates a
+<symbol>FocusIn</symbol>
+event on each window below window B down to and including window P, 
+with the detail member of each 
+<type>XFocusInEvent</type>
+structure set to  
+<symbol>NotifyPointer</symbol>.
+<!-- .RE -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+When the focus moves from window A to 
+<symbol>PointerRoot</symbol>
+(events sent to the window under the pointer)
+or
+<symbol>None</symbol>
+(discard), and the pointer is in window P,
+the X server does the following:
+<!-- .RS -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If window P is an inferior of window A, it generates a
+<symbol>FocusOut</symbol>
+event on each window from window P up to but not including window A, 
+with the detail member of each 
+<type>XFocusOutEvent</type>
+structure set to  
+<symbol>NotifyPointer</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>FocusOut</symbol>
+event on window A, with the detail member of the
+<type>XFocusOutEvent</type>
+structure set to
+<symbol>NotifyNonlinear</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If window A is not a root window,
+it generates a
+<symbol>FocusOut</symbol>
+event on each window above window A up to and including its root, 
+with the detail member of each
+<type>XFocusOutEvent</type>
+structure set to
+<symbol>NotifyNonlinearVirtual</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>FocusIn</symbol>
+event on the root window of all screens, with the detail member of each
+<type>XFocusInEvent</type>
+structure set to
+<symbol>NotifyPointerRoot</symbol>
+(or
+<symbol>NotifyDetailNone</symbol>).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the new focus is
+<symbol>PointerRoot</symbol>,
+it generates a
+<symbol>FocusIn</symbol>
+event on each window from window P's root down to and including window P, 
+with the detail member of each
+<type>XFocusInEvent</type>
+structure set to
+<symbol>NotifyPointer</symbol>.
+<!-- .RE -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+When the focus moves from 
+<symbol>PointerRoot</symbol>
+(events sent to the window under the pointer)
+or
+<symbol>None</symbol>
+to window A, and the pointer is in window P, 
+the X server does the following: 
+<!-- .RS -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the old focus is
+<symbol>PointerRoot</symbol>,
+it generates a
+<symbol>FocusOut</symbol>
+event on each window from window P up to and including window P's root, 
+with the detail member of each
+<type>XFocusOutEvent</type>
+structure set to
+<symbol>NotifyPointer</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>FocusOut</symbol>
+event on all root windows,
+with the detail member of each
+<type>XFocusOutEvent</type>
+structure set to
+<symbol>NotifyPointerRoot</symbol>
+(or
+<symbol>NotifyDetailNone</symbol>).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If window A is not a root window,
+it generates a
+<symbol>FocusIn</symbol>
+event on each window from window A's root down to but not including window A,
+with the detail member of each
+<type>XFocusInEvent</type>
+structure set to
+<symbol>NotifyNonlinearVirtual</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>FocusIn</symbol>
+event on window A,
+with the detail member of the 
+<type>XFocusInEvent</type>
+structure set to  
+<symbol>NotifyNonlinear</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If window P is an inferior of window A, it generates a
+<symbol>FocusIn</symbol>
+event on each window below window A down to and including window P, 
+with the detail member of each 
+<type>XFocusInEvent</type>
+structure set to  
+<symbol>NotifyPointer</symbol>.
+<!-- .RE -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+When the focus moves from 
+<symbol>PointerRoot</symbol>
+(events sent to the window under the pointer)
+to
+<symbol>None</symbol>
+(or vice versa), and the pointer is in window P, 
+the X server does the following:
+<!-- .RS -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the old focus is
+<symbol>PointerRoot</symbol>,
+it generates a
+<symbol>FocusOut</symbol>
+event on each window from window P up to and including window P's root, 
+with the detail member of each
+<type>XFocusOutEvent</type>
+structure set to
+<symbol>NotifyPointer</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>FocusOut</symbol>
+event on all root windows,
+with the detail member of each 
+<type>XFocusOutEvent</type>
+structure set to either
+<symbol>NotifyPointerRoot</symbol>
+or
+<symbol>NotifyDetailNone</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates a
+<symbol>FocusIn</symbol>
+event on all root windows,
+with the detail member of each
+<type>XFocusInEvent</type>
+structure set to
+<symbol>NotifyDetailNone</symbol>
+or
+<symbol>NotifyPointerRoot</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the new focus is
+<symbol>PointerRoot</symbol>,
+it generates a
+<symbol>FocusIn</symbol>
+event on each window from window P's root down to and including window P, 
+with the detail member of each
+<type>XFocusInEvent</type>
+structure set to
+<symbol>NotifyPointer</symbol>.
+<!-- .RE -->
+<!-- .\".SH 3 -->
+    </para>
+  </listitem>
+</itemizedlist>
+</sect2>
+<sect2 id="Focus_Events_Generated_by_Grabs">
+<title>Focus Events Generated by Grabs</title>
+<!-- .XS -->
+<!-- (SN Focus Events Generated by Grabs  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Focus events in which the keyboard grab activates
+are identified by
+<type>XFocusInEvent</type>
+or
+<type>XFocusOutEvent</type>
+structures whose mode member is set to 
+<symbol>NotifyGrab</symbol>.
+Focus events in which the keyboard grab deactivates
+are identified by
+<type>XFocusInEvent</type>
+or
+<type>XFocusOutEvent</type>
+structures whose mode member is set to 
+<symbol>NotifyUngrab</symbol>
+(see 
+<xref linkend='XGrabKeyboard' xrefstyle='select: title'/>).
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+When a keyboard grab activates before generating any actual 
+<symbol>KeyPress</symbol>
+event that activates the grab,
+G is the grab_window, and F is the current focus, 
+the X server does the following:
+<!-- .RS -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates 
+<symbol>FocusIn</symbol>
+and
+<symbol>FocusOut</symbol>
+events, with the mode members of the 
+<type>XFocusInEvent</type>
+and
+<type>XFocusOutEvent</type>
+structures set to 
+<symbol>NotifyGrab</symbol>.
+These events are generated
+as if the focus were to change from
+F to G.
+<!-- .RE -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+When a keyboard grab deactivates after generating any actual
+<symbol>KeyRelease</symbol>
+event that deactivates the grab,
+G is the grab_window, and F is the current focus,
+the X server does the following:
+<!-- .RS -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It generates 
+<symbol>FocusIn</symbol>
+and
+<symbol>FocusOut</symbol>
+events, with the mode members of the 
+<type>XFocusInEvent</type>
+and
+<type>XFocusOutEvent</type>
+structures set to
+<symbol>NotifyUngrab</symbol>.
+These events are generated
+as if the focus were to change from
+G to F.
+<!-- .RE -->
+    </para>
+  </listitem>
+</itemizedlist>
+</sect2>
+</sect1>
+<sect1 id="Key_Map_State_Notification_Events">
+<title>Key Map State Notification Events</title>
+<!-- .XS -->
+<!-- (SN Key Map State Notification Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>KeymapNotify</secondary></indexterm>
+<indexterm significance="preferred"><primary>KeymapNotify</primary></indexterm>
+The X server can report
+<symbol>KeymapNotify</symbol>
+events to clients that want information about changes in their keyboard state.
+</para>
+<para>
+<!-- .LP -->
+To receive
+<symbol>KeymapNotify</symbol>
+events, set the
+<symbol>KeymapStateMask</symbol>
+bit in the event-mask attribute of the window. 
+The X server generates this event immediately after every
+<symbol>EnterNotify</symbol>
+and
+<symbol>FocusIn</symbol>
+event.
+</para>
+<para>
+<!-- .LP -->
+The structure for this event type contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XKeymapEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+/* generated on EnterWindow and FocusIn when KeymapState selected */
+typedef struct {
+     int            type;           /* KeymapNotify */
+     unsigned long  serial;         /* # of last request processed by server */
+     Bool           send_event;     /* true if this came from a SendEvent request */
+     Display        *display;       /* Display the event was read from */
+     Window         window;
+     char           key_vector[32];
+} XKeymapEvent;     
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The window member is not used but is present to aid some toolkits.
+The key_vector member is set to the bit vector of the keyboard.
+Each bit set to 1 indicates that the corresponding key 
+is currently pressed.
+The vector is represented as 32 bytes.
+Byte N (from 0) contains the bits for keys 8N to 8N + 7 
+with the least significant bit in the byte representing key 8N.
+</para>
+</sect1>
+<sect1 id="Exposure_Events">
+<title>Exposure Events</title>
+<!-- .XS -->
+<!-- (SN Exposure Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The X protocol does not guarantee to preserve the contents of window 
+regions when
+the windows are obscured or reconfigured.
+Some implementations may preserve the contents of windows.
+Other implementations are free to destroy the contents of windows
+when exposed.
+X expects client applications to assume the responsibility for
+restoring the contents of an exposed window region. 
+(An exposed window region describes a formerly obscured window whose 
+region becomes visible.) 
+Therefore, the X server sends 
+<symbol>Expose</symbol>
+events describing the window and the region of the window that has been exposed.
+A naive client application usually redraws the entire window. 
+A more sophisticated client application redraws only the exposed region.
+</para>
+<sect2 id="Expose_Events">
+<title>Expose Events</title>
+<!-- .XS -->
+<!-- (SN Expose Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>Expose</secondary></indexterm>
+<indexterm significance="preferred"><primary>Expose</primary></indexterm>
+The X server can report
+<symbol>Expose</symbol>
+events to clients wanting information about when the contents of window regions
+have been lost.
+The circumstances in which the X server generates
+<symbol>Expose</symbol>
+events are not as definite as those for other events.
+However, the X server never generates
+<symbol>Expose</symbol>
+events on windows whose class you specified as
+<symbol>InputOnly</symbol>.
+The X server can generate
+<symbol>Expose</symbol>
+events when no valid contents are available for regions of a window
+and either the regions are visible, 
+the regions are viewable and the server is (perhaps newly) maintaining 
+backing store on the window,
+or the window is not viewable but the server is (perhaps newly) honoring the
+window's backing-store attribute of
+<symbol>Always</symbol>
+or
+<symbol>WhenMapped</symbol>.
+The regions decompose into an (arbitrary) set of rectangles,
+and an
+<symbol>Expose</symbol>
+event is generated for each rectangle.
+For any given window,
+the X server guarantees to report contiguously 
+all of the regions exposed by some action that causes 
+<symbol>Expose</symbol>
+events, such as raising a window.
+</para>
+<para>
+<!-- .LP -->
+To receive
+<symbol>Expose</symbol>
+events, set the
+<symbol>ExposureMask</symbol>
+bit in the event-mask attribute of the window. 
+</para>
+<para>
+<!-- .LP -->
+The structure for this event type contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XExposeEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;           /* Expose */
+     unsigned long serial;         /* # of last request processed by server */
+     Bool          send_event;     /* true if this came from a SendEvent request */
+     Display       *display;       /* Display the event was read from */
+     Window        window;
+     int           x, y;
+     int           width, height;
+     int           count;          /* if nonzero, at least this many more */
+} XExposeEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The window member is set to the exposed (damaged) window.
+The x and y members are set to the coordinates relative to the window's origin
+and indicate the upper-left corner of the rectangle.
+The width and height members are set to the size (extent) of the rectangle.
+The count member is set to the number of
+<symbol>Expose</symbol>
+events that are to follow.
+If count is zero, no more
+<symbol>Expose</symbol>
+events follow for this window.
+However, if count is nonzero, at least that number of 
+<symbol>Expose</symbol>
+events (and possibly more) follow for this window.
+Simple applications that do not want to optimize redisplay by distinguishing
+between subareas of its window can just ignore all
+<symbol>Expose</symbol>
+events with nonzero counts and perform full redisplays
+on events with zero counts.
+</para>
+</sect2>
+<sect2 id="GraphicsExpose_and_NoExpose_Events">
+<title>GraphicsExpose and NoExpose Events</title>
+<!-- .XS -->
+<!-- (SN GraphicsExpose and NoExpose Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>GraphicsExpose</secondary></indexterm>
+<indexterm><primary>Events</primary><secondary>NoExpose</secondary></indexterm>
+<indexterm significance="preferred"><primary>GraphicsExpose</primary></indexterm>
+The X server can report
+<symbol>GraphicsExpose</symbol>
+events to clients wanting information about when a destination region could not
+be computed during certain graphics requests:
+<xref linkend='XCopyArea' xrefstyle='select: title'/>
+or
+<xref linkend='XCopyPlane' xrefstyle='select: title'/>.
+The X server generates this event whenever a destination region could not be
+computed because of an obscured or out-of-bounds source region.
+In addition, the X server guarantees to report contiguously all of the regions exposed by
+some graphics request 
+(for example, copying an area of a drawable to a destination
+drawable).
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>NoExpose</primary></indexterm>
+The X server generates a
+<symbol>NoExpose</symbol>
+event whenever a graphics request that might
+produce a
+<symbol>GraphicsExpose</symbol>
+event does not produce any.
+In other words, the client is really asking for a
+<symbol>GraphicsExpose</symbol>
+event but instead receives a
+<symbol>NoExpose</symbol>
+event.
+</para>
+<para>
+<!-- .LP -->
+To receive
+<symbol>GraphicsExpose</symbol>
+or
+<symbol>NoExpose</symbol>
+events, you must first set the graphics-exposure 
+attribute of the graphics context to
+<symbol>True</symbol>.
+You also can set the graphics-expose attribute when creating a graphics
+context using
+<xref linkend='XCreateGC' xrefstyle='select: title'/>
+or by calling
+<xref linkend='XSetGraphicsExposures' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+The structures for these event types contain:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XGraphicsExposeEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int            type;           /* GraphicsExpose */
+     unsigned long  serial;         /* # of last request processed by server */
+     Bool           send_event;     /* true if this came from a SendEvent request */
+     Display        *display;       /* Display the event was read from */
+     Drawable       drawable;
+     int            x, y;
+     int            width, height;
+     int            count;          /* if nonzero, at least this many more */
+     int            major_code;     /* core is CopyArea or CopyPlane */
+     int            minor_code;     /* not defined in the core */
+} XGraphicsExposeEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XNoExposeEvent</primary></indexterm>
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;         /* NoExpose */
+     unsigned long serial;       /* # of last request processed by server */
+     Bool          send_event;   /* true if this came from a SendEvent request */
+     Display       *display;     /* Display the event was read from */
+     Drawable      drawable;
+     int           major_code;   /* core is CopyArea or CopyPlane */
+     int           minor_code;   /* not defined in the core */
+} XNoExposeEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Both structures have these common members: drawable, major_code, and minor_code.
+The drawable member is set to the drawable of the destination region on 
+which the graphics request was to be performed.
+The major_code member is set to the graphics request initiated by the client
+and can be either
+<symbol>X_CopyArea</symbol>
+or
+<symbol>X_CopyPlane</symbol>.
+If it is
+<symbol>X_CopyArea</symbol>,
+a call to
+<xref linkend='XCopyArea' xrefstyle='select: title'/>
+initiated the request.
+If it is
+<symbol>X_CopyPlane</symbol>,
+a call to
+<xref linkend='XCopyPlane' xrefstyle='select: title'/>
+initiated the request.
+These constants are defined in 
+<filename class="headerfile">&lt;X11/Xproto.h&gt;</filename>.
+<indexterm type="file"><primary><filename class="headerfile">X11/Xproto.h</filename></primary></indexterm>
+<indexterm><primary>Files</primary><secondary><filename class="headerfile">&lt;X11/Xproto.h&gt;</filename></secondary></indexterm>
+<indexterm><primary>Headers</primary><secondary><filename class="headerfile">&lt;X11/Xproto.h&gt;</filename></secondary></indexterm>
+The minor_code member,
+like the major_code member, 
+indicates which graphics request was initiated by
+the client. 
+However, the minor_code member is not defined by the core
+X protocol and will be zero in these cases, 
+although it may be used by an extension.
+</para>
+<para>
+<!-- .LP -->
+The 
+<structname>XGraphicsExposeEvent</structname>
+structure has these additional members: x, y, width, height, and count. 
+The x and y members are set to the coordinates relative to the drawable's origin
+and indicate the upper-left corner of the rectangle.
+The width and height members are set to the size (extent) of the rectangle.
+The count member is set to the number of
+<symbol>GraphicsExpose</symbol>
+events to follow.
+If count is zero, no more
+<symbol>GraphicsExpose</symbol>
+events follow for this window.
+However, if count is nonzero, at least that number of
+<symbol>GraphicsExpose</symbol>
+events (and possibly more) are to follow for this window.
+</para>
+</sect2>
+</sect1>
+<sect1 id='Window_State_Change_Events'>
+<title>Window State Change Events</title>
+<!-- .XS -->
+<!-- (SN Window State Change Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The following sections discuss:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+<symbol>CirculateNotify</symbol>
+events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>ConfigureNotify</symbol>
+events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>CreateNotify</symbol>
+events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>DestroyNotify</symbol>
+events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>GravityNotify</symbol>
+events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>MapNotify</symbol>
+events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>MappingNotify</symbol>
+events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>ReparentNotify</symbol>
+events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>UnmapNotify</symbol>
+events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>VisibilityNotify</symbol>
+events
+<!-- .\" .SH 3 -->
+    </para>
+  </listitem>
+</itemizedlist>
+<sect2 id="CirculateNotify_Events">
+<title>CirculateNotify Events</title>
+<!-- .XS -->
+<!-- (SN CirculateNotify Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>CirculateNotify</secondary></indexterm>
+<indexterm significance="preferred"><primary>CirculateNotify</primary></indexterm>
+The X server can report
+<symbol>CirculateNotify</symbol>
+events to clients wanting information about when a window changes 
+its position in the stack.
+The X server generates this event type whenever a window is actually restacked 
+as a result of a client application calling
+<xref linkend='XCirculateSubwindows' xrefstyle='select: title'/>,
+<xref linkend='XCirculateSubwindowsUp' xrefstyle='select: title'/>,
+or
+<xref linkend='XCirculateSubwindowsDown' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+To receive 
+<symbol>CirculateNotify</symbol>
+events, set the
+<symbol>StructureNotifyMask</symbol>
+bit in the event-mask attribute of the window
+or the
+<symbol>SubstructureNotifyMask</symbol>
+bit in the event-mask attribute of the parent window
+(in which case, circulating any child generates an event).
+</para>
+<para>
+<!-- .LP -->
+The structure for this event type contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XCirculateEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int type;     /* CirculateNotify */
+     unsigned long serial;     /* # of last request processed by server */
+     Bool send_event;     /* true if this came from a SendEvent request */
+     Display *display;     /* Display the event was read from */
+     Window event;
+     Window window;
+     int place;     /* PlaceOnTop, PlaceOnBottom */
+} XCirculateEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The event member is set either to the restacked window or to its parent,
+depending on whether
+<systemitem class="event">StructureNotify</systemitem>
+or
+<systemitem class="event">SubstructureNotify</systemitem>
+was selected.
+The window member is set to the window that was restacked.
+The place member is set to the window's position after the restack occurs and
+is either
+<symbol>PlaceOnTop</symbol>
+or
+<symbol>PlaceOnBottom</symbol>.
+If it is
+<symbol>PlaceOnTop</symbol>,
+the window is now on top of all siblings.
+If it is
+<symbol>PlaceOnBottom</symbol>,
+the window is now below all siblings.
+</para>
+</sect2>
+<sect2 id="ConfigureNotify_Events">
+<title>ConfigureNotify Events</title>
+<!-- .XS -->
+<!-- (SN ConfigureNotify Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>ConfigureNotify</secondary></indexterm>
+<indexterm significance="preferred"><primary>ConfigureNotify</primary></indexterm>
+The X server can report
+<symbol>ConfigureNotify</symbol>
+events to clients wanting information about actual changes to a window's
+state, such as size, position, border, and stacking order.
+The X server generates this event type whenever one of the following configure 
+window requests made by a client application actually completes:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+A window's size, position, border, and/or stacking order is reconfigured 
+by calling
+<xref linkend='XConfigureWindow' xrefstyle='select: title'/>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The window's position in the stacking order is changed by calling
+<xref linkend='XLowerWindow' xrefstyle='select: title'/>,
+<xref linkend='XRaiseWindow' xrefstyle='select: title'/>,
+or
+<xref linkend='XRestackWindows' xrefstyle='select: title'/>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A window is moved by calling
+<xref linkend='XMoveWindow' xrefstyle='select: title'/>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A window's size is changed by calling
+<xref linkend='XResizeWindow' xrefstyle='select: title'/>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A window's size and location is changed by calling
+<xref linkend='XMoveResizeWindow' xrefstyle='select: title'/>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A window is mapped and its position in the stacking order is changed
+by calling
+<xref linkend='XMapRaised' xrefstyle='select: title'/>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A window's border width is changed by calling
+<xref linkend='XSetWindowBorderWidth' xrefstyle='select: title'/>.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+To receive 
+<symbol>ConfigureNotify</symbol>
+events, set the
+<symbol>StructureNotifyMask</symbol>
+bit in the event-mask attribute of the window or the
+<symbol>SubstructureNotifyMask</symbol>
+bit in the event-mask attribute of the parent window
+(in which case, configuring any child generates an event).
+</para>
+<para>
+<!-- .LP -->
+The structure for this event type contains:
+</para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XConfigureEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;       /* ConfigureNotify */
+     unsigned long serial;     /* # of last request processed by server */
+     Bool          send_event; /* true if this came from a SendEvent request */
+     Display       *display;   /* Display the event was read from */
+     Window        event;
+     Window        window;
+     int           x, y;
+     int           width, height;
+     int           border_width;
+     Window        above;
+     Bool          override_redirect;
+} XConfigureEvent;
+</literallayout>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The event member is set either to the reconfigured window or to its parent,
+depending on whether
+<systemitem class="event">StructureNotify</systemitem>
+or
+<systemitem class="event">SubstructureNotify</systemitem>
+was selected.
+The window member is set to the window whose size, position, 
+border, and/or stacking
+order was changed.
+</para>
+<para>
+<!-- .LP -->
+The x and y members are set to the coordinates relative to the parent window's 
+origin and indicate the position of the upper-left outside corner of the window.
+The width and height members are set to the inside size of the window, 
+not including
+the border.
+The border_width member is set to the width of the window's border, in pixels.
+</para>
+<para>
+<!-- .LP -->
+The above member is set to the sibling window and is used 
+for stacking operations.
+If the X server sets this member to
+<symbol>None</symbol>,
+the window whose state was changed is on the bottom of the stack
+with respect to sibling windows.
+However, if this member is set to a sibling window, 
+the window whose state was changed is placed on top of this sibling window.
+</para>
+<para>
+<!-- .LP -->
+The override_redirect member is set to the override-redirect attribute of the
+window.
+Window manager clients normally should ignore this window if the 
+override_redirect member
+is
+<symbol>True</symbol>.
+</para>
+</sect2>
+<sect2 id="CreateNotify_Events">
+<title>CreateNotify Events</title>
+<!-- .XS -->
+<!-- (SN CreateNotify Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>CreateNotify</secondary></indexterm>
+<indexterm significance="preferred"><primary>CreateNotify</primary></indexterm>
+The X server can report
+<symbol>CreateNotify</symbol>
+events to clients wanting information about creation of windows.
+The X server generates this event whenever a client
+application creates a window by calling
+<xref linkend='XCreateWindow' xrefstyle='select: title'/>
+or
+<xref linkend='XCreateSimpleWindow' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+To receive 
+<symbol>CreateNotify</symbol>
+events, set the
+<symbol>SubstructureNotifyMask</symbol>
+bit in the event-mask attribute of the window.
+Creating any children then generates an event.
+</para>
+<para>
+<!-- .LP -->
+The structure for the event type contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XCreateWindowEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;               /* CreateNotify */
+     unsigned long serial;             /* # of last request processed by server */
+     Bool          send_event;         /* true if this came from a SendEvent request */
+     Display       *display;           /* Display the event was read from */
+     Window        parent;             /* parent of the window */
+     Window        window;             /* window id of window created */
+     int           x, y;               /* window location */
+     int           width, height;      /* size of window */
+     int           border_width;       /* border width */
+     Bool          override_redirect;  /* creation should be overridden */
+} XCreateWindowEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The parent member is set to the created window's parent.
+The window member specifies the created window.
+The x and y members are set to the created window's coordinates relative 
+to the parent window's origin and indicate the position of the upper-left 
+outside corner of the created window.
+The width and height members are set to the inside size of the created window 
+(not including the border) and are always nonzero.
+The border_width member is set to the width of the created window's border, in pixels.
+The override_redirect member is set to the override-redirect attribute of the
+window.
+Window manager clients normally should ignore this window 
+if the override_redirect member is
+<symbol>True</symbol>.
+</para>
+</sect2>
+<sect2 id="DestroyNotify_Events">
+<title>DestroyNotify Events</title>
+<!-- .XS -->
+<!-- (SN DestroyNotify Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>DestroyNotify</secondary></indexterm>
+<indexterm significance="preferred"><primary>DestroyNotify</primary></indexterm>
+The X server can report
+<symbol>DestroyNotify</symbol>
+events to clients wanting information about which windows are destroyed.
+The X server generates this event whenever a client application destroys a 
+window by calling
+<xref linkend='XDestroyWindow' xrefstyle='select: title'/>
+or
+<xref linkend='XDestroySubwindows' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+The ordering of the 
+<symbol>DestroyNotify</symbol>
+events is such that for any given window, 
+<symbol>DestroyNotify</symbol>
+is generated on all inferiors of the window
+before being generated on the window itself.  
+The X protocol does not constrain the ordering among
+siblings and across subhierarchies.
+</para>
+<para>
+<!-- .LP -->
+To receive 
+<symbol>DestroyNotify</symbol>
+events, set the
+<symbol>StructureNotifyMask</symbol>
+bit in the event-mask attribute of the window or the
+<symbol>SubstructureNotifyMask</symbol>
+bit in the event-mask attribute of the parent window
+(in which case, destroying any child generates an event).
+</para>
+<para>
+<!-- .LP -->
+The structure for this event type contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XDestroyWindowEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;       /* DestroyNotify */
+     unsigned long serial;     /* # of last request processed by server */
+     Bool          send_event; /* true if this came from a SendEvent request */
+     Display       *display;   /* Display the event was read from */
+     Window        event;
+     Window        window;
+} XDestroyWindowEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The event member is set either to the destroyed window or to its parent,
+depending on whether
+<systemitem class="event">StructureNotify</systemitem>
+or 
+<systemitem class="event">SubstructureNotify</systemitem>
+was selected.
+The window member is set to the window that is destroyed.
+</para>
+</sect2>
+<sect2 id="GravityNotify_Events">
+<title>GravityNotify Events</title>
+<!-- .XS -->
+<!-- (SN GravityNotify Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>GravityNotify</secondary></indexterm>
+<indexterm significance="preferred"><primary>GravityNotify</primary></indexterm>
+The X server can report
+<symbol>GravityNotify</symbol>
+events to clients wanting information about when a window is moved because of a
+change in the size of its parent.
+The X server generates this event whenever a client
+application actually moves a child window as a result of resizing its parent by calling
+<xref linkend='XConfigureWindow' xrefstyle='select: title'/>,
+<xref linkend='XMoveResizeWindow' xrefstyle='select: title'/>,
+or
+<xref linkend='XResizeWindow' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+To receive 
+<symbol>GravityNotify</symbol>
+events, set the
+<symbol>StructureNotifyMask</symbol>
+bit in the event-mask attribute of the window or the
+<symbol>SubstructureNotifyMask</symbol>
+bit in the event-mask attribute of the parent window
+(in which case, any child that is moved because its parent has been resized
+generates an event).
+</para>
+<para>
+<!-- .LP -->
+The structure for this event type contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XGravityEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;       /* GravityNotify */
+     unsigned long serial;     /* # of last request processed by server */
+     Bool          send_event; /* true if this came from a SendEvent request */
+     Display       *display;   /* Display the event was read from */
+     Window        event;
+     Window        window;
+     int           x, y;
+} XGravityEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The event member is set either to the window that was moved or to its parent,
+depending on whether
+<systemitem class="event">StructureNotify</systemitem>
+or
+<systemitem class="event">SubstructureNotify</systemitem>
+was selected.
+The window member is set to the child window that was moved.
+The x and y members are set to the coordinates relative to the 
+new parent window's origin
+and indicate the position of the upper-left outside corner of the 
+window.
+</para>
+</sect2>
+<sect2 id="MapNotify_Events">
+<title>MapNotify Events</title>
+<!-- .XS -->
+<!-- (SN MapNotify Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>MapNotify</secondary></indexterm>
+<indexterm significance="preferred"><primary>MapNotify</primary></indexterm>
+The X server can report
+<symbol>MapNotify</symbol>
+events to clients wanting information about which windows are mapped.
+The X server generates this event type whenever a client application changes the
+window's state from unmapped to mapped by calling
+<xref linkend='XMapWindow' xrefstyle='select: title'/>,
+<xref linkend='XMapRaised' xrefstyle='select: title'/>,
+<xref linkend='XMapSubwindows' xrefstyle='select: title'/>,
+<xref linkend='XReparentWindow' xrefstyle='select: title'/>,
+or as a result of save-set processing.
+</para>
+<para>
+<!-- .LP -->
+To receive 
+<symbol>MapNotify</symbol>
+events, set the
+<symbol>StructureNotifyMask</symbol>
+bit in the event-mask attribute of the window or the
+<symbol>SubstructureNotifyMask</symbol>
+bit in the event-mask attribute of the parent window
+(in which case, mapping any child generates an event).
+</para>
+<para>
+<!-- .LP -->
+The structure for this event type contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XMapEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;                  /* MapNotify */
+     unsigned long serial;                /* # of last request processed by server */
+     Bool          send_event;            /* true if this came from a SendEvent request */
+     Display       *display;              /* Display the event was read from */
+     Window        event;
+     Window        window;
+     Bool          override_redirect;     /* boolean, is override set... */
+} XMapEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The event member is set either to the window that was mapped or to its parent,
+depending on whether
+<systemitem class="event">StructureNotify</systemitem>
+or
+<systemitem class="event">SubstructureNotify</systemitem>
+was selected.
+The window member is set to the window that was mapped.
+The override_redirect member is set to the override-redirect attribute
+of the window.
+Window manager clients normally should ignore this window 
+if the override-redirect attribute is
+<symbol>True</symbol>,
+because these events usually are generated from pop-ups,
+which override structure control.
+</para>
+</sect2>
+<sect2 id="MappingNotify_Events">
+<title>MappingNotify Events</title>
+<!-- .XS -->
+<!-- (SN MappingNotify Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>MappingNotify</secondary></indexterm>
+<indexterm significance="preferred"><primary>MappingNotify</primary></indexterm>
+The X server reports
+<symbol>MappingNotify</symbol>
+events to all clients.
+There is no mechanism to express disinterest in this event.
+The X server generates this event type whenever a client application 
+successfully calls:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+<xref linkend='XSetModifierMapping' xrefstyle='select: title'/>
+to indicate which KeyCodes are to be used as modifiers
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XChangeKeyboardMapping' xrefstyle='select: title'/>
+to change the keyboard mapping
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XSetPointerMapping' xrefstyle='select: title'/>
+to set the pointer mapping
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+The structure for this event type contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XMappingEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;           /* MappingNotify */
+     unsigned long serial;         /* # of last request processed by server */
+     Bool          send_event;     /* true if this came from a SendEvent request */
+     Display       *display;       /* Display the event was read from */
+     Window        window;         /* unused */
+     int           request;        /* one of MappingModifier, MappingKeyboard,
+                   MappingPointer  */
+     int           first_keycode;  /* first keycode */
+     int           count;          /* defines range of change w. first_keycode*/
+} XMappingEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The request member is set to indicate the kind of mapping change that occurred
+and can be
+<symbol>MappingModifier</symbol>,
+<symbol>MappingKeyboard</symbol>,
+or
+<symbol>MappingPointer</symbol>.
+If it is
+<symbol>MappingModifier</symbol>,
+the modifier mapping was changed.
+If it is
+<symbol>MappingKeyboard</symbol>,
+the keyboard mapping was changed.
+If it is
+<symbol>MappingPointer</symbol>,
+the pointer button mapping was changed. 
+The first_keycode and count members are set only 
+if the request member was set to
+<symbol>MappingKeyboard</symbol>.
+The number in first_keycode represents the first number in the range 
+of the altered mapping, 
+and count represents the number of keycodes altered.
+</para>
+<para>
+<!-- .LP -->
+To update the client application's knowledge of the keyboard,
+you should call
+<xref linkend='XRefreshKeyboardMapping' xrefstyle='select: title'/>.
+</para>
+</sect2>
+<sect2 id="ReparentNotify_Events">
+<title>ReparentNotify Events</title>
+<!-- .XS -->
+<!-- (SN ReparentNotify Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>ReparentNotify</secondary></indexterm>
+<indexterm significance="preferred"><primary>ReparentNotify</primary></indexterm>
+The X server can report
+<symbol>ReparentNotify</symbol>
+events to clients wanting information about changing a window's parent.
+The X server generates this event whenever a client
+application calls
+<xref linkend='XReparentWindow' xrefstyle='select: title'/>
+and the window is actually reparented.
+</para>
+<para>
+<!-- .LP -->
+To receive 
+<symbol>ReparentNotify</symbol>
+events, set the
+<symbol>StructureNotifyMask</symbol>
+bit in the event-mask attribute of the window or the
+<symbol>SubstructureNotifyMask</symbol>
+bit in the event-mask attribute of either the old or the new parent window
+(in which case, reparenting any child generates an event).
+</para>
+<para>
+<!-- .LP -->
+The structure for this event type contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XReparentEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;       /* ReparentNotify */
+     unsigned long serial;     /* # of last request processed by server */
+     Bool          send_event; /* true if this came from a SendEvent request */
+     Display       *display;   /* Display the event was read from */
+     Window        event;
+     Window        window;
+     Window        parent;
+     int           x, y;
+     Bool          override_redirect;
+} XReparentEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The event member is set either to the reparented window
+or to the old or the new parent, depending on whether
+<systemitem class="event">StructureNotify</systemitem>
+or
+<systemitem class="event">SubstructureNotify</systemitem>
+was selected. 
+The window member is set to the window that was reparented.
+The parent member is set to the new parent window.
+The x and y members are set to the reparented window's coordinates relative 
+to the new parent window's
+origin and define the upper-left outer corner of the reparented window.
+The override_redirect member is set to the override-redirect attribute of the
+window specified by the window member.
+Window manager clients normally should ignore this window 
+if the override_redirect member is
+<symbol>True</symbol>.
+</para>
+</sect2>
+<sect2 id="UnmapNotify_Events">
+<title>UnmapNotify Events</title>
+<!-- .XS -->
+<!-- (SN UnmapNotify Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>UnmapNotify</secondary></indexterm>
+<indexterm significance="preferred"><primary>UnmapNotify</primary></indexterm>
+The X server can report
+<symbol>UnmapNotify</symbol>
+events to clients wanting information about which windows are unmapped.
+The X server generates this event type whenever a client application changes the
+window's state from mapped to unmapped.
+</para>
+<para>
+<!-- .LP -->
+To receive 
+<symbol>UnmapNotify</symbol>
+events, set the
+<symbol>StructureNotifyMask</symbol>
+bit in the event-mask attribute of the window or the
+<symbol>SubstructureNotifyMask</symbol>
+bit in the event-mask attribute of the parent window
+(in which case, unmapping any child window generates an event).
+</para>
+<para>
+<!-- .LP -->
+The structure for this event type contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XUnmapEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;       /* UnmapNotify */
+     unsigned long serial;     /* # of last request processed by server */
+     Bool          send_event; /* true if this came from a SendEvent request */
+     Display       *display;   /* Display the event was read from */
+     Window        event;
+     Window        window;
+     Bool          from_configure;
+} XUnmapEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The event member is set either to the unmapped window or to its parent,
+depending on whether
+<systemitem class="event">StructureNotify</systemitem>
+or
+<systemitem class="event">SubstructureNotify</systemitem>
+was selected.
+This is the window used by the X server to report the event.
+The window member is set to the window that was unmapped.
+The from_configure member is set to
+<symbol>True</symbol>
+if the event was generated as a result of a resizing of the window's parent when
+the window itself had a win_gravity of
+<symbol>UnmapGravity</symbol>.
+</para>
+</sect2>
+<sect2 id="VisibilityNotify_Events">
+<title>VisibilityNotify Events</title>
+<!-- .XS -->
+<!-- (SN VisibilityNotify Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>VisibilityNotify</secondary></indexterm>
+<indexterm significance="preferred"><primary>VisibilityNotify</primary></indexterm>
+The X server can report
+<symbol>VisibilityNotify</symbol>
+events to clients wanting any change in the visibility of the specified window.
+A region of a window is visible if someone looking at the screen can
+actually see it.
+The X server generates this event whenever the visibility changes state. 
+However, this event is never generated for windows whose class is
+<symbol>InputOnly</symbol>.
+</para>
+<para>
+<!-- .LP -->
+All 
+<symbol>VisibilityNotify</symbol>
+events caused by a hierarchy change are generated
+after any hierarchy event
+(<symbol>UnmapNotify</symbol>,
+<symbol>MapNotify</symbol>,
+<symbol>ConfigureNotify</symbol>,
+<symbol>GravityNotify</symbol>,
+<symbol>CirculateNotify</symbol>)
+caused by that change.  Any
+<symbol>VisibilityNotify</symbol>
+event on a given window is generated before any
+<symbol>Expose</symbol>
+events on that window, but it is not required that all
+<symbol>VisibilityNotify</symbol>
+events on all windows be generated before all 
+<symbol>Expose</symbol>
+events on all windows.  
+The X protocol does not constrain the ordering of 
+<symbol>VisibilityNotify</symbol>
+events with
+respect to 
+<symbol>FocusOut</symbol>,
+<symbol>EnterNotify</symbol>,
+and 
+<symbol>LeaveNotify</symbol>
+events.
+</para>
+<para>
+<!-- .LP -->
+To receive 
+<symbol>VisibilityNotify</symbol>
+events, set the
+<symbol>VisibilityChangeMask</symbol>
+bit in the event-mask attribute of the window. 
+</para>
+<para>
+<!-- .LP -->
+The structure for this event type contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XVisibilityEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;       /* VisibilityNotify */
+     unsigned long serial;     /* # of last request processed by server */
+     Bool          send_event; /* true if this came from a SendEvent request */
+     Display       *display;   /* Display the event was read from */
+     Window        window;
+     int           state;
+} XVisibilityEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The window member is set to the window whose visibility state changes.
+The state member is set to the state of the window's visibility and can be
+<symbol>VisibilityUnobscured</symbol>,
+<symbol>VisibilityPartiallyObscured</symbol>,
+or
+<symbol>VisibilityFullyObscured</symbol>.
+The X server ignores all of a window's subwindows
+when determining the visibility state of the window and processes 
+<symbol>VisibilityNotify</symbol>
+events according to the following:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+When the window changes state from partially obscured, fully obscured,
+or not viewable to viewable and completely unobscured,
+the X server generates the event with the state member of the
+<structname>XVisibilityEvent</structname>
+structure set to
+<symbol>VisibilityUnobscured</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+When the window changes state from viewable and completely unobscured or 
+not viewable to viewable and partially obscured,
+the X server generates the event with the state member of the
+<structname>XVisibilityEvent</structname>
+structure set to
+<symbol>VisibilityPartiallyObscured</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+When the window changes state from viewable and completely unobscured, 
+viewable and partially obscured, or not viewable to viewable and 
+fully obscured,
+the X server generates the event with the state member of the
+<structname>XVisibilityEvent</structname>
+structure set to
+<symbol>VisibilityFullyObscured</symbol>.
+    </para>
+  </listitem>
+</itemizedlist>
+</sect2>
+</sect1>
+<sect1 id="Structure_Control_Events">
+<title>Structure Control Events</title>
+<!-- .XS -->
+<!-- (SN Structure Control Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+This section discusses:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+<symbol>CirculateRequest</symbol>
+events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>ConfigureRequest</symbol>
+events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>MapRequest</symbol>
+events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>ResizeRequest</symbol>
+events
+    </para>
+  </listitem>
+</itemizedlist>
+<sect2 id="CirculateRequest_Events">
+<title>CirculateRequest Events</title>
+<!-- .XS -->
+<!-- (SN CirculateRequest Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>CirculateRequest</secondary></indexterm>
+<indexterm significance="preferred"><primary>CirculateRequest</primary></indexterm>
+The X server can report
+<symbol>CirculateRequest</symbol>
+events to clients wanting information about 
+when another client initiates a circulate window request 
+on a specified window.
+The X server generates this event type whenever a client initiates a circulate
+window request on a window and a subwindow actually needs to be restacked. 
+The client initiates a circulate window request on the window by calling
+<xref linkend='XCirculateSubwindows' xrefstyle='select: title'/>,
+<xref linkend='XCirculateSubwindowsUp' xrefstyle='select: title'/>,
+or
+<xref linkend='XCirculateSubwindowsDown' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+To receive
+<symbol>CirculateRequest</symbol>
+events, set the
+<symbol>SubstructureRedirectMask</symbol>
+in the event-mask attribute of the window. 
+Then, in the future,
+the circulate window request for the specified window is not executed,
+and thus, any subwindow's position in the stack is not changed.
+For example, suppose a client application calls
+<xref linkend='XCirculateSubwindowsUp' xrefstyle='select: title'/>
+to raise a subwindow to the top of the stack.
+If you had selected
+<symbol>SubstructureRedirectMask</symbol>
+on the window, the X server reports to you a
+<symbol>CirculateRequest</symbol>
+event and does not raise the subwindow to the top of the stack.
+</para>
+<para>
+<!-- .LP -->
+The structure for this event type contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XCirculateRequestEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;       /* CirculateRequest */
+     unsigned long serial;     /* # of last request processed by server */
+     Bool          send_event; /* true if this came from a SendEvent request */
+     Display       *display;   /* Display the event was read from */
+     Window        parent;
+     Window        window;
+     int place;                /* PlaceOnTop, PlaceOnBottom */
+} XCirculateRequestEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The parent member is set to the parent window.
+The window member is set to the subwindow to be restacked.
+The place member is set to what the new position in the stacking order should be
+and is either
+<symbol>PlaceOnTop</symbol>
+or
+<symbol>PlaceOnBottom</symbol>.
+If it is
+<symbol>PlaceOnTop</symbol>,
+the subwindow should be on top of all siblings.
+If it is
+<symbol>PlaceOnBottom</symbol>,
+the subwindow should be below all siblings.
+</para>
+</sect2>
+<sect2 id="ConfigureRequest_Events">
+<title>ConfigureRequest Events</title>
+<!-- .XS -->
+<!-- (SN ConfigureRequest Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>ConfigureRequest</secondary></indexterm>
+<indexterm significance="preferred"><primary>ConfigureRequest</primary></indexterm>
+The X server can report
+<symbol>ConfigureRequest</symbol>
+events to clients wanting information about when a different client initiates 
+a configure window request on any child of a specified window. 
+The configure window request attempts to 
+reconfigure a window's size, position, border, and stacking order.
+The X server generates this event whenever a different client initiates
+a configure window request on a window by calling
+<xref linkend='XConfigureWindow' xrefstyle='select: title'/>,
+<xref linkend='XLowerWindow' xrefstyle='select: title'/>,
+<xref linkend='XRaiseWindow' xrefstyle='select: title'/>,
+<xref linkend='XMapRaised' xrefstyle='select: title'/>,
+<xref linkend='XMoveResizeWindow' xrefstyle='select: title'/>,
+<xref linkend='XMoveWindow' xrefstyle='select: title'/>,
+<xref linkend='XResizeWindow' xrefstyle='select: title'/>,
+<xref linkend='XRestackWindows' xrefstyle='select: title'/>,
+or
+<xref linkend='XSetWindowBorderWidth' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+To receive
+<symbol>ConfigureRequest</symbol>
+events, set the
+<symbol>SubstructureRedirectMask</symbol>
+bit in the event-mask attribute of the window. 
+<symbol>ConfigureRequest</symbol>
+events are generated when a
+<systemitem>ConfigureWindow</systemitem>
+protocol request is issued on a child window by another client.
+For example, suppose a client application calls
+<xref linkend='XLowerWindow' xrefstyle='select: title'/>
+to lower a window.
+If you had selected
+<symbol>SubstructureRedirectMask</symbol>
+on the parent window and if the override-redirect attribute 
+of the window is set to
+<symbol>False</symbol>,
+the X server reports a
+<symbol>ConfigureRequest</symbol>
+event to you and does not lower the specified window.
+</para>
+<para>
+<!-- .LP -->
+The structure for this event type contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XConfigureRequestEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;         /* ConfigureRequest */
+     unsigned long serial;       /* # of last request processed by server */
+     Bool          send_event;   /* true if this came from a SendEvent request */
+     Display       *display;     /* Display the event was read from */
+     Window        parent;
+     Window        window;
+     int           x, y;
+     int           width, height;
+     int           border_width;
+     Window        above;
+     int           detail;       /* Above, Below, TopIf, BottomIf, Opposite */
+     unsigned long value_mask;
+} XConfigureRequestEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The parent member is set to the parent window.
+The window member is set to the window whose size, position, border width, 
+and/or stacking order is to be reconfigured.
+The value_mask member indicates which components were specified in the
+<systemitem>ConfigureWindow</systemitem>
+protocol request.
+The corresponding values are reported as given in the request.
+The remaining values are filled in from the current geometry of the window,
+except in the case of above (sibling) and detail (stack-mode),
+which are reported as
+<symbol>None</symbol>
+and
+<symbol>Above</symbol>,
+respectively, if they are not given in the request.
+</para>
+</sect2>
+<sect2 id="MapRequest_Events">
+<title>MapRequest Events</title>
+<!-- .XS -->
+<!-- (SN MapRequest Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>MapRequest</secondary></indexterm>
+<indexterm significance="preferred"><primary>MapRequest</primary></indexterm>
+The X server can report
+<symbol>MapRequest</symbol>
+events to clients wanting information about a different client's desire 
+to map windows.
+A window is considered mapped when a map window request completes.
+The X server generates this event whenever a different client initiates 
+a map window request on an unmapped window whose override_redirect member 
+is set to
+<symbol>False</symbol>.
+Clients initiate map window requests by calling
+<xref linkend='XMapWindow' xrefstyle='select: title'/>,
+<xref linkend='XMapRaised' xrefstyle='select: title'/>,
+or
+<xref linkend='XMapSubwindows' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+To receive
+<symbol>MapRequest</symbol>
+events, set the
+<symbol>SubstructureRedirectMask</symbol>
+bit in the event-mask attribute of the window. 
+This means another client's attempts to map a child window by calling one of
+the map window request functions is intercepted, and you are sent a 
+<symbol>MapRequest</symbol>
+instead.
+For example, suppose a client application calls
+<xref linkend='XMapWindow' xrefstyle='select: title'/>
+to map a window.
+If you (usually a window manager) had selected
+<symbol>SubstructureRedirectMask</symbol>
+on the parent window and if the override-redirect attribute 
+of the window is set to
+<symbol>False</symbol>,
+the X server reports a
+<symbol>MapRequest</symbol>
+event to you 
+and does not map the specified window.
+Thus, this event gives your window manager client the ability 
+to control the placement of subwindows.
+</para>
+<para>
+<!-- .LP -->
+The structure for this event type contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XMapRequestEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;       /* MapRequest */
+     unsigned long serial;     /* # of last request processed by server */
+     Bool          send_event; /* true if this came from a SendEvent request */
+     Display       *display;   /* Display the event was read from */
+     Window        parent;
+     Window        window;
+} XMapRequestEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The parent member is set to the parent window.
+The window member is set to the window to be mapped.
+</para>
+</sect2>
+<sect2 id="ResizeRequest_Events">
+<title>ResizeRequest Events</title>
+<!-- .XS -->
+<!-- (SN ResizeRequest Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>ResizeRequest</secondary></indexterm>
+<indexterm significance="preferred"><primary>ResizeRequest</primary></indexterm>
+The X server can report
+<symbol>ResizeRequest</symbol>
+events to clients wanting information about another client's attempts to change the
+size of a window.
+The X server generates this event whenever some other client attempts to change
+the size of the specified window by calling
+<xref linkend='XConfigureWindow' xrefstyle='select: title'/>,
+<xref linkend='XResizeWindow' xrefstyle='select: title'/>,
+or
+<xref linkend='XMoveResizeWindow' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+To receive
+<symbol>ResizeRequest</symbol>
+events, set the
+<symbol>ResizeRedirect</symbol>
+bit in the event-mask attribute of the window. 
+Any attempts to change the size by other clients are then redirected.
+</para>
+<para>
+<!-- .LP -->
+The structure for this event type contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XResizeRequestEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;        /* ResizeRequest */
+     unsigned long serial;      /* # of last request processed by server */
+     Bool          send_event;  /* true if this came from a SendEvent request */
+     Display       *display;    /* Display the event was read from */
+     Window        window;
+     int           width, height;
+} XResizeRequestEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The window member is set to the window whose size another 
+client attempted to change.
+The width and height members are set to the inside size of the window, 
+excluding the border.
+</para>
+</sect2>
+</sect1>
+<sect1 id="Colormap_State_Change_Events">
+<title>Colormap State Change Events</title>
+<!-- .XS -->
+<!-- (SN Colormap State Change Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>ColormapNotify</secondary></indexterm>
+<indexterm significance="preferred"><primary>ColormapNotify</primary></indexterm>
+The X server can report
+<symbol>ColormapNotify</symbol>
+events to clients wanting information about when the colormap changes 
+and when a colormap is installed or uninstalled. 
+The X server generates this event type whenever a client application:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Changes the colormap member of the
+<structname>XSetWindowAttributes</structname>
+structure by 
+calling
+<xref linkend='XChangeWindowAttributes' xrefstyle='select: title'/>,
+<xref linkend='XFreeColormap' xrefstyle='select: title'/>,
+or
+<xref linkend='XSetWindowColormap' xrefstyle='select: title'/>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Installs or uninstalls the colormap by calling
+<xref linkend='XInstallColormap' xrefstyle='select: title'/>
+or
+<xref linkend='XUninstallColormap' xrefstyle='select: title'/>
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+To receive 
+<symbol>ColormapNotify</symbol>
+events, set the
+<symbol>ColormapChangeMask</symbol>
+bit in the event-mask attribute of the window. 
+</para>
+<para>
+<!-- .LP -->
+The structure for this event type contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XColormapEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;       /* ColormapNotify */
+     unsigned long serial;     /* # of last request processed by server */
+     Bool          send_event; /* true if this came from a SendEvent request */
+     Display       *display;   /* Display the event was read from */
+     Window        window;
+     Colormap      colormap;   /* colormap or None */
+     Bool          new;
+     int           state;      /* ColormapInstalled, ColormapUninstalled */
+} XColormapEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The window member is set to the window whose associated 
+colormap is changed, installed, or uninstalled.
+For a colormap that is changed, installed, or uninstalled,
+the colormap member is set to the colormap associated with the window. 
+For a colormap that is changed by a call to
+<xref linkend='XFreeColormap' xrefstyle='select: title'/>,
+the colormap member is set to
+<symbol>None</symbol>.
+The new member is set to indicate whether the colormap 
+for the specified window was changed or installed or uninstalled
+and can be 
+<symbol>True</symbol>
+or
+<symbol>False</symbol>.
+If it is
+<symbol>True</symbol>,
+the colormap was changed.
+If it is
+<symbol>False</symbol>,
+the colormap was installed or uninstalled.
+The state member is always set to indicate whether the colormap is installed or
+uninstalled and can be 
+<symbol>ColormapInstalled</symbol>
+or
+<symbol>ColormapUninstalled</symbol>.
+</para>
+</sect1>
+<sect1 id="Client_Communication_Events">
+<title>Client Communication Events</title>
+<!-- .XS -->
+<!-- (SN Client Communication Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+This section discusses:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+<symbol>ClientMessage</symbol>
+events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>PropertyNotify</symbol>
+events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>SelectionClear</symbol>
+events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>SelectionNotify</symbol>
+events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<symbol>SelectionRequest</symbol>
+events
+    </para>
+  </listitem>
+</itemizedlist>
+<sect2 id="ClientMessage_Events">
+<title>ClientMessage Events</title>
+<!-- .XS -->
+<!-- (SN ClientMessage Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>ClientMessage</secondary></indexterm>
+<indexterm significance="preferred"><primary>ClientMessage</primary></indexterm>
+The X server generates
+<symbol>ClientMessage</symbol>
+events only when a client calls the function
+<xref linkend='XSendEvent' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+The structure for this event type contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XClientMessageEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 1i 3i -->
+<!-- .ta .5i 1i 3i -->
+typedef struct {
+     int           type;           /* ClientMessage */
+     unsigned long serial;         /* # of last request processed by server */
+     Bool          send_event;     /* true if this came from a SendEvent request */
+     Display       *display;       /* Display the event was read from */
+     Window        window;
+     Atom          message_type;
+     int           format;
+     union         {
+                     char  b[20];
+                     short s[10];
+                     long  l[5];
+                   } data;
+} XClientMessageEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The message_type member is set to an atom that indicates how the data 
+should be interpreted by the receiving client.
+The format member is set to 8, 16, or 32 and specifies whether the data
+should be viewed as a list of bytes, shorts, or longs.
+The data member is a union that contains the members b, s, and l.
+The b, s, and l members represent data of twenty 8-bit values, 
+ten 16-bit values, and five 32-bit values.
+Particular message types might not make use of all these values.
+The X server places no interpretation on the values in the window,
+message_type, or data members.
+</para>
+</sect2>
+<sect2 id="PropertyNotify_Events">
+<title>PropertyNotify Events</title>
+<!-- .XS -->
+<!-- (SN PropertyNotify Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>PropertyNotify</secondary></indexterm>
+<indexterm significance="preferred"><primary>PropertyNotify</primary></indexterm>
+The X server can report
+<symbol>PropertyNotify</symbol>
+events to clients wanting information about property changes 
+for a specified window.
+</para>
+<para>
+<!-- .LP -->
+To receive
+<symbol>PropertyNotify</symbol>
+events, set the
+<symbol>PropertyChangeMask</symbol>
+bit in the event-mask attribute of the window. 
+</para>
+<para>
+<!-- .LP -->
+The structure for this event type contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XPropertyEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;       /* PropertyNotify */
+     unsigned long serial;     /* # of last request processed by server */
+     Bool          send_event; /* true if this came from a SendEvent request */
+     Display       *display;   /* Display the event was read from */
+     Window        window;
+     Atom atom;
+     Time time;
+     int state;                /* PropertyNewValue or PropertyDelete */
+} XPropertyEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The window member is set to the window whose associated 
+property was changed.
+The atom member is set to the property's atom and indicates which
+property was changed or desired.
+The time member is set to the server time when the property was changed.
+The state member is set to indicate whether the property was changed 
+to a new value or deleted and can be
+<symbol>PropertyNewValue</symbol>
+or
+<symbol>PropertyDelete</symbol>.
+The state member is set to
+<symbol>PropertyNewValue</symbol>
+when a property of the window is changed using
+<xref linkend='XChangeProperty' xrefstyle='select: title'/>
+or
+<xref linkend='XRotateWindowProperties' xrefstyle='select: title'/>
+(even when adding zero-length data using
+<xref linkend='XChangeProperty' xrefstyle='select: title'/>)
+and when replacing all or part of a property with identical data using
+<xref linkend='XChangeProperty' xrefstyle='select: title'/>
+or 
+<xref linkend='XRotateWindowProperties' xrefstyle='select: title'/>.
+The state member is set to
+<symbol>PropertyDelete</symbol>
+when a property of the window is deleted using
+<xref linkend='XDeleteProperty' xrefstyle='select: title'/>
+or, if the delete argument is 
+<symbol>True</symbol>,
+<xref linkend='XGetWindowProperty' xrefstyle='select: title'/>.
+</para>
+</sect2>
+<sect2 id="SelectionClear_Events">
+<title>SelectionClear Events</title>
+<!-- .XS -->
+<!-- (SN SelectionClear Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm ><primary>Events</primary><secondary>SelectionClear</secondary></indexterm>
+<indexterm significance="preferred"><primary>SelectionClear</primary></indexterm>
+The X server reports
+<symbol>SelectionClear</symbol>
+events to the client losing ownership of a selection.
+The X server generates this event type when another client
+asserts ownership of the selection by calling
+<xref linkend='XSetSelectionOwner' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+The structure for this event type contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XSelectionClearEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;       /* SelectionClear */
+     unsigned long serial;     /* # of last request processed by server */
+     Bool          send_event; /* true if this came from a SendEvent request */
+     Display       *display;   /* Display the event was read from */
+     Window        window;
+     Atom          selection;
+     Time          time;
+} XSelectionClearEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The selection member is set to the selection atom.
+The time member is set to the last change time recorded for the 
+selection.
+The window member is the window that was specified by the current owner
+(the owner losing the selection) in its
+<xref linkend='XSetSelectionOwner' xrefstyle='select: title'/>
+call.
+</para>
+</sect2>
+<sect2 id="SelectionRequest_Events">
+<title>SelectionRequest Events</title>
+<!-- .XS -->
+<!-- (SN SelectionRequest Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>SelectionRequest</secondary></indexterm>
+<indexterm significance="preferred"><primary>SelectionRequest</primary></indexterm>
+The X server reports
+<symbol>SelectionRequest</symbol>
+events to the owner of a selection.
+The X server generates this event whenever a client 
+requests a selection conversion by calling 
+<xref linkend='XConvertSelection' xrefstyle='select: title'/>
+for the owned selection.
+</para>
+<para>
+<!-- .LP -->
+The structure for this event type contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XSelectionRequestEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;       /* SelectionRequest */
+     unsigned long serial;     /* # of last request processed by server */
+     Bool          send_event; /* true if this came from a SendEvent request */
+     Display       *display;   /* Display the event was read from */
+     Window        owner;
+     Window        requestor;
+     Atom          selection;
+     Atom          target;
+     Atom          property;
+     Time          time;
+} XSelectionRequestEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The owner member is set to the window
+that was specified by the current owner in its
+<xref linkend='XSetSelectionOwner' xrefstyle='select: title'/>
+call.
+The requestor member is set to the window requesting the selection.
+The selection member is set to the atom that names the selection.
+For example, PRIMARY is used to indicate the primary selection.
+The target member is set to the atom that indicates the type
+the selection is desired in.
+The property member can be a property name or 
+<symbol>None</symbol>.
+The time member is set to the timestamp or 
+<symbol>CurrentTime</symbol>
+value from the
+<systemitem>ConvertSelection</systemitem>
+request.
+</para>
+<para>
+<!-- .LP -->
+The owner should convert the selection based on the specified target type
+and send a
+<symbol>SelectionNotify</symbol>
+event back to the requestor.
+A complete specification for using selections is given in the X Consortium
+standard <citetitle>Inter-Client Communication Conventions Manual</citetitle>.
+</para>
+</sect2>
+<sect2 id="SelectionNotify_Events">
+<title>SelectionNotify Events</title>
+<!-- .XS -->
+<!-- (SN SelectionNotify Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Events</primary><secondary>SelectionNotify</secondary></indexterm>
+<indexterm significance="preferred"><primary>SelectionNotify</primary></indexterm>
+This event is generated by the X server in response to a
+<systemitem>ConvertSelection</systemitem>
+protocol request when there is no owner for the selection.
+When there is an owner, it should be generated by the owner
+of the selection by using
+<xref linkend='XSendEvent' xrefstyle='select: title'/>.
+The owner of a selection should send this event to a requestor when a selection
+has been converted and stored as a property
+or when a selection conversion could
+not be performed (which is indicated by setting the property member to
+<symbol>None</symbol>).
+</para>
+<para>
+<!-- .LP -->
+If
+<symbol>None</symbol>
+is specified as the property in the 
+<systemitem>ConvertSelection</systemitem>
+protocol request, the owner should choose a property name,
+store the result as that property on the requestor window,
+and then send a 
+<symbol>SelectionNotify</symbol>
+giving that actual property name.
+</para>
+<para>
+<!-- .LP -->
+The structure for this event type contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XSelectionEvent</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int           type;       /* SelectionNotify */
+     unsigned long serial;     /* # of last request processed by server */
+     Bool          send_event; /* true if this came from a SendEvent request */
+     Display       *display;   /* Display the event was read from */
+     Window        requestor;
+     Atom          selection;
+     Atom          target;
+     Atom          property;   /* atom or None */
+     Time          time;
+} XSelectionEvent;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The requestor member is set to the window associated with
+the requestor of the selection.
+The selection member is set to the atom that indicates the selection.
+For example, PRIMARY is used for the primary selection.
+The target member is set to the atom that indicates the converted type.
+For example, PIXMAP is used for a pixmap.
+The property member is set to the atom that indicates which
+property the result was stored on.
+If the conversion failed, 
+the property member is set to
+<symbol>None</symbol>.
+The time member is set to the time the conversion took place and
+can be a timestamp or
+<symbol>CurrentTime</symbol>.
+<!-- .bp -->
+
+
+</para>
+</sect2>
+</sect1>
+</chapter>
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH12.xml
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH12.xml	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH12.xml	(revision 5)
@@ -0,0 +1,3946 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+	  "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+<chapter id='Input_Device_Functions'>
+<title>Input Device Functions</title>
+
+<para>
+You can use the Xlib input device functions to:
+</para>
+
+<itemizedlist>
+  <listitem><para>Grab the pointer and individual buttons on the pointer</para></listitem>
+  <listitem><para>Grab the keyboard and individual keys on the keyboard</para></listitem>
+  <listitem><para>Resume event processing</para></listitem>
+  <listitem><para>Move the pointer</para></listitem>
+  <listitem><para>Set the input focus</para></listitem>
+  <listitem><para>Manipulate the keyboard and pointer settings</para></listitem>
+  <listitem><para>Manipulate the keyboard encoding</para></listitem>
+</itemizedlist>
+
+<sect1 id='Pointer_Grabbing'>
+<title>Pointer Grabbing</title>
+<!-- .XS -->
+<!-- (SN Pointer Grabbing   -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to control input from the pointer,
+which usually is a mouse.
+Usually, as soon as keyboard and mouse events occur,
+the X server delivers them to the appropriate client,
+which is determined by the window and input focus.
+The X server provides sufficient control over event delivery to
+allow window managers to support mouse ahead and various other
+styles of user interface.
+Many of these user interfaces depend on synchronous delivery of events.
+The delivery of  pointer and keyboard events can be controlled
+independently.
+</para>
+<para>
+<!-- .LP -->
+When mouse buttons or keyboard keys are grabbed, events
+will be sent to the grabbing client rather than the normal
+client who would have received the event.
+If the keyboard or pointer is in asynchronous mode,
+further mouse and keyboard events will continue to be processed.
+If the keyboard or pointer is in synchronous mode, no
+further events are processed until the grabbing client
+allows them (see
+<xref linkend='XAllowEvents' xrefstyle='select: title'/>).
+The keyboard or pointer is considered frozen during this
+interval.
+The event that triggered the grab can also be replayed.
+</para>
+<para>
+<!-- .LP -->
+Note that the logical state of a device (as seen by client applications)
+may lag the physical state if device event processing is frozen.
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>Active grab</primary></indexterm>
+There are two kinds of grabs:
+active and passive.
+An active grab occurs when a single client grabs the keyboard and/or pointer
+explicitly (see
+<xref linkend='XGrabPointer' xrefstyle='select: title'/>
+and
+<xref linkend='XGrabKeyboard' xrefstyle='select: title'/>).
+<indexterm><primary>Passive grab</primary></indexterm>
+A passive grab occurs when clients grab a particular keyboard key 
+or pointer button in a window,
+and the grab will activate when the key or button is actually pressed.
+Passive grabs are convenient for implementing reliable pop-up menus.
+For example, you can guarantee that the pop-up is mapped 
+before the up pointer button event occurs by
+grabbing a button requesting synchronous behavior.
+The down event will trigger the grab and freeze further
+processing of pointer events until you have the chance to
+map the pop-up window.
+You can then allow further event processing.
+The up event will then be correctly processed relative to the
+pop-up window.
+</para>
+<para>
+<!-- .LP -->
+For many operations,
+there are functions that take a time argument.
+The X server includes a timestamp in various events.
+One special time, called
+<indexterm significance="preferred"><primary>CurrentTime</primary></indexterm>
+<indexterm significance="preferred"><primary>Time</primary></indexterm>
+<symbol>CurrentTime</symbol>,
+represents the current server time.
+The X server maintains the time when the input focus was last changed,
+when the keyboard was last grabbed,
+when the pointer was last grabbed,
+or when a selection was last changed.
+Your
+application may be slow reacting to an event.
+You often need some way to specify that your
+request should not occur if another application has in the meanwhile
+taken control of the keyboard, pointer, or selection.
+By providing the timestamp from the event in the request, 
+you can arrange that the operation not take effect
+if someone else has performed an operation in the meanwhile.
+</para>
+<para>
+<!-- .LP -->
+A timestamp is a time value, expressed in milliseconds. 
+It typically is the time since the last server reset.
+Timestamp values wrap around (after about 49.7 days).
+The server, given its current time is represented by timestamp T, 
+always interprets timestamps from clients by treating half of the timestamp 
+space as being later in time than T.
+One timestamp value, named
+<symbol>CurrentTime</symbol>,
+is never generated by the server.
+This value is reserved for use in requests to represent the current server time.
+</para>
+<para>
+<!-- .LP -->
+For many functions in this section,
+you pass pointer event mask bits.
+The valid pointer event mask bits are:
+<symbol>ButtonPressMask</symbol>,
+<symbol>ButtonReleaseMask</symbol>,
+<symbol>EnterWindowMask</symbol>,
+<symbol>LeaveWindowMask</symbol>,
+<symbol>PointerMotionMask</symbol>,
+<symbol>PointerMotionHintMask</symbol>,
+<symbol>Button1MotionMask</symbol>,
+<symbol>Button2MotionMask</symbol>,
+<symbol>Button3MotionMask</symbol>,
+<symbol>Button4MotionMask</symbol>,
+<symbol>Button5MotionMask</symbol>,
+<symbol>ButtonMotionMask</symbol>,
+and
+<symbol>KeymapStateMask</symbol>.
+For other functions in this section,
+you pass keymask bits.
+The valid keymask bits are:
+<symbol>ShiftMask</symbol>,
+<symbol>LockMask</symbol>,
+<symbol>ControlMask</symbol>,
+<symbol>Mod1Mask</symbol>,
+<symbol>Mod2Mask</symbol>,
+<symbol>Mod3Mask</symbol>,
+<symbol>Mod4Mask</symbol>,
+and
+<symbol>Mod5Mask</symbol>.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To grab the pointer, use
+<xref linkend='XGrabPointer' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Grabbing</primary><secondary>pointer</secondary></indexterm>
+<indexterm><primary>Pointer</primary><secondary>grabbing</secondary></indexterm>
+<indexterm significance="preferred"><primary>XGrabPointer</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGrabPointer'>
+<funcprototype>
+  <funcdef>int <function>XGrabPointer</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>grab_window</parameter></paramdef>
+  <paramdef>Bool <parameter>owner_events</parameter></paramdef>
+  <paramdef>unsigned int <parameter>event_mask</parameter></paramdef>
+  <paramdef>int <parameter>pointer_mode</parameter></paramdef>
+  <paramdef>int <parameter>keyboard_mode</parameter></paramdef>
+  <paramdef>Window <parameter>confine_to</parameter></paramdef>
+  <paramdef>Cursor <parameter>cursor</parameter></paramdef>
+  <paramdef>Time <parameter>time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>grab_window</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the grab window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>owner_events</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a Boolean value that indicates whether the pointer 
+events are to be reported as usual or reported with respect to the grab window 
+if selected by the event mask.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_mask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies which pointer events are reported to the client.
+The mask is the bitwise inclusive OR of the valid pointer event mask bits.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>pointer_mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies further processing of pointer events.
+You can pass 
+<symbol>GrabModeSync</symbol>
+or
+<symbol>GrabModeAsync</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keyboard_mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies further processing of keyboard events.
+You can pass 
+<symbol>GrabModeSync</symbol>
+or
+<symbol>GrabModeAsync</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>confine_to</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window to confine the pointer in or
+<symbol>None</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>cursor</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the cursor that is to be displayed during the grab or
+<symbol>None</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the time.
+You can pass either a timestamp or
+<symbol>CurrentTime</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGrabPointer' xrefstyle='select: title'/>
+function actively grabs control of the pointer and returns
+<symbol>GrabSuccess</symbol>
+if the grab was successful.
+Further pointer events are reported only to the grabbing client.
+<xref linkend='XGrabPointer' xrefstyle='select: title'/>
+overrides any active pointer grab by this client.
+If owner_events is 
+<symbol>False</symbol>,
+all generated pointer events
+are reported with respect to grab_window and are reported only if
+selected by event_mask.
+If owner_events is 
+<symbol>True</symbol>
+and if a generated
+pointer event would normally be reported to this client, 
+it is reported as usual. 
+Otherwise, the event is reported with respect to the
+grab_window and is reported only if selected by event_mask.
+For either value of owner_events, unreported events are discarded.
+</para>
+<para>
+<!-- .LP -->
+If the pointer_mode is 
+<symbol>GrabModeAsync</symbol>,
+pointer event processing continues as usual.
+If the pointer is currently frozen by this client, 
+the processing of events for the pointer is resumed.
+If the pointer_mode is 
+<symbol>GrabModeSync</symbol>,
+the state of the pointer, as seen by
+client applications,
+appears to freeze, and the X server generates no further pointer events
+until the grabbing client calls 
+<xref linkend='XAllowEvents' xrefstyle='select: title'/>
+or until the pointer grab is released.
+Actual pointer changes are not lost while the pointer is frozen;
+they are simply queued in the server for later processing.
+</para>
+<para>
+<!-- .LP -->
+If the keyboard_mode is 
+<symbol>GrabModeAsync</symbol>,
+keyboard event processing is unaffected by activation of the grab.
+If the keyboard_mode is 
+<symbol>GrabModeSync</symbol>,
+the state of the keyboard, as seen by
+client applications,
+appears to freeze, and the X server generates no further keyboard events
+until the grabbing client calls 
+<xref linkend='XAllowEvents' xrefstyle='select: title'/>
+or until the pointer grab is released.
+Actual keyboard changes are not lost while the pointer is frozen;
+they are simply queued in the server for later processing.
+</para>
+<para>
+<!-- .LP -->
+If a cursor is specified, it is displayed regardless of what
+window the pointer is in.  
+If 
+<symbol>None</symbol>
+is specified,
+the normal cursor for that window is displayed
+when the pointer is in grab_window or one of its subwindows;
+otherwise, the cursor for grab_window is displayed.
+</para>
+<para>
+<!-- .LP -->
+If a confine_to window is specified,
+the pointer is restricted to stay contained in that window.
+The confine_to window need have no relationship to the grab_window.
+If the pointer is not initially in the confine_to window, 
+it is warped automatically to the closest edge 
+just before the grab activates and enter/leave events are generated as usual. 
+If the confine_to window is subsequently reconfigured, 
+the pointer is warped automatically, as necessary, 
+to keep it contained in the window.
+</para>
+<para>
+<!-- .LP -->
+The time argument allows you to avoid certain circumstances that come up
+if applications take a long time to respond or if there are long network
+delays.
+Consider a situation where you have two applications, both
+of which normally grab the pointer when clicked on.
+If both applications specify the timestamp from the event, 
+the second application may wake up faster and successfully grab the pointer
+before the first application. 
+The first application then will get an indication that the other application 
+grabbed the pointer before its request was processed.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGrabPointer' xrefstyle='select: title'/>
+generates
+<symbol>EnterNotify</symbol>
+and
+<symbol>LeaveNotify</symbol>
+events.
+</para>
+<para>
+<!-- .LP -->
+Either if grab_window or confine_to window is not viewable
+or if the confine_to window lies completely outside the boundaries of the root
+window,
+<xref linkend='XGrabPointer' xrefstyle='select: title'/>
+fails and returns
+<symbol>GrabNotViewable</symbol>.
+If the pointer is actively grabbed by some other client,
+it fails and returns
+<symbol>AlreadyGrabbed</symbol>.
+If the pointer is frozen by an active grab of another client,
+it fails and returns
+<symbol>GrabFrozen</symbol>.
+If the specified time is earlier than the last-pointer-grab time or later 
+than the current X server time, it fails and returns
+<symbol>GrabInvalidTime</symbol>.
+Otherwise, the last-pointer-grab time is set to the specified time
+(<symbol>CurrentTime</symbol>
+is replaced by the current X server time).
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGrabPointer' xrefstyle='select: title'/>
+can generate
+<errorname>BadCursor</errorname>,
+<errorname>BadValue</errorname>,
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To ungrab the pointer, use
+<xref linkend='XUngrabPointer' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Ungrabbing</primary><secondary>pointer</secondary></indexterm>
+<indexterm><primary>Pointer</primary><secondary>ungrabbing</secondary></indexterm>
+<indexterm significance="preferred"><primary>XUngrabPointer</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XUngrabPointer'>
+<funcprototype>
+  <funcdef><function>XUngrabPointer</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Time <parameter>time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the time.
+You can pass either a timestamp or
+<symbol>CurrentTime</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XUngrabPointer' xrefstyle='select: title'/>
+function releases the pointer and any queued events
+if this client has actively grabbed the pointer from
+<xref linkend='XGrabPointer' xrefstyle='select: title'/>,
+<xref linkend='XGrabButton' xrefstyle='select: title'/>,
+or from a normal button press.
+<xref linkend='XUngrabPointer' xrefstyle='select: title'/>
+does not release the pointer if the specified
+time is earlier than the last-pointer-grab time or is later than the
+current X server time.
+It also generates 
+<symbol>EnterNotify</symbol>
+and 
+<symbol>LeaveNotify</symbol>
+events.
+The X server performs an 
+<systemitem>UngrabPointer</systemitem>
+request automatically if the event window or confine_to window 
+for an active pointer grab becomes not viewable
+or if window reconfiguration causes the confine_to window to lie completely
+outside the boundaries of the root window.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To change an active pointer grab, use
+<xref linkend='XChangeActivePointerGrab' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Pointer</primary><secondary>grabbing</secondary></indexterm>
+<indexterm ><primary>Changing</primary><secondary>pointer grab</secondary></indexterm>
+<indexterm significance="preferred"><primary>XChangeActivePointerGrab</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XChangeActivePointerGrab'>
+<funcprototype>
+  <funcdef><function>XChangeActivePointerGrab</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>unsigned int <parameter>event_mask</parameter></paramdef>
+  <paramdef>Cursor <parameter>cursor</parameter></paramdef>
+  <paramdef>Time <parameter>time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>event_mask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies which pointer events are reported to the client.
+The mask is the bitwise inclusive OR of the valid pointer event mask bits.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>cursor</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the cursor that is to be displayed or
+<symbol>None</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the time.
+You can pass either a timestamp or
+<symbol>CurrentTime</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XChangeActivePointerGrab' xrefstyle='select: title'/>
+function changes the specified dynamic parameters if the pointer is actively
+grabbed by the client and if the specified time is no earlier than the
+last-pointer-grab time and no later than the current X server time.
+This function has no effect on the passive parameters of an
+<xref linkend='XGrabButton' xrefstyle='select: title'/>.
+The interpretation of event_mask and cursor is the same as described in
+<xref linkend='XGrabPointer' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XChangeActivePointerGrab' xrefstyle='select: title'/>
+can generate
+<errorname>BadCursor</errorname>
+and
+<errorname>BadValue</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To grab a pointer button, use
+<xref linkend='XGrabButton' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Grabbing</primary><secondary>buttons</secondary></indexterm>
+<indexterm><primary>Button</primary><secondary>grabbing</secondary></indexterm>
+<indexterm significance="preferred"><primary>XGrabButton</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGrabButton'>
+<funcprototype>
+  <funcdef><function>XGrabButton</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>unsigned int <parameter>button</parameter></paramdef>
+  <paramdef>unsigned int <parameter>modifiers</parameter></paramdef>
+  <paramdef>Window <parameter>grab_window</parameter></paramdef>
+  <paramdef>Bool <parameter>owner_events</parameter></paramdef>
+  <paramdef>unsigned int <parameter>event_mask</parameter></paramdef>
+  <paramdef>int <parameter>pointer_mode</parameter></paramdef>
+  <paramdef>int <parameter>keyboard_mode</parameter></paramdef>
+  <paramdef>Window <parameter>confine_to</parameter></paramdef>
+  <paramdef>Cursor <parameter>cursor</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>button</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the pointer button that is to be grabbed or
+<symbol>AnyButton</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modifiers</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the set of keymasks or
+<symbol>AnyModifier</symbol>.
+The mask is the bitwise inclusive OR of the valid keymask bits.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>grab_window</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the grab window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>owner_events</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a Boolean value that indicates whether the pointer 
+events are to be reported as usual or reported with respect to the grab window 
+if selected by the event mask.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_mask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies which pointer events are reported to the client.
+The mask is the bitwise inclusive OR of the valid pointer event mask bits.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>pointer_mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies further processing of pointer events.
+You can pass 
+<symbol>GrabModeSync</symbol>
+or
+<symbol>GrabModeAsync</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keyboard_mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies further processing of keyboard events.
+You can pass 
+<symbol>GrabModeSync</symbol>
+or
+<symbol>GrabModeAsync</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>confine_to</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window to confine the pointer in or
+<symbol>None</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>cursor</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the cursor that is to be displayed or
+<symbol>None</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGrabButton' xrefstyle='select: title'/>
+function establishes a passive grab.
+In the future,
+the pointer is actively grabbed (as for
+<xref linkend='XGrabPointer' xrefstyle='select: title'/>),
+the last-pointer-grab time is set to the time at which the button was pressed
+(as transmitted in the
+<symbol>ButtonPress</symbol>
+event), and the
+<symbol>ButtonPress</symbol>
+event is reported if all of the following conditions are true:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+The pointer is not grabbed, and the specified button is logically pressed
+when the specified modifier keys are logically down,
+and no other buttons or modifier keys are logically down.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The grab_window contains the pointer.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The confine_to window (if any) is viewable.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A passive grab on the same button/key combination does not exist
+on any ancestor of grab_window.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+The interpretation of the remaining arguments is as for
+<xref linkend='XGrabPointer' xrefstyle='select: title'/>.
+The active grab is terminated automatically when the logical state of the
+pointer has all buttons released
+(independent of the state of the logical modifier keys).
+</para>
+<para>
+<!-- .LP -->
+Note that the logical state of a device (as seen by client applications)
+may lag the physical state if device event processing is frozen.
+</para>
+<para>
+<!-- .LP -->
+This request overrides all previous grabs by the same client on the same
+button/key combinations on the same window.
+A modifiers of 
+<symbol>AnyModifier</symbol>
+is equivalent to issuing the grab request for all
+possible modifier combinations (including the combination of no modifiers).  
+It is not required that all modifiers specified have currently assigned 
+KeyCodes.
+A button of 
+<symbol>AnyButton</symbol>
+is equivalent to
+issuing the request for all possible buttons.
+Otherwise, it is not required that the specified button currently be assigned
+to a physical button.
+</para>
+<para>
+<!-- .LP -->
+If some other client has already issued an
+<xref linkend='XGrabButton' xrefstyle='select: title'/>
+with the same button/key combination on the same window, a
+<errorname>BadAccess</errorname>
+error results.
+When using 
+<symbol>AnyModifier</symbol>
+or 
+<symbol>AnyButton</symbol>,
+the request fails completely,
+and a
+<errorname>BadAccess</errorname>
+error results (no grabs are
+established) if there is a conflicting grab for any combination.
+<xref linkend='XGrabButton' xrefstyle='select: title'/>
+has no effect on an active grab.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGrabButton' xrefstyle='select: title'/>
+can generate
+<errorname>BadCursor</errorname>,
+<errorname>BadValue</errorname>,
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To ungrab a pointer button, use
+<xref linkend='XUngrabButton' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Ungrabbing</primary><secondary>buttons</secondary></indexterm>
+<indexterm><primary>Button</primary><secondary>ungrabbing</secondary></indexterm>
+<indexterm significance="preferred"><primary>XUngrabButton</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XUngrabButton'>
+<funcprototype>
+  <funcdef><function>XUngrabButton</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>unsigned int <parameter>button</parameter></paramdef>
+  <paramdef>unsigned int <parameter>modifiers</parameter></paramdef>
+  <paramdef>Window <parameter>grab_window</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>button</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the pointer button that is to be released or
+<symbol>AnyButton</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modifiers</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the set of keymasks or
+<symbol>AnyModifier</symbol>.
+The mask is the bitwise inclusive OR of the valid keymask bits.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>grab_window</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the grab window.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XUngrabButton' xrefstyle='select: title'/>
+function releases the passive button/key combination on the specified window if
+it was grabbed by this client.
+A modifiers of 
+<symbol>AnyModifier</symbol>
+is
+equivalent to issuing 
+the ungrab request for all possible modifier combinations, including 
+the combination of no modifiers.
+A button of 
+<symbol>AnyButton</symbol>
+is equivalent to issuing the
+request for all possible buttons.
+<xref linkend='XUngrabButton' xrefstyle='select: title'/>
+has no effect on an active grab.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XUngrabButton' xrefstyle='select: title'/>
+can generate
+<errorname>BadValue</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+</sect1>
+<sect1 id='Keyboard_Grabbing'>
+<title>Keyboard Grabbing</title>
+<!-- .XS -->
+<!-- (SN Keyboard Grabbing  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to grab or ungrab the keyboard
+as well as allow events.
+</para>
+<para>
+<!-- .LP -->
+For many functions in this section,
+you pass keymask bits.
+The valid keymask bits are:
+<symbol>ShiftMask</symbol>,
+<symbol>LockMask</symbol>,
+<symbol>ControlMask</symbol>,
+<symbol>Mod1Mask</symbol>,
+<symbol>Mod2Mask</symbol>,
+<symbol>Mod3Mask</symbol>,
+<symbol>Mod4Mask</symbol>,
+and
+<symbol>Mod5Mask</symbol>.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To grab the keyboard, use
+<xref linkend='XGrabKeyboard' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Keyboard</primary><secondary>grabbing</secondary></indexterm>
+<indexterm><primary>Grabbing</primary><secondary>keyboard</secondary></indexterm>
+<indexterm significance="preferred"><primary>XGrabKeyboard</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGrabKeyboard'>
+<funcprototype>
+  <funcdef>int <function>XGrabKeyboard</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>grab_window</parameter></paramdef>
+  <paramdef>Bool <parameter>owner_events</parameter></paramdef>
+  <paramdef>int <parameter>pointer_mode</parameter></paramdef>
+  <paramdef>int <parameter>keyboard_mode</parameter></paramdef>
+  <paramdef>Time <parameter>time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>grab_window</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the grab window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>owner_events</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a Boolean value that indicates whether the keyboard events 
+are to be reported as usual.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>pointer_mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies further processing of pointer events.
+You can pass 
+<symbol>GrabModeSync</symbol>
+or
+<symbol>GrabModeAsync</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keyboard_mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies further processing of keyboard events.
+You can pass 
+<symbol>GrabModeSync</symbol>
+or
+<symbol>GrabModeAsync</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the time.
+You can pass either a timestamp or
+<symbol>CurrentTime</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGrabKeyboard' xrefstyle='select: title'/>
+function actively grabs control of the keyboard and generates
+<symbol>FocusIn</symbol>
+and
+<symbol>FocusOut</symbol>
+events.
+Further key events are reported only to the
+grabbing client.
+<xref linkend='XGrabKeyboard' xrefstyle='select: title'/>
+overrides any active keyboard grab by this client.
+If owner_events is 
+<symbol>False</symbol>,
+all generated key events are reported with
+respect to grab_window.  
+If owner_events is 
+<symbol>True</symbol>
+and if a generated
+key event would normally be reported to this client, it is reported
+normally; otherwise, the event is reported with respect to the
+grab_window.  
+Both 
+<symbol>KeyPress</symbol>
+and 
+<symbol>KeyRelease</symbol>
+events are always reported,
+independent of any event selection made by the client.
+</para>
+<para>
+<!-- .LP -->
+If the keyboard_mode argument is 
+<symbol>GrabModeAsync</symbol>,
+keyboard event processing continues
+as usual. 
+If the keyboard is currently frozen by this client, 
+then processing of keyboard events is resumed.
+If the keyboard_mode  argument is
+<symbol>GrabModeSync</symbol>,
+the state of the keyboard (as seen by client applications) appears to freeze,
+and the X server generates no further keyboard events until the
+grabbing client issues a releasing 
+<xref linkend='XAllowEvents' xrefstyle='select: title'/>
+call or until the keyboard grab is released.
+Actual keyboard changes are not lost while the keyboard is frozen; 
+they are simply queued in the server for later processing.
+</para>
+<para>
+<!-- .LP -->
+If pointer_mode is 
+<symbol>GrabModeAsync</symbol>,
+pointer event processing is unaffected
+by activation of the grab.  
+If pointer_mode is 
+<symbol>GrabModeSync</symbol>,
+the state of the pointer (as seen by client applications) appears to freeze, 
+and the X server generates no further pointer events 
+until the grabbing client issues a releasing 
+<xref linkend='XAllowEvents' xrefstyle='select: title'/>
+call or until the keyboard grab is released.
+Actual pointer changes are not lost while the pointer is frozen; 
+they are simply queued in the server for later processing.
+</para>
+<para>
+<!-- .LP -->
+If the keyboard is actively grabbed by some other client,
+<xref linkend='XGrabKeyboard' xrefstyle='select: title'/>
+fails and returns
+<symbol>AlreadyGrabbed</symbol>.
+If grab_window is not viewable,
+it fails and returns
+<symbol>GrabNotViewable</symbol>.
+If the keyboard is frozen by an active grab of another client,
+it fails and returns
+<symbol>GrabFrozen</symbol>.
+If the specified time is earlier than the last-keyboard-grab time 
+or later than the current X server time,
+it fails and returns
+<symbol>GrabInvalidTime</symbol>.
+Otherwise, the last-keyboard-grab time is set to the specified time
+(<symbol>CurrentTime</symbol>
+is replaced by the current X server time).
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGrabKeyboard' xrefstyle='select: title'/>
+can generate
+<errorname>BadValue</errorname>
+and 
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To ungrab the keyboard, use
+<xref linkend='XUngrabKeyboard' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Keyboard</primary><secondary>ungrabbing</secondary></indexterm>
+<indexterm><primary>Ungrabbing</primary><secondary>keyboard</secondary></indexterm>
+<indexterm significance="preferred"><primary>XUngrabKeyboard</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XUngrabKeyboard'>
+<funcprototype>
+  <funcdef><function>XUngrabKeyboard</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Time <parameter>time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the time.
+You can pass either a timestamp or
+<symbol>CurrentTime</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XUngrabKeyboard' xrefstyle='select: title'/>
+function
+releases the keyboard and any queued events if this client has it actively grabbed from
+either
+<xref linkend='XGrabKeyboard' xrefstyle='select: title'/>
+or
+<xref linkend='XGrabKey' xrefstyle='select: title'/>.
+<xref linkend='XUngrabKeyboard' xrefstyle='select: title'/>
+does not release the keyboard and any queued events
+if the specified time is earlier than
+the last-keyboard-grab time or is later than the current X server time.
+It also generates
+<symbol>FocusIn</symbol>
+and 
+<symbol>FocusOut</symbol>
+events.
+The X server automatically performs an 
+<systemitem>UngrabKeyboard</systemitem>
+request if the event window for an
+active keyboard grab becomes not viewable.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To passively grab a single key of the keyboard, use
+<xref linkend='XGrabKey' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Key</primary><secondary>grabbing</secondary></indexterm>
+<indexterm><primary>Grabbing</primary><secondary>keys</secondary></indexterm>
+<indexterm significance="preferred"><primary>XGrabKey</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGrabKey'>
+<funcprototype>
+  <funcdef><function>XGrabKey</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>keycode</parameter></paramdef>
+  <paramdef>unsigned int <parameter>modifiers</parameter></paramdef>
+  <paramdef>Window <parameter>grab_window</parameter></paramdef>
+  <paramdef>Bool <parameter>owner_events</parameter></paramdef>
+  <paramdef>int <parameter>pointer_mode</parameter></paramdef>
+  <paramdef>int <parameter>keyboard_mode</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>keycode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the KeyCode or
+<symbol>AnyKey</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modifiers</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the set of keymasks or
+<symbol>AnyModifier</symbol>.
+The mask is the bitwise inclusive OR of the valid keymask bits.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>grab_window</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the grab window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>owner_events</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a Boolean value that indicates whether the keyboard events 
+are to be reported as usual.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>pointer_mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies further processing of pointer events.
+You can pass 
+<symbol>GrabModeSync</symbol>
+or
+<symbol>GrabModeAsync</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keyboard_mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies further processing of keyboard events.
+You can pass 
+<symbol>GrabModeSync</symbol>
+or
+<symbol>GrabModeAsync</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGrabKey' xrefstyle='select: title'/>
+function establishes a passive grab on the keyboard.
+In the future,
+the keyboard is actively grabbed (as for
+<xref linkend='XGrabKeyboard' xrefstyle='select: title'/>),
+the last-keyboard-grab time is set to the time at which the key was pressed
+(as transmitted in the
+<symbol>KeyPress</symbol>
+event), and the
+<symbol>KeyPress</symbol>
+event is reported if all of the following conditions are true:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+The keyboard is not grabbed and the specified key
+(which can itself be a modifier key) is logically pressed
+when the specified modifier keys are logically down,
+and no other modifier keys are logically down.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Either the grab_window is an ancestor of (or is) the focus window,
+or the grab_window is a descendant of the focus window and contains the pointer.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A passive grab on the same key combination does not exist
+on any ancestor of grab_window.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+The interpretation of the remaining arguments is as for 
+<xref linkend='XGrabKeyboard' xrefstyle='select: title'/>.
+The active grab is terminated automatically when the logical state of the
+keyboard has the specified key released
+(independent of the logical state of the modifier keys).
+</para>
+<para>
+<!-- .LP -->
+Note that the logical state of a device (as seen by client applications)
+may lag the physical state if device event processing is frozen.
+</para>
+<para>
+<!-- .LP -->
+A modifiers argument of 
+<symbol>AnyModifier</symbol>
+is equivalent to issuing the request for all
+possible modifier combinations (including the combination of no
+modifiers).  
+It is not required that all modifiers specified have
+currently assigned KeyCodes.
+A keycode argument of 
+<symbol>AnyKey</symbol>
+is equivalent to issuing
+the request for all possible KeyCodes.
+Otherwise, the specified keycode must be in
+the range specified by min_keycode and max_keycode in the connection
+setup, 
+or a
+<errorname>BadValue</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+If some other client has issued a 
+<xref linkend='XGrabKey' xrefstyle='select: title'/>
+with the same key combination on the same window, a 
+<errorname>BadAccess</errorname>
+error results.
+When using
+<symbol>AnyModifier</symbol>
+or 
+<symbol>AnyKey</symbol>,
+the request fails completely,
+and a
+<errorname>BadAccess</errorname>
+error results (no grabs are established) 
+if there is a conflicting grab for any combination.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGrabKey' xrefstyle='select: title'/>
+can generate
+<errorname>BadAccess</errorname>,
+<errorname>BadValue</errorname>,
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To ungrab a key, use
+<xref linkend='XUngrabKey' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Key</primary><secondary>ungrabbing</secondary></indexterm>
+<indexterm><primary>Ungrabbing</primary><secondary>keys</secondary></indexterm>
+<indexterm significance="preferred"><primary>XUngrabKey</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XUngrabKey'>
+<funcprototype>
+  <funcdef><function>XUngrabKey</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>keycode</parameter></paramdef>
+  <paramdef>unsigned int <parameter>modifiers</parameter></paramdef>
+  <paramdef>Window <parameter>grab_window</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>keycode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the KeyCode or
+<symbol>AnyKey</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modifiers</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the set of keymasks or
+<symbol>AnyModifier</symbol>.
+The mask is the bitwise inclusive OR of the valid keymask bits.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>grab_window</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the grab window.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XUngrabKey' xrefstyle='select: title'/>
+function releases the key combination on the specified window if it was grabbed
+by this client.
+It has no effect on an active grab.
+A modifiers of
+<symbol>AnyModifier</symbol>
+is equivalent to issuing
+the request for all possible modifier combinations
+(including the combination of no modifiers).
+A keycode argument of
+<symbol>AnyKey</symbol>
+is equivalent to issuing the request for all possible key codes.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XUngrabKey' xrefstyle='select: title'/>
+can generate
+<errorname>BadValue</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+</sect1>
+<sect1 id="Resuming_Event_Processing">
+<title>Resuming Event Processing</title>
+<!-- .XS -->
+<!-- (SN Resuming Event Processing -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The previous sections discussed grab mechanisms with which processing
+of events by the server can be temporarily suspended.  This section
+describes the mechanism for resuming event processing.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To allow further events to be processed when the device has been frozen, use
+<xref linkend='XAllowEvents' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XAllowEvents</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XAllowEvents'>
+<funcprototype>
+  <funcdef><function>XAllowEvents</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>event_mode</parameter></paramdef>
+  <paramdef>Time <parameter>time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>event_mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the event mode.
+You can pass 
+<symbol>AsyncPointer</symbol>,
+<symbol>SyncPointer</symbol>,
+<symbol>AsyncKeyboard</symbol>,
+<symbol>SyncKeyboard</symbol>,
+<symbol>ReplayPointer</symbol>,
+<symbol>ReplayKeyboard</symbol>,
+<symbol>AsyncBoth</symbol>,
+or
+<symbol>SyncBoth</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the time.
+You can pass either a timestamp or
+<symbol>CurrentTime</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XAllowEvents' xrefstyle='select: title'/>
+function releases some queued events if the client has caused a device 
+to freeze.
+It has no effect if the specified time is earlier than the last-grab
+time of the most recent active grab for the client or if the specified time
+is later than the current X server time.
+Depending on the event_mode argument, the following occurs:
+</para>
+<informaltable frame='none'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth='1.0*'/>
+  <colspec colname='c2' colwidth='4.0*'/>
+  <tbody>
+    <row>
+      <entry><symbol>AsyncPointer</symbol></entry>
+      <entry>If the pointer is frozen by the client,
+      pointer event processing continues as usual.
+      If the pointer is frozen twice by the client on behalf of two separate grabs,
+      <symbol>AsyncPointer</symbol>
+      thaws for both.
+      <symbol>AsyncPointer</symbol>
+      has no effect if the pointer is not frozen by the client,
+      but the pointer need not be grabbed by the client.</entry>
+    </row>
+    <row>
+      <entry><symbol>SyncPointer</symbol></entry>
+      <entry>If the pointer is frozen and actively grabbed by the client,
+      pointer event processing continues as usual until the next
+      <symbol>ButtonPress</symbol>
+      or
+      <symbol>ButtonRelease</symbol>
+      event is reported to the client.
+      At this time,
+      the pointer again appears to freeze.
+      However, if the reported event causes the pointer grab to be released,
+      the pointer does not freeze.
+      <symbol>SyncPointer</symbol>
+      has no effect if the pointer is not frozen by the client
+      or if the pointer is not grabbed by the client.</entry>
+    </row>
+    <row>
+      <entry><symbol>ReplayPointer</symbol></entry>
+      <entry>If the pointer is actively grabbed by the client and is frozen as the result of
+      an event having been sent to the client (either from the activation of an
+      <xref linkend='XGrabButton' xrefstyle='select: title'/>
+      or from a previous
+      <xref linkend='XAllowEvents' xrefstyle='select: title'/>
+      with mode
+      <symbol>SyncPointer</symbol>
+      but not from an 
+      <xref linkend='XGrabPointer' xrefstyle='select: title'/>),
+      the pointer grab is released and that event is completely reprocessed.
+      This time, however, the function ignores any passive grabs at or above 
+      (toward the root of) the grab_window of the grab just released.
+      The request has no effect if the pointer is not grabbed by the client
+      or if the pointer is not frozen as the result of an event.</entry>
+    </row>
+    <row>
+      <entry><symbol>AsyncKeyboard</symbol></entry>
+      <entry>If the keyboard is frozen by the client,
+      keyboard event processing continues as usual.
+      If the keyboard is frozen twice by the client on behalf of two separate grabs,
+      <symbol>AsyncKeyboard</symbol>
+      thaws for both.
+      <symbol>AsyncKeyboard</symbol>
+      has no effect if the keyboard is not frozen by the client,
+      but the keyboard need not be grabbed by the client.</entry>
+    </row>
+    <row>
+      <entry><symbol>SyncKeyboard</symbol></entry>
+      <entry>If the keyboard is frozen and actively grabbed by the client,
+      keyboard event processing continues as usual until the next
+      <symbol>KeyPress</symbol>
+      or
+      <symbol>KeyRelease</symbol>
+      event is reported to the client.
+      At this time,
+      the keyboard again appears to freeze.
+      However, if the reported event causes the keyboard grab to be released,
+      the keyboard does not freeze.
+      <symbol>SyncKeyboard</symbol>
+      has no effect if the keyboard is not frozen by the client
+      or if the keyboard is not grabbed by the client.</entry>
+    </row>
+    <row>
+      <entry><symbol>ReplayKeyboard</symbol></entry>
+      <entry>If the keyboard is actively grabbed by the client and is frozen
+      as the result of an event having been sent to the client (either from the
+      activation of an
+      <xref linkend='XGrabKey' xrefstyle='select: title'/>
+      or from a previous
+      <xref linkend='XAllowEvents' xrefstyle='select: title'/>
+      with mode
+      <symbol>SyncKeyboard</symbol>
+      but not from an 
+      <xref linkend='XGrabKeyboard' xrefstyle='select: title'/>),
+      the keyboard grab is released and that event is completely reprocessed.
+      This time, however, the function ignores any passive grabs at or above
+      (toward the root of)
+      the grab_window of the grab just released.
+      The request has no effect if the keyboard is not grabbed by the client
+      or if the keyboard is not frozen as the result of an event.</entry>
+    </row>
+    <row>
+      <entry><symbol>SyncBoth</symbol></entry>
+      <entry>If both pointer and keyboard are frozen by the client,
+      event processing for both devices continues as usual until the next
+      <symbol>ButtonPress</symbol>,
+      <symbol>ButtonRelease</symbol>,
+      <symbol>KeyPress</symbol>,
+      or 
+      <symbol>KeyRelease</symbol>
+      event is reported to the client for a grabbed device 
+      (button event for the pointer, key event for the keyboard), 
+      at which time the devices again appear to freeze.  
+      However, if the reported event causes the grab to be released,
+      then the devices do not freeze (but if the other device is still
+      grabbed, then a subsequent event for it will still cause both devices
+      to freeze).  
+      <symbol>SyncBoth</symbol>
+      has no effect unless both pointer and keyboard
+      are frozen by the client.
+      If the pointer or keyboard is frozen twice
+      by the client on behalf of two separate grabs, 
+      <symbol>SyncBoth</symbol>
+      thaws for both (but a subsequent freeze for 
+      <symbol>SyncBoth</symbol>
+      will only freeze each device once).</entry>
+    </row>
+    <row>
+      <entry><symbol>AsyncBoth</symbol></entry>
+      <entry>If the pointer and the keyboard are frozen by the
+      client, event processing for both devices continues as usual.
+      If a device is frozen twice by the client on behalf of two separate grabs,
+      <symbol>AsyncBoth</symbol>
+      thaws for both.
+      <symbol>AsyncBoth</symbol>
+      has no effect unless both
+      pointer and keyboard are frozen by the client.</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+<!-- .LP -->
+<symbol>AsyncPointer</symbol>,
+<symbol>SyncPointer</symbol>,
+and 
+<symbol>ReplayPointer</symbol>
+have no effect on the
+processing of keyboard events.
+<symbol>AsyncKeyboard</symbol>,
+<symbol>SyncKeyboard</symbol>,
+and 
+<symbol>ReplayKeyboard</symbol>
+have no effect on the
+processing of pointer events.
+It is possible for both a pointer grab and a keyboard grab (by the same 
+or different clients) to be active simultaneously.
+If a device is frozen on behalf of either grab,
+no event processing is performed for the device.
+It is possible for a single device to be frozen because of both grabs.
+In this case,
+the freeze must be released on behalf of both grabs before events can 
+again be processed.
+If a device is frozen twice by a single client,
+then a single
+<xref linkend='XAllowEvents' xrefstyle='select: title'/>
+releases both.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XAllowEvents' xrefstyle='select: title'/>
+can generate a
+<errorname>BadValue</errorname>
+error.
+</para>
+</sect1>
+<sect1 id="Moving_the_Pointer">
+<title>Moving the Pointer</title>
+<!-- .XS -->
+<!-- (SN Moving the Pointer -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Although movement of the pointer normally should be left to the
+control of the end user, sometimes it is necessary to move the
+pointer to a new position under program control.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To move the pointer to an arbitrary point in a window, use
+<xref linkend='XWarpPointer' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XWarpPointer</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XWarpPointer'>
+<funcprototype>
+  <funcdef><function>XWarpPointer</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>src_w</parameter></paramdef>
+  <paramdef>Window <parameter>dest_w</parameter></paramdef>
+  <paramdef>int <parameter>src_x</parameter></paramdef>
+  <paramdef>int <parameter>src_y</parameter></paramdef>
+  <paramdef>unsigned int <parameter>src_width</parameter></paramdef>
+  <paramdef>unsigned int <parameter>src_height</parameter></paramdef>
+  <paramdef>int <parameter>dest_x</parameter></paramdef>
+  <paramdef>int <parameter>dest_y</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>src_w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the source window or
+<symbol>None</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>dest_w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the destination window or
+<symbol>None</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>src_x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>src_y</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>src_width</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>src_height</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify a rectangle in the source window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>dest_x</emphasis>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>dest_y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the x and y coordinates within the destination window.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+If dest_w is
+<symbol>None</symbol>,
+<xref linkend='XWarpPointer' xrefstyle='select: title'/>
+moves the pointer by the offsets (dest_x, dest_y) relative to the current
+position of the pointer.
+If dest_w is a window,
+<xref linkend='XWarpPointer' xrefstyle='select: title'/>
+moves the pointer to the offsets (dest_x, dest_y) relative to the origin of
+dest_w.
+However, if src_w is a window,
+the move only takes place if the window src_w contains the pointer 
+and if the specified rectangle of src_w contains the pointer.
+</para>
+<para>
+<!-- .LP -->
+The src_x and src_y coordinates are relative to the origin of src_w.
+If src_height is zero,
+it is replaced with the current height of src_w minus src_y.
+If src_width is zero,
+it is replaced with the current width of src_w minus src_x.
+</para>
+<para>
+<!-- .LP -->
+There is seldom any reason for calling this function. 
+The pointer should normally be left to the user.
+If you do use this function, however, it generates events just as if the user
+had instantaneously moved the pointer from one position to another.
+Note that you cannot use
+<xref linkend='XWarpPointer' xrefstyle='select: title'/>
+to move the pointer outside the confine_to window of an active pointer grab.
+An attempt to do so will only move the pointer as far as the closest edge of the
+confine_to window. 
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XWarpPointer' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+</sect1>
+<sect1 id="Controlling_Input_Focus">
+<title>Controlling Input Focus</title>
+<!-- .XS -->
+<!-- (SN Controlling Input Focus  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to set and get the input focus.
+The input focus is a shared resource, and cooperation among clients is
+required for correct interaction.  See the
+<citetitle>Inter-Client Communication Conventions Manual</citetitle>
+for input focus policy.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To set the input focus, use
+<xref linkend='XSetInputFocus' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetInputFocus</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetInputFocus'>
+<funcprototype>
+  <funcdef><function>XSetInputFocus</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>focus</parameter></paramdef>
+  <paramdef>int <parameter>revert_to</parameter></paramdef>
+  <paramdef>Time <parameter>time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>focus</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window,
+<symbol>PointerRoot</symbol>,
+or
+<symbol>None</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>revert_to</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies where the input focus reverts to if the window becomes not
+viewable.
+You can pass 
+<symbol>RevertToParent</symbol>,
+<symbol>RevertToPointerRoot</symbol>,
+or 
+<symbol>RevertToNone</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the time.
+You can pass either a timestamp or
+<symbol>CurrentTime</symbol>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XSetInputFocus' xrefstyle='select: title'/>
+function changes the input focus and the last-focus-change time.
+It has no effect if the specified time is earlier than the current
+last-focus-change time or is later than the current X server time.
+Otherwise, the last-focus-change time is set to the specified time
+(<symbol>CurrentTime</symbol>
+is replaced by the current X server time).
+<xref linkend='XSetInputFocus' xrefstyle='select: title'/>
+causes the X server to generate
+<symbol>FocusIn</symbol>
+and 
+<symbol>FocusOut</symbol>
+events.
+</para>
+<para>
+<!-- .LP -->
+Depending on the focus argument,
+the following occurs: 
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+If focus is
+<symbol>None</symbol>,
+all keyboard events are discarded until a new focus window is set,
+and the revert_to argument is ignored.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If focus is a window, 
+it becomes the keyboard's focus window.
+If a generated keyboard event would normally be reported to this window
+or one of its inferiors, the event is reported as usual. 
+Otherwise, the event is reported relative to the focus window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If focus is
+<symbol>PointerRoot</symbol>,
+the focus window is dynamically taken to be the root window of whatever screen 
+the pointer is on at each keyboard event.  
+In this case, the revert_to argument is ignored.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+The specified focus window must be viewable at the time 
+<xref linkend='XSetInputFocus' xrefstyle='select: title'/>
+is called,
+or a
+<errorname>BadMatch</errorname>
+error results.
+If the focus window later becomes not viewable, 
+the X server
+evaluates the revert_to argument to determine the new focus window as follows: 
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+If revert_to is
+<symbol>RevertToParent</symbol>,
+the focus reverts to the parent (or the closest viewable ancestor), 
+and the new revert_to value is taken to be
+<symbol>RevertToNone</symbol>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If revert_to is
+<symbol>RevertToPointerRoot</symbol>
+or 
+<symbol>RevertToNone</symbol>,
+the focus reverts to
+<symbol>PointerRoot</symbol>
+or
+<symbol>None</symbol>,
+respectively.
+When the focus reverts,
+the X server generates
+<symbol>FocusIn</symbol>
+and
+<symbol>FocusOut</symbol>
+events, but the last-focus-change time is not affected.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+<xref linkend='XSetInputFocus' xrefstyle='select: title'/>
+can generate
+<errorname>BadMatch</errorname>,
+<errorname>BadValue</errorname>,
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To obtain the current input focus, use
+<xref linkend='XGetInputFocus' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetInputFocus</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetInputFocus'>
+<funcprototype>
+  <funcdef><function>XGetInputFocus</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window *<parameter>focus_return</parameter></paramdef>
+  <paramdef>int *<parameter>revert_to_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>focus_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the focus window,
+<symbol>PointerRoot</symbol>,
+or 
+<symbol>None</symbol>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>revert_to_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the current focus state
+(<symbol>RevertToParent</symbol>,
+<symbol>RevertToPointerRoot</symbol>,
+or 
+<symbol>RevertToNone</symbol>).
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGetInputFocus' xrefstyle='select: title'/>
+function returns the focus window and the current focus state.
+</para>
+</sect1>
+<sect1 id="Manipulating_the_Keyboard_and_Pointer_Settings">
+<title>Manipulating the Keyboard and Pointer Settings</title>
+<!-- .XS -->
+<!-- (SN Manipulating the Keyboard and Pointer Settings  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to
+change the keyboard control, obtain a list of the auto-repeat keys,
+turn keyboard auto-repeat on or off, ring the bell, 
+set or obtain the pointer button or keyboard mapping, 
+and obtain a bit vector for the keyboard.
+</para>
+<para>
+<!-- .LP -->
+<indexterm><primary>Keyboard</primary><secondary>bell volume</secondary></indexterm>
+<indexterm><primary>Keyboard</primary><secondary>keyclick volume</secondary></indexterm>
+<indexterm><primary>Keyboard</primary><secondary>bit vector</secondary></indexterm>
+<indexterm><primary>Mouse</primary><secondary>programming</secondary></indexterm>
+This section discusses 
+the user-preference options of bell, key click,
+pointer behavior, and so on.
+The default values for many of these options are server dependent.
+Not all implementations will actually be able to control all of these
+parameters.
+</para>
+<para>
+<!-- .LP -->
+The
+<xref linkend='XChangeKeyboardControl' xrefstyle='select: title'/>
+function changes control of a keyboard and operates on a
+<structname>XKeyboardControl</structname>
+structure:
+<!-- .sM -->
+</para>
+
+<literallayout class="monospaced">
+/* Mask bits for ChangeKeyboardControl */
+
+
+#define     KBBellPercent           (1L&lt;&lt;0)
+#define     KBBellPitch             (1L&lt;&lt;1)
+#define     KBBellDuration          (1L&lt;&lt;2)
+#define     KBLed                   (1L&lt;&lt;3)
+#define     KBLedMode               (1L&lt;&lt;4)
+#define     KBKey                   (1L&lt;&lt;5)
+#define     KBAutoRepeatMode        (1L&lt;&lt;6)
+
+
+/* Values */
+
+typedef struct {
+int key_click_percent;
+int bell_percent;
+int bell_pitch;
+int bell_duration;
+int led;
+int led_mode;                /* LedModeOn, LedModeOff */
+int key;
+int auto_repeat_mode;        /* AutoRepeatModeOff, AutoRepeatModeOn,
+                                AutoRepeatModeDefault */
+} XKeyboardControl;
+
+</literallayout>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The key_click_percent member sets the volume for key clicks between 0 (off) 
+and 100 (loud) inclusive, if possible.  
+A setting of -1 restores the default.
+Other negative values generate a
+<errorname>BadValue</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+The bell_percent sets the base volume for the bell between 0 (off) and 100
+(loud) inclusive, if possible.  
+A setting of -1 restores the default.
+Other negative values generate a
+<errorname>BadValue</errorname>
+error.
+The bell_pitch member sets the pitch (specified in Hz) of the bell, if possible.
+A setting of -1 restores the default.
+Other negative values generate a
+<errorname>BadValue</errorname>
+error.
+The bell_duration member sets the duration of the
+bell specified in milliseconds, if possible.  
+A setting of -1 restores the default.
+Other negative values generate a
+<errorname>BadValue</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+If both the led_mode and led members are specified,
+the state of that <acronym>LED</acronym> is changed, if possible.  
+The led_mode member can be set to
+<symbol>LedModeOn</symbol>
+or
+<symbol>LedModeOff</symbol>.
+If only led_mode is specified, the state of
+all LEDs are changed, if possible.  
+At most 32 LEDs numbered from one are supported. 
+No standard interpretation of LEDs is defined.
+If led is specified without led_mode, a
+<errorname>BadMatch</errorname>
+error results. 
+</para>
+<para>
+<!-- .LP -->
+If both the auto_repeat_mode and key members are specified, 
+the auto_repeat_mode of that key is changed (according to
+<symbol>AutoRepeatModeOn</symbol>,
+<symbol>AutoRepeatModeOff</symbol>,
+or
+<symbol>AutoRepeatModeDefault</symbol>),
+if possible.
+If only auto_repeat_mode is
+specified, the global auto_repeat_mode for the entire keyboard is
+changed, if possible, and does not affect the per-key settings.
+If a key is specified without an auto_repeat_mode, a
+<errorname>BadMatch</errorname>
+error results.
+Each key has an individual mode of whether or not it should auto-repeat
+and a default setting for the mode.
+In addition,
+there is a global mode of whether auto-repeat should be enabled or not
+and a default setting for that mode.
+When global mode is
+<symbol>AutoRepeatModeOn</symbol>,
+keys should obey their individual auto-repeat modes.
+When global mode is
+<symbol>AutoRepeatModeOff</symbol>,
+no keys should auto-repeat.
+An auto-repeating key generates alternating
+<symbol>KeyPress</symbol>
+and
+<symbol>KeyRelease</symbol>
+events.
+When a key is used as a modifier,
+it is desirable for the key not to auto-repeat,
+regardless of its auto-repeat setting.
+</para>
+<para>
+<!-- .LP -->
+A bell generator connected with the console but not directly on a
+keyboard is treated as if it were part of the keyboard.
+The order in which controls are verified and altered is server-dependent.
+If an error is generated, a subset of the controls may have been altered.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+</para>
+<indexterm significance="preferred"><primary>XChangeKeyboardControl</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XChangeKeyboardControl'>
+<funcprototype>
+  <funcdef><function>XChangeKeyboardControl</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>unsigned long <parameter>value_mask</parameter></paramdef>
+  <paramdef>XKeyboardControl *<parameter>values</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>value_mask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies which controls to change.
+This mask is the bitwise inclusive OR of the valid control mask bits.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>values</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies one value for each bit set to 1 in the mask.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XChangeKeyboardControl' xrefstyle='select: title'/>
+function controls the keyboard characteristics defined by the
+<structname>XKeyboardControl</structname>
+structure.
+The value_mask argument specifies which values are to be changed.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XChangeKeyboardControl' xrefstyle='select: title'/>
+can generate
+<errorname>BadMatch</errorname>
+and
+<errorname>BadValue</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To obtain the current control values for the keyboard, use
+<xref linkend='XGetKeyboardControl' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetKeyboardControl</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetKeyboardControl'>
+<funcprototype>
+  <funcdef><function>XGetKeyboardControl</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XKeyboardState *<parameter>values_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>values_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the current keyboard controls in the specified
+<structname>XKeyboardState</structname>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGetKeyboardControl' xrefstyle='select: title'/>
+function returns the current control values for the keyboard to the
+<structname>XKeyboardState</structname>
+structure.
+</para>
+<para>
+<!-- .LP -->
+<indexterm><primary>XGetKeyboardControl</primary></indexterm>
+<indexterm significance="preferred"><primary>XKeyboardState</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i  -->
+<!-- .ta .5i -->
+typedef struct {
+	int key_click_percent;
+	int bell_percent;
+	unsigned int bell_pitch, bell_duration;
+	unsigned long led_mask;
+	int global_auto_repeat;
+	char auto_repeats[32];
+} XKeyboardState;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+For the LEDs, 
+the least significant bit of led_mask corresponds to <acronym>LED</acronym> one,
+and each bit set to 1 in led_mask indicates an <acronym>LED</acronym> that is lit.
+The global_auto_repeat member can be set to
+<symbol>AutoRepeatModeOn</symbol>
+or
+<symbol>AutoRepeatModeOff</symbol>.
+The auto_repeats member is a bit vector.
+Each bit set to 1 indicates that auto-repeat is enabled 
+for the corresponding key.
+The vector is represented as 32 bytes.  
+Byte N (from 0) contains the bits for keys 8N to 8N + 7
+with the least significant bit in the byte representing key 8N.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To turn on keyboard auto-repeat, use
+<xref linkend='XAutoRepeatOn' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XAutoRepeatOn</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XAutoRepeatOn'>
+<funcprototype>
+  <funcdef><function>XAutoRepeatOn</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XAutoRepeatOn' xrefstyle='select: title'/>
+function turns on auto-repeat for the keyboard on the specified display.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To turn off keyboard auto-repeat, use
+<xref linkend='XAutoRepeatOff' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XAutoRepeatOff</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XAutoRepeatOff'>
+<funcprototype>
+  <funcdef><function>XAutoRepeatOff</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XAutoRepeatOff' xrefstyle='select: title'/>
+function turns off auto-repeat for the keyboard on the specified display.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To ring the bell, use
+<xref linkend='XBell' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XBell</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XBell'>
+<funcprototype>
+  <funcdef><function>XBell</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>percent</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>percent</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the volume for the bell,
+which can range from -100 to 100 inclusive. 
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XBell' xrefstyle='select: title'/>
+function rings the bell on the keyboard on the specified display, if possible.
+The specified volume is relative to the base volume for the keyboard.
+If the value for the percent argument is not in the range -100 to 100
+inclusive, a
+<errorname>BadValue</errorname>
+error results.
+The volume at which the bell rings
+when the percent argument is nonnegative is:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+base - [(base * percent) / 100] + percent
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+The volume at which the bell rings
+when the percent argument is negative is:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+base + [(base * percent) / 100]
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+To change the base volume of the bell, use
+<xref linkend='XChangeKeyboardControl' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XBell' xrefstyle='select: title'/>
+can generate a
+<errorname>BadValue</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To obtain a bit vector that describes the state of the keyboard, use
+<xref linkend='XQueryKeymap' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XQueryKeymap</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XQueryKeymap'>
+<funcprototype>
+  <funcdef><function>XQueryKeymap</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>char <parameter>keys_return[32]</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>keys_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns an array of bytes that identifies which keys are pressed down.
+Each bit represents one key of the keyboard.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XQueryKeymap' xrefstyle='select: title'/>
+function returns a bit vector for the logical state of the keyboard, 
+where each bit set to 1 indicates that the corresponding key is currently 
+pressed down.
+The vector is represented as 32 bytes.
+Byte N (from 0) contains the bits for keys 8N to 8N + 7 
+with the least significant bit in the byte representing key 8N.
+</para>
+<para>
+<!-- .LP -->
+Note that the logical state of a device (as seen by client applications)
+may lag the physical state if device event processing is frozen.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To set the mapping of the pointer buttons, use
+<xref linkend='XSetPointerMapping' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetPointerMapping</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetPointerMapping'>
+<funcprototype>
+  <funcdef>int <function>XSetPointerMapping</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>unsignedchar <parameter>map[]</parameter></paramdef>
+  <paramdef>int <parameter>nmap</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>map</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the mapping list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nmap</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of items in the mapping list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XSetPointerMapping' xrefstyle='select: title'/>
+function sets the mapping of the pointer.
+If it succeeds, the X server generates a
+<symbol>MappingNotify</symbol>
+event, and
+<xref linkend='XSetPointerMapping' xrefstyle='select: title'/>
+returns
+<symbol>MappingSuccess</symbol>.
+Element map[i] defines the logical button number for the physical button
+i+1.
+The length of the list must be the same as
+<xref linkend='XGetPointerMapping' xrefstyle='select: title'/>
+would return,
+or a
+<errorname>BadValue</errorname>
+error results.
+A zero element disables a button, and elements are not restricted in
+value by the number of physical buttons.
+However, no two elements can have the same nonzero value,
+or a
+<errorname>BadValue</errorname>
+error results.
+If any of the buttons to be altered are logically in the down state,
+<xref linkend='XSetPointerMapping' xrefstyle='select: title'/>
+returns
+<symbol>MappingBusy</symbol>,
+and the mapping is not changed.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetPointerMapping' xrefstyle='select: title'/>
+can generate a
+<errorname>BadValue</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To get the pointer mapping, use
+<xref linkend='XGetPointerMapping' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetPointerMapping</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetPointerMapping'>
+<funcprototype>
+  <funcdef>int <function>XGetPointerMapping</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>unsignedchar <parameter>map_return[]</parameter></paramdef>
+  <paramdef>int <parameter>nmap</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>map_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the mapping list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nmap</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of items in the mapping list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGetPointerMapping' xrefstyle='select: title'/>
+function returns the current mapping of the pointer.
+Pointer buttons are numbered starting from one.
+<xref linkend='XGetPointerMapping' xrefstyle='select: title'/>
+returns the number of physical buttons actually on the pointer.
+The nominal mapping for a pointer is map[i]=i+1.
+The nmap argument specifies the length of the array where the pointer
+mapping is returned, and only the first nmap elements are returned 
+in map_return.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To control the pointer's interactive feel, use
+<xref linkend='XChangePointerControl' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XChangePointerControl</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XChangePointerControl'>
+<funcprototype>
+  <funcdef><function>XChangePointerControl</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Bool <parameter>do_accel</parameter></paramdef>
+  <paramdef>Bool <parameter>do_threshold</parameter></paramdef>
+  <paramdef>int <parameter>accel_numerator</parameter></paramdef>
+  <paramdef>int <parameter>accel_denominator</parameter></paramdef>
+  <paramdef>int <parameter>threshold</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>do_accel</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a Boolean value that controls whether the values for 
+the accel_numerator or accel_denominator are used.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>do_threshold</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a Boolean value that controls whether the value for the 
+threshold is used.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>accel_numerator</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the numerator for the acceleration multiplier.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>accel_denominator</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the denominator for the acceleration multiplier.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>threshold</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the acceleration threshold.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XChangePointerControl' xrefstyle='select: title'/>
+function defines how the pointing device moves.
+The acceleration, expressed as a fraction, is a
+multiplier for movement. 
+For example,
+specifying 3/1 means the pointer moves three times as fast as normal.
+The fraction may be rounded arbitrarily by the X server.  
+Acceleration
+only takes effect if the pointer moves more than threshold pixels at
+once and only applies to the amount beyond the value in the threshold argument.
+Setting a value to -1 restores the default.
+The values of the do_accel and do_threshold arguments must be 
+<symbol>True</symbol>
+for the pointer values to be set,
+or the parameters are unchanged.
+Negative values (other than -1) generate a
+<errorname>BadValue</errorname>
+error, as does a zero value
+for the accel_denominator argument.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XChangePointerControl' xrefstyle='select: title'/>
+can generate a
+<errorname>BadValue</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To get the current pointer parameters, use
+<xref linkend='XGetPointerControl' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetPointerControl</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetPointerControl'>
+<funcprototype>
+  <funcdef><function>XGetPointerControl</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int *<parameter>accel_numerator_return</parameter></paramdef>
+  <paramdef>int *<parameter>accel_denominator_return</parameter></paramdef>
+  <paramdef>int *<parameter>threshold_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>accel_numerator_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the numerator for the acceleration multiplier.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>accel_denominator_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the denominator for the acceleration multiplier.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>threshold_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the acceleration threshold.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGetPointerControl' xrefstyle='select: title'/>
+function returns the pointer's current acceleration multiplier
+and acceleration threshold.
+</para>
+</sect1>
+<sect1 id="Manipulating_the_Keyboard_Encoding">
+<title>Manipulating the Keyboard Encoding</title>
+<!-- .XS -->
+<!-- (SN Manipulating the Keyboard Encoding  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+A KeyCode represents a physical (or logical) key.  
+KeyCodes lie in the inclusive range [8,255].  
+A KeyCode value carries no intrinsic information,
+although server implementors may attempt to encode geometry 
+(for example, matrix) information in some fashion so that it can
+be interpreted in a server-dependent fashion.
+The mapping between keys and KeyCodes cannot be changed.
+</para>
+<para>
+<!-- .LP -->
+A KeySym is an encoding of a symbol on the cap of a key.  
+The set of defined KeySyms includes the ISO Latin character sets (1-4), 
+Katakana, Arabic, Cyrillic, Greek, Technical,
+Special, Publishing, APL, Hebrew, Thai, Korean
+and a miscellany of keys found
+on keyboards (Return, Help, Tab, and so on).  
+To the extent possible, these sets are derived from international
+standards. 
+In areas where no standards exist,
+some of these sets are derived from Digital Equipment Corporation standards.
+The list of defined symbols can be found in
+<filename class="headerfile">&lt;X11/keysymdef.h&gt;</filename>.
+<indexterm type="file"><primary><filename class="headerfile">X11/keysymdef.h</filename></primary></indexterm>
+<indexterm><primary>Files</primary><secondary><filename class="headerfile">&lt;X11/keysymdef.h&gt;</filename></secondary></indexterm>
+<indexterm><primary>Headers</primary><secondary><filename class="headerfile">&lt;X11/keysymdef.h&gt;</filename></secondary></indexterm>
+Unfortunately, some C preprocessors have
+limits on the number of defined symbols.
+If you must use KeySyms not
+in the Latin 1-4, Greek, and miscellaneous classes,
+you may have to define a symbol for those sets.
+Most applications usually only include 
+<filename class="headerfile">&lt;X11/keysym.h&gt;</filename>,
+<indexterm type="file"><primary><filename class="headerfile">X11/keysym.h</filename></primary></indexterm>
+<indexterm><primary>Files</primary><secondary><filename class="headerfile">&lt;X11/keysym.h&gt;</filename></secondary></indexterm>
+<indexterm><primary>Headers</primary><secondary><filename class="headerfile">&lt;X11/keysym.h&gt;</filename></secondary></indexterm>
+which defines symbols for ISO Latin 1-4, Greek, and miscellaneous.
+</para>
+<para>
+<!-- .LP -->
+A list of KeySyms is associated with each KeyCode.
+The list is intended to convey the set of symbols on the corresponding key.
+If the list (ignoring trailing
+<symbol>NoSymbol</symbol>
+entries) is 
+a single KeySym ``<emphasis remap='I'>K</emphasis>'',
+then the list is treated as if it were the list 
+``<emphasis remap='I'>K</emphasis> NoSymbol <emphasis remap='I'>K</emphasis> NoSymbol''.
+If the list (ignoring trailing
+<symbol>NoSymbol</symbol>
+entries) is a pair of KeySyms ``<emphasis remap='I'>K1 K2</emphasis>'',
+then the list is treated as if it were the list ``<emphasis remap='I'>K1 K2 K1 K2</emphasis>''.
+If the list (ignoring trailing
+<symbol>NoSymbol</symbol>
+entries) is a triple of KeySyms ``<emphasis remap='I'>K1 K2 K3</emphasis>'',
+then the list is treated as if it were the list ``<emphasis remap='I'>K1 K2 K3</emphasis> NoSymbol''.
+When an explicit ``void'' element is desired in the list,
+the value
+<symbol>VoidSymbol</symbol>
+can be used.
+</para>
+<para>
+<!-- .LP -->
+The first four elements of the list are split into two groups of KeySyms.
+Group 1 contains the first and second KeySyms;
+Group 2 contains the third and fourth KeySyms.
+Within each group,
+if the second element of the group is
+<symbol>NoSymbol</symbol>,
+then the group should be treated as if the second element were 
+the same as the first element,
+except when the first element is an alphabetic KeySym ``<emphasis remap='I'>K</emphasis>'' 
+for which both lowercase and uppercase forms are defined.
+In that case,
+the group should be treated as if the first element were 
+the lowercase form of ``<emphasis remap='I'>K</emphasis>'' and the second element were 
+the uppercase form of ``<emphasis remap='I'>K</emphasis>''.
+</para>
+<para>
+<!-- .LP -->
+The standard rules for obtaining a KeySym from a
+<symbol>KeyPress</symbol>
+event make use of only the Group 1 and Group 2 KeySyms;
+no interpretation of other KeySyms in the list is given.
+Which group to use is determined by the modifier state.
+Switching between groups is controlled by the KeySym named MODE SWITCH,
+by attaching that KeySym to some KeyCode and attaching 
+that KeyCode to any one of the modifiers
+<symbol>Mod1</symbol>
+through
+<symbol>Mod5</symbol>.
+This modifier is called the <emphasis remap='I'>group modifier</emphasis>.
+For any KeyCode,
+Group 1 is used when the group modifier is off,
+and Group 2 is used when the group modifier is on.
+</para>
+<para>
+<!-- .LP -->
+The
+<symbol>Lock</symbol>
+modifier is interpreted as CapsLock when the KeySym named XK_Caps_Lock
+is attached to some KeyCode and that KeyCode is attached to the
+<symbol>Lock</symbol>
+modifier.  The
+<symbol>Lock</symbol>
+modifier is interpreted as ShiftLock when the KeySym named XK_Shift_Lock
+is attached to some KeyCode and that KeyCode is attached to the
+<symbol>Lock</symbol>
+modifier.  If the
+<symbol>Lock</symbol>
+modifier could be interpreted as both
+CapsLock and ShiftLock, the CapsLock interpretation is used.
+</para>
+<para>
+<!-- .LP -->
+The operation of keypad keys is controlled by the KeySym named XK_Num_Lock,
+by attaching that KeySym to some KeyCode and attaching that KeyCode to any
+one of the modifiers
+<symbol>Mod1</symbol>
+through
+<symbol>Mod5</symbol>.
+This modifier is called the
+<emphasis remap='I'>numlock modifier</emphasis>.  The standard KeySyms with the prefix ``XK_KP_''
+in their
+name are called keypad KeySyms; these are KeySyms with numeric value in
+the hexadecimal range 0xFF80 to 0xFFBD inclusive.  In addition,
+vendor-specific KeySyms in the hexadecimal range 0x11000000 to 0x1100FFFF
+are also keypad KeySyms.
+</para>
+<para>
+<!-- .LP -->
+Within a group, the choice of KeySym is determined by applying the first
+rule that is satisfied from the following list:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+The numlock modifier is on and the second KeySym is a keypad KeySym.  In
+this case, if the
+<symbol>Shift</symbol>
+modifier is on, or if the
+<symbol>Lock</symbol>
+modifier is on and
+is interpreted as ShiftLock, then the first KeySym is used, otherwise the
+second KeySym is used.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The
+<symbol>Shift</symbol>
+and
+<symbol>Lock</symbol>
+modifiers are both off.  In this case, the first
+KeySym is used.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The
+<symbol>Shift</symbol>
+modifier is off, and the
+<symbol>Lock</symbol>
+modifier is on and is
+interpreted as CapsLock.  In this case, the first KeySym is used, but if
+that KeySym is lowercase alphabetic, then the corresponding uppercase
+KeySym is used instead.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The
+<symbol>Shift</symbol>
+modifier is on, and the
+<symbol>Lock</symbol>
+modifier is on and is interpreted
+as CapsLock.  In this case, the second KeySym is used, but if that KeySym
+is lowercase alphabetic, then the corresponding uppercase KeySym is used
+instead.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The
+<symbol>Shift</symbol>
+modifier is on, or the
+<symbol>Lock</symbol>
+modifier is on and is interpreted
+as ShiftLock, or both.  In this case, the second KeySym is used.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+No spatial geometry of the symbols on the key is defined by
+their order in the KeySym list, 
+although a geometry might be defined on a
+server-specific basis.
+The X server does not use the mapping between KeyCodes and KeySyms.
+Rather, it merely stores it for reading and writing by clients.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To obtain the legal KeyCodes for a display, use
+<xref linkend='XDisplayKeycodes' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XDisplayKeycodes</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XDisplayKeycodes'>
+<funcprototype>
+  <funcdef><function>XDisplayKeycodes</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int *<parameter>min_keycodes_return</parameter></paramdef>
+  <paramdef>int *<parameter>max_keycodes_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>min_keycodes_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the minimum number of KeyCodes.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>max_keycodes_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the maximum number of KeyCodes.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XDisplayKeycodes' xrefstyle='select: title'/>
+function returns the min-keycodes and max-keycodes supported by the
+specified display.
+The minimum number of KeyCodes returned is never less than 8,
+and the maximum number of KeyCodes returned is never greater than 255.
+Not all KeyCodes in this range are required to have corresponding keys.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To obtain the symbols for the specified KeyCodes, use
+<xref linkend='XGetKeyboardMapping' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetKeyboardMapping</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetKeyboardMapping'>
+<funcprototype>
+  <funcdef>KeySym *<function>XGetKeyboardMapping</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>KeyCode <parameter>first_keycode</parameter></paramdef>
+  <paramdef>int <parameter>keycode_count</parameter></paramdef>
+  <paramdef>int *<parameter>keysyms_per_keycode_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>first_keycode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the first KeyCode that is to be returned.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keycode_count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of KeyCodes that are to be returned.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keysyms_per_keycode_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of KeySyms per KeyCode.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGetKeyboardMapping' xrefstyle='select: title'/>
+function returns the symbols for the specified number of KeyCodes
+starting with first_keycode.
+The value specified in first_keycode must be greater than 
+or equal to min_keycode as returned by
+<xref linkend='XDisplayKeycodes' xrefstyle='select: title'/>,
+or a
+<errorname>BadValue</errorname>
+error results.
+In addition, the following expression must be less than or equal 
+to max_keycode as returned by
+<xref linkend='XDisplayKeycodes' xrefstyle='select: title'/>:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+first_keycode + keycode_count - 1
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+If this is not the case, a 
+<errorname>BadValue</errorname>
+error results. 
+The number of elements in the KeySyms list is:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+keycode_count * keysyms_per_keycode_return
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+KeySym number N, counting from zero, for KeyCode K has the following index
+in the list, counting from zero: 
+<literallayout class="monospaced">
+(K - first_code) * keysyms_per_code_return + N
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+The X server arbitrarily chooses the keysyms_per_keycode_return value 
+to be large enough to report all requested symbols. 
+A special KeySym value of 
+<symbol>NoSymbol</symbol>
+is used to fill in unused elements for
+individual KeyCodes.
+To free the storage returned by 
+<xref linkend='XGetKeyboardMapping' xrefstyle='select: title'/>,
+use
+<xref linkend='XFree' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetKeyboardMapping' xrefstyle='select: title'/>
+can generate a
+<errorname>BadValue</errorname>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To change the keyboard mapping, use
+<xref linkend='XChangeKeyboardMapping' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XChangeKeyboardMapping</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XChangeKeyboardMapping'>
+<funcprototype>
+  <funcdef><function>XChangeKeyboardMapping</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>int <parameter>first_keycode</parameter></paramdef>
+  <paramdef>int <parameter>keysyms_per_keycode</parameter></paramdef>
+  <paramdef>KeySym *<parameter>keysyms</parameter></paramdef>
+  <paramdef>int <parameter>num_codes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>first_keycode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the first KeyCode that is to be changed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keysyms_per_keycode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of KeySyms per KeyCode.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keysyms</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an array of KeySyms.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_codes</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of KeyCodes that are to be changed.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XChangeKeyboardMapping' xrefstyle='select: title'/>
+function defines the symbols for the specified number of KeyCodes
+starting with first_keycode.
+The symbols for KeyCodes outside this range remain unchanged.  
+The number of elements in keysyms must be:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+num_codes * keysyms_per_keycode
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+The specified first_keycode must be greater than or equal to min_keycode 
+returned by
+<xref linkend='XDisplayKeycodes' xrefstyle='select: title'/>,
+or a 
+<errorname>BadValue</errorname>
+error results.
+In addition, the following expression must be less than or equal to 
+max_keycode as returned by
+<xref linkend='XDisplayKeycodes' xrefstyle='select: title'/>,
+or a
+<errorname>BadValue</errorname>
+error results:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+first_keycode + num_codes - 1
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+KeySym number N, counting from zero, for KeyCode K has the following index
+in keysyms, counting from zero: 
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+(K - first_keycode) * keysyms_per_keycode + N
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+The specified keysyms_per_keycode can be chosen arbitrarily by the client
+to be large enough to hold all desired symbols. 
+A special KeySym value of 
+<symbol>NoSymbol</symbol>
+should be used to fill in unused elements 
+for individual KeyCodes.  
+It is legal for 
+<symbol>NoSymbol</symbol>
+to appear in nontrailing positions
+of the effective list for a KeyCode.
+<xref linkend='XChangeKeyboardMapping' xrefstyle='select: title'/>
+generates a 
+<symbol>MappingNotify</symbol>
+event.
+</para>
+<para>
+<!-- .LP -->
+There is no requirement that the X server interpret this mapping. 
+It is merely stored for reading and writing by clients.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XChangeKeyboardMapping' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>
+and
+<errorname>BadValue</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+The next six functions make use of the 
+<structname>XModifierKeymap</structname>
+data structure, which contains:
+</para>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>XModifierKeymap</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 2.5i -->
+<!-- .ta .5i 2.5i -->
+typedef struct {
+	int max_keypermod;	/* This server's max number of keys per modifier */
+	KeyCode *modifiermap;	/* An 8 by max_keypermod array of the modifiers */
+} XModifierKeymap;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+To create an
+<structname>XModifierKeymap</structname>
+structure, use
+<xref linkend='XNewModifiermap' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XNewModifiermap</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XNewModifiermap'>
+<funcprototype>
+  <funcdef>XModifierKeymap *<function>XNewModifiermap</function></funcdef>
+  <paramdef>int <parameter>max_keys_per_mod</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>max_keys_per_mod</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of KeyCode entries preallocated to the modifiers
+in the map.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XNewModifiermap' xrefstyle='select: title'/>
+function returns a pointer to
+<structname>XModifierKeymap</structname>
+structure for later use.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To add a new entry to an 
+<structname>XModifierKeymap</structname>
+structure, use
+<xref linkend='XInsertModifiermapEntry' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XInsertModifiermapEntry</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XInsertModifiermapEntry'>
+<funcprototype>
+  <funcdef>XModifierKeymap *<function>XInsertModifiermapEntry</function></funcdef>
+  <paramdef>XModifierKeymap *<parameter>modmap</parameter></paramdef>
+  <paramdef>KeyCode <parameter>keycode_entry</parameter></paramdef>
+  <paramdef>int <parameter>modifier</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modmap</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the 
+<structname>XModifierKeymap</structname>
+structure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keycode_entry</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the KeyCode. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modifier</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the modifier.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XInsertModifiermapEntry' xrefstyle='select: title'/>
+function adds the specified KeyCode to the set that controls the specified
+modifier and returns the resulting
+<structname>XModifierKeymap</structname>
+structure (expanded as needed).
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To delete an entry from an 
+<structname>XModifierKeymap</structname>
+structure, use
+<xref linkend='XDeleteModifiermapEntry' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XDeleteModifiermapEntry</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XDeleteModifiermapEntry'>
+<funcprototype>
+  <funcdef>XModifierKeymap *<function>XDeleteModifiermapEntry</function></funcdef>
+  <paramdef>XModifierKeymap *<parameter>modmap</parameter></paramdef>
+  <paramdef>KeyCode <parameter>keycode_entry</parameter></paramdef>
+  <paramdef>int <parameter>modifier</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modmap</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the 
+<structname>XModifierKeymap</structname>
+structure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keycode_entry</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the KeyCode. 
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modifier</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the modifier.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XDeleteModifiermapEntry' xrefstyle='select: title'/>
+function deletes the specified KeyCode from the set that controls the
+specified modifier and returns a pointer to the resulting
+<structname>XModifierKeymap</structname>
+structure.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To destroy an
+<structname>XModifierKeymap</structname>
+structure, use
+<xref linkend='XFreeModifiermap' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XFreeModifiermap</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XFreeModifiermap'>
+<funcprototype>
+  <funcdef><function>XFreeModifiermap</function></funcdef>
+  <paramdef>XModifierKeymap *<parameter>modmap</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modmap</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the 
+<structname>XModifierKeymap</structname>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XFreeModifiermap' xrefstyle='select: title'/>
+function frees the specified
+<structname>XModifierKeymap</structname>
+structure.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To set the KeyCodes to be used as modifiers, use
+<xref linkend='XSetModifierMapping' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetModifierMapping</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetModifierMapping'>
+<funcprototype>
+  <funcdef>int <function>XSetModifierMapping</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XModifierKeymap *<parameter>modmap</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>modmap</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the 
+<structname>XModifierKeymap</structname>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XSetModifierMapping' xrefstyle='select: title'/>
+function specifies the KeyCodes of the keys (if any) that are to be used 
+as modifiers.
+If it succeeds,
+the X server generates a
+<symbol>MappingNotify</symbol>
+event, and
+<xref linkend='XSetModifierMapping' xrefstyle='select: title'/>
+returns
+<symbol>MappingSuccess</symbol>.
+X permits at most 8 modifier keys.
+If more than 8 are specified in the
+<structname>XModifierKeymap</structname>
+structure, a
+<errorname>BadLength</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+The modifiermap member of the 
+<structname>XModifierKeymap</structname>
+structure contains 8 sets of max_keypermod KeyCodes, 
+one for each modifier in the order 
+<symbol>Shift</symbol>,
+<symbol>Lock</symbol>,
+<symbol>Control</symbol>,
+<symbol>Mod1</symbol>,
+<symbol>Mod2</symbol>,
+<symbol>Mod3</symbol>,
+<symbol>Mod4</symbol>,
+and 
+<symbol>Mod5</symbol>.
+Only nonzero KeyCodes have meaning in each set, 
+and zero KeyCodes are ignored.
+In addition, all of the nonzero KeyCodes must be in the range specified by 
+min_keycode and max_keycode in the 
+<type>Display</type>
+structure,
+or a 
+<errorname>BadValue</errorname>
+error results.
+</para>
+<para>
+<!-- .LP -->
+An X server can impose restrictions on how modifiers can be changed, 
+for example,
+if certain keys do not generate up transitions in hardware,
+if auto-repeat cannot be disabled on certain keys,
+or if multiple modifier keys are not supported.  
+If some such restriction is violated, 
+the status reply is
+<symbol>MappingFailed</symbol>,
+and none of the modifiers are changed.
+If the new KeyCodes specified for a modifier differ from those
+currently defined and any (current or new) keys for that modifier are
+in the logically down state, 
+<xref linkend='XSetModifierMapping' xrefstyle='select: title'/>
+returns
+<symbol>MappingBusy</symbol>,
+and none of the modifiers is changed.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetModifierMapping' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>
+and 
+<errorname>BadValue</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To obtain the KeyCodes used as modifiers, use
+<xref linkend='XGetModifierMapping' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetModifierMapping</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetModifierMapping'>
+<funcprototype>
+  <funcdef>XModifierKeymap *<function>XGetModifierMapping</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGetModifierMapping' xrefstyle='select: title'/>
+function returns a pointer to a newly created
+<structname>XModifierKeymap</structname>
+structure that contains the keys being used as modifiers.
+The structure should be freed after use by calling
+<xref linkend='XFreeModifiermap' xrefstyle='select: title'/>.
+If only zero values appear in the set for any modifier, 
+that modifier is disabled.
+<!-- .bp -->
+
+
+</para>
+</sect1>
+</chapter>
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH14.xml
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH14.xml	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/CH14.xml	(revision 5)
@@ -0,0 +1,5237 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+	  "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+<chapter id='Inter_Client_Communication_Functions'>
+<title>Inter-Client Communication Functions</title>
+<para>
+The <citetitle>Inter-Client Communication Conventions Manual</citetitle>,
+hereafter referred to as the <acronym>ICCCM</acronym>,
+details the X Consortium approved conventions that govern inter-client communications. These
+conventions ensure peer-to-peer client cooperation in the use of selections, cut buffers, and shared
+resources as well as client cooperation with window and session managers. For further information,
+see the <citetitle>Inter-Client Communication Conventions Manual</citetitle>.
+</para>
+<para>
+Xlib provides a number of standard properties and programming interfaces that are <acronym>ICCCM</acronym>
+compliant. The predefined atoms for some of these properties are defined in the &lt;X11/Xatom.h&gt;
+header file, where to avoid name conflicts with user symbols their #define name has an XA_ prefix.
+For further information about atoms and properties,
+see <link linkend="Properties_and_Atoms">section 4.3</link>.
+</para>
+<para>
+Xlib’s selection and cut buffer mechanisms provide the primary programming interfaces by which
+peer client applications communicate with each other
+(see sections <link linkend="Selections">4.5</link> and
+<link linkend="Using_Cut_Buffers">16.6</link>). The functions
+discussed in this chapter provide the primary programming interfaces by which client applications
+communicate with their window and session managers as well as share standard colormaps.
+</para>
+<para>
+The standard properties that are of special interest for communicating with window and session
+managers are:
+</para>
+
+<informaltable frame='topbot'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='4' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth='3.0*'/>
+  <colspec colname='c2' colwidth='2.3*'/>
+  <colspec colname='c3' colwidth='0.9*'/>
+  <colspec colname='c4' colwidth='2.7*'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Name</entry>
+      <entry>Type</entry>
+      <entry>Format</entry>
+      <entry>Description</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry><property>WM_CLASS</property></entry>
+      <entry>STRING</entry>
+      <entry>8</entry>
+      <entry>Set by application programs to allow
+      window and session managers to
+      obtain the application’s resources
+      from the resource database.
+      </entry>
+    </row>
+    <row>
+      <entry><property>WM_CLIENT_MACHINE</property></entry>
+      <entry>TEXT</entry>
+      <entry></entry>
+      <entry>The string name of the machine on
+      which the client application is running.
+      </entry>
+    </row>
+    <row>
+      <entry><property>WM_COLORMAP_WINDOWS</property></entry>
+      <entry>WINDOWS</entry>
+      <entry>32</entry>
+      <entry>The list of window IDs that may
+      need a different colormap from that
+      of their top-level window.
+      </entry>
+    </row>
+    <row>
+      <entry><property>WM_COMMAND</property></entry>
+      <entry>TEXT</entry>
+      <entry></entry>
+      <entry>The command and arguments, null
+      separated, used to invoke the application.
+      </entry>
+    </row>
+    <row>
+      <entry><property>WM_HINTS</property></entry>
+      <entry><property>WM_HINTS</property></entry>
+      <entry>32</entry>
+      <entry>Additional hints set by the client for
+      use by the window manager. The C
+      type of this property is XWMHints.
+      </entry> 
+    </row>
+    <row>
+      <entry><property>WM_ICON_NAME</property></entry>
+      <entry>TEXT</entry>
+      <entry></entry>
+      <entry>The name to be used in an icon.</entry>
+    </row>
+    <row>
+      <entry><property>WM_ICON_SIZE</property></entry>
+      <entry><property>WM_ICON_SIZE</property></entry>
+      <entry>32</entry>
+      <entry>The window manager may set this
+      property on the root window to
+      specify the icon sizes it supports.
+      The C type of this property is
+      XIconSize.
+      </entry>
+    </row>
+    <row>
+      <entry><property>WM_NAME</property></entry>
+      <entry>TEXT</entry>
+      <entry></entry>
+      <entry>The name of the application.</entry>
+    </row>
+    <row>
+      <entry><property>WM_NORMAL_HINTS</property></entry>
+      <entry><property>WM_NORMAL_HINTS</property></entry>
+      <entry>32</entry>
+      <entry>Size hints for a window in its
+      normal state. The C type of this
+      property is XSizeHints.
+      </entry>
+    </row>
+    <row>
+      <entry><property>WM_PROTOCOLS</property></entry>
+      <entry>ATOM</entry>
+      <entry>32</entry>
+      <entry>List of atoms that identify the 
+      communications protocols between the
+      client and window manager in
+      which the client is willing to participate.
+      </entry>
+    </row>
+    <row>
+      <entry><property>WM_STATE</property></entry>
+      <entry><property>WM_STATE</property></entry>
+      <entry>32</entry>
+      <entry>Intended for communication
+      between window and session managers only.
+      </entry>
+    </row>
+    <row>
+      <entry><property>WM_TRANSIENT_FOR</property></entry>
+      <entry>WINDOW</entry>
+      <entry>32</entry>
+      <entry>Set by application programs to 
+      indicate to the window manager that a
+      transient top-level window, such as a
+      dialog box.
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The remainder of this chapter discusses:
+</para>
+
+<itemizedlist>
+  <listitem><para>Client to window manager communication</para></listitem>
+  <listitem><para>Client to session manager communication</para></listitem>
+  <listitem><para>Standard colormaps</para></listitem>
+</itemizedlist>
+
+<sect1 id="Client_to_Window_Manager_Communication">
+<title>Client to Window Manager Communication</title>
+<!-- .XS -->
+<!-- (SN Client to Window Manager Communication -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+This section discusses how to:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Manipulate top-level windows
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Convert string lists
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Set and read text properties
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Set and read the <property>WM_NAME</property> property
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Set and read the <property>WM_ICON_NAME</property> property
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Set and read the <property>WM_HINTS</property> property
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Set and read the <property>WM_NORMAL_HINTS</property> property
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Set and read the <property>WM_CLASS</property> property
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Set and read the <property>WM_TRANSIENT_FOR</property> property
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Set and read the <property>WM_PROTOCOLS</property> property
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Set and read the <property>WM_COLORMAP_WINDOWS</property> property
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Set and read the <property>WM_ICON_SIZE</property> property
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Use window manager convenience functions
+    </para>
+  </listitem>
+</itemizedlist>
+<sect2 id="Manipulating_Top_Level_Windows">
+<title>Manipulating Top-Level Windows</title>
+<!-- .XS -->
+<!-- (SN Manipulating Top-Level Windows -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to change the visibility or size
+of top-level windows (that is, those that were created as children 
+of the root window).
+Note that the subwindows that you create are ignored by window managers.
+Therefore,
+you should use the basic window functions described in
+<link linkend='Window_Functions'>chapter 3</link>
+to manipulate your application's subwindows.
+</para>
+<para>
+<!-- .LP -->
+To request that a top-level window be iconified, use
+<xref linkend='XIconifyWindow' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XIconifyWindow</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XIconifyWindow'>
+<funcprototype>
+  <funcdef>Status <function>XIconifyWindow</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>int <parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate screen number on the host server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XIconifyWindow' xrefstyle='select: title'/>
+function sends a <property>WM_CHANGE_STATE</property> 
+<symbol>ClientMessage</symbol>
+event with a format of 32 and a first data element of 
+<symbol>IconicState</symbol>
+(as described in section 4.1.4 of the
+<citetitle>Inter-Client Communication Conventions Manual</citetitle>)
+and a window of w
+to the root window of the specified screen
+with an event mask set to
+<symbol>SubstructureNotifyMask</symbol> |
+<symbol>SubstructureRedirectMask</symbol>.
+Window managers may elect to receive this message and
+if the window is in its normal state, 
+may treat it as a request to change the window's state from normal to iconic.
+If the <property>WM_CHANGE_STATE</property> property cannot be interned, 
+<xref linkend='XIconifyWindow' xrefstyle='select: title'/>
+does not send a message and returns a zero status.
+It returns a nonzero status if the client message is sent successfully;
+otherwise, it returns a zero status.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To request that a top-level window be withdrawn, use
+<xref linkend='XWithdrawWindow' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XWithdrawWindow</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XWithdrawWindow'>
+<funcprototype>
+  <funcdef>Status <function>XWithdrawWindow</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>int <parameter>screen_number</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate screen number on the host server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XWithdrawWindow' xrefstyle='select: title'/>
+function unmaps the specified window 
+and sends a synthetic 
+<symbol>UnmapNotify</symbol>
+event to the root window of the specified screen.
+Window managers may elect to receive this message 
+and may treat it as a request to change the window's state to withdrawn.
+When a window is in the withdrawn state, 
+neither its normal nor its iconic representations is visible.
+It returns a nonzero status if the 
+<symbol>UnmapNotify</symbol>
+event is successfully sent; 
+otherwise, it returns a zero status.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XWithdrawWindow' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To request that a top-level window be reconfigured, use
+<xref linkend='XReconfigureWMWindow' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XReconfigureWMWindow</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XReconfigureWMWindow'>
+<funcprototype>
+  <funcdef>Status <function>XReconfigureWMWindow</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>int <parameter>screen_number</parameter></paramdef>
+  <paramdef>unsigned int <parameter>value_mask</parameter></paramdef>
+  <paramdef>XWindowChanges *<parameter>values</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen_number</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the appropriate screen number on the host server.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>value_mask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies which values are to be set using information in
+the values structure.
+This mask is the bitwise inclusive OR of the valid configure window values bits.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>values</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the 
+<structname>XWindowChanges</structname>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XReconfigureWMWindow' xrefstyle='select: title'/>
+function issues a 
+<systemitem>ConfigureWindow</systemitem>
+request on the specified top-level window.
+If the stacking mode is changed and the request fails with a 
+<errorname>BadMatch</errorname>
+error, 
+the error is trapped by Xlib and a synthetic 
+<systemitem class="event">ConfigureRequestEvent</systemitem>
+containing the same configuration parameters is sent to the root 
+of the specified window.
+Window managers may elect to receive this event 
+and treat it as a request to reconfigure the indicated window.
+It returns a nonzero status if the request or event is successfully sent;
+otherwise, it returns a zero status.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XReconfigureWMWindow' xrefstyle='select: title'/>
+can generate
+<errorname>BadValue</errorname>
+and 
+<errorname>BadWindow</errorname>
+errors.
+</para>
+</sect2>
+<sect2 id="Converting_String_Lists">
+<title>Converting String Lists</title>
+<!-- .XS -->
+<!-- (SN Converting String Lists -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Many of the text properties allow a variety of types and formats.
+Because the data stored in these properties are not
+simple null-terminated strings, an
+<structname>XTextProperty</structname>
+structure is used to describe the encoding, type, and length of the text 
+as well as its value.
+The
+<structname>XTextProperty</structname>
+structure contains:
+<indexterm significance="preferred"><primary>XTextProperty</primary></indexterm>
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 2.5i -->
+<!-- .ta .5i 2.5i -->
+typedef struct {
+	unsigned char *value;	/* property data */
+	Atom encoding;	/* type of property */
+	int format;	/* 8, 16, or 32 */
+	unsigned long nitems;	/* number of items in value */
+} XTextProperty;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Xlib provides functions to convert localized text to or from encodings
+that support the inter-client communication conventions for text.
+In addition, functions are provided for converting between lists of pointers 
+to character strings and text properties in the STRING encoding.
+</para>
+<para>
+<!-- .LP -->
+The functions for localized text return a signed integer error status 
+that encodes 
+<symbol>Success</symbol>
+as zero, specific error conditions as negative numbers, and partial conversion
+as a count of unconvertible characters.
+</para>
+
+<literallayout class="monospaced">
+
+#define #XNoMemory           -1
+#define #XLocaleNotSupported -2
+#define #XConverterNotFound  -3
+
+typedef enum {
+	XStringStyle,		/* STRING */
+	XCompoundTextStyle,	/* COMPOUND_TEXT */
+	XTextStyle,		/* text in owner's encoding (current locale) */
+	XStdICCTextStyle	/* STRING, else COMPOUND_TEXT */
+} XICCEncodingStyle;
+</literallayout>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To convert a list of text strings to an 
+<structname>XTextProperty</structname>
+structure, use
+<xref linkend='XmbTextListToTextProperty' xrefstyle='select: title'/>
+or
+<xref linkend='XwcTextListToTextProperty' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XmbTextListToTextProperty</primary></indexterm>
+<indexterm significance="preferred"><primary>XwcTextListToTextProperty</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XmbTextListToTextProperty'>
+<funcprototype>
+  <funcdef>int <function>XmbTextListToTextProperty</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>char **<parameter>list</parameter></paramdef>
+  <paramdef>int <parameter>count</parameter></paramdef>
+  <paramdef>XICCEncodingStyle <parameter>style</parameter></paramdef>
+  <paramdef>XTextProperty *<parameter>text_prop_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<funcsynopsis id='XwcTextListToTextProperty'>
+<funcprototype>
+  <funcdef>int <function>XwcTextListToTextProperty</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>wchar_t **<parameter>list</parameter></paramdef>
+  <paramdef>int <parameter>count</parameter></paramdef>
+  <paramdef>XICCEncodingStyle <parameter>style</parameter></paramdef>
+  <paramdef>XTextProperty *<parameter>text_prop_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>list</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a list of null-terminated character strings.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of strings specified.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>style</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the manner in which the property is encoded.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>text_prop_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the
+<structname>XTextProperty</structname>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XmbTextListToTextProperty' xrefstyle='select: title'/>
+and
+<xref linkend='XwcTextListToTextProperty' xrefstyle='select: title'/>
+functions set the specified 
+<structname>XTextProperty</structname>
+value to a set of null-separated elements representing the concatenation
+of the specified list of null-terminated text strings.
+A final terminating null is stored at the end of the value field 
+of text_prop_return but is not included in the nitems member.
+</para>
+<para>
+<!-- .LP -->
+The functions set the encoding field of text_prop_return to an
+<type>Atom</type>
+for the specified display 
+naming the encoding determined by the specified style
+and convert the specified text list to this encoding for storage in
+the text_prop_return value field.
+If the style 
+<constant>XStringStyle</constant>
+or 
+<constant>XCompoundTextStyle</constant>
+is specified,
+this encoding is ``STRING'' or ``COMPOUND_TEXT'', respectively.
+If the style 
+<constant>XTextStyle</constant>
+is specified,
+this encoding is the encoding of the current locale.
+If the style 
+<constant>XStdICCTextStyle</constant>
+is specified,
+this encoding is ``STRING'' if the text is fully convertible to STRING,
+else ``COMPOUND_TEXT''.
+</para>
+<para>
+<!-- .LP -->
+If insufficient memory is available for the new value string,
+the functions return 
+<symbol>XNoMemory</symbol>.
+If the current locale is not supported,
+the functions return 
+<symbol>XLocaleNotSupported</symbol>.
+In both of these error cases,
+the functions do not set text_prop_return.
+</para>
+<para>
+<!-- .LP -->
+To determine if the functions are guaranteed not to return
+<symbol>XLocaleNotSupported</symbol>,
+use
+<function>XSupportsLocale</function>.
+</para>
+<para>
+<!-- .LP -->
+If the supplied text is not fully convertible to the specified encoding,
+the functions return the number of unconvertible characters.
+Each unconvertible character is converted to an implementation-defined and
+encoding-specific default string.
+Otherwise, the functions return 
+<symbol>Success</symbol>.
+Note that full convertibility to all styles except 
+<constant>XStringStyle</constant>
+is guaranteed.
+</para>
+<para>
+<!-- .LP -->
+To free the storage for the value field, use
+<xref linkend='XFree' xrefstyle='select: title'/>.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To obtain a list of text strings from an 
+<structname>XTextProperty</structname>
+structure, use
+<xref linkend='XmbTextPropertyToTextList' xrefstyle='select: title'/>
+or
+<xref linkend='XwcTextPropertyToTextList' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XmbTextPropertyToTextList</primary></indexterm>
+<indexterm significance="preferred"><primary>XwcTextPropertyToTextList</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XmbTextPropertyToTextList'>
+<funcprototype>
+  <funcdef>int <function>XmbTextPropertyToTextList</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XTextProperty *<parameter>text_prop</parameter></paramdef>
+  <paramdef>char ***<parameter>list_return</parameter></paramdef>
+  <paramdef>int *<parameter>count_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<funcsynopsis id='XwcTextPropertyToTextList'>
+<funcprototype>
+  <funcdef>int <function>XwcTextPropertyToTextList</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>XTextProperty *<parameter>text_prop</parameter></paramdef>
+  <paramdef>wchar_t ***<parameter>list_return</parameter></paramdef>
+  <paramdef>int *<parameter>count_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>text_prop</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the
+<structname>XTextProperty</structname>
+structure to be used.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>list_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns a list of null-terminated character strings.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of strings.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XmbTextPropertyToTextList' xrefstyle='select: title'/>
+and 
+<xref linkend='XwcTextPropertyToTextList' xrefstyle='select: title'/>
+functions return a list of text strings in the current locale representing the
+null-separated elements of the specified
+<structname>XTextProperty</structname>
+structure.
+The data in text_prop must be format 8.
+</para>
+<para>
+<!-- .LP -->
+Multiple elements of the property (for example, the strings in a disjoint
+text selection) are separated by a null byte.
+The contents of the property are not required to be null-terminated;
+any terminating null should not be included in text_prop.nitems.
+</para>
+<para>
+<!-- .LP -->
+If insufficient memory is available for the list and its elements,
+<xref linkend='XmbTextPropertyToTextList' xrefstyle='select: title'/>
+and
+<xref linkend='XwcTextPropertyToTextList' xrefstyle='select: title'/>
+return 
+<symbol>XNoMemory</symbol>.
+If the current locale is not supported,
+the functions return
+<symbol>XLocaleNotSupported</symbol>.
+Otherwise, if the encoding field of text_prop is not convertible 
+to the encoding of the current locale,
+the functions return
+<symbol>XConverterNotFound</symbol>.
+For supported locales,
+existence of a converter from COMPOUND_TEXT, STRING
+or the encoding of the current locale is guaranteed if
+<function>XSupportsLocale</function>
+returns 
+<symbol>True</symbol>
+for the current locale (but the actual text
+may contain unconvertible characters).
+Conversion of other encodings is implementation-dependent.
+In all of these error cases,
+the functions do not set any return values.
+</para>
+<para>
+<!-- .LP -->
+Otherwise, 
+<xref linkend='XmbTextPropertyToTextList' xrefstyle='select: title'/>
+and
+<xref linkend='XwcTextPropertyToTextList' xrefstyle='select: title'/>
+return the list of null-terminated text strings to list_return
+and the number of text strings to count_return.
+</para>
+<para>
+<!-- .LP -->
+If the value field of text_prop is not fully convertible to the encoding of
+the current locale,
+the functions return the number of unconvertible characters.
+Each unconvertible character is converted to a string in the
+current locale that is specific to the current locale.
+To obtain the value of this string, 
+use
+<function>XDefaultString</function>.
+Otherwise,
+<xref linkend='XmbTextPropertyToTextList' xrefstyle='select: title'/>
+and
+<xref linkend='XwcTextPropertyToTextList' xrefstyle='select: title'/>
+return 
+<symbol>Success</symbol>.
+</para>
+<para>
+<!-- .LP -->
+To free the storage for the list and its contents returned by
+<xref linkend='XmbTextPropertyToTextList' xrefstyle='select: title'/>,
+use
+<xref linkend='XFreeStringList' xrefstyle='select: title'/>.
+To free the storage for the list and its contents returned by
+<xref linkend='XwcTextPropertyToTextList' xrefstyle='select: title'/>,
+use
+<xref linkend='XwcFreeStringList' xrefstyle='select: title'/>.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To free the in-memory data associated with the specified
+wide character string list, use
+<xref linkend='XwcFreeStringList' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XwcFreeStringList</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XwcFreeStringList'>
+<funcprototype>
+  <funcdef>void <function>XwcFreeStringList</function></funcdef>
+  <paramdef>wchar_t **<parameter>list</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>list</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the list of strings to be freed.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XwcFreeStringList' xrefstyle='select: title'/>
+function frees memory allocated by
+<xref linkend='XwcTextPropertyToTextList' xrefstyle='select: title'/>.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To obtain the default string for text conversion in the current locale,
+use</para>
+
+<funcsynopsis id='XDefaultString'>
+<funcprototype>
+  <funcdef>char *<function>XDefaultString</function></funcdef>
+  <void />
+</funcprototype>
+</funcsynopsis>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<function>XDefaultString</function>
+function returns the default string used by Xlib for text conversion
+(for example, in 
+<xref linkend='XmbTextPropertyToTextList' xrefstyle='select: title'/>).
+The default string is the string in the current locale that is output 
+when an unconvertible character is found during text conversion.
+If the string returned by
+<function>XDefaultString</function>
+is the empty string (""),
+no character is output in the converted text.
+<function>XDefaultString</function>
+does not return NULL.
+</para>
+<para>
+<!-- .LP -->
+The string returned by 
+<function>XDefaultString</function>
+is independent of the default string for text drawing;
+see 
+<xref linkend='XCreateFontSet' xrefstyle='select: title'/>
+to obtain the default string for an
+<type>XFontSet</type>.
+</para>
+<para>
+<!-- .LP -->
+The behavior when an invalid codepoint is supplied to any Xlib function is
+undefined.
+</para>
+<para>
+<!-- .LP -->
+The returned string is null-terminated.
+It is owned by Xlib and should not be modified or freed by the client.
+It may be freed after the current locale is changed.
+Until freed, it will not be modified by Xlib.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To set the specified list of strings in the STRING encoding to a 
+<structname>XTextProperty</structname>
+structure, use
+<xref linkend='XStringListToTextProperty' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XStringListToTextProperty</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XStringListToTextProperty'>
+<funcprototype>
+  <funcdef>Status <function>XStringListToTextProperty</function></funcdef>
+  <paramdef>char **<parameter>list</parameter></paramdef>
+  <paramdef>int <parameter>count</parameter></paramdef>
+  <paramdef>XTextProperty *<parameter>text_prop_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>list</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a list of null-terminated character strings.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of strings.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>text_prop_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the
+<structname>XTextProperty</structname>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XStringListToTextProperty' xrefstyle='select: title'/>
+function sets the specified 
+<structname>XTextProperty</structname>
+to be of type STRING (format 8) with a value representing the
+concatenation of the specified list of null-separated character strings.
+An extra null byte (which is not included in the nitems member) 
+is stored at the end of the value field of text_prop_return.
+The strings are assumed (without verification) to be in the STRING encoding.
+If insufficient memory is available for the new value string, 
+<xref linkend='XStringListToTextProperty' xrefstyle='select: title'/>
+does not set any fields in the
+<structname>XTextProperty</structname>
+structure and returns a zero status.
+Otherwise, it returns a nonzero status.
+To free the storage for the value field, use 
+<xref linkend='XFree' xrefstyle='select: title'/>.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To obtain a list of strings from a specified
+<structname>XTextProperty</structname>
+structure in the STRING encoding, use
+<xref linkend='XTextPropertyToStringList' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XTextPropertyToStringList</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XTextPropertyToStringList'>
+<funcprototype>
+  <funcdef>Status <function>XTextPropertyToStringList</function></funcdef>
+  <paramdef>XTextProperty *<parameter>text_prop</parameter></paramdef>
+  <paramdef>char ***<parameter>list_return</parameter></paramdef>
+  <paramdef>int *<parameter>count_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>text_prop</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the
+<structname>XTextProperty</structname>
+structure to be used.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>list_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns a list of null-terminated character strings.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of strings.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XTextPropertyToStringList' xrefstyle='select: title'/>
+function returns a list of strings representing the null-separated elements 
+of the specified
+<structname>XTextProperty</structname>
+structure.
+The data in text_prop must be of type STRING and format 8. 
+Multiple elements of the property 
+(for example, the strings in a disjoint text selection) 
+are separated by NULL (encoding 0).
+The contents of the property are not null-terminated.
+If insufficient memory is available for the list and its elements, 
+<xref linkend='XTextPropertyToStringList' xrefstyle='select: title'/>
+sets no return values and returns a zero status.
+Otherwise, it returns a nonzero status.
+To free the storage for the list and its contents, use 
+<xref linkend='XFreeStringList' xrefstyle='select: title'/>.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To free the in-memory data associated with the specified string list, use
+<xref linkend='XFreeStringList' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XFreeStringList</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XFreeStringList'>
+<funcprototype>
+  <funcdef>void <function>XFreeStringList</function></funcdef>
+  <paramdef>char **<parameter>list</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>list</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the list of strings to be freed.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XFreeStringList' xrefstyle='select: title'/>
+function releases memory allocated by 
+<xref linkend='XmbTextPropertyToTextList' xrefstyle='select: title'/>
+and
+<xref linkend='XTextPropertyToStringList' xrefstyle='select: title'/>
+and the missing charset list allocated by 
+<xref linkend='XCreateFontSet' xrefstyle='select: title'/>.
+</para>
+</sect2>
+<sect2 id="Setting_and_Reading_Text_Properties">
+<title>Setting and Reading Text Properties</title>
+<!-- .XS -->
+<!-- (SN Setting and Reading Text Properties -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides two functions that you can use to set and read
+the text properties for a given window.
+You can use these functions to set and read those properties of type TEXT
+(<property>WM_NAME</property>, <property>WM_ICON_NAME</property>, <property>WM_COMMAND</property>, and <property>WM_CLIENT_MACHINE</property>).
+In addition,
+Xlib provides separate convenience functions that you can use to set each 
+of these properties.
+For further information about these convenience functions,
+see sections
+<link linkend="Setting_and_Reading_the_WM_NAME_Property">14.1.4</link>,
+<link linkend="Setting_and_Reading_the_WM_ICON_NAME_Property">14.1.5</link>,
+<link linkend="Setting_and_Reading_the_WM_COMMAND_Property">14.2.1</link>, and
+<link linkend="Setting_and_Reading_the_WM_CLIENT_MACHINE_Property">14.2.2</link>,
+respectively.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To set one of a window's text properties, use
+<xref linkend='XSetTextProperty' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetTextProperty</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetTextProperty'>
+<funcprototype>
+  <funcdef>void <function>XSetTextProperty</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>XTextProperty *<parameter>text_prop</parameter></paramdef>
+  <paramdef>Atom <parameter>property</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>text_prop</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the
+<structname>XTextProperty</structname>
+structure to be used.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>property</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the property name.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XSetTextProperty' xrefstyle='select: title'/>
+function replaces the existing specified property for the named window 
+with the data, type, format, and number of items determined 
+by the value field, the encoding field, the format field, 
+and the nitems field, respectively, of the specified
+<structname>XTextProperty</structname>
+structure.
+If the property does not already exist,
+<xref linkend='XSetTextProperty' xrefstyle='select: title'/>
+sets it for the specified window.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetTextProperty' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>,
+<errorname>BadAtom</errorname>,
+<errorname>BadValue</errorname>,
+and 
+<errorname>BadWindow</errorname>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To read one of a window's text properties, use
+<xref linkend='XGetTextProperty' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetTextProperty</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetTextProperty'>
+<funcprototype>
+  <funcdef>Status <function>XGetTextProperty</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>XTextProperty *<parameter>text_prop_return</parameter></paramdef>
+  <paramdef>Atom <parameter>property</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>text_prop_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the
+<structname>XTextProperty</structname>
+structure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>property</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the property name.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGetTextProperty' xrefstyle='select: title'/>
+function reads the specified property from the window
+and stores the data in the returned
+<structname>XTextProperty</structname>
+structure.
+It stores the data in the value field,
+the type of the data in the encoding field,
+the format of the data in the format field, 
+and the number of items of data in the nitems field.
+An extra byte containing null (which is not included in the nitems member) 
+is stored at the end of the value field of text_prop_return.
+The particular interpretation of the property's encoding 
+and data as text is left to the calling application.
+If the specified property does not exist on the window,
+<xref linkend='XGetTextProperty' xrefstyle='select: title'/>
+sets the value field to NULL, 
+the encoding field to
+<symbol>None</symbol>,
+the format field to zero, 
+and the nitems field to zero.
+</para>
+<para>
+<!-- .LP -->
+If it was able to read and store the data in the
+<structname>XTextProperty</structname>
+structure,
+<xref linkend='XGetTextProperty' xrefstyle='select: title'/>
+returns a nonzero status; 
+otherwise, it returns a zero status.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetTextProperty' xrefstyle='select: title'/>
+can generate
+<errorname>BadAtom</errorname>
+and 
+<errorname>BadWindow</errorname>
+errors.
+</para>
+</sect2>
+<sect2 id="Setting_and_Reading_the_WM_NAME_Property">
+<title>Setting and Reading the WM_NAME Property</title>
+<!-- .XS -->
+<!-- (SN Setting and Reading the WM_NAME Property -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides convenience functions that you can use to set and read 
+the <property>WM_NAME</property> property for a given window.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To set a window's <property>WM_NAME</property> property with the supplied convenience function, use
+<xref linkend='XSetWMName' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetWMName</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetWMName'>
+<funcprototype>
+  <funcdef>void <function>XSetWMName</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>XTextProperty *<parameter>text_prop</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>text_prop</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the
+<structname>XTextProperty</structname>
+structure to be used.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XSetWMName' xrefstyle='select: title'/>
+convenience function calls
+<xref linkend='XSetTextProperty' xrefstyle='select: title'/>
+to set the <property>WM_NAME</property> property.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To read a window's <property>WM_NAME</property> property with the supplied convenience function, use
+<xref linkend='XGetWMName' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetWMName</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetWMName'>
+<funcprototype>
+  <funcdef>Status <function>XGetWMName</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>XTextProperty *<parameter>text_prop_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>text_prop_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the
+<structname>XTextProperty</structname>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGetWMName' xrefstyle='select: title'/>
+convenience function calls
+<xref linkend='XGetTextProperty' xrefstyle='select: title'/>
+to obtain the <property>WM_NAME</property> property.
+It returns a nonzero status on success;
+otherwise, it returns a zero status.
+</para>
+<para>
+<!-- .LP -->
+The following two functions have been superseded by
+<xref linkend='XSetWMName' xrefstyle='select: title'/>
+and
+<xref linkend='XGetWMName' xrefstyle='select: title'/>,
+respectively. 
+You can use these additional convenience functions 
+for window names that are encoded as STRING properties.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To assign a name to a window, use
+<xref linkend='XStoreName' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Window</primary><secondary>name</secondary></indexterm>
+<indexterm significance="preferred"><primary>XStoreName</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XStoreName'>
+<funcprototype>
+  <funcdef><function>XStoreName</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>char *<parameter>window_name</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>window_name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window name,
+which should be a null-terminated string.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XStoreName' xrefstyle='select: title'/>
+function assigns the name passed to window_name to the specified window.
+A window manager can display the window name in some prominent
+place, such as the title bar, to allow users to identify windows easily.
+Some window managers may display a window's name in the window's icon,
+although they are encouraged to use the window's icon name
+if one is provided by the application.
+If the string is not in the Host Portable Character Encoding,
+the result is implementation-dependent.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XStoreName' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To get the name of a window, use
+<xref linkend='XFetchName' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XFetchName</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XFetchName'>
+<funcprototype>
+  <funcdef>Status <function>XFetchName</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>char **<parameter>window_name_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>window_name_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the window name, which is a null-terminated string.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XFetchName' xrefstyle='select: title'/>
+function returns the name of the specified window.
+If it succeeds,
+it returns a nonzero status; 
+otherwise, no name has been set for the window,
+and it returns zero.
+If the <property>WM_NAME</property> property has not been set for this window,
+<xref linkend='XFetchName' xrefstyle='select: title'/>
+sets window_name_return to NULL.
+If the data returned by the server is in the Latin Portable Character Encoding,
+then the returned string is in the Host Portable Character Encoding.
+Otherwise, the result is implementation-dependent.
+When finished with it, a client must free
+the window name string using
+<xref linkend='XFree' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XFetchName' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+</sect2>
+<sect2 id="Setting_and_Reading_the_WM_ICON_NAME_Property">
+<title>Setting and Reading the WM_ICON_NAME Property</title>
+<!-- .XS -->
+<!-- (SN Setting and Reading the WM_ICON_NAME Property -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides convenience functions that you can use to set and read 
+the <property>WM_ICON_NAME</property> property for a given window.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To set a window's <property>WM_ICON_NAME</property> property,
+use
+<xref linkend='XSetWMIconName' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetWMIconName</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetWMIconName'>
+<funcprototype>
+  <funcdef>void <function>XSetWMIconName</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>XTextProperty *<parameter>text_prop</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>text_prop</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the
+<structname>XTextProperty</structname>
+structure to be used.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XSetWMIconName' xrefstyle='select: title'/>
+convenience function calls
+<xref linkend='XSetTextProperty' xrefstyle='select: title'/>
+to set the <property>WM_ICON_NAME</property> property.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To read a window's <property>WM_ICON_NAME</property> property,
+use
+<xref linkend='XGetWMIconName' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetWMIconName</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetWMIconName'>
+<funcprototype>
+  <funcdef>Status <function>XGetWMIconName</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>XTextProperty *<parameter>text_prop_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>text_prop_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the
+<structname>XTextProperty</structname>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XGetWMIconName' xrefstyle='select: title'/>
+convenience function calls
+<xref linkend='XGetTextProperty' xrefstyle='select: title'/>
+to obtain the <property>WM_ICON_NAME</property> property.
+It returns a nonzero status on success;
+otherwise, it returns a zero status.
+</para>
+<para>
+<!-- .LP -->
+The next two functions have been superseded by
+<xref linkend='XSetWMIconName' xrefstyle='select: title'/>
+and
+<xref linkend='XGetWMIconName' xrefstyle='select: title'/>,
+respectively.
+You can use these additional convenience functions 
+for window names that are encoded as STRING properties.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To set the name to be displayed in a window's icon, use
+<xref linkend='XSetIconName' xrefstyle='select: title'/>.
+</para>
+<indexterm><primary>Window</primary><secondary>icon name</secondary></indexterm>
+<indexterm significance="preferred"><primary>XSetIconName</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetIconName'>
+<funcprototype>
+  <funcdef><function>XSetIconName</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>char *<parameter>icon_name</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>icon_name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the icon name,
+which should be a null-terminated string.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+If the string is not in the Host Portable Character Encoding,
+the result is implementation-dependent.
+<xref linkend='XSetIconName' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To get the name a window wants displayed in its icon, use
+<xref linkend='XGetIconName' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetIconName</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetIconName'>
+<funcprototype>
+  <funcdef>Status <function>XGetIconName</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>char **<parameter>icon_name_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>icon_name_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the window's icon name,
+which is a null-terminated string.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGetIconName' xrefstyle='select: title'/>
+function returns the name to be displayed in the specified window's icon.
+If it succeeds, it returns a nonzero status; otherwise, 
+if no icon name has been set for the window,
+it returns zero.
+If you never assigned a name to the window,
+<xref linkend='XGetIconName' xrefstyle='select: title'/>
+sets icon_name_return to NULL.
+If the data returned by the server is in the Latin Portable Character Encoding,
+then the returned string is in the Host Portable Character Encoding.
+Otherwise, the result is implementation-dependent.
+When finished with it, a client must free
+the icon name string using
+<xref linkend='XFree' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetIconName' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+</sect2>
+<sect2 id="Setting_and_Reading_the_WM_HINTS_Property">
+<title>Setting and Reading the WM_HINTS Property</title>
+<!-- .XS -->
+<!-- (SN Setting and Reading the WM_HINTS Property -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to set and read 
+the <property>WM_HINTS</property> property for a given window.
+These functions use the flags and the
+<structname>XWMHints</structname>
+structure, as defined in the
+<filename class="headerfile">&lt;X11/Xutil.h&gt;</filename>
+<indexterm type="file"><primary><filename class="headerfile">X11/Xutil.h</filename></primary></indexterm>
+<indexterm><primary>Files</primary><secondary><filename class="headerfile">&lt;X11/Xutil.h&gt;</filename></secondary></indexterm>
+<indexterm><primary>Headers</primary><secondary><filename class="headerfile">&lt;X11/Xutil.h&gt;</filename></secondary></indexterm>
+header file.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To allocate an
+<structname>XWMHints</structname>
+structure, use
+<function>XAllocWMHints</function>.
+</para>
+
+<funcsynopsis id='XAllocWMHints'>
+<funcprototype>
+  <funcdef>XWMHints *<function>XAllocWMHints</function></funcdef>
+  <void />
+</funcprototype>
+</funcsynopsis>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<function>XAllocWMHints</function>
+function allocates and returns a pointer to an
+<structname>XWMHints</structname>
+structure.
+Note that all fields in the
+<structname>XWMHints</structname>
+structure are initially set to zero.
+If insufficient memory is available, 
+<function>XAllocWMHints</function>
+returns NULL.
+To free the memory allocated to this structure,
+use
+<xref linkend='XFree' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+The
+<structname>XWMHints</structname>
+structure contains:
+</para>
+
+<literallayout class="monospaced">
+/* Window manager hints mask bits */
+
+#define         InputHint             (1L&lt;&lt;0)
+#define         StateHint             (1L&lt;&lt;1)
+#define         IconPixmapHint        (1L&lt;&lt;2)
+#define         IconWindowHint        (1L&lt;&lt;3)
+#define         IconPositionHint      (1L&lt;&lt;4)
+#define         IconMaskHint          (1L&lt;&lt;5)
+#define         WindowGroupHint       (1L&lt;&lt;6)
+#define         UrgencyHint           (1L&lt;&lt;8)
+#define         AllHints              (InputHint|StateHint|IconPixmapHint|
+                                       IconWIndowHint|IconPositionHint|
+                                       IconMaskHint|WindowGroupHint)
+
+
+/* Values */
+
+typedef struct {
+	long flags;	        /* marks which fields in this structure are defined */
+	Bool input;	        /* does this application rely on the window manager to
+			           get keyboard input? */
+	int initial_state;	/* see below */
+	Pixmap icon_pixmap;	/* pixmap to be used as icon */
+	Window icon_window;	/* window to be used as icon */
+	int icon_x, icon_y;	/* initial position of icon */
+	Pixmap icon_mask;	/* pixmap to be used as mask for icon_pixmap */
+	XID window_group;	/* id of related window group */
+	/* this structure may be extended in the future */
+} XWMHints;
+</literallayout>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The input member is used to communicate to the window manager the input focus
+model used by the application.
+Applications that expect input but never explicitly set focus to any 
+of their subwindows (that is, use the push model of focus management), 
+such as X Version 10 style applications that use real-estate
+driven focus, should set this member to 
+<symbol>True</symbol>.
+Similarly, applications
+that set input focus to their subwindows only when it is given to their
+top-level window by a window manager should also set this member to 
+<symbol>True</symbol>.
+Applications that manage their own input focus by explicitly setting
+focus to one of their subwindows whenever they want keyboard input 
+(that is, use the pull model of focus management) should set this member to 
+<symbol>False</symbol>.
+Applications that never expect any keyboard input also should set this member
+to 
+<symbol>False</symbol>.
+</para>
+<para>
+<!-- .LP -->
+Pull model window managers should make it possible for push model
+applications to get input by setting input focus to the top-level windows of
+applications whose input member is 
+<symbol>True</symbol>.
+Push model window managers should
+make sure that pull model applications do not break them 
+by resetting input focus to 
+<symbol>PointerRoot</symbol>
+when it is appropriate (for example, whenever an application whose
+input member is 
+<symbol>False</symbol>
+sets input focus to one of its subwindows).
+</para>
+<para>
+<!-- .LP -->
+The definitions for the initial_state flag are:
+</para>
+
+<literallayout class="monospaced">
+#define      WithdrawnState 0
+#define      NormalState    1   /* most applications start this way */
+#define      IconicState    3   /* application wants to start as an icon */
+
+</literallayout>
+<para>
+The icon_mask specifies which pixels of the icon_pixmap should be used as the
+icon.  
+This allows for nonrectangular icons.
+Both icon_pixmap and icon_mask must be bitmaps.
+The icon_window lets an application provide a window for use as an icon
+for window managers that support such use.
+The window_group lets you specify that this window belongs to a group
+of other windows.
+For example, if a single application manipulates multiple 
+top-level windows, this allows you to provide enough
+information that a window manager can iconify all of the windows
+rather than just the one window.
+</para>
+<para>
+<!-- .LP -->
+The
+<symbol>UrgencyHint</symbol>
+flag, if set in the flags field, indicates that the client deems the window
+contents to be urgent, requiring the timely response of the user.  The
+window manager will make some effort to draw the user's attention to this
+window while this flag is set.  The client must provide some means by which the
+user can cause the urgency flag to be cleared (either mitigating
+the condition that made the window urgent or merely shutting off the alarm)
+or the window to be withdrawn.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To set a window's <property>WM_HINTS</property> property, use
+<xref linkend='XSetWMHints' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetWMHints</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetWMHints'>
+<funcprototype>
+  <funcdef><function>XSetWMHints</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>XWMHints *<parameter>wmhints</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>wmhints</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the 
+<structname>XWMHints</structname>
+structure to be used.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XSetWMHints' xrefstyle='select: title'/>
+function sets the window manager hints that include icon information and location,
+the initial state of the window, and whether the application relies on the
+window manager to get keyboard input.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetWMHints' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To read a window's <property>WM_HINTS</property> property, use
+<xref linkend='XGetWMHints' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetWMHints</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetWMHints'>
+<funcprototype>
+  <funcdef>XWMHints *<function>XGetWMHints</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGetWMHints' xrefstyle='select: title'/>
+function reads the window manager hints and 
+returns NULL if no <property>WM_HINTS</property> property was set on the window 
+or returns a pointer to an 
+<structname>XWMHints</structname>
+structure if it succeeds.
+When finished with the data,
+free the space used for it by calling
+<xref linkend='XFree' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetWMHints' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+</sect2>
+<sect2 id="Setting_and_Reading_the_WM_NORMAL_HINTS_Property">
+<title>Setting and Reading the WM_NORMAL_HINTS Property</title>
+<!-- .XS -->
+<!-- (SN Setting and Reading the WM_NORMAL_HINTS Property -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to set or read 
+the <property>WM_NORMAL_HINTS</property> property for a given window.
+The functions use the flags and the
+<structname>XSizeHints</structname>
+structure, as defined in the
+<filename class="headerfile">&lt;X11/Xutil.h&gt;</filename>
+<indexterm type="file"><primary><filename class="headerfile">X11/Xutil.h</filename></primary></indexterm>
+<indexterm><primary>Files</primary><secondary><filename class="headerfile">&lt;X11/Xutil.h&gt;</filename></secondary></indexterm>
+<indexterm><primary>Headers</primary><secondary><filename class="headerfile">&lt;X11/Xutil.h&gt;</filename></secondary></indexterm>
+header file.
+</para>
+<para>
+<!-- .LP -->
+The size of the
+<structname>XSizeHints</structname>
+structure may grow in future releases, as new components are
+added to support new <acronym>ICCCM</acronym> features.
+Passing statically allocated instances of this structure into
+Xlib may result in memory corruption when running against a
+future release of the library.
+As such, it is recommended that only dynamically allocated
+instances of the structure be used.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To allocate an
+<structname>XSizeHints</structname>
+structure, use
+<function>XAllocSizeHints</function>.
+</para>
+
+<funcsynopsis id='XAllocSizeHints'>
+<funcprototype>
+  <funcdef>XSizeHints *<function>XAllocSizeHints</function></funcdef>
+  <void />
+</funcprototype>
+</funcsynopsis>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<function>XAllocSizeHints</function>
+function allocates and returns a pointer to an
+<structname>XSizeHints</structname>
+structure.
+Note that all fields in the
+<structname>XSizeHints</structname>
+structure are initially set to zero.
+If insufficient memory is available, 
+<function>XAllocSizeHints</function>
+returns NULL.
+To free the memory allocated to this structure,
+use
+<xref linkend='XFree' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+The
+<structname>XSizeHints</structname>
+structure contains:
+</para>
+
+
+<literallayout class="monospaced">
+/* Size hints mask bits */
+
+#define           USPosition         (1L&lt;&lt;0)  /* user specified x,y */
+#define           USSize             (1L&lt;&lt;1)  /* user specified width,height */
+#define           PPosition          (1L&lt;&lt;2)  /* program specified position */
+#define           PSize              (1L&lt;&lt;3)  /* program specified size */
+#define           PMinSize           (1L&lt;&lt;4)  /* program specified minimum size */
+#define           PMaxSize           (1L&lt;&lt;5)  /* program specified maximum size */
+#define           PResizeInc         (1L&lt;&lt;5)  /* program specified resize increments */
+#define           PAspect            (1L&lt;&lt;6)  /* program specified min and max aspect ratios */
+#define           PBaseSize          (1L&lt;&lt;8)
+#define           PWinGravity        (1L&lt;&lt;9)
+#define           PAllHints          (PPosition|Psize|
+                                      PMinSize|PMaxSize|
+                                      PResizeInc|PAspect)
+
+
+/* Values */
+
+typedef struct {
+	long flags;	        /* marks which fields in this structure are defined */
+	int x, y;	        /* Obsolete */
+	int width, height;	/* Obsolete */
+	int min_width, min_height;
+	int max_width, max_height;
+	int width_inc, height_inc;
+	struct {
+	       int x;	        /* numerator */
+	       int y;	        /* denominator */
+	} min_aspect, max_aspect;
+	int base_width, base_height;
+	int win_gravity;
+	/* this structure may be extended in the future */
+} XSizeHints;
+</literallayout>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The x, y, width, and height members are now obsolete
+and are left solely for compatibility reasons.
+The min_width and min_height members specify the
+minimum window size that still allows the application to be useful.
+The max_width and max_height members specify the maximum window size.
+The width_inc and height_inc members define an arithmetic progression of
+sizes (minimum to maximum) into which the window prefers to be resized.
+The min_aspect and max_aspect members are expressed
+as ratios of x and y, 
+and they allow an application to specify the range of aspect
+ratios it prefers.
+The base_width and base_height members define the desired size of the window.
+The window manager will interpret the position of the window 
+and its border width to position the point of the outer rectangle 
+of the overall window specified by the win_gravity member.
+The outer rectangle of the window includes any borders or decorations
+supplied by the window manager.
+In other words,
+if the window manager decides to place the window where the client asked,
+the position on the parent window's border named by the win_gravity 
+will be placed where the client window would have been placed 
+in the absence of a window manager.
+</para>
+<para>
+<!-- .LP -->
+Note that use of the
+<symbol>PAllHints</symbol>
+macro is highly discouraged.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To set a window's <property>WM_NORMAL_HINTS</property> property, use
+<xref linkend='XSetWMNormalHints' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetWMNormalHints</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetWMNormalHints'>
+<funcprototype>
+  <funcdef>void <function>XSetWMNormalHints</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>XSizeHints *<parameter>hints</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>hints</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the size hints for the window in its normal state.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XSetWMNormalHints' xrefstyle='select: title'/>
+function replaces the size hints for the <property>WM_NORMAL_HINTS</property> property 
+on the specified window.
+If the property does not already exist,
+<xref linkend='XSetWMNormalHints' xrefstyle='select: title'/>
+sets the size hints for the <property>WM_NORMAL_HINTS</property> property on the specified window.
+The property is stored with a type of <property>WM_SIZE_HINTS</property> and a format of 32.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetWMNormalHints' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To read a window's <property>WM_NORMAL_HINTS</property> property, use
+<xref linkend='XGetWMNormalHints' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetWMNormalHints</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetWMNormalHints'>
+<funcprototype>
+  <funcdef>Status <function>XGetWMNormalHints</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>XSizeHints *<parameter>hints_return</parameter></paramdef>
+  <paramdef>long *<parameter>supplied_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>hints_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the size hints for the window in its normal state.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>supplied_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the hints that were supplied by the user.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XGetWMNormalHints' xrefstyle='select: title'/>
+function returns the size hints stored in the <property>WM_NORMAL_HINTS</property> property 
+on the specified window.
+If the property is of type <property>WM_SIZE_HINTS</property>, is of format 32,
+and is long enough to contain either an old (pre-<acronym>ICCCM</acronym>) 
+or new size hints structure, 
+<xref linkend='XGetWMNormalHints' xrefstyle='select: title'/>
+sets the various fields of the 
+<structname>XSizeHints</structname>
+structure, sets the supplied_return argument to the list of fields 
+that were supplied by the user (whether or not they contained defined values),
+and returns a nonzero status.
+Otherwise, it returns a zero status.
+</para>
+<para>
+<!-- .LP -->
+If 
+<xref linkend='XGetWMNormalHints' xrefstyle='select: title'/>
+returns successfully and a pre-<acronym>ICCCM</acronym> size hints property is read, 
+the supplied_return argument will contain the following bits:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+(USPosition|USSize|PPosition|PSize|PMinSize|
+ PMaxSize|PResizeInc|PAspect)
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+If the property is large enough to contain the base size 
+and window gravity fields as well, 
+the supplied_return argument will also contain the following bits:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+PBaseSize|PWinGravity
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetWMNormalHints' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To set a window's <property>WM_SIZE_HINTS</property> property, use
+<xref linkend='XSetWMSizeHints' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetWMSizeHints</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetWMSizeHints'>
+<funcprototype>
+  <funcdef>void <function>XSetWMSizeHints</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>XSizeHints *<parameter>hints</parameter></paramdef>
+  <paramdef>Atom <parameter>property</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>hints</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the
+<structname>XSizeHints</structname>
+structure to be used.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>property</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the property name.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XSetWMSizeHints' xrefstyle='select: title'/>
+function replaces the size hints for the specified property 
+on the named window.
+If the specified property does not already exist,
+<xref linkend='XSetWMSizeHints' xrefstyle='select: title'/>
+sets the size hints for the specified property
+on the named window.
+The property is stored with a type of <property>WM_SIZE_HINTS</property> and a format of 32.
+To set a window's normal size hints, 
+you can use the 
+<xref linkend='XSetWMNormalHints' xrefstyle='select: title'/>
+function.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetWMSizeHints' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>,
+<errorname>BadAtom</errorname>,
+and 
+<errorname>BadWindow</errorname>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To read a window's <property>WM_SIZE_HINTS</property> property, use
+<xref linkend='XGetWMSizeHints' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetWMSizeHints</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetWMSizeHints'>
+<funcprototype>
+  <funcdef>Status <function>XGetWMSizeHints</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>XSizeHints *<parameter>hints_return</parameter></paramdef>
+  <paramdef>long *<parameter>supplied_return</parameter></paramdef>
+  <paramdef>Atom <parameter>property</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>hints_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the
+<structname>XSizeHints</structname>
+structure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>supplied_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the hints that were supplied by the user.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>property</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the property name.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XGetWMSizeHints' xrefstyle='select: title'/>
+function returns the size hints stored in the specified property 
+on the named window.
+If the property is of type <property>WM_SIZE_HINTS</property>, is of format 32, 
+and is long enough to contain either an old (pre-<acronym>ICCCM</acronym>) 
+or new size hints structure, 
+<xref linkend='XGetWMSizeHints' xrefstyle='select: title'/>
+sets the various fields of the 
+<structname>XSizeHints</structname>
+structure, sets the supplied_return argument to the
+list of fields that were supplied by the user 
+(whether or not they contained defined values), 
+and returns a nonzero status.
+Otherwise, it returns a zero status.
+To get a window's normal size hints, 
+you can use the 
+<xref linkend='XGetWMNormalHints' xrefstyle='select: title'/>
+function.
+</para>
+<para>
+<!-- .LP -->
+If 
+<xref linkend='XGetWMSizeHints' xrefstyle='select: title'/>
+returns successfully and a pre-<acronym>ICCCM</acronym> size hints property is read, 
+the supplied_return argument will contain the following bits:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+(USPosition|USSize|PPosition|PSize|PMinSize|
+ PMaxSize|PResizeInc|PAspect)
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+If the property is large enough to contain the base size 
+and window gravity fields as well, 
+the supplied_return argument will also contain the following bits:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+PBaseSize|PWinGravity
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetWMSizeHints' xrefstyle='select: title'/>
+can generate
+<errorname>BadAtom</errorname>
+and 
+<errorname>BadWindow</errorname>
+errors.
+</para>
+</sect2>
+<sect2 id="Setting_and_Reading_the_WM_CLASS_Property">
+<title>Setting and Reading the WM_CLASS Property</title>
+<!-- .XS -->
+<!-- (SN Setting and Reading the WM_CLASS Property -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to set and get 
+the <property>WM_CLASS</property> property for a given window.
+These functions use the
+<structname>XClassHint</structname>
+structure, which is defined in the
+<filename class="headerfile">&lt;X11/Xutil.h&gt;</filename>
+<indexterm type="file"><primary><filename class="headerfile">X11/Xutil.h</filename></primary></indexterm>
+<indexterm><primary>Files</primary><secondary><filename class="headerfile">&lt;X11/Xutil.h&gt;</filename></secondary></indexterm>
+<indexterm><primary>Headers</primary><secondary><filename class="headerfile">&lt;X11/Xutil.h&gt;</filename></secondary></indexterm>
+header file.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To allocate an
+<structname>XClassHint</structname>
+structure, use
+<function>XAllocClassHint</function>.
+<indexterm significance="preferred"><primary>XAllocClassHint</primary></indexterm>
+<!-- .sM -->
+</para>
+
+<funcsynopsis id='XAllocClassHint'>
+<funcprototype>
+  <funcdef>XClassHint *<function>XAllocClassHint</function></funcdef>
+  <void />
+</funcprototype>
+</funcsynopsis>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<function>XAllocClassHint</function>
+function allocates and returns a pointer to an
+<structname>XClassHint</structname>
+structure.
+Note that the pointer fields in the
+<structname>XClassHint</structname>
+structure are initially set to NULL.
+If insufficient memory is available, 
+<function>XAllocClassHint</function>
+returns NULL.
+To free the memory allocated to this structure,
+use
+<xref linkend='XFree' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+The
+<structname>XClassHint</structname>
+contains:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<indexterm significance="preferred"><primary>XClassHint</primary></indexterm>
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+	char *res_name;
+	char *res_class;
+} XClassHint;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The res_name member contains the application name, 
+and the res_class member contains the application class. 
+Note that the name set in this property may differ from the name set as <property>WM_NAME</property>.
+That is, <property>WM_NAME</property> specifies what should be displayed in the title bar and,
+therefore, can contain temporal information (for example, the name of
+a file currently in an editor's buffer).
+On the other hand, 
+the name specified as part of <property>WM_CLASS</property> is the formal name of the application
+that should be used when retrieving the application's resources from the 
+resource database.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To set a window's <property>WM_CLASS</property> property, use
+<xref linkend='XSetClassHint' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetClassHint</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetClassHint'>
+<funcprototype>
+  <funcdef><function>XSetClassHint</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>XClassHint *<parameter>class_hints</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>class_hints</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the
+<structname>XClassHint</structname>
+structure that is to be used.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XSetClassHint' xrefstyle='select: title'/>
+function sets the class hint for the specified window.
+If the strings are not in the Host Portable Character Encoding,
+the result is implementation-dependent.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetClassHint' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>
+and
+<errorname>BadWindow</errorname>
+errors. 
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To read a window's <property>WM_CLASS</property> property, use
+<xref linkend='XGetClassHint' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetClassHint</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetClassHint'>
+<funcprototype>
+  <funcdef>Status <function>XGetClassHint</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>XClassHint *<parameter>class_hints_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>class_hints_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the 
+<structname>XClassHint</structname>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGetClassHint' xrefstyle='select: title'/>
+function returns the class hint of the specified window to the members
+of the supplied structure.
+If the data returned by the server is in the Latin Portable Character Encoding,
+then the returned strings are in the Host Portable Character Encoding.
+Otherwise, the result is implementation-dependent.
+It returns a nonzero status on success;
+otherwise, it returns a zero status.
+To free res_name and res_class when finished with the strings,
+use
+<xref linkend='XFree' xrefstyle='select: title'/>
+on each individually.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetClassHint' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+</sect2>
+<sect2 id="Setting_and_Reading_the_WM_TRANSIENT_FOR_Property">
+<title>Setting and Reading the WM_TRANSIENT_FOR Property</title>
+<!-- .XS -->
+<!-- (SN Setting and Reading the WM_TRANSIENT_FOR Property -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to set and read
+the <property>WM_TRANSIENT_FOR</property> property for a given window.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To set a window's <property>WM_TRANSIENT_FOR</property> property, use
+<xref linkend='XSetTransientForHint' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetTransientForHint</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetTransientForHint'>
+<funcprototype>
+  <funcdef><function>XSetTransientForHint</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>Window <parameter>prop_window</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>prop_window</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window that the <property>WM_TRANSIENT_FOR</property> property is to be set to.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XSetTransientForHint' xrefstyle='select: title'/>
+function sets the <property>WM_TRANSIENT_FOR</property> property of the specified window to the 
+specified prop_window.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetTransientForHint' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To read a window's <property>WM_TRANSIENT_FOR</property> property, use
+<xref linkend='XGetTransientForHint' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetTransientForHint</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetTransientForHint'>
+<funcprototype>
+  <funcdef>Status <function>XGetTransientForHint</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>Window *<parameter>prop_window_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>prop_window_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the <property>WM_TRANSIENT_FOR</property> property of the specified window.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGetTransientForHint' xrefstyle='select: title'/>
+function returns the <property>WM_TRANSIENT_FOR</property> property for the specified window.
+It returns a nonzero status on success;
+otherwise, it returns a zero status.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetTransientForHint' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+</sect2>
+<sect2 id="Setting_and_Reading_the_WM_PROTOCOLS_Property">
+<title>Setting and Reading the WM_PROTOCOLS Property</title>
+<!-- .XS -->
+<!-- (SN Setting and Reading the WM_PROTOCOLS Property -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to set and read
+the <property>WM_PROTOCOLS</property> property for a given window.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To set a window's <property>WM_PROTOCOLS</property> property, use
+<xref linkend='XSetWMProtocols' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetWMProtocols</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetWMProtocols'>
+<funcprototype>
+  <funcdef>Status <function>XSetWMProtocols</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>Atom *<parameter>protocols</parameter></paramdef>
+  <paramdef>int <parameter>count</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>protocols</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the list of protocols.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of protocols in the list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XSetWMProtocols' xrefstyle='select: title'/>
+function replaces the <property>WM_PROTOCOLS</property> property on the specified window 
+with the list of atoms specified by the protocols argument.
+If the property does not already exist,
+<xref linkend='XSetWMProtocols' xrefstyle='select: title'/>
+sets the <property>WM_PROTOCOLS</property> property on the specified window
+to the list of atoms specified by the protocols argument.
+The property is stored with a type of ATOM and a format of 32.
+If it cannot intern the <property>WM_PROTOCOLS</property> atom, 
+<xref linkend='XSetWMProtocols' xrefstyle='select: title'/>
+returns a zero status.
+Otherwise, it returns a nonzero status.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetWMProtocols' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To read a window's <property>WM_PROTOCOLS</property> property, use
+<xref linkend='XGetWMProtocols' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetWMProtocols</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetWMProtocols'>
+<funcprototype>
+  <funcdef>Status <function>XGetWMProtocols</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>Atom **<parameter>protocols_return</parameter></paramdef>
+  <paramdef>int *<parameter>count_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>protocols_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the list of protocols.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of protocols in the list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XGetWMProtocols' xrefstyle='select: title'/>
+function returns the list of atoms stored in the <property>WM_PROTOCOLS</property> property 
+on the specified window.
+These atoms describe window manager protocols in which the owner 
+of this window is willing to participate.
+If the property exists, is of type ATOM, is of format 32, 
+and the atom <property>WM_PROTOCOLS</property> can be interned, 
+<xref linkend='XGetWMProtocols' xrefstyle='select: title'/>
+sets the protocols_return argument to a list of atoms, 
+sets the count_return argument to the number of elements in the list, 
+and returns a nonzero status.
+Otherwise, it sets neither of the return arguments
+and returns a zero status.
+To release the list of atoms, use
+<xref linkend='XFree' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetWMProtocols' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+</sect2>
+<sect2 id="Setting_and_Reading_the_WM_COLORMAP_WINDOWS_Property">
+<title>Setting and Reading the WM_COLORMAP_WINDOWS Property</title>
+<!-- .XS -->
+<!-- (SN Setting and Reading the WM_COLORMAP_WINDOWS Property -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to set and read
+the <property>WM_COLORMAP_WINDOWS</property> property for a given window.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To set a window's <property>WM_COLORMAP_WINDOWS</property> property, use
+<xref linkend='XSetWMColormapWindows' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetWMColormapWindows</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetWMColormapWindows'>
+<funcprototype>
+  <funcdef>Status <function>XSetWMColormapWindows</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>Window *<parameter>colormap_windows</parameter></paramdef>
+  <paramdef>int <parameter>count</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>colormap_windows</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the list of windows.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of windows in the list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XSetWMColormapWindows' xrefstyle='select: title'/>
+function replaces the <property>WM_COLORMAP_WINDOWS</property> property on the specified
+window with the list of windows specified by the colormap_windows argument.
+If the property does not already exist,
+<xref linkend='XSetWMColormapWindows' xrefstyle='select: title'/>
+sets the <property>WM_COLORMAP_WINDOWS</property> property on the specified
+window to the list of windows specified by the colormap_windows argument.
+The property is stored with a type of WINDOW and a format of 32.
+If it cannot intern the <property>WM_COLORMAP_WINDOWS</property> atom,
+<xref linkend='XSetWMColormapWindows' xrefstyle='select: title'/>
+returns a zero status.
+Otherwise, it returns a nonzero status.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetWMColormapWindows' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To read a window's <property>WM_COLORMAP_WINDOWS</property> property, use
+<xref linkend='XGetWMColormapWindows' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetWMColormapWindows</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetWMColormapWindows'>
+<funcprototype>
+  <funcdef>Status <function>XGetWMColormapWindows</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>Window **<parameter>colormap_windows_return</parameter></paramdef>
+  <paramdef>int *<parameter>count_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>colormap_windows_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the list of windows.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of windows in the list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XGetWMColormapWindows' xrefstyle='select: title'/>
+function returns the list of window identifiers stored 
+in the <property>WM_COLORMAP_WINDOWS</property> property on the specified window.
+These identifiers indicate the colormaps that the window manager
+may need to install for this window.
+If the property exists, is of type WINDOW, is of format 32, 
+and the atom <property>WM_COLORMAP_WINDOWS</property> can be interned, 
+<xref linkend='XGetWMColormapWindows' xrefstyle='select: title'/>
+sets the windows_return argument to a list of window identifiers, 
+sets the count_return argument to the number of elements in the list, 
+and returns a nonzero status.
+Otherwise, it sets neither of the return arguments
+and returns a zero status.
+To release the list of window identifiers, use
+<xref linkend='XFree' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetWMColormapWindows' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+</sect2>
+<sect2 id="Setting_and_Reading_the_WM_ICON_SIZE_Property">
+<title>Setting and Reading the WM_ICON_SIZE Property</title>
+<!-- .XS -->
+<!-- (SN Setting and Reading the WM_ICON_SIZE Property -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to set and read 
+the <property>WM_ICON_SIZE</property> property for a given window.
+These functions use the 
+<structname>XIconSize</structname>
+<indexterm><primary>XIconSize</primary></indexterm>
+structure, which is defined in the
+<filename class="headerfile">&lt;X11/Xutil.h&gt;</filename>
+<indexterm type="file"><primary><filename class="headerfile">X11/Xutil.h</filename></primary></indexterm>
+<indexterm><primary>Files</primary><secondary><filename class="headerfile">&lt;X11/Xutil.h&gt;</filename></secondary></indexterm>
+<indexterm><primary>Headers</primary><secondary><filename class="headerfile">&lt;X11/Xutil.h&gt;</filename></secondary></indexterm>
+header file.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To allocate an
+<structname>XIconSize</structname>
+structure, use
+<function>XAllocIconSize</function>.
+</para>
+
+<funcsynopsis id='XAllocIconSize'>
+<funcprototype>
+  <funcdef>XIconSize *<function>XAllocIconSize</function></funcdef>
+  <void />
+</funcprototype>
+</funcsynopsis>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<function>XAllocIconSize</function>
+function allocates and returns a pointer to an
+<structname>XIconSize</structname>
+structure.
+Note that all fields in the
+<structname>XIconSize</structname>
+structure are initially set to zero.
+If insufficient memory is available, 
+<function>XAllocIconSize</function>
+returns NULL.
+To free the memory allocated to this structure,
+use
+<xref linkend='XFree' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+The
+<structname>XIconSize</structname>
+structure contains:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<indexterm significance="preferred"><primary>XIconSize</primary></indexterm>
+<literallayout class="monospaced">
+<!-- .TA .5i 2.5i -->
+<!-- .ta .5i 2.5i -->
+typedef struct {
+	int min_width, min_height;
+	int max_width, max_height;
+	int width_inc, height_inc;
+} XIconSize;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The width_inc and height_inc members define an arithmetic progression of
+sizes (minimum to maximum) that represent the supported icon sizes.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To set a window's <property>WM_ICON_SIZE</property> property, use
+<xref linkend='XSetIconSizes' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetIconSizes</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetIconSizes'>
+<funcprototype>
+  <funcdef><function>XSetIconSizes</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>XIconSize *<parameter>size_list</parameter></paramdef>
+  <paramdef>int <parameter>count</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>size_list</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the size list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of items in the size list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XSetIconSizes' xrefstyle='select: title'/>
+function is used only by window managers to set the supported icon sizes.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetIconSizes' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To read a window's <property>WM_ICON_SIZE</property> property, use
+<xref linkend='XGetIconSizes' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetIconSizes</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetIconSizes'>
+<funcprototype>
+  <funcdef>Status <function>XGetIconSizes</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>XIconSize **<parameter>size_list_return</parameter></paramdef>
+  <paramdef>int *<parameter>count_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>size_list_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the size list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of items in the size list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGetIconSizes' xrefstyle='select: title'/>
+function returns zero if a window manager has not set icon sizes;
+otherwise, it returns nonzero.
+<xref linkend='XGetIconSizes' xrefstyle='select: title'/>
+should be called by an application that
+wants to find out what icon sizes would be most appreciated by the
+window manager under which the application is running.
+The application
+should then use
+<xref linkend='XSetWMHints' xrefstyle='select: title'/>
+to supply the window manager with an icon pixmap or window in one of the
+supported sizes.
+To free the data allocated in size_list_return, use
+<xref linkend='XFree' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetIconSizes' xrefstyle='select: title'/>
+can generate a
+<errorname>BadWindow</errorname>
+error.
+</para>
+</sect2>
+<sect2 id="Using_Window_Manager_Convenience_Functions">
+<title>Using Window Manager Convenience Functions</title>
+<!-- .XS -->
+<!-- (SN Using Window Manager Convenience Functions -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The 
+<xref linkend='XmbSetWMProperties' xrefstyle='select: title'/>
+function stores the standard set of window manager properties,
+with text properties in standard encodings
+for internationalized text communication.
+The standard window manager properties for a given window are
+<property>WM_NAME</property>, <property>WM_ICON_NAME</property>, <property>WM_HINTS</property>, <property>WM_NORMAL_HINTS</property>, <property>WM_CLASS</property>,
+<property>WM_COMMAND</property>, <property>WM_CLIENT_MACHINE</property>, and <property>WM_LOCALE_NAME</property>.
+</para>
+<indexterm significance="preferred"><primary>XmbSetWMProperties</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XmbSetWMProperties'>
+<funcprototype>
+  <funcdef>void <function>XmbSetWMProperties</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>char *<parameter>window_name</parameter></paramdef>
+  <paramdef>char *<parameter>icon_name</parameter></paramdef>
+  <paramdef>char *<parameter>argv[]</parameter></paramdef>
+  <paramdef>int <parameter>argc</parameter></paramdef>
+  <paramdef>XSizeHints *<parameter>normal_hints</parameter></paramdef>
+  <paramdef>XWMHints *<parameter>wm_hints</parameter></paramdef>
+  <paramdef>XClassHint *<parameter>class_hints</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>window_name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window name,
+which should be a null-terminated string.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>icon_name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the icon name,
+which should be a null-terminated string.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>argv</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application's argument list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>argc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of arguments.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>hints</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the size hints for the window in its normal state.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>wm_hints</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the
+<structname>XWMHints</structname>
+structure to be used.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>class_hints</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the
+<structname>XClassHint</structname>
+structure to be used.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XmbSetWMProperties' xrefstyle='select: title'/>
+convenience function provides a simple programming interface 
+for setting those essential window properties that are used 
+for communicating with other clients
+(particularly window and session managers).
+</para>
+<para>
+<!-- .LP -->
+If the window_name argument is non-NULL,
+<xref linkend='XmbSetWMProperties' xrefstyle='select: title'/>
+sets the <property>WM_NAME</property> property.
+If the icon_name argument is non-NULL,
+<xref linkend='XmbSetWMProperties' xrefstyle='select: title'/>
+sets the <property>WM_ICON_NAME</property> property.
+The window_name and icon_name arguments are null-terminated strings
+in the encoding of the current locale.
+If the arguments can be fully converted to the STRING encoding,
+the properties are created with type ``STRING''; 
+otherwise, the arguments are converted to Compound Text, 
+and the properties are created with type ``COMPOUND_TEXT''.
+</para>
+<para>
+<!-- .LP -->
+If the normal_hints argument is non-NULL,
+<xref linkend='XmbSetWMProperties' xrefstyle='select: title'/>
+calls
+<xref linkend='XSetWMNormalHints' xrefstyle='select: title'/>,
+which sets the <property>WM_NORMAL_HINTS</property> property
+(see <link linkend="Setting_and_Reading_the_WM_NORMAL_HINTS_Property">section 14.1.7</link>).
+If the wm_hints argument is non-NULL, 
+<xref linkend='XmbSetWMProperties' xrefstyle='select: title'/>
+calls
+<xref linkend='XSetWMHints' xrefstyle='select: title'/>,
+which sets the <property>WM_HINTS</property> property
+(see <link linkend="Setting_and_Reading_the_WM_HINTS_Property">section 14.1.6</link>).
+</para>
+<para>
+<!-- .LP -->
+If the argv argument is non-NULL,
+<xref linkend='XmbSetWMProperties' xrefstyle='select: title'/>
+sets the <property>WM_COMMAND</property> property from argv and argc.
+An argc of zero indicates a zero-length command.
+</para>
+<para>
+<!-- .LP -->
+The hostname of the machine is stored using 
+<xref linkend='XSetWMClientMachine' xrefstyle='select: title'/>
+(see <link linkend="Setting_and_Reading_the_WM_CLIENT_MACHINE_Property">section 14.2.2</link>).
+</para>
+<para>
+<!-- .LP -->
+If the class_hints argument is non-NULL,
+<xref linkend='XmbSetWMProperties' xrefstyle='select: title'/>
+sets the <property>WM_CLASS</property> property.
+If the res_name member in the 
+<structname>XClassHint</structname>
+structure is set to the NULL pointer and the RESOURCE_NAME
+environment variable is set,
+the value of the environment variable is substituted for res_name.
+If the res_name member is NULL,
+the environment variable is not set, and argv and argv[0] are set,
+then the value of argv[0], stripped of any directory prefixes,
+is substituted for res_name.
+</para>
+<para>
+<!-- .LP -->
+It is assumed that the supplied class_hints.res_name and argv,
+the RESOURCE_NAME environment variable, and the hostname of the machine
+are in the encoding of the locale announced for the LC_CTYPE category
+(on <acronym>POSIX</acronym>-compliant systems, the LC_CTYPE, else LANG environment variable).
+The corresponding <property>WM_CLASS</property>, <property>WM_COMMAND</property>, and <property>WM_CLIENT_MACHINE</property> properties
+are typed according to the local host locale announcer.
+No encoding conversion is performed prior to storage in the properties.
+</para>
+<para>
+<!-- .LP -->
+For clients that need to process the property text in a locale,
+<xref linkend='XmbSetWMProperties' xrefstyle='select: title'/>
+sets the <property>WM_LOCALE_NAME</property> property to be the name of the current locale.
+The name is assumed to be in the Host Portable Character Encoding
+and is converted to STRING for storage in the property.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XmbSetWMProperties' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To set a window's standard window manager properties
+with strings in client-specified encodings, use
+<xref linkend='XSetWMProperties' xrefstyle='select: title'/>.
+The standard window manager properties for a given window are
+<property>WM_NAME</property>, <property>WM_ICON_NAME</property>, <property>WM_HINTS</property>, <property>WM_NORMAL_HINTS</property>, <property>WM_CLASS</property>,
+<property>WM_COMMAND</property>, and <property>WM_CLIENT_MACHINE</property>.
+</para>
+<indexterm significance="preferred"><primary>XSetWMProperties</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetWMProperties'>
+<funcprototype>
+  <funcdef>void <function>XSetWMProperties</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>XTextProperty *<parameter>window_name</parameter></paramdef>
+  <paramdef>XTextProperty *<parameter>icon_name</parameter></paramdef>
+  <paramdef>char **<parameter>argv</parameter></paramdef>
+  <paramdef>int <parameter>argc</parameter></paramdef>
+  <paramdef>XSizeHints *<parameter>normal_hints</parameter></paramdef>
+  <paramdef>XWMHints *<parameter>wm_hints</parameter></paramdef>
+  <paramdef>XClassHint *<parameter>class_hints</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>window_name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window name,
+which should be a null-terminated string.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>icon_name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the icon name,
+which should be a null-terminated string.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>argv</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application's argument list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>argc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of arguments.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>normal_hints</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the size hints for the window in its normal state.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>wm_hints</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the
+<structname>XWMHints</structname>
+structure to be used.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>class_hints</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the
+<structname>XClassHint</structname>
+structure to be used.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XSetWMProperties' xrefstyle='select: title'/>
+convenience function provides a single programming interface 
+for setting those essential window properties that are used 
+for communicating with other clients (particularly window and session
+managers).
+</para>
+<para>
+<!-- .LP -->
+If the window_name argument is non-NULL, 
+<xref linkend='XSetWMProperties' xrefstyle='select: title'/>
+calls
+<xref linkend='XSetWMName' xrefstyle='select: title'/>,
+which, in turn, sets the <property>WM_NAME</property> property
+(see <link linkend="Setting_and_Reading_the_WM_NAME_Property">section 14.1.4</link>).
+If the icon_name argument is non-NULL,
+<xref linkend='XSetWMProperties' xrefstyle='select: title'/>
+calls
+<xref linkend='XSetWMIconName' xrefstyle='select: title'/>,
+which sets the <property>WM_ICON_NAME</property> property
+(see <link linkend="Setting_and_Reading_the_WM_ICON_NAME_Property">section 14.1.5</link>).
+If the argv argument is non-NULL, 
+<xref linkend='XSetWMProperties' xrefstyle='select: title'/>
+calls
+<xref linkend='XSetCommand' xrefstyle='select: title'/>,
+which sets the <property>WM_COMMAND</property> property
+(see <link linkend="Setting_and_Reading_the_WM_COMMAND_Property">section 14.2.1</link>).
+Note that an argc of zero is allowed to indicate a zero-length command.
+Note also that the hostname of this machine is stored using
+<xref linkend='XSetWMClientMachine' xrefstyle='select: title'/>
+(see <link linkend="Setting_and_Reading_the_WM_CLIENT_MACHINE_Property">section 14.2.2</link>).
+</para>
+<para>
+<!-- .LP -->
+If the normal_hints argument is non-NULL, 
+<xref linkend='XSetWMProperties' xrefstyle='select: title'/>
+calls
+<xref linkend='XSetWMNormalHints' xrefstyle='select: title'/>,
+which sets the <property>WM_NORMAL_HINTS</property> property
+(see <link linkend="Setting_and_Reading_the_WM_NORMAL_HINTS_Property">section 14.1.7</link>).
+If the wm_hints argument is non-NULL, 
+<xref linkend='XSetWMProperties' xrefstyle='select: title'/>
+calls
+<xref linkend='XSetWMHints' xrefstyle='select: title'/>,
+which sets the <property>WM_HINTS</property> property
+(see <link linkend="Setting_and_Reading_the_WM_HINTS_Property">section 14.1.6</link>).
+</para>
+<para>
+<!-- .LP -->
+If the class_hints argument is non-NULL, 
+<xref linkend='XSetWMProperties' xrefstyle='select: title'/>
+calls
+<xref linkend='XSetClassHint' xrefstyle='select: title'/>,
+which sets the <property>WM_CLASS</property> property
+(see <link linkend="Setting_and_Reading_the_WM_CLASS_Property">section 14.1.8</link>).
+If the res_name member in the
+<structname>XClassHint</structname>
+structure is set to the NULL pointer and the RESOURCE_NAME environment 
+variable is set, 
+then the value of the environment variable is substituted for res_name.
+If the res_name member is NULL, 
+the environment variable is not set, 
+and argv and argv[0] are set, 
+then the value of argv[0], stripped of
+any directory prefixes, is substituted for res_name.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetWMProperties' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+</para>
+</sect2>
+</sect1>
+<sect1 id="Client_to_Session_Manager_Communication">
+<title>Client to Session Manager Communication</title>
+<!-- .XS -->
+<!-- (SN Client to Session Manager Communication -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+This section discusses how to:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Set and read the <property>WM_COMMAND</property> property
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Set and read the <property>WM_CLIENT_MACHINE</property> property
+    </para>
+  </listitem>
+</itemizedlist>
+<sect2 id="Setting_and_Reading_the_WM_COMMAND_Property">
+<title>Setting and Reading the WM_COMMAND Property</title>
+<!-- .XS -->
+<!-- (SN Setting and Reading the WM_COMMAND Property -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to set and read
+the <property>WM_COMMAND</property> property for a given window.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To set a window's <property>WM_COMMAND</property> property, use
+<xref linkend='XSetCommand' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetCommand</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetCommand'>
+<funcprototype>
+  <funcdef><function>XSetCommand</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>char **<parameter>argv</parameter></paramdef>
+  <paramdef>int <parameter>argc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>argv</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application's argument list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>argc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of arguments.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XSetCommand' xrefstyle='select: title'/>
+function sets the command and arguments used to invoke the
+application.
+(Typically, argv is the argv array of your main program.)
+If the strings are not in the Host Portable Character Encoding,
+the result is implementation-dependent.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetCommand' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To read a window's <property>WM_COMMAND</property> property, use
+<xref linkend='XGetCommand' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetCommand</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetCommand'>
+<funcprototype>
+  <funcdef>Status <function>XGetCommand</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>char ***<parameter>argv_return</parameter></paramdef>
+  <paramdef>int *<parameter>argc_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>argv_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the application's argument list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>argc_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of arguments returned.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XGetCommand' xrefstyle='select: title'/>
+function reads the <property>WM_COMMAND</property> property from the specified window 
+and returns a string list.
+If the <property>WM_COMMAND</property> property exists, 
+it is of type STRING and format 8.
+If sufficient memory can be allocated to contain the string list, 
+<xref linkend='XGetCommand' xrefstyle='select: title'/>
+fills in the argv_return and argc_return arguments
+and returns a nonzero status.
+Otherwise, it returns a zero status.
+If the data returned by the server is in the Latin Portable Character Encoding,
+then the returned strings are in the Host Portable Character Encoding.
+Otherwise, the result is implementation-dependent.
+To free the memory allocated to the string list, use
+<xref linkend='XFreeStringList' xrefstyle='select: title'/>.
+</para>
+</sect2>
+<sect2 id="Setting_and_Reading_the_WM_CLIENT_MACHINE_Property">
+<title>Setting and Reading the WM_CLIENT_MACHINE Property</title>
+<!-- .XS -->
+<!-- (SN Setting and Reading the WM_CLIENT_MACHINE Property -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to set and read 
+the <property>WM_CLIENT_MACHINE</property> property for a given window.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To set a window's <property>WM_CLIENT_MACHINE</property> property, use
+<xref linkend='XSetWMClientMachine' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetWMClientMachine</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetWMClientMachine'>
+<funcprototype>
+  <funcdef>void <function>XSetWMClientMachine</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>XTextProperty *<parameter>text_prop</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>text_prop</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the
+<structname>XTextProperty</structname>
+structure to be used.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XSetWMClientMachine' xrefstyle='select: title'/>
+convenience function calls
+<xref linkend='XSetTextProperty' xrefstyle='select: title'/>
+to set the <property>WM_CLIENT_MACHINE</property> property.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To read a window's <property>WM_CLIENT_MACHINE</property> property, use
+<xref linkend='XGetWMClientMachine' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetWMClientMachine</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetWMClientMachine'>
+<funcprototype>
+  <funcdef>Status <function>XGetWMClientMachine</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>XTextProperty *<parameter>text_prop_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>text_prop_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the
+<structname>XTextProperty</structname>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<xref linkend='XGetWMClientMachine' xrefstyle='select: title'/>
+convenience function performs an 
+<xref linkend='XGetTextProperty' xrefstyle='select: title'/>
+on the <property>WM_CLIENT_MACHINE</property> property.
+It returns a nonzero status on success;
+otherwise, it returns a zero status.
+</para>
+</sect2>
+</sect1>
+<sect1 id="Standard_Colormaps">
+<title>Standard Colormaps</title>
+<!-- .XS -->
+<!-- (SN Standard Colormaps  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Applications with color palettes, smooth-shaded drawings, or digitized
+images demand large numbers of colors.  
+In addition, these applications often require an efficient mapping 
+from color triples to pixel values that display the appropriate colors.
+</para>
+<para>
+<!-- .LP -->
+As an example, consider a three-dimensional display program that wants 
+to draw a smoothly shaded sphere.  
+At each pixel in the image of the sphere, 
+the program computes the intensity and color of light
+reflected back to the viewer.  
+The result of each computation is a triple of red, green, and blue (<acronym>RGB</acronym>)
+coefficients in the range 0.0 to 1.0.  
+To draw the sphere, the program needs a colormap that provides a
+large range of uniformly distributed colors.  
+The colormap should be arranged so that the program can
+convert its <acronym>RGB</acronym> triples into pixel values very quickly,
+because drawing the entire sphere requires many such
+conversions.
+</para>
+<para>
+<!-- .LP -->
+On many current workstations,
+the display is limited to 256 or fewer colors.  
+Applications must allocate colors carefully, 
+not only to make sure they cover the entire range they need 
+but also to make use of as many of the available colors as possible.
+On a typical X display, 
+many applications are active at once.
+Most workstations have only one hardware look-up table for colors,
+so only one application colormap can be installed at a given time.
+The application using the installed colormap is displayed correctly, 
+and the other applications go technicolor and are
+displayed with false colors.
+</para>
+<para>
+<!-- .LP -->
+As another example, consider a user who is running an 
+image processing program to display earth-resources data.  
+The image processing program needs a colormap set up with 8 reds, 
+8 greens, and 4 blues, for a total of 256 colors.
+Because some colors are already in use in the default colormap, 
+the image processing program allocates and installs a new colormap.
+</para>
+<para>
+<!-- .LP -->
+The user decides to alter some of the colors in the image
+by invoking a color palette program to mix and choose colors.
+The color palette program also needs a
+colormap with eight reds, eight greens, and four blues, so just like
+the image processing program, it must allocate and
+install a new colormap.
+</para>
+<para>
+<!-- .LP -->
+Because only one colormap can be installed at a time,
+the color palette may be displayed incorrectly
+whenever the image processing program is active.
+Conversely, whenever the palette program is active, 
+the image may be displayed incorrectly.  
+The user can never match or compare colors in the palette and image.
+Contention for colormap resources can be reduced if applications
+with similar color needs share colormaps.
+</para>
+<para>
+<!-- .LP -->
+The image processing program and the color palette program 
+could share the same colormap if there existed a convention that described
+how the colormap was set up.  
+Whenever either program was active, 
+both would be displayed correctly.
+</para>
+<para>
+<!-- .LP -->
+The standard colormap properties define a set of commonly used
+colormaps.  
+Applications that share these colormaps and conventions display 
+true colors more often and provide a better interface to the user.
+</para>
+<para>
+<!-- .LP -->
+Standard colormaps allow applications to share commonly used color
+resources.  
+This allows many applications to be displayed in true colors
+simultaneously, even when each application needs an entirely filled
+colormap.
+</para>
+<para>
+<!-- .LP -->
+Several standard colormaps are described in this section.
+Usually, a window manager creates these colormaps.
+Applications should use the standard colormaps if they already exist.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To allocate an
+<structname>XStandardColormap</structname>
+structure, use
+<function>XAllocStandardColormap</function>.
+</para>
+
+<funcsynopsis id='XAllocStandardColormap'>
+<funcprototype>
+  <funcdef>XStandardColormap *<function>XAllocStandardColormap</function></funcdef>
+  <void />
+</funcprototype>
+</funcsynopsis>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<function>XAllocStandardColormap</function>
+function allocates and returns a pointer to an
+<structname>XStandardColormap</structname>
+structure.
+Note that all fields in the
+<structname>XStandardColormap</structname>
+structure are initially set to zero.
+If insufficient memory is available, 
+<function>XAllocStandardColormap</function>
+returns NULL.
+To free the memory allocated to this structure,
+use
+<xref linkend='XFree' xrefstyle='select: title'/>.
+</para>
+<para>
+<!-- .LP -->
+The 
+<structname>XStandardColormap</structname>
+structure contains:
+</para>
+<literallayout class="monospaced">
+/* Hints */
+
+#define       ReeaseByFreeingColormap  ((XID)1L)
+
+/* Values */
+
+typedef struct {
+	Colormap colormap;
+	unsigned long red_max;
+	unsigned long red_mult;
+	unsigned long green_max;
+	unsigned long green_mult;
+	unsigned long blue_max;
+	unsigned long blue_mult;
+	unsigned long base_pixel;
+	VisualID visualid;
+	XID killid;
+} XStandardColormap;
+</literallayout>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The colormap member is the colormap created by the
+<xref linkend='XCreateColormap' xrefstyle='select: title'/>
+function.
+The red_max, green_max, and blue_max members give the maximum
+red, green, and blue values, respectively.  
+Each color coefficient ranges from zero to its max, inclusive.  
+For example,
+a common colormap allocation is 3/3/2 (3 planes for red, 3
+planes for green, and 2 planes for blue).  
+This colormap would have red_max = 7, green_max = 7, 
+and blue_max = 3.  
+An alternate allocation that uses only 216 colors is red_max = 5, 
+green_max = 5, and blue_max = 5.
+</para>
+<para>
+<!-- .LP -->
+The red_mult, green_mult, and blue_mult members give the
+scale factors used to compose a full pixel value. 
+(See the discussion of the base_pixel members for further information.)
+For a 3/3/2 allocation, red_mult might be 32,
+green_mult might be 4, and blue_mult might be 1.  
+For a 6-colors-each allocation, red_mult might be 36, 
+green_mult might be 6, and blue_mult might be 1.
+</para>
+<para>
+<!-- .LP -->
+The base_pixel member gives the base pixel value used to
+compose a full pixel value.  
+Usually, the base_pixel is obtained from a call to the 
+<xref linkend='XAllocColorPlanes' xrefstyle='select: title'/>
+function.  
+Given integer red, green, and blue coefficients in their appropriate 
+ranges, one then can compute a corresponding pixel value by
+using the following expression:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i 1.5i -->
+<!-- .ta .5i 1.5i -->
+(r * red_mult + g * green_mult + b * blue_mult + base_pixel) &amp; 0xFFFFFFFF
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+For 
+<symbol>GrayScale</symbol>
+colormaps, 
+only the colormap, red_max, red_mult, 
+and base_pixel members are defined. 
+The other members are ignored.  
+To compute a 
+<symbol>GrayScale</symbol>
+pixel value, use the following expression:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i 1.5i -->
+<!-- .ta .5i 1.5i -->
+(gray * red_mult + base_pixel) &amp; 0xFFFFFFFF
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+Negative multipliers can be represented by converting the 2's
+complement representation of the multiplier into an unsigned long and
+storing the result in the appropriate _mult field.
+The step of masking by 0xFFFFFFFF effectively converts the resulting
+positive multiplier into a negative one.
+The masking step will take place automatically on many machine architectures,
+depending on the size of the integer type used to do the computation.
+</para>
+<para>
+<!-- .LP -->
+The visualid member gives the ID number of the visual from which the
+colormap was created.
+The killid member gives a resource ID that indicates whether
+the cells held by this standard colormap are to be released 
+by freeing the colormap ID or by calling the
+<xref linkend='XKillClient' xrefstyle='select: title'/>
+function on the indicated resource.
+(Note that this method is necessary for allocating out of an existing colormap.)
+</para>
+<para>
+<!-- .LP -->
+The properties containing the 
+<structname>XStandardColormap</structname>
+information have 
+the type RGB_COLOR_MAP.
+</para>
+<para>
+<!-- .LP -->
+The remainder of this section discusses standard colormap properties and atoms
+as well as how to manipulate standard colormaps.
+</para>
+<sect2 id="Standard_Colormap_Properties_and_Atoms">
+<title>Standard Colormap Properties and Atoms</title>
+<!-- .XS -->
+<!-- (SN Standard Colormap Properties and Atoms  -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<indexterm><primary>Standard Colormaps</primary></indexterm>
+<indexterm><primary>Colormaps</primary><secondary>standard</secondary></indexterm>
+Several standard colormaps are available.  
+Each standard colormap is defined by a property, 
+and each such property is identified by an atom.  
+The following list names the atoms and describes the colormap
+associated with each one.
+The
+<filename class="headerfile">&lt;X11/Xatom.h&gt;</filename>
+<indexterm type="file"><primary><filename class="headerfile">X11/Xatom.h</filename></primary></indexterm>
+<indexterm><primary>Files</primary><secondary><filename class="headerfile">&lt;X11/Xatom.h&gt;</filename></secondary></indexterm>
+<indexterm><primary>Headers</primary><secondary><filename class="headerfile">&lt;X11/Xatom.h&gt;</filename></secondary></indexterm>
+header file contains the definitions for each of the following atoms,
+which are prefixed with XA_.
+</para>
+
+
+
+<variablelist>
+  <varlistentry>
+    <term>RGB_DEFAULT_MAP</term>
+    <listitem>
+      <para>
+This atom names a property.
+The value of the property is an array of
+<structname>XStandardColormap</structname>
+structures.
+Each entry in the array describes an <acronym>RGB</acronym> subset of the default color
+map for the Visual specified by visual_id.
+      </para>
+      <para>
+Some applications only need a few <acronym>RGB</acronym> colors and
+may be able to allocate them from the system default colormap.
+This is the ideal situation because the fewer colormaps that are
+active in the system the more applications are displayed
+with correct colors at all times.
+      </para>
+      <para>
+A typical allocation for the RGB_DEFAULT_MAP on 8-plane displays
+is 6 reds, 6 greens, and 6 blues.  
+This gives 216 uniformly distributed colors 
+(6 intensities of 36 different hues) and still leaves 40 elements 
+of a 256-element colormap available for special-purpose colors 
+for text, borders, and so on.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>RGB_BEST_MAP</term>
+    <listitem>
+      <para>
+This atom names a property.  The value of the property is an 
+<structname>XStandardColormap</structname>.
+      </para>
+      <para>
+The property defines the best <acronym>RGB</acronym> colormap available on
+the screen.
+(Of course, this is a subjective evaluation.)
+Many image processing and three-dimensional applications need to
+use all available colormap cells and to distribute as many
+perceptually distinct colors as possible over those cells.
+This implies that there may be more green values available than
+red, as well as more green or red than blue.
+      </para>
+      <para>
+For an 8-plane 
+<symbol>PseudoColor</symbol>
+visual, 
+RGB_BEST_MAP is likely to be a 3/3/2 allocation.  
+For a 24-plane 
+<symbol>DirectColor</symbol>
+visual, 
+RGB_BEST_MAP is normally an 8/8/8 allocation.  
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>RGB_RED_MAP,RGB_GREEN_MAP,RGB_BLUE_MAP</term>
+    <listitem>
+      <para>
+These atoms name properties.
+The value of each property is an
+<structname>XStandardColormap</structname>.
+      </para>
+      <para>
+The properties define all-red, all-green, and all-blue
+colormaps, respectively.  
+These maps are used by applications that want to make color-separated 
+images.  
+For example, a user might generate a full-color image 
+on an 8-plane display both by rendering an image three times 
+(once with high color resolution in red, once with green, 
+and once with blue) and by multiply exposing a single frame in a camera.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry> 
+    <term>RGB_GRAY_MAP</term>
+    <listitem>
+      <para>
+This atom names a property.
+The value of the property is an 
+<structname>XStandardColormap</structname>.
+      </para>
+      <para>
+The property describes the best 
+<symbol>GrayScale</symbol>
+colormap available on the screen.  
+As previously mentioned, 
+only the colormap, red_max, red_mult, and base_pixel members of the
+<structname>XStandardColormap</structname>
+structure are used for 
+<symbol>GrayScale</symbol>
+colormaps.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+</sect2>
+
+<sect2 id="Setting_and_Obtaining_Standard_Colormaps">
+<title>Setting and Obtaining Standard Colormaps</title>
+<!-- .XS -->
+<!-- (SN Setting and Obtaining Standard Colormaps -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Xlib provides functions that you can use to set and obtain an
+<structname>XStandardColormap</structname>
+structure.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To set an
+<structname>XStandardColormap</structname>
+structure, use
+<xref linkend='XSetRGBColormaps' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XSetRGBColormaps</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XSetRGBColormaps'>
+<funcprototype>
+  <funcdef>void <function>XSetRGBColormaps</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>XStandardColormap *<parameter>std_colormap</parameter></paramdef>
+  <paramdef>int <parameter>count</parameter></paramdef>
+  <paramdef>Atom <parameter>property</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>std_colormap</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the
+<structname>XStandardColormap</structname>
+structure to be used.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of colormaps.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>property</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the property name.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XSetRGBColormaps' xrefstyle='select: title'/>
+function replaces the <acronym>RGB</acronym> colormap definition in the specified property 
+on the named window.
+If the property does not already exist,
+<xref linkend='XSetRGBColormaps' xrefstyle='select: title'/>
+sets the <acronym>RGB</acronym> colormap definition in the specified property
+on the named window.
+The property is stored with a type of RGB_COLOR_MAP and a format of 32.
+Note that it is the caller's responsibility to honor the <acronym>ICCCM</acronym>
+restriction that only RGB_DEFAULT_MAP contain more than one definition.
+</para>
+<para>
+<!-- .LP -->
+The
+<xref linkend='XSetRGBColormaps' xrefstyle='select: title'/>
+function usually is only used by window or session managers.
+To create a standard colormap, 
+follow this procedure:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Open a new connection to the same server.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Grab the server.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+See if the property is on the property list of the root window for the screen.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the desired property is not present:
+<!-- .RS -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Create a colormap (unless you are using the default colormap of the screen).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Determine the color characteristics of the visual.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Allocate cells in the colormap (or create it with
+<symbol>AllocAll</symbol>).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Call 
+<xref linkend='XStoreColors' xrefstyle='select: title'/>
+to store appropriate color values in the colormap.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Fill in the descriptive members in the 
+<structname>XStandardColormap</structname>
+structure.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Attach the property to the root window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Use
+<xref linkend='XSetCloseDownMode' xrefstyle='select: title'/>
+to make the resource permanent.
+<!-- .RE -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Ungrab the server.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+<xref linkend='XSetRGBColormaps' xrefstyle='select: title'/>
+can generate
+<errorname>BadAlloc</errorname>,
+<errorname>BadAtom</errorname>,
+and
+<errorname>BadWindow</errorname>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To obtain the 
+<structname>XStandardColormap</structname>
+structure associated with the specified property, use
+<xref linkend='XGetRGBColormaps' xrefstyle='select: title'/>.
+</para>
+<indexterm significance="preferred"><primary>XGetRGBColormaps</primary></indexterm>
+<!-- .sM -->
+<funcsynopsis id='XGetRGBColormaps'>
+<funcprototype>
+  <funcdef>Status <function>XGetRGBColormaps</function></funcdef>
+  <paramdef>Display *<parameter>display</parameter></paramdef>
+  <paramdef>Window <parameter>w</parameter></paramdef>
+  <paramdef>XStandardColormap **<parameter>std_colormap_return</parameter></paramdef>
+  <paramdef>int *<parameter>count_return</parameter></paramdef>
+  <paramdef>Atom <parameter>property</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>std_colormap_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the
+<structname>XStandardColormap</structname>
+structure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of colormaps.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>property</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the property name.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The 
+<xref linkend='XGetRGBColormaps' xrefstyle='select: title'/>
+function returns the <acronym>RGB</acronym> colormap definitions stored 
+in the specified property on the named window.
+If the property exists, is of type RGB_COLOR_MAP, is of format 32, 
+and is long enough to contain a colormap definition,
+<xref linkend='XGetRGBColormaps' xrefstyle='select: title'/>
+allocates and fills in space for the returned colormaps
+and returns a nonzero status.
+If the visualid is not present, 
+<xref linkend='XGetRGBColormaps' xrefstyle='select: title'/>
+assumes the default visual for the screen on which the window is located; 
+if the killid is not present, 
+<symbol>None</symbol>
+is assumed, which indicates that the resources cannot be released.
+Otherwise, 
+none of the fields are set, and 
+<xref linkend='XGetRGBColormaps' xrefstyle='select: title'/>
+returns a zero status.
+Note that it is the caller's responsibility to honor the <acronym>ICCCM</acronym>
+restriction that only RGB_DEFAULT_MAP contain more than one definition.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetRGBColormaps' xrefstyle='select: title'/>
+can generate
+<errorname>BadAtom</errorname>
+and
+<errorname>BadWindow</errorname>
+errors.
+<!-- .bp -->
+
+</para>
+</sect2>
+</sect1>
+</chapter>
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/glossary.xml
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/glossary.xml	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11/glossary.xml	(revision 5)
@@ -0,0 +1,1754 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE glossary PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+	  "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+<glossary id='glossary'>
+<title>Glossary</title>
+<glossentry id="glossary:Access_control_list">
+  <glossterm>Access control list</glossterm>
+<indexterm significance="preferred"><primary>Access control list</primary></indexterm>
+  <glossdef>
+    <para>
+X maintains a list of hosts from which client programs can be run.  
+By default, 
+only programs on the local host and hosts specified in an initial list read
+by the server can use the display.
+This access control list can be changed by clients on the local host.  
+Some server implementations can also implement other authorization mechanisms
+in addition to or in place of this mechanism.
+The action of this mechanism can be conditional based on the authorization 
+protocol name and data received by the server at connection setup. 
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Active_grab">
+  <glossterm>Active grab</glossterm>
+<indexterm significance="preferred"><primary>Active grab</primary></indexterm>
+  <glossdef>
+    <para>
+A grab is active when the pointer or keyboard is actually owned by the 
+single grabbing client.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Ancestors">
+  <glossterm>Ancestors</glossterm>
+<indexterm significance="preferred"><primary>Ancestors</primary></indexterm>
+  <glossdef>
+    <para>
+If W is an inferior of A, then A is an ancestor of W.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Atom">
+  <glossterm>Atom</glossterm>
+<indexterm significance="preferred"><primary>Atom</primary></indexterm>
+  <glossdef>
+    <para>
+An atom is a unique ID corresponding to a string name.
+Atoms are used to identify properties, types, and selections.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Background">
+  <glossterm>Background</glossterm>
+<indexterm significance="preferred"><primary>Background</primary></indexterm>
+  <glossdef>
+    <para>
+An
+<symbol>InputOutput</symbol>
+window can have a background, which is defined as a pixmap.
+When regions of the window have their contents lost 
+or invalidated,
+the server automatically tiles those regions with the background.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Backing_store">
+  <glossterm>Backing store</glossterm>
+<indexterm significance="preferred"><primary>Backing store</primary></indexterm>
+  <glossdef>
+    <para>
+When a server maintains the contents of a window, 
+the pixels saved off-screen are known as a backing store.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Base_font_name">
+  <glossterm>Base font name</glossterm>
+<indexterm significance="preferred"><primary>Base font name</primary></indexterm>
+  <glossdef>
+    <para>
+A font name used to select a family of fonts whose members may be encoded 
+in various charsets.
+The
+<structfield>CharSetRegistry</structfield>
+and 
+<structfield>CharSetEncoding</structfield>
+fields of an <acronym>XLFD</acronym> name identify the charset of the font.
+A base font name may be a full <acronym>XLFD</acronym> name, with all fourteen '-' delimiters, 
+or an abbreviated <acronym>XLFD</acronym> name containing only the first 12 fields of an <acronym>XLFD</acronym> name,
+up to but not including 
+<structfield>CharSetRegistry</structfield>,
+with or without the thirteenth '-', or a non-<acronym>XLFD</acronym> name.
+Any <acronym>XLFD</acronym> fields may contain wild cards.
+</para>
+    <para>
+When creating an 
+<type>XFontSet</type>,
+Xlib accepts from the client a list of one or more base font names 
+which select one or more font families.
+They are combined with charset names obtained from the encoding of the locale
+to load the fonts required to render text.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Bit_gravity">
+  <glossterm>Bit gravity</glossterm>
+<indexterm significance="preferred"><primary>Bit</primary><secondary>gravity</secondary></indexterm>
+  <glossdef>
+    <para>
+When a window is resized, 
+the contents of the window are not necessarily discarded.  
+It is possible to request that the server relocate the previous contents 
+to some region of the window (though no guarantees are made).
+This attraction of window contents for some location of
+a window is known as bit gravity.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Bit_plane">
+  <glossterm>Bit plane</glossterm>
+<indexterm significance="preferred"><primary>Bit</primary><secondary>plane</secondary></indexterm>
+  <glossdef>
+    <para>
+When a pixmap or window is thought of as a stack of bitmaps,
+each bitmap is called a bit plane or plane.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Bitmap">
+  <glossterm>Bitmap</glossterm>
+<indexterm significance="preferred"><primary>Bitmap</primary></indexterm>
+  <glossdef>
+    <para>
+A bitmap is a <glossterm linkend="glossary:Pixmap">pixmap</glossterm> of depth one.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Border">
+  <glossterm>Border</glossterm>
+<indexterm significance="preferred"><primary>Border</primary></indexterm>
+  <glossdef>
+    <para>
+An
+<symbol>InputOutput</symbol>
+window can have a border of equal thickness on all four sides of the window.
+The contents of the border are defined by a pixmap,
+and the server automatically maintains the contents of the border.
+Exposure events are never generated for border regions.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Button_grabbing">
+  <glossterm>Button grabbing</glossterm>
+<indexterm significance="preferred"><primary>Button</primary><secondary>grabbing</secondary></indexterm>
+  <glossdef>
+    <para>
+Buttons on the pointer can be passively grabbed by a client.
+When the button is pressed, 
+the pointer is then actively grabbed by the client.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Byte_order">
+  <glossterm>Byte order</glossterm>
+<indexterm significance="preferred"><primary>Byte</primary><secondary>order</secondary></indexterm>
+  <glossdef>
+    <para>
+For image (pixmap/bitmap) data, 
+the server defines the byte order,
+and clients with different native byte ordering must swap bytes as
+necessary.  
+For all other parts of the protocol, 
+the client defines the byte order,
+and the server swaps bytes as necessary.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Character">
+  <glossterm>Character</glossterm>
+<indexterm significance="preferred"><primary>Character</primary></indexterm>
+  <glossdef>
+    <para>
+A member of a set of elements used for the organization,
+control, or representation of text (ISO2022, as adapted by XPG3).
+Note that in ISO2022 terms, a character is not bound to a coded value 
+until it is identified as part of a coded character set.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Character_glyph">
+  <glossterm>Character glyph</glossterm>
+<indexterm significance="preferred"><primary>Character glyph</primary></indexterm>
+  <glossdef>
+    <para>
+The abstract graphical symbol for a character.
+Character glyphs may or may not map one-to-one to font glyphs,
+and may be context-dependent, varying with the adjacent characters.
+Multiple characters may map to a single character glyph.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Character_set">
+  <glossterm>Character set</glossterm>
+<indexterm significance="preferred"><primary>Character set</primary></indexterm>
+  <glossdef>
+    <para>
+A collection of characters.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Charset">
+  <glossterm>Charset</glossterm>
+<indexterm significance="preferred"><primary>Charset</primary></indexterm>
+  <glossdef>
+    <para>
+An encoding with a uniform, state-independent mapping from characters 
+to codepoints.
+A coded character set.
+</para>
+    <para>
+For display in X,
+there can be a direct mapping from a charset to one font,
+if the width of all characters in the charset is either one or two bytes.
+A text string encoded in an encoding such as Shift-JIS cannot be passed
+directly to the X server, because the text imaging requests accept only
+single-width charsets (either 8 or 16 bits).
+Charsets which meet these restrictions can serve as ``font charsets''.
+Font charsets strictly speaking map font indices to font glyphs,
+not characters to character glyphs.
+</para>
+    <para>
+Note that a single font charset is sometimes used as the encoding of a locale,
+for example, ISO8859-1.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Children">
+  <glossterm>Children</glossterm>
+<indexterm significance="preferred"><primary>Children</primary></indexterm>
+  <glossdef>
+    <para>
+The children of a window are its first-level subwindows.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Class">
+  <glossterm>Class</glossterm>
+<indexterm significance="preferred"><primary>Class</primary></indexterm>
+  <glossdef>
+    <para>
+Windows can be of different classes or types.
+See the entries for
+<glossterm linkend="glossary:InputOnly_window">InputOnly</glossterm>
+and
+<glossterm linkend="glossary:InputOutput_window">InputOutput</glossterm>
+windows for further information about valid window types.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Client">
+  <glossterm>Client</glossterm>
+<indexterm significance="preferred"><primary>Client</primary></indexterm>
+  <glossdef>
+    <para>
+An application program connects to the window system server by some
+interprocess communication (<acronym>IPC</acronym>) path, such as a <acronym>TCP</acronym> connection or a
+shared memory buffer.  
+This program is referred to as a client of the window system server.  
+More precisely, 
+the client is the <acronym>IPC</acronym> path itself. 
+A program with multiple paths open to the server is viewed as
+multiple clients by the protocol.  
+Resource lifetimes are controlled by
+connection lifetimes, not by program lifetimes.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Clipping_region">
+  <glossterm>Clipping region</glossterm>
+<indexterm significance="preferred"><primary>Clipping region</primary></indexterm>
+  <glossdef>
+    <para>
+In a graphics context, 
+a bitmap or list of rectangles can be specified
+to restrict output to a particular region of the window.  
+The image defined by the bitmap or rectangles is called a clipping region.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Coded_character">
+  <glossterm>Coded character</glossterm>
+<indexterm significance="preferred"><primary>Coded character</primary></indexterm>
+  <glossdef>
+    <para>
+A character bound to a codepoint.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Coded_character_set">
+  <glossterm>Coded character set</glossterm>
+<indexterm significance="preferred"><primary>Coded character set</primary></indexterm>
+  <glossdef>
+    <para>
+A set of unambiguous rules that establishes a character set 
+and the one-to-one relationship between each character of the set 
+and its bit representation.
+(ISO2022, as adapted by XPG3)
+A definition of a one-to-one mapping of a set of characters to a set of
+codepoints.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Codepoint">
+  <glossterm>Codepoint</glossterm>
+<indexterm significance="preferred"><primary>Codepoint</primary></indexterm>
+  <glossdef>
+    <para>
+The coded representation of a single character in a coded character set.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Colormap">
+  <glossterm>Colormap</glossterm>
+<indexterm significance="preferred"><primary>Colormap</primary></indexterm>
+  <glossdef>
+    <para>
+A colormap consists of a set of entries defining color values.
+The colormap associated with a window is used to display the contents of
+the window; each pixel value indexes the colormap to produce an <acronym>RGB</acronym> value
+that drives the guns of a monitor.
+Depending on hardware limitations, 
+one or more colormaps can be installed at one time so
+that windows associated with those maps display with true colors.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Connection">
+  <glossterm>Connection</glossterm>
+<indexterm significance="preferred"><primary>Connection</primary></indexterm>
+  <glossdef>
+    <para>
+The <acronym>IPC</acronym> path between the server and client program is known as a connection.
+A client program typically (but not necessarily) has one
+connection to the server over which requests and events are sent.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Containment">
+  <glossterm>Containment</glossterm>
+<indexterm significance="preferred"><primary>Containment</primary></indexterm>
+  <glossdef>
+    <para>
+A window contains the pointer if the window is viewable and the
+hotspot of the cursor is within a visible region of the window or a
+visible region of one of its inferiors.  
+The border of the window is included as part of the window for containment.  
+The pointer is in a window if the window contains the pointer
+but no inferior contains the pointer.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Coordinate_system">
+  <glossterm>Coordinate system</glossterm>
+<indexterm significance="preferred"><primary>Coordinate system</primary></indexterm>
+  <glossdef>
+    <para>
+The coordinate system has X horizontal and Y vertical, 
+with the origin [0, 0] at the upper left.  
+Coordinates are integral and coincide with pixel centers.
+Each window and pixmap has its own coordinate system.  
+For a window, 
+the origin is inside the border at the inside upper-left corner.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Cursor">
+  <glossterm>Cursor</glossterm>
+<indexterm significance="preferred"><primary>Cursor</primary></indexterm>
+  <glossdef>
+    <para>
+A cursor is the visible shape of the pointer on a screen.  
+It consists of a hotspot, a source bitmap, a shape bitmap, 
+and a pair of colors.  
+The cursor defined for a window controls the visible
+appearance when the pointer is in that window.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Depth">
+  <glossterm>Depth</glossterm>
+<indexterm significance="preferred"><primary>Depth</primary></indexterm>
+  <glossdef>
+    <para>
+The depth of a window or pixmap is the number of bits per pixel it has.
+The depth of a graphics context is the depth of the drawables it can be
+used in conjunction with graphics output.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Device">
+  <glossterm>Device</glossterm>
+<indexterm significance="preferred"><primary>Device</primary></indexterm>
+  <glossdef>
+    <para>
+Keyboards, mice, tablets, track-balls, button boxes, and so on are all
+collectively known as input devices.
+Pointers can have one or more buttons 
+(the most common number is three).
+The core protocol only deals with two devices: the keyboard 
+and the pointer.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:DirectColor">
+  <glossterm>DirectColor</glossterm>
+<indexterm significance="preferred"><primary>DirectColor</primary></indexterm>
+  <glossdef>
+    <para>
+<symbol>DirectColor</symbol>
+is a class of colormap in which a pixel value is decomposed into three
+separate subfields for indexing.
+The first subfield indexes an array to produce red intensity values. 
+The second subfield indexes a second array to produce blue intensity values.
+The third subfield indexes a third array to produce green intensity values.
+The <acronym>RGB</acronym> (red, green, and blue) values in the colormap entry can be 
+changed dynamically.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Display">
+  <glossterm>Display</glossterm>
+<indexterm significance="preferred"><primary>Display</primary></indexterm>
+<indexterm><primary>Display</primary><secondary>structure</secondary></indexterm>
+  <glossdef>
+    <para>
+A server, together with its screens and input devices, is called a display.
+The Xlib
+<type>Display</type>
+structure contains all information about the particular display and its screens
+as well as the state that Xlib needs to communicate with the display over a
+particular connection.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Drawable">
+  <glossterm>Drawable</glossterm>
+<indexterm significance="preferred"><primary>Drawable</primary></indexterm>
+  <glossdef>
+    <para>
+Both windows and pixmaps can be used as sources and destinations 
+in graphics operations.  
+These windows and pixmaps are collectively known as drawables.
+However, an 
+<symbol>InputOnly</symbol>
+window cannot be used as a source or destination in a
+graphics operation.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Encoding">
+  <glossterm>Encoding</glossterm>
+<indexterm significance="preferred"><primary>Encoding</primary></indexterm>
+  <glossdef>
+    <para>
+A set of unambiguous rules that establishes a character set 
+and a relationship between the characters and their representations.
+The character set does not have to be fixed to a finite pre-defined set of
+characters.
+The representations do not have to be of uniform length.
+Examples are an ISO2022 graphic set, a state-independent 
+or state-dependent combination of graphic sets, possibly including control
+sets, and the X Compound Text encoding.
+</para>
+    <para>
+In X, encodings are identified by a string
+which appears as: the
+<structfield>CharSetRegistry</structfield>
+and
+<structfield>CharSetEncoding</structfield>
+components of an <acronym>XLFD</acronym>
+name; the name of a charset of the locale for which a font could not be
+found; or an atom which identifies the encoding of a text property or
+which names an encoding for a text selection target type.
+Encoding names should be composed of characters from the X Portable 
+Character Set.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Escapement">
+  <glossterm>Escapement</glossterm>
+<indexterm significance="preferred"><primary>Escapement</primary></indexterm>
+  <glossdef>
+    <para>
+The escapement of a string is the distance in pixels in the
+primary draw direction from the drawing origin to the origin of the next
+character (that is, the one following the given string) to be drawn.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Event">
+  <glossterm>Event</glossterm>
+<indexterm significance="preferred"><primary>Event</primary></indexterm>
+  <glossdef>
+    <para>
+Clients are informed of information asynchronously by means of events.
+These events can be either asynchronously generated from devices or
+generated as side effects of client requests.  
+Events are grouped into types. 
+The server never sends an event to a client unless the
+client has specifically asked to be informed of that type of event.
+However, clients can force events to be sent to other clients.  
+Events are typically reported relative to a window.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Event_mask">
+  <glossterm>Event mask</glossterm>
+<indexterm significance="preferred"><primary>Event</primary><secondary>mask</secondary></indexterm>
+  <glossdef>
+    <para>
+Events are requested relative to a window.  
+The set of event types a client requests relative to a window is described 
+by using an event mask.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Event_propagation">
+  <glossterm>Event propagation</glossterm>
+<indexterm significance="preferred"><primary>Event</primary><secondary>propagation</secondary></indexterm>
+  <glossdef>
+    <para>
+Device-related events propagate from the source window to ancestor
+windows until some client has expressed interest in handling that type
+of event or until the event is discarded explicitly.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Event_source">
+  <glossterm>Event source</glossterm>
+<indexterm significance="preferred"><primary>Event</primary><secondary>source</secondary></indexterm>
+  <glossdef>
+    <para>
+The deepest viewable window that the pointer is in is called
+the source of a device-related event.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Event_synchronization">
+  <glossterm>Event synchronization</glossterm>
+<indexterm significance="preferred"><primary>Event</primary><secondary>synchronization</secondary></indexterm>
+  <glossdef>
+    <para>
+There are certain race conditions possible when demultiplexing device
+events to clients (in particular, deciding where pointer and keyboard
+events should be sent when in the middle of window management
+operations).  
+The event synchronization mechanism allows synchronous processing of 
+device events.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Exposure_event">
+  <glossterm>Exposure event</glossterm>
+<indexterm significance="preferred"><primary>Event</primary><secondary>Exposure</secondary></indexterm>
+  <glossdef>
+    <para>
+Servers do not guarantee to preserve the contents of windows when
+windows are obscured or reconfigured.  
+Exposure events are sent to clients to inform them when contents of regions
+of windows have been lost.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Extension">
+  <glossterm>Extension</glossterm>
+<indexterm significance="preferred"><primary>Extension</primary></indexterm>
+  <glossdef>
+    <para>
+Named extensions to the core protocol can be defined to extend the system.  
+Extensions to output requests, resources, and event types are all possible
+and expected.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Font">
+  <glossterm>Font</glossterm>
+<indexterm significance="preferred"><primary>Font</primary></indexterm>
+  <glossdef>
+    <para>
+A font is an array of glyphs (typically characters).  
+The protocol does no translation or interpretation of character sets.  
+The client simply indicates values used to index the glyph array.  
+A font contains additional metric information to determine interglyph 
+and interline spacing.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Font_glyph">
+  <glossterm>Font glyph</glossterm>
+<indexterm significance="preferred"><primary>Font glyph</primary></indexterm>
+  <glossdef>
+    <para>
+The abstract graphical symbol for an index into a font.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Frozen_events">
+  <glossterm>Frozen events</glossterm>
+<indexterm significance="preferred"><primary>Frozen events</primary></indexterm>
+  <glossdef>
+    <para>
+Clients can freeze event processing during keyboard and pointer grabs.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:GC">
+  <glossterm>GC</glossterm>
+<indexterm significance="preferred"><primary>GC</primary></indexterm>
+  <glossdef>
+    <para>
+GC is an abbreviation for graphics context.
+See <glossterm linkend="glossary:Graphics_context">Graphics context</glossterm>.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Glyph">
+  <glossterm>Glyph</glossterm>
+<indexterm significance="preferred"><primary>Glyph</primary></indexterm>
+  <glossdef>
+    <para>
+An identified abstract graphical symbol independent of any actual image.
+(ISO/IEC/DIS 9541-1)
+An abstract visual representation of a graphic character,
+not bound to a codepoint.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Glyph_image">
+  <glossterm>Glyph image</glossterm>
+<indexterm significance="preferred"><primary>Glyph image</primary></indexterm>
+  <glossdef>
+    <para>
+An image of a glyph, as obtained from a glyph representation displayed 
+on a presentation surface.
+(ISO/IEC/DIS 9541-1)
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Grab">
+  <glossterm>Grab</glossterm>
+<indexterm significance="preferred"><primary>Grab</primary></indexterm>
+  <glossdef>
+    <para>
+Keyboard keys, the keyboard, pointer buttons, the pointer, 
+and the server can be grabbed for exclusive use by a client.  
+In general, 
+these facilities are not intended to be used by normal applications
+but are intended for various input and window managers to implement various
+styles of user interfaces.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Graphics_context">
+  <glossterm>Graphics context</glossterm>
+<indexterm significance="preferred"><primary>Graphics context</primary></indexterm>
+  <glossdef>
+    <para>
+Various information for graphics output is stored in a graphics
+context (<acronym>GC</acronym>), such as foreground pixel, background
+pixel, line width, clipping region, and so on.
+A graphics context can only
+be used with drawables that have the same root and the same depth as
+the graphics context. 
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Gravity">
+  <glossterm>Gravity</glossterm>
+<indexterm significance="preferred"><primary>Gravity</primary></indexterm>
+  <glossdef>
+    <para>
+The contents of windows and windows themselves have a gravity,
+which determines how the contents move when a window is resized.
+See <glossterm linkend="glossary:Bit_gravity">Bit gravity</glossterm> and
+<glossterm linkend="glossary:Window_gravity">Window gravity</glossterm>.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:GrayScale">
+  <glossterm>GrayScale</glossterm>
+<indexterm significance="preferred"><primary>GrayScale</primary></indexterm>
+  <glossdef>
+    <para>
+<symbol>GrayScale</symbol>
+can be viewed as a degenerate case of 
+<glossterm linkend="glossary:PseudoColor"><symbol>PseudoColor</symbol></glossterm>,
+in which the red, green, and blue values in any given colormap entry 
+are equal and thus, produce shades of gray.
+The gray values can be changed dynamically.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Host_Portable_Character_Encoding">
+  <glossterm>Host Portable Character Encoding</glossterm>
+<indexterm significance="preferred"><primary>Host Portable Character Encoding</primary></indexterm>
+  <glossdef>
+    <para>
+The encoding of the <glossterm linkend="glossary:X_Portable_Character_Set">X Portable Character Set</glossterm> on the host.
+The encoding itself is not defined by this standard,
+but the encoding must be the same in all locales supported by Xlib on the host.
+If a string is said to be in the Host Portable Character Encoding,
+then it only contains characters from the X Portable Character Set,
+in the host encoding.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Hotspot">
+  <glossterm>Hotspot</glossterm>
+<indexterm significance="preferred"><primary>Hotspot</primary></indexterm>
+  <glossdef>
+    <para>
+A cursor has an associated hotspot, which defines the point in the
+cursor corresponding to the coordinates reported for the pointer.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Identifier">
+  <glossterm>Identifier</glossterm>
+<indexterm significance="preferred"><primary>Identifier</primary></indexterm>
+  <glossdef>
+    <para>
+An identifier is a unique value associated with a resource
+that clients use to name that resource.  
+The identifier can be used over any connection to name the resource.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Inferiors">
+  <glossterm>Inferiors</glossterm>
+<indexterm significance="preferred"><primary>Inferiors</primary></indexterm>
+  <glossdef>
+    <para>
+The inferiors of a window are all of the subwindows nested below it:
+the children, the children's children, and so on.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Input_focus">
+  <glossterm>Input focus</glossterm>
+<indexterm significance="preferred"><primary>Input</primary><secondary>focus</secondary></indexterm>
+  <glossdef>
+    <para>
+The input focus is usually a window defining the scope for processing
+of keyboard input.
+If a generated keyboard event usually would be reported to this window 
+or one of its inferiors,
+the event is reported as usual.
+Otherwise, the event is reported with respect to the focus window.
+The input focus also can be set such that all keyboard events are discarded
+and such that the focus window is dynamically taken to be the root window
+of whatever screen the pointer is on at each keyboard event.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Input_manager">
+  <glossterm>Input manager</glossterm>
+<indexterm significance="preferred"><primary>Input</primary><secondary>manager</secondary></indexterm>
+  <glossdef>
+    <para>
+Control over keyboard input is typically provided by an input manager 
+client, which usually is part of a window manager.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:InputOnly_window">
+  <glossterm>InputOnly window</glossterm>
+<indexterm significance="preferred"><primary>Window</primary><secondary>InputOnly</secondary></indexterm>
+  <glossdef>
+    <para>
+An
+<symbol>InputOnly</symbol>
+window is a window that cannot be used for graphics requests.  
+<symbol>InputOnly</symbol>
+windows are invisible and are used to control such things as cursors,
+input event generation, and grabbing.
+<symbol>InputOnly</symbol>
+windows cannot have 
+<symbol>InputOutput</symbol>
+windows as inferiors.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:InputOutput_window">
+  <glossterm>InputOutput window</glossterm>
+<indexterm significance="preferred"><primary>Window</primary><secondary>InputOutput</secondary></indexterm>
+  <glossdef>
+    <para>
+An
+<symbol>InputOutput</symbol>
+window is the normal kind of window that is used for both input and output.
+<symbol>InputOutput</symbol>
+windows can have both 
+<symbol>InputOutput</symbol>
+and 
+<symbol>InputOnly</symbol>
+windows as inferiors.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Internationalization">
+  <glossterm>Internationalization</glossterm>
+<indexterm significance="preferred"><primary>Internationalization</primary></indexterm>
+  <glossdef>
+    <para>
+The process of making software adaptable to the requirements
+of different native languages, local customs, and character string encodings.
+Making a computer program adaptable to different locales 
+without program source modifications or recompilation.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:ISO2022">
+  <glossterm>ISO2022</glossterm>
+<indexterm significance="preferred"><primary>ISO2022</primary></indexterm>
+  <glossdef>
+    <para>
+ISO standard for code extension techniques for 7-bit and 8-bit coded 
+character sets.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Key_grabbing">
+  <glossterm>Key grabbing</glossterm>
+<indexterm significance="preferred"><primary>Key</primary><secondary>grabbing</secondary></indexterm>
+  <glossdef>
+    <para>
+Keys on the keyboard can be passively grabbed by a client.  
+When the key is pressed, 
+the keyboard is then actively grabbed by the client.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Keyboard_grabbing">
+  <glossterm>Keyboard grabbing</glossterm>
+<indexterm significance="preferred"><primary>Keyboard</primary><secondary>grabbing</secondary></indexterm>
+  <glossdef>
+    <para>
+A client can actively grab control of the keyboard, and key events
+will be sent to that client rather than the client the events would
+normally have been sent to.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Keysym">
+  <glossterm>Keysym</glossterm>
+<indexterm significance="preferred"><primary>Keysym</primary></indexterm>
+  <glossdef>
+    <para>
+An encoding of a symbol on a keycap on a keyboard.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Latin-1">
+  <glossterm>Latin-1</glossterm>
+<indexterm significance="preferred"><primary>Latin-1</primary></indexterm>
+  <glossdef>
+    <para>
+The coded character set defined by the ISO8859-1 standard.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Latin_Portable_Character_Encoding">
+  <glossterm>Latin Portable Character Encoding</glossterm>
+<indexterm significance="preferred"><primary>Latin Portable Character Encoding</primary></indexterm>
+  <glossdef>
+    <para>
+The encoding of the X Portable Character Set using the Latin-1 codepoints
+plus ASCII control characters.
+If a string is said to be in the Latin Portable Character Encoding,
+then it only contains characters from the X Portable Character Set,
+not all of Latin-1.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Locale">
+  <glossterm>Locale</glossterm>
+<indexterm significance="preferred"><primary>Locale</primary></indexterm>
+  <glossdef>
+    <para>
+The international environment of a computer program defining the ``localized''
+behavior of that program at run-time.
+This information can be established from one or more sets of localization data.
+ANSI C defines locale-specific processing by C system library calls.
+See ANSI C and the X/Open Portability Guide specifications for more details.
+In this specification, on implementations that conform to the ANSI C library,
+the ``current locale'' is the current setting of the LC_CTYPE
+<function>setlocale</function>
+category.
+Associated with each locale is a text encoding.  When text is processed
+in the context of a locale, the text must be in the encoding of the locale.
+The current locale affects Xlib in its:
+    <itemizedlist>
+      <listitem><para>
+Encoding and processing of input method text
+      </para></listitem>
+      <listitem><para>
+Encoding of resource files and values
+      </para></listitem>
+      <listitem><para>
+Encoding and imaging of text strings
+      </para></listitem>
+      <listitem><para>
+Encoding and decoding for inter-client text communication
+      </para></listitem>
+    </itemizedlist></para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Locale_name">
+  <glossterm>Locale name</glossterm>
+<indexterm significance="preferred"><primary>Locale name</primary></indexterm>
+  <glossdef>
+    <para>
+The identifier used to select the desired locale for the host C library 
+and X library functions.
+On ANSI C library compliant systems,
+the locale argument to the
+<function>setlocale</function>
+function.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Localization">
+  <glossterm>Localization</glossterm>
+<indexterm significance="preferred"><primary>Localization</primary></indexterm>
+  <glossdef>
+    <para>
+The process of establishing information within a computer system specific 
+to the operation of particular native languages, local customs 
+and coded character sets.
+(XPG3)
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Mapped">
+  <glossterm>Mapped</glossterm>
+<indexterm significance="preferred"><primary>Mapped window</primary></indexterm>
+  <glossdef>
+    <para>
+A window is said to be mapped if a map call has been performed on it.
+Unmapped windows and their inferiors are never viewable or visible.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Modifier_keys">
+  <glossterm>Modifier keys</glossterm>
+<indexterm significance="preferred"><primary>Modifier keys</primary></indexterm>
+  <glossdef>
+    <para>
+Shift, Control, Meta, Super, Hyper, Alt, Compose, Apple, CapsLock,
+ShiftLock, and similar keys are called modifier keys.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Monochrome">
+  <glossterm>Monochrome</glossterm>
+<indexterm significance="preferred"><primary>Monochrome</primary></indexterm>
+  <glossdef>
+    <para>
+Monochrome is a special case of 
+<glossterm linkend="glossary:StaticGray"><symbol>StaticGray</symbol></glossterm>
+in which there are only two colormap entries.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Multibyte">
+  <glossterm>Multibyte</glossterm>
+<indexterm significance="preferred"><primary>Multibyte</primary></indexterm>
+  <glossdef>
+    <para>
+A character whose codepoint is stored in more than one byte;
+any encoding which can contain multibyte characters;
+text in a multibyte encoding.
+The ``<type>char *</type>'' null-terminated string datatype in ANSI C.
+Note that references in this document to multibyte strings
+imply only that the strings <emphasis remap='I'>may</emphasis> contain multibyte characters.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Obscure">
+  <glossterm>Obscure</glossterm>
+<indexterm significance="preferred"><primary>Obscure</primary></indexterm>
+  <glossdef>
+    <para>
+A window is obscured if some other window obscures it.
+A window can be partially obscured and so still have visible regions.
+Window A obscures window B if both are viewable 
+<symbol>InputOutput</symbol>
+windows, if A is higher in the global stacking order, 
+and if the rectangle defined by the outside
+edges of A intersects the rectangle defined by the outside edges of B.
+Note the distinction between obscures and occludes.
+Also note that window borders are included in the calculation.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Occlude">
+  <glossterm>Occlude</glossterm>
+<indexterm significance="preferred"><primary>Occlude</primary></indexterm>
+  <glossdef>
+    <para>
+A window is occluded if some other window occludes it.
+Window A occludes window B if both are mapped, 
+if A is higher in the global stacking order, 
+and if the rectangle defined by the outside edges of A intersects the rectangle defined 
+by the outside edges of B.  
+Note the distinction between occludes and obscures.
+Also note that window borders are included in the calculation
+and that
+<symbol>InputOnly</symbol>
+windows never obscure other windows but can occlude other windows.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Padding">
+  <glossterm>Padding</glossterm>
+<indexterm significance="preferred"><primary>Padding</primary></indexterm>
+  <glossdef>
+    <para>
+Some padding bytes are inserted in the data stream to maintain
+alignment of the protocol requests on natural boundaries.  
+This increases ease of portability to some machine architectures.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Parent_window">
+  <glossterm>Parent window</glossterm>
+<indexterm significance="preferred"><primary>Window</primary><secondary>parent</secondary></indexterm>
+  <glossdef>
+    <para>
+If C is a child of P, then P is the parent of C.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Passive_grab">
+  <glossterm>Passive grab</glossterm>
+<indexterm significance="preferred"><primary>Passive grab</primary></indexterm>
+  <glossdef>
+    <para>
+Grabbing a key or button is a passive grab.  
+The grab activates when the key or button is actually pressed.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Pixel_value">
+  <glossterm>Pixel value</glossterm>
+<indexterm significance="preferred"><primary>Pixel value</primary></indexterm>
+  <glossdef>
+    <para>
+A pixel is an N-bit value,
+where N is the number of bit planes used in a particular window or pixmap
+(that is, is the depth of the window or pixmap).  
+A pixel in a window indexes a colormap to derive an actual color to be 
+displayed.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Pixmap">
+  <glossterm>Pixmap</glossterm>
+<indexterm significance="preferred"><primary>Pixmap</primary></indexterm>
+  <glossdef>
+    <para>
+A pixmap is a three-dimensional array of bits.  
+A pixmap is normally thought of as a two-dimensional array of pixels, 
+where each pixel can be a value from 0 to 2<superscript>N</superscript>-1,
+and where N is the depth (z axis) of the pixmap.  
+A pixmap can also be thought of as a stack of N bitmaps.
+A pixmap can only be used on the screen that it was created in.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Plane">
+  <glossterm>Plane</glossterm>
+<indexterm significance="preferred"><primary>Plane</primary></indexterm>
+  <glossdef>
+    <para>
+When a pixmap or window is thought of as a stack of bitmaps, each
+bitmap is called a plane or bit plane.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Plane_mask">
+  <glossterm>Plane mask</glossterm>
+<indexterm significance="preferred"><primary>Plane</primary><secondary>mask</secondary></indexterm>
+  <glossdef>
+    <para>
+Graphics operations can be restricted to only affect a subset of bit
+planes of a destination.  
+A plane mask is a bit mask describing which planes are to be modified.
+The plane mask is stored in a graphics context.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Pointer">
+  <glossterm>Pointer</glossterm>
+<indexterm significance="preferred"><primary>Pointer</primary></indexterm>
+  <glossdef>
+    <para>
+The pointer is the pointing device currently attached to the cursor
+and tracked on the screens.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Pointer_grabbing">
+  <glossterm>Pointer grabbing</glossterm>
+<indexterm significance="preferred"><primary>Pointer</primary><secondary>grabbing</secondary></indexterm>
+  <glossdef>
+    <para>
+A client can actively grab control of the pointer. 
+Then button and motion events will be sent to that client 
+rather than the client the events would normally have been sent to.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Pointing_device">
+  <glossterm>Pointing device</glossterm>
+<indexterm significance="preferred"><primary>Pointing device</primary></indexterm>
+  <glossdef>
+    <para>
+A pointing device is typically a mouse, tablet, or some other
+device with effective dimensional motion.  
+The core protocol defines only one visible cursor,
+which tracks whatever pointing device is attached as the pointer.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:POSIX">
+  <glossterm><acronym>POSIX</acronym></glossterm>
+<indexterm significance="preferred"><primary><acronym>POSIX</acronym></primary></indexterm>
+  <glossdef>
+    <para>
+Portable Operating System Interface, ISO/IEC 9945-1 (IEEE Std 1003.1).
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:POSIX_Portable_Filename_Character_Set">
+  <glossterm><acronym>POSIX</acronym> Portable Filename Character Set</glossterm>
+<indexterm significance="preferred"><primary><acronym>POSIX</acronym> Portable Filename Character Set</primary></indexterm>
+  <glossdef>
+    <para>
+The set of 65 characters which can be used in naming files on a <acronym>POSIX</acronym>-compliant
+host that are correctly processed in all locales.
+The set is:
+</para>
+    <para>
+<!-- .Ds 0 -->
+a..z A..Z 0..9 ._-
+<!-- .De -->
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Property">
+  <glossterm>Property</glossterm>
+<indexterm significance="preferred"><primary>Property</primary></indexterm>
+  <glossdef>
+    <para>
+Windows can have associated properties that consist of a name, a type,
+a data format, and some data. 
+The protocol places no interpretation on properties. 
+They are intended as a general-purpose naming mechanism for clients.  
+For example, clients might use properties to share information such as resize
+hints, program names, and icon formats with a window manager.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Property_list">
+  <glossterm>Property list</glossterm>
+<indexterm significance="preferred"><primary>Property list</primary></indexterm>
+  <glossdef>
+    <para>
+The property list of a window is the list of properties that have
+been defined for the window.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:PseudoColor">
+  <glossterm>PseudoColor</glossterm>
+<indexterm significance="preferred"><primary>PseudoColor</primary></indexterm>
+  <glossdef>
+    <para>
+<symbol>PseudoColor</symbol>
+is a class of colormap in which a pixel value indexes the colormap entry to
+produce an independent <acronym>RGB</acronym> value;
+that is, the colormap is viewed as an array of triples (<acronym>RGB</acronym> values).
+The <acronym>RGB</acronym> values can be changed dynamically.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Rectangle">
+  <glossterm>Rectangle</glossterm>
+<indexterm significance="preferred"><primary>Rectangle</primary></indexterm>
+  <glossdef>
+    <para>
+A rectangle specified by [x,y,w,h] has an infinitely thin
+outline path with corners at [x,y], [x+w,y], [x+w,y+h], and [x, y+h].
+When a rectangle is filled,
+the lower-right edges are not drawn.
+For example,
+if w=h=0,
+nothing would be drawn.
+For w=h=1,
+a single pixel would be drawn.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Redirecting_control">
+  <glossterm>Redirecting control</glossterm>
+<indexterm significance="preferred"><primary>Redirecting control</primary></indexterm>
+  <glossdef>
+    <para>
+Window managers (or client programs) may enforce window layout
+policy in various ways.  
+When a client attempts to change the size or position of a window, 
+the operation may be redirected to a specified client
+rather than the operation actually being performed.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Reply">
+  <glossterm>Reply</glossterm>
+<indexterm significance="preferred"><primary>Reply</primary></indexterm>
+  <glossdef>
+    <para>
+Information requested by a client program using the X protocol 
+is sent back to the client with a reply.
+Both events and replies are multiplexed on the same connection.  
+Most requests do not generate replies,
+but some requests generate multiple replies.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Request">
+  <glossterm>Request</glossterm>
+<indexterm significance="preferred"><primary>Request</primary></indexterm>
+  <glossdef>
+    <para>
+A command to the server is called a request.
+It is a single block of data sent over a connection.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Resource">
+  <glossterm>Resource</glossterm>
+<indexterm significance="preferred"><primary>Resource</primary></indexterm>
+  <glossdef>
+    <para>
+Windows, pixmaps, cursors, fonts, graphics contexts, and colormaps are
+known as resources.  
+They all have unique identifiers associated with them for naming purposes.  
+The lifetime of a resource usually is bounded by the lifetime of the 
+connection over which the resource was created.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:RGB_values">
+  <glossterm><acronym>RGB</acronym> values</glossterm>
+<indexterm significance="preferred"><primary><acronym>RGB</acronym> values</primary></indexterm>
+  <glossdef>
+    <para>
+<acronym>RGB</acronym> values are the red, green, and blue intensity values that are used
+to define a color.
+These values are always represented as 16-bit, unsigned numbers, with 0
+the minimum intensity and 65535 the maximum intensity.
+The X server scales these values to match the display hardware.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Root">
+  <glossterm>Root</glossterm>
+<indexterm significance="preferred"><primary>Root</primary></indexterm>
+  <glossdef>
+    <para>
+The root of a pixmap or graphics context is the same as the root 
+of whatever drawable was used when the pixmap or GC was created.  
+The root of a window is the root window under which the window was created.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Root_window">
+  <glossterm>Root window</glossterm>
+<indexterm significance="preferred"><primary>Window</primary><secondary>root</secondary></indexterm>
+  <glossdef>
+    <para>
+Each screen has a root window covering it.
+The root window cannot be reconfigured or unmapped, 
+but otherwise it acts as a full-fledged window.
+A root window has no parent.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Save_set">
+  <glossterm>Save set</glossterm>
+<indexterm significance="preferred"><primary>Save set</primary></indexterm>
+  <glossdef>
+    <para>
+The save set of a client is a list of other clients' windows that,
+if they are inferiors of one of the client's windows at connection
+close, should not be destroyed and that should be remapped 
+if currently unmapped.
+Save sets are typically used by window managers to avoid
+lost windows if the manager should terminate abnormally.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Scanline">
+  <glossterm>Scanline</glossterm>
+<indexterm significance="preferred"><primary>Scanline</primary></indexterm>
+  <glossdef>
+    <para>
+A scanline is a list of pixel or bit values viewed as a horizontal
+row (all values having the same y coordinate) of an image, with the
+values ordered by increasing the x coordinate.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Scanline_order">
+  <glossterm>Scanline order</glossterm>
+<indexterm significance="preferred"><primary>Scanline</primary><secondary>order</secondary></indexterm>
+  <glossdef>
+    <para>
+An image represented in scanline order contains scanlines ordered by
+increasing the y coordinate.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Screen">
+  <glossterm>Screen</glossterm>
+<indexterm significance="preferred"><primary>Screen</primary></indexterm>
+<indexterm><primary>Screen</primary><secondary>structure</secondary></indexterm>
+<indexterm><primary>Display</primary><secondary>structure</secondary></indexterm>
+  <glossdef>
+    <para>
+A server can provide several independent screens, 
+which typically have physically independent monitors.  
+This would be the expected configuration when there is only a single keyboard 
+and pointer shared among the screens.
+A 
+<type>Screen</type>
+structure contains the information about that screen
+and is linked to the 
+<type>Display</type>
+structure.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Selection">
+  <glossterm>Selection</glossterm>
+<indexterm significance="preferred"><primary>Selection</primary></indexterm>
+  <glossdef>
+    <para>
+A selection can be thought of as an indirect property with dynamic
+type.
+That is, rather than having the property stored in the X server,
+it is maintained by some client (the owner).
+A selection is global and is thought of as belonging to the user 
+and being maintained by clients, 
+rather than being private to a particular window subhierarchy
+or a particular set of clients.
+When a client asks for the contents of
+a selection, it specifies a selection target type,
+which can be used to control the transmitted representation of the contents.
+For example, if the selection is ``the last thing the user clicked on,''
+and that is currently an image, then the target type might specify
+whether the contents of the image should be sent in XY format or
+Z format.
+</para>
+    <para>
+The target type can also be used to control the class of
+contents transmitted; for example, 
+asking for the ``looks'' (fonts, line
+spacing, indentation, and so forth) of a paragraph selection, rather than the
+text of the paragraph.
+The target type can also be used for other
+purposes.
+The protocol does not constrain the semantics.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Server">
+  <glossterm>Server</glossterm>
+<indexterm significance="preferred"><primary>Server</primary></indexterm>
+  <glossdef>
+    <para>
+The server, which is also referred to as the X server, 
+provides the basic windowing mechanism.  
+It handles <acronym>IPC</acronym> connections from clients, 
+multiplexes graphics requests onto the screens, 
+and demultiplexes input back to the appropriate clients.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Server_grabbing">
+  <glossterm>Server grabbing</glossterm>
+<indexterm significance="preferred"><primary>Server</primary><secondary>grabbing</secondary></indexterm>
+  <glossdef>
+    <para>
+The server can be grabbed by a single client for exclusive use.  
+This prevents processing of any requests from other client connections until
+the grab is completed.
+This is typically only a transient state for such things as rubber-banding,
+pop-up menus, or executing requests indivisibly.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Shift_sequence">
+  <glossterm>Shift sequence</glossterm>
+<indexterm significance="preferred"><primary>Shift sequence</primary></indexterm>
+  <glossdef>
+    <para>
+ISO2022 defines control characters and escape sequences 
+which temporarily (single shift) or permanently (locking shift) cause a
+different character set to be in effect (``invoking'' a character set).
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Sibling">
+  <glossterm>Sibling</glossterm>
+<indexterm significance="preferred"><primary>Sibling</primary></indexterm>
+  <glossdef>
+    <para>
+Children of the same parent window are known as sibling windows.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Stacking_order">
+  <glossterm>Stacking order</glossterm>
+<indexterm significance="preferred"><primary>Stacking order</primary></indexterm>
+  <glossdef>
+    <para>
+Sibling windows, similar to sheets of paper on a desk,
+can stack on top of each other.  
+Windows above both obscure and occlude lower windows.  
+The relationship between sibling windows is known as the stacking order.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:State-dependent_encoding">
+  <glossterm>State-dependent encoding</glossterm>
+<indexterm significance="preferred"><primary>State-dependent encoding</primary></indexterm>
+  <glossdef>
+    <para>
+An encoding in which an invocation of a charset can apply to multiple
+characters in sequence.
+A state-dependent encoding begins in an ``initial state'' 
+and enters other ``shift states'' when specific ``shift sequences'' 
+are encountered in the byte sequence.
+In ISO2022 terms,
+this means use of locking shifts, not single shifts.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:State-independent_encoding">
+  <glossterm>State-independent encoding</glossterm>
+<indexterm significance="preferred"><primary>State-independent encoding</primary></indexterm>
+  <glossdef>
+    <para>
+Any encoding in which the invocations of the charsets are fixed,
+or span only a single character.
+In ISO2022 terms,
+this means use of at most single shifts, not locking shifts.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:StaticColor">
+  <glossterm>StaticColor</glossterm>
+<indexterm significance="preferred"><primary>StaticColor</primary></indexterm>
+  <glossdef>
+    <para>
+<symbol>StaticColor</symbol>
+can be viewed as a degenerate case of 
+<glossterm linkend="glossary:PseudoColor"><symbol>PseudoColor</symbol></glossterm>
+in which the <acronym>RGB</acronym> values are predefined and read-only.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:StaticGray">
+  <glossterm>StaticGray</glossterm>
+<indexterm significance="preferred"><primary>StaticGray</primary></indexterm>
+  <glossdef>
+    <para>
+<symbol>StaticGray</symbol>
+can be viewed as a degenerate case of 
+<glossterm linkend="glossary:GrayScale"><symbol>GrayScale</symbol></glossterm>
+in which the gray values are predefined and read-only.
+The values are typically linear or near-linear increasing ramps.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Status">
+  <glossterm>Status</glossterm>
+<indexterm significance="preferred"><primary>Status</primary></indexterm>
+  <glossdef>
+    <para>
+Many Xlib functions return a success status.
+If the function does not succeed,
+however, its arguments are not disturbed.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Stipple">
+  <glossterm>Stipple</glossterm>
+<indexterm significance="preferred"><primary>Stipple</primary></indexterm>
+  <glossdef>
+    <para>
+A stipple pattern is a bitmap that is used to tile a region to serve
+as an additional clip mask for a fill operation with the foreground
+color.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:STRING_encoding">
+  <glossterm>STRING encoding</glossterm>
+  <glossdef>
+    <para>
+<glossterm linkend="glossary:Latin-1">Latin-1</glossterm>, plus tab and newline.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:String_Equivalence">
+  <glossterm>String Equivalence</glossterm>
+<indexterm significance="preferred"><primary>String Equivalence</primary></indexterm>
+  <glossdef>
+    <para>
+Two ISO Latin-1 STRING8 values are considered equal if they are the same
+length and if corresponding bytes are either equal or are equivalent as
+follows:  decimal values 65 to 90 inclusive (characters ``A'' to ``Z'') are
+pairwise equivalent to decimal values 97 to 122 inclusive
+(characters ``a'' to ``z''), decimal values 192 to 214 inclusive
+(characters ``A grave'' to ``O diaeresis'') are pairwise equivalent to decimal
+values 224 to 246 inclusive (characters ``a grave'' to ``o diaeresis''),
+and decimal values 216 to 222 inclusive (characters ``O oblique'' to ``THORN'')
+are pairwise equivalent to decimal values 246 to 254 inclusive
+(characters ``o oblique'' to ``thorn'').
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Tile">
+  <glossterm>Tile</glossterm>
+<indexterm significance="preferred"><primary>Tile</primary></indexterm>
+  <glossdef>
+    <para>
+A pixmap can be replicated in two dimensions to tile a region.  
+The pixmap itself is also known as a tile.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Timestamp">
+  <glossterm>Timestamp</glossterm>
+<indexterm significance="preferred"><primary>Timestamp</primary></indexterm>
+  <glossdef>
+    <para>
+A timestamp is a time value expressed in milliseconds. 
+It is typically the time since the last server reset.
+Timestamp values wrap around (after about 49.7 days).
+The server, given its current time is represented by timestamp T, 
+always interprets timestamps from clients by treating half 
+of the timestamp space as being earlier in time than T 
+and half of the timestamp space as being later in time than T.
+One timestamp value, represented by the constant 
+<symbol>CurrentTime</symbol>,
+is never generated by the server. 
+This value is reserved for use in requests to represent the current server time.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:TrueColor">
+  <glossterm>TrueColor</glossterm>
+<indexterm significance="preferred"><primary>TrueColor</primary></indexterm>
+  <glossdef>
+    <para>
+<symbol>TrueColor</symbol>
+can be viewed as a degenerate case of 
+<glossterm linkend="glossary:DirectColor"><symbol>DirectColor</symbol></glossterm>
+in which the subfields in the pixel value directly encode the corresponding <acronym>RGB</acronym>
+values.
+That is, the colormap has predefined read-only <acronym>RGB</acronym> values.
+The values are typically linear or near-linear increasing ramps.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Type">
+  <glossterm>Type</glossterm>
+<indexterm significance="preferred"><primary>Type</primary></indexterm>
+  <glossdef>
+    <para>
+A type is an arbitrary atom used to identify the interpretation of property 
+data.  
+Types are completely uninterpreted by the server. 
+They are solely for the benefit of clients.
+X predefines type atoms for many frequently used types,
+and clients also can define new types.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Viewable">
+  <glossterm>Viewable</glossterm>
+<indexterm significance="preferred"><primary>Viewable</primary></indexterm>
+  <glossdef>
+    <para>
+A window is viewable if it and all of its ancestors are mapped.  
+This does not imply that any portion of the window is actually visible.
+Graphics requests can be performed on a window when it is not
+viewable, but output will not be retained unless the server is maintaining
+backing store. 
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Visible">
+  <glossterm>Visible</glossterm>
+<indexterm significance="preferred"><primary>Visible</primary></indexterm>
+  <glossdef>
+    <para>
+A region of a window is visible if someone looking at the screen can
+actually see it; that is, the window is viewable and the region is not occluded
+by any other window.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Whitespace">
+  <glossterm>Whitespace</glossterm>
+<indexterm significance="preferred"><primary>Whitespace</primary></indexterm>
+  <glossdef>
+    <para>
+Any spacing character.
+On implementations that conform to the ANSI C library,
+whitespace is any character for which
+<function>isspace</function>
+returns true.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Window_gravity">
+  <glossterm>Window gravity</glossterm>
+<indexterm significance="preferred"><primary>Window</primary><secondary>gravity</secondary></indexterm>
+  <glossdef>
+    <para>
+When windows are resized, 
+subwindows may be repositioned automatically relative to some position in the 
+window.
+This attraction of a subwindow to some part of its parent is known 
+as window gravity.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Window_manager">
+  <glossterm>Window manager</glossterm>
+<indexterm significance="preferred"><primary>Window</primary><secondary>manager</secondary></indexterm>
+  <glossdef>
+    <para>
+Manipulation of windows on the screen and much of the user interface
+(policy) is typically provided by a window manager client.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:X_Portable_Character_Set">
+  <glossterm>X Portable Character Set</glossterm>
+<indexterm significance="preferred"><primary>X Portable Character Set</primary></indexterm>
+  <glossdef>
+    <para>
+A basic set of 97 characters which are assumed to exist in all
+locales supported by Xlib.  This set contains the following characters:
+      <literallayout>
+a..z A..Z 0..9
+!"#$%&amp;'()*+,-./:;&lt;=&gt;?@[\\]^_`{|}~
+&lt;space&gt;, &lt;tab&gt;, and &lt;newline&gt;
+      </literallayout>
+    </para>
+    <para>
+This is the left/lower half (also called the G0 set)
+of the graphic character set of ISO8859-1 plus &lt;space&gt;, &lt;tab&gt;, and &lt;newline&gt;.
+It is also the set of graphic characters in 7-bit ASCII plus the same
+three control characters.
+The actual encoding of these characters on the host is system dependent;
+see the <glossterm linkend="glossary:Host_Portable_Character_Encoding">Host Portable Character Encoding</glossterm>.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:XLFD">
+  <glossterm><acronym>XLFD</acronym></glossterm>
+<indexterm significance="preferred"><primary><acronym>XLFD</acronym></primary></indexterm>
+  <glossdef>
+    <para>
+The <citetitle>X Logical Font Description Conventions</citetitle>
+that define a standard syntax for structured font names.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:XY_format">
+  <glossterm>XY format</glossterm>
+<indexterm significance="preferred"><primary>XY format</primary></indexterm>
+  <glossdef>
+    <para>
+The data for a pixmap is said to be in XY format if it is organized as
+a set of bitmaps representing individual bit planes with the planes
+appearing from most-significant to least-significant bit order.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry id="glossary:Z_format">
+  <glossterm>Z format</glossterm>
+<indexterm significance="preferred"><primary>Z format</primary></indexterm>
+  <glossdef>
+    <para>
+The data for a pixmap is said to be in Z format if it is organized as
+a set of pixel values in scanline order.
+    </para>
+  </glossdef>
+</glossentry>
+
+<bibliography>
+<title>References</title>
+<biblioentry>
+<title>Draft Proposed Multibyte Extension of ANSI C, Draft 1.1</title>
+<date>November 30, 1989 SC22/C WG/SWG IPSJ/ITSCJ Japan</date>
+</biblioentry>
+
+<biblioentry>
+<title>ISO2022: Information processing - ISO 7-bit and 8-bit coded character
+sets - Code extension techniques.</title>
+</biblioentry>
+
+<biblioentry>
+<title>ISO8859-1: Information processing - 8-bit single-byte coded graphic
+character sets - Part 1: Latin alphabet No. 1.</title>
+</biblioentry>
+
+<biblioentry>
+<title><acronym>POSIX</acronym>: Information Technology - Portable Operating System Interface (<acronym>POSIX</acronym>) -
+Part 1: System Application Program Interface (API) [C Language],
+ISO/IEC 9945-1.</title>
+</biblioentry>
+
+<biblioentry>
+<title>Text of ISO/IEC/DIS 9541-1, Information Processing - Font Information
+Interchange - Part 1:  Architecture.</title>
+</biblioentry>
+
+<biblioentry>
+<title>X/Open Portability Guide, Issue 3, December 1988 (XPG3), X/Open Company,
+Ltd, Prentice-Hall, Inc. 1989. ISBN 0-13-685835-8.
+(See especially Volume 3:  XSI Supplementary Definitions.)</title>
+</biblioentry>
+</bibliography>
+
+</glossary>
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11	(revision 5)

Property changes on: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs/libX11
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs	(revision 5)

Property changes on: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new/specs
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new	(revision 5)

Property changes on: lib/libX11/create-1.8.3-docbook-patch/libX11-1.8.3-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libX11/create-1.8.3-docbook-patch
===================================================================
--- lib/libX11/create-1.8.3-docbook-patch	(nonexistent)
+++ lib/libX11/create-1.8.3-docbook-patch	(revision 5)

Property changes on: lib/libX11/create-1.8.3-docbook-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libX11/patches/README
===================================================================
--- lib/libX11/patches/README	(nonexistent)
+++ lib/libX11/patches/README	(revision 5)
@@ -0,0 +1,6 @@
+
+/* begin *
+
+   TODO: Leave some comment here.
+
+ * end */
Index: lib/libX11/patches
===================================================================
--- lib/libX11/patches	(nonexistent)
+++ lib/libX11/patches	(revision 5)

Property changes on: lib/libX11/patches
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libX11
===================================================================
--- lib/libX11	(nonexistent)
+++ lib/libX11	(revision 5)

Property changes on: lib/libX11
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXScrnSaver/Makefile
===================================================================
--- lib/libXScrnSaver/Makefile	(nonexistent)
+++ lib/libXScrnSaver/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXScrnSaver
+
+versions    = 1.2.4
+pkgname     = libXScrnSaver
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXScrnSaver
===================================================================
--- lib/libXScrnSaver	(nonexistent)
+++ lib/libXScrnSaver	(revision 5)

Property changes on: lib/libXScrnSaver
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXau/Makefile
===================================================================
--- lib/libXau/Makefile	(nonexistent)
+++ lib/libXau/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXau
+
+versions    = 1.0.11
+pkgname     = libXau
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXau
===================================================================
--- lib/libXau	(nonexistent)
+++ lib/libXau	(revision 5)

Property changes on: lib/libXau
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXaw/Makefile
===================================================================
--- lib/libXaw/Makefile	(nonexistent)
+++ lib/libXaw/Makefile	(revision 5)
@@ -0,0 +1,56 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXaw
+
+versions    = 1.0.14
+pkgname     = libXaw
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+patches     = $(CURDIR)/patches/libXaw-1.0.14-docbook.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-1.0.14-docbook-patch ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s) $(patches)
Index: lib/libXaw/create-1.0.14-docbook-patch/create.patch.sh
===================================================================
--- lib/libXaw/create-1.0.14-docbook-patch/create.patch.sh	(nonexistent)
+++ lib/libXaw/create-1.0.14-docbook-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=1.0.14
+
+tar --files-from=file.list -xjvf ../libXaw-$VERSION.tar.bz2
+mv libXaw-$VERSION libXaw-$VERSION-orig
+
+cp -rf ./libXaw-$VERSION-new ./libXaw-$VERSION
+
+diff --unified -Nr  libXaw-$VERSION-orig  libXaw-$VERSION > libXaw-$VERSION-docbook.patch
+
+mv libXaw-$VERSION-docbook.patch ../patches
+
+rm -rf ./libXaw-$VERSION
+rm -rf ./libXaw-$VERSION-orig

Property changes on: lib/libXaw/create-1.0.14-docbook-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: lib/libXaw/create-1.0.14-docbook-patch/file.list
===================================================================
--- lib/libXaw/create-1.0.14-docbook-patch/file.list	(nonexistent)
+++ lib/libXaw/create-1.0.14-docbook-patch/file.list	(revision 5)
@@ -0,0 +1,7 @@
+libXaw-1.0.14/specs/CH1.xml
+libXaw-1.0.14/specs/CH2.xml
+libXaw-1.0.14/specs/CH6.xml
+libXaw-1.0.14/specs/CH7.xml
+libXaw-1.0.14/specs/Grip.xml
+libXaw-1.0.14/specs/SimpleMenu.xml
+libXaw-1.0.14/specs/TextSink.xml
Index: lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs/CH1.xml
===================================================================
--- lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs/CH1.xml	(nonexistent)
+++ lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs/CH1.xml	(revision 5)
@@ -0,0 +1,642 @@
+<chapter id='Athena_Widgets_and_The_Intrinsics'>
+<title>Athena Widgets and The Intrinsics</title>
+<para>
+The X Toolkit is made up of two distinct pieces, the Xt Intrinsics and a
+widget set.  The Athena widget set is a sample implementation of a
+widget set built upon the Intrinsics.  In the X Toolkit, a widget is the
+combination of an X window or subwindow and its associated input and
+output semantics.
+</para>
+<para>
+Because the Intrinsics provide the same basic functionality to all widget
+sets it may be possible to use widgets from the Athena widget set with
+other widget sets based upon the Intrinsics.  Since widget sets may also
+implement private protocols, all functionality may not be available when
+mixing and matching widget sets.  For information about the Intrinsics, see
+the 
+<citetitle>X Toolkit Intrinsics - C Language Interface</citetitle>.
+</para>
+<para>
+The Athena widget set is a library package layered on top of the Intrinsics
+and Xlib that provides a set of user interface tools sufficient to build
+a wide variety of applications.  This layer extends the basic
+abstractions provided by X and provides the next layer of functionality
+primarily by supplying a cohesive set of sample widgets.  Although the
+Intrinsics are a Consortium standard, there is no standard widget set.
+</para>
+
+<para>
+To the extent possible, the Intrinsics are "policy-free".  The application
+environment and widget set, not the Intrinsics, define, implement, and
+enforce:
+</para>
+
+<itemizedlist>
+  <listitem><para>Policy</para></listitem>
+  <listitem><para>Consistency</para></listitem>
+  <listitem><para>Style</para></listitem>
+</itemizedlist>
+
+<para>
+Each individual widget implementation defines its own policy.  The X Toolkit
+design allows for, but does not necessarily encourage, the free mixing
+of radically differing widget implementations.
+</para>
+
+<sect1 id='Introduction_to_the_X_Toolkit'>
+<title>Introduction to the X Toolkit</title>
+<para>
+<!-- .LP -->
+<!-- .XS -->
+<!-- 	Introduction to the X Toolkit -->
+<!-- .XE -->
+<indexterm significance="preferred"><primary>introduction</primary></indexterm>
+The X Toolkit provides tools that simplify the design of
+application user interfaces in the X Window System programming environment.
+It assists application programmers by providing a set of common
+underlying user-interface functions.  It also lets widget programmers
+modify existing widgets, by subclassing, or add new widgets.  By using
+the X Toolkit in their applications, programmers can present a similar
+user interface across applications to all workstation users.
+</para>
+<para>
+<!-- .LP -->
+The X Toolkit consists of:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+A set of Intrinsics functions for building widgets
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+An architectural model for constructing widgets
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A widget set for application programming
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+While the majority of the Intrinsics functions are intended
+for the widget programmer,
+a subset of the Intrinsics functions are to be used by application programmers
+(see 
+<citetitle>X Toolkit Intrinsics - C Language Interface</citetitle>).
+The architectural model lets the widget programmer design new widgets
+by using the Intrinsics and by combining other widgets.
+The application interface layers built on top of the X Toolkit include a
+coordinated set of widgets and composition policies.
+Some of these widgets and policies are specific to a single
+application domain, and others are common to a variety of
+applications.
+</para>
+<para>
+<!-- .LP -->
+The remainder of this chapter discusses the X Toolkit and Athena widget set:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Terminology
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Model
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Conventions used in this manual
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Format of the Widget Reference Chapters
+    </para>
+  </listitem>
+</itemizedlist>
+</sect1>
+<sect1 id="Terminology">
+<title>Terminology</title>
+<!-- .LP -->
+<!-- .XS -->
+<!-- 	Terminology -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+In addition to the terms already defined for X programming (see
+
+<citetitle>Xlib - C Language Interface</citetitle>),
+the following terms are specific to the Intrinsics and Athena widget set
+and used throughout this document.
+</para>
+<glosslist>
+<glossentry>
+  <glossterm>Application programmer</glossterm>
+<indexterm significance="preferred"><primary>application programmer</primary></indexterm>
+  <glossdef>
+    <para>
+A programmer who uses the X Toolkit to produce an application user interface.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>Child</glossterm>
+<indexterm significance="preferred"><primary>child</primary></indexterm>
+  <glossdef>
+    <para>
+A widget that is contained within another "parent" widget.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>Class</glossterm>
+<indexterm significance="preferred"><primary>class</primary></indexterm>
+  <glossdef>
+    <para>
+The general group to which a specific object belongs.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>Client</glossterm>
+<indexterm significance="preferred"><primary>client</primary></indexterm>
+  <glossdef>
+    <para>
+A function that uses a widget in an application or for composing
+other widgets.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>FullName</glossterm>
+<indexterm significance="preferred"><primary>FullName</primary></indexterm>
+  <glossdef>
+    <para>
+The name of a widget instance appended to the full name of its parent.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>Instance</glossterm>
+<indexterm significance="preferred"><primary>instance</primary></indexterm>
+  <glossdef>
+    <para>
+A specific widget object as opposed to a general widget class.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>Method</glossterm>
+<indexterm significance="preferred"><primary>method</primary></indexterm>
+  <glossdef>
+    <para>
+A function or procedure implemented by a widget class.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>Name</glossterm>
+<indexterm significance="preferred"><primary>name</primary><secondary>widget</secondary></indexterm>
+  <glossdef>
+    <para>
+The name that is specific to an instance of a widget for a given client.
+This name is specified at creation time and cannot be modified.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>Object</glossterm>
+<indexterm significance="preferred"><primary>object</primary></indexterm>
+  <glossdef>
+    <para>
+A data abstraction consisting of private data and private and public
+functions that operate on the private data.
+Users of the abstraction can interact with the object only through calls
+to the object's public functions.
+In the X Toolkit,
+some of the object's public functions are called directly by the application,
+while others are called indirectly when the application calls the common
+Intrinsics functions.
+In general, if a function is common to all widgets,
+an application uses a single Intrinsics function to invoke the function for all
+types of widgets.
+If a function is unique to a single widget type,
+the widget exports the function.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>Parent</glossterm>
+<indexterm significance="preferred"><primary>parent</primary></indexterm>
+  <glossdef>
+    <para>
+A widget that contains at least one other ("child") widget.
+A parent widget is also known as a composite widget.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>Resource</glossterm>
+<indexterm significance="preferred"><primary>resource</primary></indexterm>
+  <glossdef>
+    <para>
+A named piece of data in a widget that can be set by a client,
+by an application, or by user defaults.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>Superclass</glossterm>
+<indexterm significance="preferred"><primary>superclass</primary></indexterm>
+  <glossdef>
+    <para>
+A larger class of which a specific class is a member.
+All members of a class are also members of the superclass.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>User</glossterm>
+<indexterm significance="preferred"><primary>user</primary></indexterm>
+  <glossdef>
+    <para>
+A person interacting with a workstation.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>Widget</glossterm>
+<indexterm significance="preferred"><primary>widget</primary></indexterm>
+  <glossdef>
+    <para>
+An object providing a user-interface abstraction (for example, a Scrollbar
+widget).
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>Widget class</glossterm>
+<indexterm significance="preferred"><primary>widget class</primary></indexterm>
+  <glossdef>
+    <para>
+The general group to which a specific widget belongs,
+otherwise known as the type of the widget.
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>Widget programmer</glossterm>
+<indexterm significance="preferred"><primary>widget programmer</primary></indexterm>
+  <glossdef>
+    <para>
+A programmer who adds new widgets to the X Toolkit.
+    </para>
+  </glossdef>
+</glossentry>
+</glosslist>
+</sect1>
+<sect1 id="Underlying_Model">
+<title>Underlying Model</title>
+<para>
+<!-- .LP -->
+<!-- .XS -->
+<!-- 	Underlying Model -->
+<!-- .XE -->
+<indexterm significance="preferred"><primary>underlying model</primary></indexterm>
+The underlying architectural model is based on the following premises:
+<!-- .KS -->
+</para>
+<variablelist><?dbfo list-presentation="blocks"?>
+<varlistentry>
+  <term>Widgets are X windows</term>
+  <listitem>
+    <para>
+Every user-interface widget is associated with an X window.
+The X window ID for a widget is readily available from the widget.
+Standard Xlib calls can be used by widgets for many of their input and
+output operations.
+<!-- .KE -->
+<!-- .KS -->
+    </para>
+  </listitem>
+</varlistentry>
+<varlistentry>
+  <term>Information hiding</term>
+  <listitem>
+    <para>
+The data for every widget is private to the widget and its subclasses.
+That is, the data is neither directly accessible
+nor visible outside of the module implementing the widget.
+All program interaction with the widget is performed by a set of operations
+(methods) that are defined for the widget.
+<!-- .KE -->
+<!-- .KS -->
+    </para>
+  </listitem>
+</varlistentry>
+<varlistentry>
+  <term>Widget semantics and widget layout geometry</term>
+  <listitem>
+    <para>
+Widget semantics are clearly separated from widget layout geometry.
+Widgets are concerned with implementing specific user-interface
+semantics.  They have little control over issues such as their size or
+placement relative to other widget peers.  Mechanisms are provided for
+associating geometric managers with widgets and for widgets to make
+suggestions about their own geometry.
+<!-- .KE -->
+    </para>
+  </listitem>
+</varlistentry>
+</variablelist>
+</sect1>
+<sect1 id="Conventions_Used_in_this_Manual">
+<title>Conventions Used in this Manual</title>
+<itemizedlist>
+  <listitem>
+    <para>
+<indexterm significance="preferred"><primary>conventions</primary><secondary>used in manual</secondary></indexterm>
+All resources available to the widgets are listed with each widget.  Many
+of these are available to more than one widget class due to the object
+oriented nature of the Intrinsics.  The new resources for each widget are
+listed in bold text, and the inherited resources are listed in plain text.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Global symbols are printed in <function>bold</function> and can be function names,
+symbols defined in include files, or structure names.  Arguments are
+printed in <emphasis remap='I'>italics</emphasis>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Each function is introduced by a general discussion that distinguishes
+it from other functions.  The function declaration itself follows, and
+each argument is specifically explained.  General discussion of the
+function, if any is required, follows the arguments.  Where
+applicable, the last paragraph of the explanation lists the return values
+of the function.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+To eliminate any ambiguity between those arguments that you pass and
+those that a function returns to you, the explanations for all
+arguments that you pass start with the word <emphasis remap='I'>specifies</emphasis> or, in the
+case of multiple arguments, the word <emphasis remap='I'>specify</emphasis>. The explanations
+for all arguments that are returned to you start with the word
+<emphasis remap='I'>returns</emphasis> or, in the case of multiple arguments, the word
+<emphasis remap='I'>return</emphasis>.  The explanations for all arguments that you can pass
+and are returned start with the words <emphasis remap='I'>specifies and returns</emphasis>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Any pointer to a structure that is used to return a value is
+designated as such by the <emphasis remap='I'>_return</emphasis> suffix as part of its name.
+All other pointers passed to these functions are used for reading
+only.  A few arguments use pointers to structures that are used for
+both input and output and are indicated by using the <emphasis remap='I'>_in_out</emphasis>
+suffix.
+<indexterm significance="preferred"><primary>_return</primary></indexterm>
+<indexterm significance="preferred"><primary>_in_out</primary></indexterm>
+    </para>
+  </listitem>
+</itemizedlist>
+</sect1>
+<sect1 id="Format_of_the_Widget_Reference_Chapters">
+<title>Format of the Widget Reference Chapters</title>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>conventions</primary><secondary>chapter format</secondary></indexterm>
+<indexterm significance="preferred"><primary>chapter format</primary></indexterm>
+The majority of this document is a reference guide for the Athena
+widget set.  Chapters three through six give the programmer all
+information necessary to use the widgets.  The layout of the chapters
+follows a specific pattern to allow the programmer to easily find the
+desired information.
+</para>
+<para>
+<!-- .LP -->
+The first few pages of every chapter give an overview of the widgets
+in that section.  Widgets are grouped into chapters by functionality.
+<itemizedlist>
+  <listitem><para><xref linkend='Simple_Widgets'/></para></listitem>
+  <listitem><para><xref linkend='Menus'/></para></listitem>
+  <listitem><para><xref linkend='Text_Widgets'/></para></listitem>
+  <listitem><para><xref linkend='Composite_and_Constraint_Widgets'/></para></listitem>
+</itemizedlist>
+</para>
+<para>
+<!-- .LP -->
+Following the introduction will be a description of each widget in that
+chapter.  When no functional grouping is obvious the widgets are listed
+in alphabetical order, such as in chapters three and six.
+</para>
+<para>
+<!-- .LP -->
+The first section of each widget's description is a table that
+contains general information about this widget class.  Here is the
+table for the Box widget, and an explanation of all the entries.
+<literallayout class="monospaced">
+<!-- .TA 2.0i -->
+<!-- .ta 2.0i -->
+<!-- .sp -->
+Application Header file	&lt;X11/Xaw/Box.h&gt;
+Class Header file	&lt;X11/Xaw/BoxP.h&gt;
+Class		boxWidgetClass
+Class Name	Box
+Superclass	Composite
+<!-- .sp -->
+</literallayout>
+<variablelist>
+  <varlistentry>
+    <term>
+      <function>Application Header File</function>
+    </term>
+    <listitem>
+      <para>
+<indexterm significance="preferred"><primary>application header file</primary></indexterm>
+This file must be included when an application uses this widget.
+It usually contains the class definition, and some resource macros.
+This is often called the <quote>public</quote> header file.
+<indexterm significance="preferred"><primary>class header file</primary></indexterm>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <function>Class Header File</function>
+    </term>
+    <listitem>
+      <para>
+This file will only be used by widget programmers.  It will need to be
+included by any widget that subclasses this widget.  This is often
+called the <quote>private</quote> header file.
+<indexterm significance="preferred"><primary>class</primary></indexterm>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <function>Class</function>
+    </term>
+    <listitem>
+      <para>
+This is the widget class of this widget.  This global symbol is passed to
+<function>XtCreateWidget</function> so that the Intrinsics will know which type of widget
+to create.
+<indexterm significance="preferred"><primary>class name</primary></indexterm>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <function>Class Name</function>
+    </term>
+    <listitem>
+      <para>
+This is the resource name of this class.  This name can be used in
+a resource file to match any widget of this class.
+<indexterm><primary>superclass</primary></indexterm>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <function>Superclass</function>
+    </term>
+    <listitem>
+      <para>
+This is the superclass that this widget class is descended from.  If
+you understand how the superclass works it will allow you to more quickly
+understand what this widget does, since much of its functionality may be
+inherited from its superclass.
+<!-- .sp -->
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+After this table follows a general description of the default behavior of
+this widget, as seen by the user.  In many cases this functionality
+may be overridden by the application programmer, or by the user.
+</para>
+<para>
+<!-- .LP -->
+The next section is a table showing the
+name, class, type and default value of each resource that is available
+to this widget.  There is also a column containing notes describing
+special restrictions placed upon individual resources.
+<indexterm significance="preferred"><primary>notes</primary></indexterm>
+<indexterm significance="preferred"><primary>A, note</primary></indexterm>
+<indexterm significance="preferred"><primary>D, note</primary></indexterm>
+<indexterm significance="preferred"><primary>C, note</primary></indexterm>
+<indexterm significance="preferred"><primary>R, note</primary></indexterm>
+<variablelist>
+  <varlistentry>
+    <term>
+      A
+    </term>
+    <listitem>
+      <para>
+This resource may be automatically adjusted when another
+resource is changed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      C
+    </term>
+    <listitem>
+      <para>
+This resource is only settable at widget creation time, and may not
+be modified with <xref linkend='XtSetValues' xrefstyle='select: title'/>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      D
+    </term>
+    <listitem>
+      <para>
+Do not modify this resource.  While setting this resource will
+work, it can cause unexpected behavior.  When this symbol appears
+there is another, preferred, interface provided by the X Toolkit.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      R
+    </term>
+    <listitem>
+      <para>
+This resource is READ-ONLY, and may not be modified.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+After the resource table is a detailed description of every resource
+available to that widget.  Many of these are redundant, but printing
+them with each widget saves page flipping.  The names of the resources
+that are inherited are printed in plain text, while the names of the
+resources that are new to this class are printed in <function>bold</function>.
+If you have already read the description of the superclass you need
+only pay attention to the resources printed in bold.
+</para>
+<para>
+<!-- .LP -->
+For each composite widget there is a section on layout semantics that
+follows the resource description.  This section will describe the
+effect of constraint resources on the layout of the children, as well
+as a general description of where it prefers to place its children.
+</para>
+<para>
+<!-- .LP -->
+Descriptions of default translations and action routines come next, for
+widgets to which they apply.  The last item in each widget's
+documentation is the description of all convenience routines provided by
+the widget.
+</para>
+</sect1>
+<sect1 id="Input_Focus">
+<title>Input Focus</title>
+<!-- .XS -->
+<!-- 	Input Focus -->
+<!-- .XE -->
+<indexterm significance="preferred"><primary>input focus</primary></indexterm>
+<indexterm significance="preferred"><primary>input</primary></indexterm>
+<indexterm significance="preferred"><primary>XtNinput</primary></indexterm>
+<para>
+<!-- .LP -->
+The Intrinsics define a resource on all Shell widgets that interact with
+the window manager called <function>input</function>.  This resource requests the
+assistance of window manager in acquiring the input focus.  The
+resource defaults to <function>False</function> in the Intrinsics, but is redefined to
+default to <function>True</function> when an application is using the Athena widget
+set.  An application programmer may override this default and set the
+resource back to <function>False</function> if the application does not need the window
+manager to give it the input focus.  See the
+
+<citetitle>X Toolkit Intrinsics - C Language Interface</citetitle> for details
+on the <emphasis remap='I'>input</emphasis> resource.
+
+</para>
+</sect1>
+</chapter>
Index: lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs/CH2.xml
===================================================================
--- lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs/CH2.xml	(nonexistent)
+++ lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs/CH2.xml	(revision 5)
@@ -0,0 +1,1933 @@
+<chapter><title>Using Widgets</title>
+<sect1 id='Using_Widgets'>
+<title>Using Widgets</title>
+<para>
+Widgets serve as the primary tools for building a user interface or
+application environment.  The Athena widget set consists of primitive
+widgets that contain no children (for example, a command button) and
+composite widgets which may contain one or more widget children (for
+example, a Box widget).
+</para>
+<para>
+The remaining chapters explain the widgets that are provided
+by the Athena widget set.
+These user-interface components serve as an interface for
+application programmers who do not want to implement their own widgets.
+In addition, they serve as a starting point
+for those widget programmers who, using the Intrinsics mechanisms,
+want to implement alternative application programming interfaces.
+</para>
+<para>
+This chapter is a brief introduction to widget programming.  The
+examples provided use the Athena widgets, though most of the concepts
+will apply to all widget sets.  Although there are several programming
+interfaces to the X Toolkit, only one is described here.  A full
+description of the programming interface is provided in the document
+
+<citetitle>X Toolkit Intrinsics - C Language Interface</citetitle>.
+</para>
+<sect2 id="Setting_the_Locale">
+<title>Setting the Locale</title>
+<para>
+<!-- .LP -->
+<!-- .XS -->
+<!-- 	Setting the Locale -->
+<!-- .XE -->
+If it is desirable that the application take advantage of
+internationalization (i18n), you must establish locale with
+<function>XtSetLanguageProc</function>
+prior to calling
+<xref linkend='XtOpenApplication' xrefstyle='select: title'/>,
+<function>XtOpenDisplay</function>,
+<function>XtDisplayInitialize</function>,
+or
+<function>XtAppInitialize</function>.
+For full details, please refer to the document
+
+<citetitle>X Toolkit Intrinsics - C Language Interface</citetitle>,
+section 2.2. However, the following simplest-case
+call is sufficient in many or most applications.
+</para>
+<para>
+<!-- .LP -->
+<indexterm><primary>internationalization</primary></indexterm>
+<indexterm significance="preferred"><primary>XtSetLanguageProc</primary></indexterm>
+<indexterm><primary>locale</primary></indexterm>
+<literallayout class="monospaced">
+<!-- .TA .5i 2i -->
+<!-- .ta .5i 2i -->
+	XtSetLanguageProc(NULL, NULL, NULL);
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+Most notably, this will affect the Standard C locale, determine which
+resource files will be loaded, and what fonts will be required of FontSet
+specifications.  In many cases, the addition of this line is the only source change
+required to internationalize Xaw programs, and will not disturb the function
+of programs in the default "C" locale.
+</para>
+</sect2>
+<sect2 id="Initializing_the_Toolkit">
+<title>Initializing the Toolkit</title>
+<para>
+<!-- .LP -->
+<!-- .XS -->
+<!-- 	Initializing the Toolkit -->
+<!-- .XE -->
+You must call a toolkit initialization function before invoking any
+other toolkit routines (besides locale setting, above).
+<xref linkend='XtOpenApplication' xrefstyle='select: title'/>,
+opens the X server connection, parses the command line,
+and creates an initial widget that will serve as the root of
+a tree of widgets created by this application.
+<indexterm significance="preferred"><primary>initialization</primary></indexterm>
+<indexterm significance="preferred"><primary>toolkit initialization</primary></indexterm>
+<indexterm significance="preferred"><primary>XtOpenApplication</primary></indexterm>
+<indexterm significance="preferred"><primary>fallback resources</primary></indexterm>
+<funcsynopsis id='XtOpenApplication'>
+<funcprototype>
+<funcdef>Widget <function>XtOpenApplication</function></funcdef>
+  <paramdef>XtAppContext *<parameter>app_context_return</parameter></paramdef>
+  <paramdef>String <parameter>application_class</parameter></paramdef>
+  <paramdef>XrmOptionDescList <parameter>options</parameter></paramdef>
+  <paramdef>Cardinal <parameter>num_options</parameter></paramdef>
+  <paramdef>int *<parameter>argc_in_out</parameter></paramdef>
+  <paramdef>String *<parameter>argv_in_out</parameter></paramdef>
+  <paramdef>String *<parameter>fallback_resources</parameter></paramdef>
+  <paramdef>WidgetClass <parameter>widget_class</parameter></paramdef>
+  <paramdef>ArgList <parameter>args</parameter></paramdef>
+  <paramdef>Cardinal <parameter>num_args</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the application context of this application, if non-NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>application_class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the class name of this application,
+which is usually the generic name for all instances of this application.
+A useful convention is to form the class name by capitalizing the
+first letter of the application name. For example, the application named
+<quote>xman</quote> has a class name of <quote>Xman</quote>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>options</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies how to parse the command line for any application-specific
+resources.
+The options argument is passed as a parameter to
+<function>XrmParseCommand</function>.
+For further information,
+see 
+<citetitle>Xlib - C Language Interface</citetitle>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_options</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the options list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>argc_in_out</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to the number of command line parameters.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>argv_in_out</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the command line parameters.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>fallback_resources</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies resource values to be used if the site-wide application class
+defaults file cannot be opened, or NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget_class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the class of the widget to be created.  Must be shellWidgetClass
+or a subclass.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the argument list to use when creating the Application shell.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of arguments in <emphasis remap='I'>args</emphasis>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+This function will remove the command line arguments that the toolkit
+reads from <emphasis remap='I'>argc_in_out</emphasis>, and <emphasis remap='I'>argv_in_out</emphasis>.  It will then
+attempt to open the display.  If the display cannot be opened, an error
+message is issued and XtAppInitialize terminates the application.  Once
+the display is opened, all resources are read from the locations
+specified by the Intrinsics.  This function returns an ApplicationShell
+widget to be used as the root of the application's widget tree.
+</para>
+</sect2>
+<sect2 id="Creating_a_Widget">
+<title>Creating a Widget</title>
+<para>
+<!-- .LP -->
+<!-- .XS -->
+<!-- 	Creating a Widget -->
+<!-- .XE -->
+<indexterm significance="preferred"><primary>widget creation</primary></indexterm>
+<indexterm significance="preferred"><primary>creating widgets</primary></indexterm>
+<indexterm><primary>XtRealizeWidget</primary></indexterm>
+Creating a widget is a three-step process.  First, the widget instance
+is allocated, and various instance-specific attributes are set by
+using <function>XtCreateWidget</function>.  Second, the widget's parent is informed
+of the new child by using <function>XtManageChild</function>.  Finally, X windows are
+created for the parent and all its children by using <xref linkend='XtRealizeWidget' xrefstyle='select: title'/>
+and specifying the top-most widget. The first two steps can be
+combined by using <xref linkend='XtCreateManagedWidget' xrefstyle='select: title'/>.  In addition,
+<xref linkend='XtRealizeWidget' xrefstyle='select: title'/> is automatically called when the child becomes
+managed if the parent is already realized.
+</para>
+<para>
+<!-- .LP -->
+To allocate, initialize, and manage a widget, use
+<function>XtCreateManagedWidget</function>.
+<indexterm significance="preferred"><primary>XtCreateManagedWidget</primary></indexterm>
+<funcsynopsis id='XtCreateManagedWidget'>
+<funcprototype>
+  <funcdef>Widget<function> XtCreateManagedWidget</function></funcdef>
+  <paramdef>String<parameter> name</parameter></paramdef>
+  <paramdef>WidgetClass<parameter> widget_class</parameter></paramdef>
+  <paramdef>Widget<parameter> parent</parameter></paramdef>
+  <paramdef>ArgList<parameter> args</parameter></paramdef>
+  <paramdef>Cardinal<parameter> num_args</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the instance name for the created widget that is used for retrieving
+widget resources.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget_class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget class pointer for the created widget.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>parent</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the parent widget ID.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the argument list.  The argument list is a variable-length
+list composed of name and value pairs that contain information
+pertaining to the specific widget instance being created.  For further
+information, see Section 2.7.2. <!-- xref> -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of arguments in the argument list.
+If the num_args is zero, the argument list is never referenced.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+When a widget instance is successfully created, the widget identifier
+is returned to the application.  If an error is encountered, the
+<function>XtError</function>
+routine is invoked to inform the user of the error.
+<indexterm><primary>XtError</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+For further information, see
+
+<citetitle>X Toolkit Intrinsics - C Language Interface</citetitle>.
+</para>
+</sect2>
+<sect2 id="Common_Resources">
+<title>Common Resources</title>
+<!-- .XS -->
+<!-- 	Common Resources -->
+<!-- .XE -->
+<indexterm><primary>resource</primary></indexterm>
+<para>
+<!-- .LP -->
+Although a widget can have unique arguments that it understands, all
+widgets have common arguments that provide some regularity of operation.
+The common arguments allow arbitrary widgets to be managed by
+higher-level components without regard for the individual widget type.
+Widgets will ignore any argument that they do not understand.
+</para>
+<para>
+<!-- .LP -->
+The following resources are retrieved from the argument list
+or from the resource database by all of the Athena widgets:
+<informaltable>
+  <tgroup cols='4' align='center'>
+  <colspec colname='c1'/>
+  <colspec colname='c2'/>
+  <colspec colname='c3'/>
+  <colspec colname='c4'/>
+  <thead>
+    <row>
+      <entry>Name</entry>
+      <entry>Class</entry>
+      <entry>Type</entry>
+      <entry>Default Value</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>accelerators</entry>
+      <entry>Accelerators</entry>
+      <entry>AcceleratorTable</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>ancestorSensitive</entry>
+      <entry>AncestorSensitive</entry>
+      <entry>Boolean</entry>
+      <entry>True</entry>
+    </row>
+    <row>
+      <entry>background</entry>
+      <entry>Background</entry>
+      <entry>Pixel</entry>
+      <entry>XtDefaultBackground</entry>
+    </row>
+    <row>
+      <entry>backgroundPixmap</entry>
+      <entry>Pixmap</entry>
+      <entry>Pixmap</entry>
+      <entry>XtUnspecifiedPixmap</entry>
+    </row>
+    <row>
+      <entry>borderColor</entry>
+      <entry>BorderColor</entry>
+      <entry>Pixel</entry>
+      <entry>XtDefaultForeground</entry>
+    </row>
+    <row>
+      <entry>borderPixmap</entry>
+      <entry>Pixmap</entry>
+      <entry>Pixmap</entry>
+      <entry>XtUnspecifiedPixmap</entry>
+    </row>
+    <row>
+      <entry>borderWidth</entry>
+      <entry>BorderWidth</entry>
+      <entry>Dimension</entry>
+      <entry>1</entry>
+    </row>
+    <row>
+      <entry>colormap</entry>
+      <entry>Colormap</entry>
+      <entry>Colormap</entry>
+      <entry>Parent's Colormap</entry>
+    </row>
+    <row>
+      <entry>depth</entry>
+      <entry>Depth</entry>
+      <entry>int</entry>
+      <entry>Parent's Depth</entry>
+    </row>
+    <row>
+      <entry>destroyCallback</entry>
+      <entry>Callback</entry>
+      <entry>XtCallbackList</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>height</entry>
+      <entry>Height</entry>
+      <entry>Dimension</entry>
+      <entry><emphasis remap='I'>widget dependent</emphasis></entry>
+    </row>
+    <row>
+      <entry>mappedWhenManaged</entry>
+      <entry>MappedWhenManaged</entry>
+      <entry>Boolean</entry>
+      <entry>True</entry>
+    </row>
+    <row>
+      <entry>screen</entry>
+      <entry>Screen</entry>
+      <entry>Screen</entry>
+      <entry>Parent's Screen</entry>
+    </row>
+    <row>
+      <entry>sensitive</entry>
+      <entry>Sensitive</entry>
+      <entry>Boolean</entry>
+      <entry>True</entry>
+    </row>
+    <row>
+      <entry>translations</entry>
+      <entry>Translations</entry>
+      <entry>TranslationTable</entry>
+      <entry><emphasis remap='I'>widget dependent</emphasis></entry>
+    </row>
+    <row>
+      <entry>width</entry>
+      <entry>Width</entry>
+      <entry>Dimension</entry>
+      <entry><emphasis remap='I'>widget dependent</emphasis></entry>
+    </row>
+    <row>
+      <entry>x</entry>
+      <entry>Position</entry>
+      <entry>Position</entry>
+      <entry>0</entry>
+    </row>
+    <row>
+      <entry>y</entry>
+      <entry>Position</entry>
+      <entry>Position</entry>
+      <entry>0</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+<indexterm><primary>XtDefaultForeground</primary></indexterm>
+<indexterm><primary>XtDefaultBackground</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+The following additional resources are retrieved from the argument list
+or from the resource database by many of the Athena widgets:
+<informaltable>
+  <tgroup cols='4' align='center'>
+  <colspec colname='c1'/>
+  <colspec colname='c2'/>
+  <colspec colname='c3'/>
+  <colspec colname='c4'/>
+  <thead>
+    <row>
+      <entry>Name</entry>
+      <entry>Class</entry>
+      <entry>Type</entry>
+      <entry>Default Value</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>callback</entry>
+      <entry>Callback</entry>
+      <entry>XtCallbackList</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>cursor</entry>
+      <entry>Cursor</entry>
+      <entry>Cursor</entry>
+      <entry><emphasis remap='I'>widget dependent</emphasis></entry>
+    </row>
+    <row>
+      <entry>foreground</entry>
+      <entry>Foreground</entry>
+      <entry>Pixel</entry>
+      <entry>XtDefaultForeground</entry>
+    </row>
+    <row>
+      <entry>insensitiveBorder</entry>
+      <entry>Insensitive</entry>
+      <entry>Pixmap</entry>
+      <entry>GreyPixmap</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+<indexterm><primary>XtDefaultForeground</primary></indexterm>
+</para>
+</sect2>
+<sect2 id="Resource_Conversions">
+<title>Resource Conversions</title>
+<!-- .XS -->
+<!-- 	Resource Conversions -->
+<!-- .XE -->
+<indexterm significance="preferred"><primary>conversions</primary></indexterm>
+<indexterm significance="preferred"><primary>string conversions</primary></indexterm>
+<indexterm significance="preferred"><primary>type conversions</primary></indexterm>
+<para>
+<!-- .LP -->
+Most resources in the Athena widget set have a converter registered that
+will translate the string in a resource file to the correct internal
+representation.  While some are obvious (string to integer, for example),
+others need specific mention of the allowable values.  Three general
+converters are described here:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Cursor
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Pixel
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Bitmap
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+Many widgets have defined special converters that apply only to that
+widget.  When these occur, the documentation section for that widget
+will describe the converter.
+</para>
+<sect3 id="Cursor_Conversion">
+<title>Cursor Conversion</title>
+<indexterm significance="preferred"><primary>conversions</primary><secondary>ColorCursor</secondary></indexterm>
+<indexterm significance="preferred"><primary>conversions</primary><secondary>Cursor</secondary></indexterm>
+<indexterm><primary>cursor</primary></indexterm>
+<para>
+<!-- .LP -->
+The value for the <function>cursorName</function> resource is specified in the resource
+database as a string, and is of the following forms:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+A standard X cursor name from <filename class="headerfile">&lt;X11/cursorfont.h&gt;</filename>.
+The names in <function>cursorfont.h</function> each describe a specific cursor.  The
+resource names for these cursors are exactly like the names in this file
+except the <function>XC_</function> is not used.  The cursor definition <function>XC_gumby</function>
+has a resource name of <function>gumby</function>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Glyphs, as in <emphasis remap='I'>FONT font-name glyph-index [[ font-name ] glyph-index ]</emphasis>.
+The first font and glyph specify the cursor source pixmap.
+The second font and glyph specify the cursor mask pixmap.
+The mask font defaults to the source font,
+and the mask glyph index defaults to the source glyph index.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A relative or absolute file name.
+If a relative or absolute file name is specified, that file is used to
+create the source pixmap.  Then the string "Mask" is appended to
+locate the cursor mask pixmap.  If the "Mask" file does not exist, the
+suffix "msk" is tried.  If "msk" fails, no cursor mask will be used.
+If the filename does not start with '/' or './' the the bitmap
+file path is used (see section 2.4.3). <!-- xref -->
+    </para>
+  </listitem>
+</itemizedlist>
+</sect3>
+<sect3 id="Pixel_Conversion">
+<title>Pixel Conversion</title>
+<para>
+<!-- .LP -->
+<indexterm significance="preferred"><primary>conversions</primary><secondary>Pixel</secondary></indexterm>
+<indexterm><primary>pixel</primary></indexterm>
+<indexterm><primary>rgb.txt</primary></indexterm>
+<indexterm><primary>XtDefaultForeground</primary></indexterm>
+<indexterm><primary>XtDefaultBackground</primary></indexterm>
+The string-to-pixel converter takes any name that is acceptable to
+XParseColor (see 
+<citetitle>Xlib - C Language Interface</citetitle>).  In addition this routine understands
+the special toolkit symbols `XtDefaultForeground' and
+`XtDefaultBackground', described in
+
+<citetitle>X Toolkit Intrinsics - C Language Interface</citetitle>.  In short the acceptable
+pixel names are:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Any color name for the rgb.txt file (typically in the directory
+/usr/share/X11 on POSIX systems).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A numeric specification of the form #&lt;red&gt;&lt;green&gt;&lt;blue&gt; where these
+numeric values are hexadecimal digits (both upper and lower case).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The special strings `XtDefaultForeground' and `XtDefaultBackground'
+    </para>
+  </listitem>
+</itemizedlist>
+</sect3>
+<sect3 id="Bitmap_Conversion">
+<title>Bitmap Conversion</title>
+<indexterm significance="preferred"><primary>bitmap conversions</primary></indexterm>
+<indexterm significance="preferred"><primary>conversions</primary><secondary>Bitmap</secondary></indexterm>
+<indexterm significance="preferred"><primary>bitmapFilePath</primary></indexterm>
+<indexterm significance="preferred"><primary>BitmapFilePath</primary></indexterm>
+<indexterm><primary>/usr/include/X11/bitmaps</primary></indexterm>
+<para>
+<!-- .LP -->
+The string-to-bitmap converter attempts to locate a file containing
+bitmap data whose name is specified by the input string.  If the file
+name is relative (i.e. does not begin with / or ./), the directories to
+be searched are specified in the <function>bitmapFilePath</function> resource--class
+<function>BitmapFilePath</function>.  This resource specifies a colon (:) separated
+list of directories that will be searched for the named bitmap or
+cursor glyph (see section 2.4.1).  The <function>bitmapFilePath</function> resource is
+global to the application, and may <function>not</function> be specified differently
+for each widget that wishes to convert a cursor to bitmap.  In addition
+to the directories specified in the <function>bitmapFilePath</function> resource a
+default directory is searched.  When using POSIX the default
+directory is
+<function>/usr/include/X11/bitmaps</function>.
+</para>
+</sect3>
+</sect2>
+<sect2 id="Realizing_a_Widget">
+<title>Realizing a Widget</title>
+<para>
+<!-- .LP -->
+<!-- .XS -->
+<!-- 	Realizing a Widget -->
+<!-- .XE -->
+<indexterm significance="preferred"><primary>realizing widgets</primary></indexterm>
+The
+<xref linkend='XtRealizeWidget' xrefstyle='select: title'/>
+function performs two tasks:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Calculates the geometry constraints of all managed descendants
+of this widget.  The actual calculation is put off until realize time
+for performance reasons.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Creates an X window for the widget and, if it is a composite widget,
+realizes each of its managed children.
+<indexterm significance="preferred"><primary>XtRealizeWidget</primary></indexterm>
+<funcsynopsis id='XtRealizeWidget'>
+<funcprototype>
+  <funcdef>void<function> XtRealizeWidget</function></funcdef>
+  <paramdef>Widget<parameter> w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Specifies the widget.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+For further information about this function,
+see the 
+<citetitle>X Toolkit Intrinsics - C Language Interface</citetitle>.
+</para>
+</sect2>
+<sect2 id="Processing_Events">
+<title>Processing Events</title>
+<para>
+<!-- .LP -->
+<!-- .XS -->
+<!-- 	Processing Events -->
+<!-- .XE -->
+<indexterm><primary>events</primary></indexterm>
+<indexterm><primary>XtAppInitialize</primary></indexterm>
+Now that the application has created, managed and realized its
+widgets, it is ready to process the events that will be delivered by the
+X Server to this client.  A function call that will process the
+events is <xref linkend='XtAppMainLoop' xrefstyle='select: title'/>.
+<indexterm significance="preferred"><primary>XtAppMainLoop</primary></indexterm>
+<funcsynopsis id='XtAppMainLoop'>
+<funcprototype>
+  <funcdef>void<function> XtAppMainLoop</function></funcdef>
+  <paramdef>XtAppContext<parameter> app_context</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context of this application.  The value is
+normally returned by <xref linkend='XtOpenApplication' xrefstyle='select: title'/>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+This function never returns: it is an infinite loop that processes the
+X events.  User input can be handled through callback procedures and
+application defined action routines.  More details are provided in
+
+<citetitle>X Toolkit Intrinsics - C Language Interface</citetitle>.
+</para>
+</sect2>
+<sect2 id="Standard_Widget_Manipulation_Functions">
+<title>Standard Widget Manipulation Functions</title>
+<!-- .XS -->
+<!-- 	Standard Widget Manipulation Functions -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+After a widget has been created, a client can interact with that
+widget by calling one of the standard widget manipulation routines
+provided by the Intrinsics, or a widget class-specific manipulation routine.
+</para>
+<para>
+<!-- .LP -->
+The Intrinsics provide generic routines to give the application programmer
+access to a set of standard widget functions.  The common widget
+routines let an application or composite widget perform the following
+operations on widgets without requiring explicit knowledge of the widget
+type.
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Control the mapping of widget windows
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Destroy a widget instance
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Obtain an argument value
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Set an argument value
+    </para>
+  </listitem>
+</itemizedlist>
+<sect3 id="Mapping_Widgets">
+<title>Mapping Widgets</title>
+<para>
+<!-- .LP -->
+By default,
+widget windows are mapped (made viewable) automatically by
+<xref linkend='XtRealizeWidget' xrefstyle='select: title'/>.  This behavior can be disabled by using
+<xref linkend='XtSetMappedWhenManaged' xrefstyle='select: title'/>, making the client responsible for calling
+<xref linkend='XtMapWidget' xrefstyle='select: title'/> to make the widget viewable.
+<indexterm significance="preferred"><primary>XtSetMappedWhenManaged</primary></indexterm>
+<indexterm><primary>XtMapWidget</primary></indexterm>
+<indexterm><primary>XtRealizeWidget</primary></indexterm>
+<funcsynopsis id='XtSetMappedWhenManaged'>
+<funcprototype>
+  <funcdef>void<function> XtSetMappedWhenManaged</function></funcdef>
+  <paramdef>Widget<parameter> w</parameter></paramdef>
+  <paramdef>Boolean<parameter> map_when_managed</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>map_when_managed</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the new value.
+If map_when_managed is <function>True</function>, the widget is mapped automatically
+when it is realized.  If map_when_managed is <function>False</function>, the client
+must call
+<xref linkend='XtMapWidget' xrefstyle='select: title'/>
+or make a second call to
+<xref linkend='XtSetMappedWhenManaged' xrefstyle='select: title'/>
+to cause the child window to be mapped.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+The definition for
+<xref linkend='XtMapWidget' xrefstyle='select: title'/>
+is:
+<indexterm significance="preferred"><primary>XtMapWidget</primary></indexterm>
+<funcsynopsis id='XtMapWidget'>
+<funcprototype>
+  <funcdef>void<function> XtMapWidget</function></funcdef>
+  <paramdef>Widget<parameter> w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+When you are creating several children in sequence for a previously
+realized common parent it is generally more efficient to construct a
+list of children as they are created (using <function>XtCreateWidget</function>) and
+then use <xref linkend='XtManageChildren' xrefstyle='select: title'/> to request that their parent managed
+them all at once.  By managing a list of children at one time, the
+parent can avoid wasteful duplication of geometry processing and the
+associated <quote>screen flash</quote>.
+<indexterm significance="preferred"><primary>XtManageChildren</primary></indexterm>
+<indexterm><primary>XtCreateWidget</primary></indexterm>
+<funcsynopsis id='XtManageChildren'>
+<funcprototype>
+  <funcdef>void<function> XtManageChildren</function></funcdef>
+  <paramdef>WidgetList<parameter> children</parameter></paramdef>
+  <paramdef>Cardinal<parameter> num_children</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>children</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a list of children to add.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_children</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of children to add.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+If the parent is already visible on the screen, it is especially
+important to batch updates so that the minimum amount of visible window
+reconfiguration is performed.
+</para>
+<para>
+<!-- .LP -->
+For further information about these functions,
+see the 
+<citetitle>X Toolkit Intrinsics - C Language Interface</citetitle>.
+</para>
+</sect3>
+<sect3 id="Destroying_Widgets">
+<title>Destroying Widgets</title>
+<para>
+<!-- .LP -->
+To destroy a widget instance of any type, use
+<xref linkend='XtDestroyWidget' xrefstyle='select: title'/>
+<indexterm significance="preferred"><primary>XtDestroyWidget</primary></indexterm>
+<funcsynopsis id='XtDestroyWidget'>
+<funcprototype>
+  <funcdef>void<function> XtDestroyWidget</function></funcdef>
+  <paramdef>Widget<parameter> w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XtDestroyWidget' xrefstyle='select: title'/>
+destroys the widget and recursively destroys any children that it may have,
+including the windows created by its children.
+After calling
+<function>XtDestroyWidget</function>,
+no further references should be made to the widget or any children
+that the destroyed widget may have had.
+</para>
+</sect3>
+<sect3 id="Retrieving_Widget_Resource_Values">
+<title>Retrieving Widget Resource Values</title>
+<para>
+<!-- .LP -->
+To retrieve the current value of a resource attribute associated
+with a widget instance, use
+<function>XtGetValues</function>.
+<indexterm significance="preferred"><primary>XtGetValues</primary></indexterm>
+<funcsynopsis id='XtGetValues'>
+<funcprototype>
+  <funcdef>void<function> XtGetValues</function></funcdef>
+  <paramdef>Widget<parameter> w</parameter></paramdef>
+  <paramdef>ArgList<parameter> args</parameter></paramdef>
+  <paramdef>Cardinal<parameter> num_args</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a variable-length argument list of name and <function>address</function>
+pairs that contain the resource name and the address into which the
+resource value is stored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of arguments in the argument list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+The arguments and values passed in the argument list are dependent on
+the widget. Note that the caller is responsible for providing space
+into which the returned resource value is copied; the <function>ArgList</function>
+contains a pointer to this storage (e.g. x and y must be
+allocated as Position).  For further information, see the
+
+<citetitle>X Toolkit Intrinsics - C Language Interface</citetitle>.
+</para>
+</sect3>
+<sect3 id="Modifying_Widget_Resource_Values">
+<title>Modifying Widget Resource Values</title>
+<para>
+<!-- .LP -->
+To modify the current value of a resource attribute associated with a
+widget instance, use
+<function>XtSetValues</function>.
+<indexterm significance="preferred"><primary>XtSetValues</primary></indexterm>
+<funcsynopsis id='XtSetValues'>
+<funcprototype>
+  <funcdef>void<function> XtSetValues</function></funcdef>
+  <paramdef>Widget<parameter> w</parameter></paramdef>
+  <paramdef>ArgList<parameter> args</parameter></paramdef>
+  <paramdef>Cardinal<parameter> num_args</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an array of name and <function>value</function> pairs that contain the
+arguments to be modified and their new values.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of arguments in the argument list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+The arguments and values that are passed will depend on the widget
+being modified.  Some widgets may not allow certain resources to be
+modified after the widget instance has been created or realized.
+No notification is given if any part of a <xref linkend='XtSetValues' xrefstyle='select: title'/> request is
+ignored.
+</para>
+<para>
+<!-- .LP -->
+For further information about these functions, see the
+
+<citetitle>X Toolkit Intrinsics - C Language Interface</citetitle>.
+<indexterm><primary>XtGetValues</primary></indexterm>
+<indexterm><primary>XtSetValues</primary></indexterm>
+<!-- .NT -->
+The argument list entry for
+<xref linkend='XtGetValues' xrefstyle='select: title'/>
+specifies the address to which the caller wants the value copied.  The
+argument list entry for
+<function>XtSetValues</function>,
+however, contains the new value itself, if the size of value is less than
+sizeof(XtArgVal) (architecture dependent, but at least sizeof(long));
+otherwise, it is a pointer to the value.  String resources are always
+passed as pointers, regardless of the length of the string.
+<!-- .NE -->
+</para>
+</sect3>
+</sect2>
+<sect2 id="Using_the_Client_Callback_Interface">
+<title>Using the Client Callback Interface</title>
+<para>
+<!-- .LP -->
+<!-- .XS -->
+<!-- 	Using the Client Callback Interface -->
+<!-- .XE -->
+<indexterm><primary>callbacks</primary></indexterm>
+Widgets can communicate changes in their state to their clients
+by means of a callback facility.
+The format for a client's callback handler is:
+<indexterm significance="preferred"><primary>CallbackProc</primary></indexterm>
+<funcsynopsis id='CallbackProc'>
+<funcprototype>
+  <funcdef>void<function> CallbackProc</function></funcdef>
+  <paramdef>Widget<parameter> w</parameter></paramdef>
+  <paramdef>XtPointer<parameter> client_data</parameter></paramdef>
+  <paramdef>XtPointer<parameter> call_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies widget for which the callback is registered.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies arbitrary client-supplied data that the widget should pass
+back to the client when the widget executes the client's callback
+procedure.  This is a way for the client registering the callback to
+also register client-specific data: a pointer to additional information
+about the widget, a reason for invoking the callback, and so on. If no
+additional information is necessary, NULL may be passed as this argument.
+This field is also frequently known as the <emphasis remap='I'>closure</emphasis>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>call_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies any callback-specific data the widget wants to pass to the client.
+For example, when Scrollbar executes its <function>jumpProc</function> callback list,
+it passes the current position of the thumb in <emphasis remap='I'>call_data</emphasis>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+Callbacks can be registered either by creating an argument containing
+the callback list described below or by using the special convenience
+routines <xref linkend='XtAddCallback' xrefstyle='select: title'/> and <function>XtAddCallbacks</function>.  When the widget
+is created, a pointer to a list of callback procedure and data pairs can
+be passed in the argument list to
+<function>XtCreateWidget</function>.
+The list is of type
+<function>XtCallbackList :</function>
+<indexterm><primary>XtCallbackProc</primary></indexterm>
+<indexterm><primary>XtAddCallbacks</primary></indexterm>
+<indexterm><primary>XtAddCallback</primary></indexterm>
+<indexterm significance="preferred"><primary>XtCallbackList</primary></indexterm>
+<indexterm significance="preferred"><primary>XtCallbackRec</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+	XtCallbackProc callback;
+	XtPointer closure;
+} XtCallbackRec, *XtCallbackList;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+The callback list must be allocated and initialized before calling
+<function>XtCreateWidget</function>.
+<indexterm><primary>XtCreateWidget</primary></indexterm>
+The end of the list is identified by an entry containing NULL in
+callback and closure.  Once the widget is created, the client can change
+or de-allocate this list; the widget itself makes no further reference
+to it.  The closure field contains the client_data passed to the
+callback when the callback list is executed.
+</para>
+<para>
+<!-- .LP -->
+The second method for registering callbacks is to use
+<xref linkend='XtAddCallback' xrefstyle='select: title'/>
+after the widget has been created.
+<indexterm significance="preferred"><primary>XtAddCallback</primary></indexterm>
+<funcsynopsis id='XtAddCallback'>
+<funcprototype>
+  <funcdef>void<function> XtAddCallback</function></funcdef>
+  <paramdef>Widget<parameter> w</parameter></paramdef>
+  <paramdef>String<parameter> callback_name</parameter></paramdef>
+  <paramdef>XtCallbackProc<parameter> callback</parameter></paramdef>
+  <paramdef>XtPointer<parameter> client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget to add the callback to.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>callback_name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the callback list within the widget to append to.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>callback</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the callback procedure to add.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the data to be passed to the callback when it is invoked.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XtAddCallback' xrefstyle='select: title'/>
+adds the specified callback to the list for the named widget.
+</para>
+<para>
+<!-- .LP -->
+All widgets provide a callback list named
+<function>destroyCallback</function>
+<indexterm significance="preferred"><primary>destroyCallback</primary></indexterm>
+where clients can register procedures that are to be executed when the
+widget is destroyed.  The destroy callbacks are executed when the widget
+or an ancestor is destroyed.  The <emphasis remap='I'>call_data</emphasis> argument is unused for
+destroy callbacks.
+</para>
+</sect2>
+<sect2 id="Programming_Considerations">
+<title>Programming Considerations</title>
+<para>
+<!-- .LP -->
+<!-- .XS -->
+<!-- 	Programming Considerations -->
+<!-- .XE -->
+This section provides some guidelines on how to set up an application
+program that uses the X Toolkit.
+</para>
+<sect3 id="Writing_Applications">
+<title>Writing Applications</title>
+<para>
+<!-- .LP -->
+<indexterm><primary>writing applications</primary></indexterm>
+<indexterm><primary>StringDefs.h</primary></indexterm>
+<indexterm><primary>Intrinsic.h</primary></indexterm>
+When writing an application that uses the X Toolkit,
+you should make sure that your application performs the following:
+</para>
+<orderedlist>
+  <listitem>
+    <para>
+Include
+<filename class="headerfile">&lt;X11/Intrinsic.h&gt;</filename>
+in your application programs.
+This header file automatically includes
+<filename class="headerfile">&lt;X11/Xlib.h&gt;</filename>,
+so all Xlib functions also are defined.
+It may also be necessary to include <filename class="headerfile">&lt;X11/StringDefs.h&gt;</filename> when setting
+up argument lists, as many of the XtN<emphasis remap='I'>something</emphasis> definitions are
+only defined in this file.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Include the widget-specific header files for each widget type
+that you need to use.
+For example,
+<filename class="headerfile">&lt;X11/Xaw/Label.h&gt;</filename>
+and
+<filename class="headerfile">&lt;X11/Xaw/Command.h&gt;</filename>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Call the
+<xref linkend='XtOpenApplication' xrefstyle='select: title'/>
+<indexterm><primary>XtOpenApplication</primary></indexterm>
+function before invoking any other toolkit or Xlib functions.
+For further information,
+see Section 2.1 and the
+
+<citetitle>X Toolkit Intrinsics - C Language Interface</citetitle>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+To pass attributes to the widget creation routines that will override
+any site or user customizations, set up argument lists.  In this
+document, a list of valid argument names is provided in the discussion
+of each widget.  The names each have a global symbol defined that begins
+with <function>XtN</function> to help catch spelling errors.  For example,
+<function>XtNlabel</function> is defined for the <function>label</function> resource of many widgets.
+<indexterm significance="preferred"><primary>XtN</primary></indexterm>
+    </para>
+    <para>
+For further information, see Section 2.9.2.2.  <!-- xref -->
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+When the argument list is set up, create the widget with the
+<xref linkend='XtCreateManagedWidget' xrefstyle='select: title'/> function.  For further information, see
+Section 2.2 and the
+
+<citetitle>X Toolkit Intrinsics - C Language Interface</citetitle>.
+<indexterm><primary>XtCreateManagedWidget</primary></indexterm>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the widget has any callback routines, set by the
+<function>XtNcallback</function>
+argument or the
+<xref linkend='XtAddCallback' xrefstyle='select: title'/>
+function, declare these routines within the application.
+<indexterm><primary>XtAddCallback</primary></indexterm>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+After creating the initial widget hierarchy, windows must be created
+for each widget by calling
+<xref linkend='XtRealizeWidget' xrefstyle='select: title'/>
+on the top level widget.
+<indexterm><primary>XtRealizeWidget</primary></indexterm>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Most applications now sit in a loop processing events using
+<function>XtAppMainLoop</function>,
+for example:
+<indexterm><primary>XtAppMainLoop</primary></indexterm>
+<literallayout class="monospaced">
+XtCreateManagedWidget(<emphasis remap='I'>name</emphasis>, <emphasis remap='I'>class</emphasis>, <emphasis remap='I'>parent</emphasis>, <emphasis remap='I'>args</emphasis>, <emphasis remap='I'>num_args</emphasis>);
+XtRealizeWidget(<emphasis remap='I'>shell</emphasis>);
+XtAppMainLoop(<emphasis remap='I'>app_context</emphasis>);
+</literallayout>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+For information about this function, see the
+
+<citetitle>X Toolkit Intrinsics - C Language Interface</citetitle>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Link your application with
+<function>libXaw</function>
+(the Athena widgets),
+<function>libXmu</function>
+(miscellaneous utilities),
+<function>libXt</function>
+(the X Toolkit Intrinsics),
+<function>libSM</function>
+(Session Management),
+<function>libICE</function>
+(Inter-Client Exchange),
+<function>libXext</function>
+(the extension library needed for the shape extension code which allows
+rounded Command buttons), and
+<function>libX11</function>
+(the core X library).
+The following provides a sample command line:
+<indexterm><primary>libXaw</primary></indexterm>
+<indexterm><primary>libXmu</primary></indexterm>
+<indexterm><primary>libXt</primary></indexterm>
+<indexterm><primary>libSM</primary></indexterm>
+<indexterm><primary>libICE</primary></indexterm>
+<indexterm><primary>libXext</primary></indexterm>
+<indexterm><primary>libX11</primary></indexterm>
+<indexterm><primary>linking applications</primary></indexterm>
+<indexterm><primary>compiling applications</primary></indexterm>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<literallayout class="monospaced">
+cc -o <emphasis remap='I'>application</emphasis> <emphasis remap='I'>application</emphasis>.c -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11
+</literallayout>
+    </para>
+  </listitem>
+</orderedlist>
+</sect3>
+<sect3 id="Changing_Resource_Values">
+<title>Changing Resource Values</title>
+<indexterm><primary>resource</primary></indexterm>
+<para>
+<!-- .LP -->
+The Intrinsics support two methods of changing the default resource
+values; the resource manager, and an argument list passed into
+XtCreateWidget.  While resources values will get updated no matter
+which method you use, the two methods provide slightly different
+functionality.
+<variablelist>
+  <varlistentry>
+    <term>Resource Manager</term>
+    <listitem>
+      <para>
+This method picks up resource definitions described in
+
+<citetitle>Xlib - C Language Interface</citetitle> from
+many different locations at run time.  The locations most important to
+the application programmer are the <emphasis remap='I'>fallback resources</emphasis> and the
+<emphasis remap='I'>app-defaults</emphasis> file, (see
+
+<citetitle>X Toolkit Intrinsics - C Language Interface</citetitle>
+for the complete list).
+Since these resource are loaded at run time, they can be overridden by
+the user, allowing an application to be customized to fit the
+particular needs of each individual user.  These values can also be
+modified without the need to rebuild the application, allowing rapid
+prototyping of user interfaces.  Application programmers should use
+resources in preference to hard-coded values whenever possible.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Argument Lists</term>
+    <listitem>
+      <para>
+The values passed into the widget at creation time via an argument list
+cannot be modified by the user, and allow no opportunity for
+customization.  It is used to set resources that cannot be specified as
+strings (e.g. callback lists) or resources that should not be
+overridden (e.g. window depth) by the user.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<sect4 id="Specifying_Resources">
+<title>Specifying Resources</title>
+<para>
+<!-- .LP -->
+It is important for all X Toolkit application programmers to
+understand how to use the X Resource Manager to specify resources for
+widgets in an X application.  This section will describe the most common
+methods used to specify these resources, and how to use the X Resource
+manager.
+<indexterm><primary>xrdb</primary></indexterm>
+<variablelist>
+  <varlistentry>
+    <term>
+      <function>Xrdb</function>
+    </term>
+    <listitem>
+      <para>
+The <function>xrdb</function> utility may be used to load a file containing
+resources into the X server.   Once the resources are loaded, the
+resources will affect any new applications started on the display that
+they were loaded onto.
+<indexterm><primary>application defaults</primary></indexterm>
+<indexterm><primary>app-defaults</primary></indexterm>
+<indexterm><primary>/usr/share/X11/app-defaults</primary></indexterm>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Application Defaults</term>
+    <listitem>
+      <para>
+The application defaults (app-defaults) file (normally in
+/usr/share/X11/app-defaults/<emphasis remap='I'>classname</emphasis>) for an application is loaded
+whenever the application is started.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+The resource specification has two colon-separated parts, a name, and
+a value.  The <emphasis remap='I'>value</emphasis> is a string whose format is dependent on the
+resource specified by <emphasis remap='I'>name</emphasis>.  <emphasis remap='I'>Name</emphasis> is constructed by
+appending a resource name to a full widget name.
+</para>
+<para>
+<!-- .LP -->
+The full widget name is a list of the name of every ancestor of the
+desired widget separated by periods (.).  Each widget also has a class
+associated with it.  A class is a type of widget (e.g. Label or
+Scrollbar or Box).  Notice that class names, by convention, begin with
+capital letters and instance names begin with lower case letters.  The
+class of any widget may be used in place of its name in a resource
+specification.  Here are a few examples:
+<variablelist>
+  <varlistentry>
+    <term>
+      xman.form.button1
+    </term>
+    <listitem>
+      <para>
+This is a fully specified resource name, and will affect only widgets
+called button1 that are children of widgets called form that are
+children of
+applications named xman.  (Note that while typically two widgets that
+are siblings will have different names, it is not prohibited.)
+
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      Xman.Form.Command
+    </term>
+    <listitem>
+      <para>
+This will match any Command widget that is a child of a Form widget
+that is itself a child of an application of class <emphasis remap='I'>Xman</emphasis>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      Xman.Form.button1
+    </term>
+    <listitem>
+      <para>
+This is a mixed resource name with both widget names and classes specified.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+This syntax allows an application programmer to specify any widget
+in the widget tree.  To match more than one widget (for example a user
+may want to make all Command buttons blue), use an asterisk (*)
+instead of a period.  When an asterisk is used, any number of widgets
+(including zero) may exist between the two widget names. For example:
+<variablelist>
+  <varlistentry>
+    <term>
+      Xman*Command
+    </term>
+    <listitem>
+      <para>
+This matches all Command widgets in the Xman application.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      Foo*button1
+    </term>
+    <listitem>
+      <para>
+This matches any widget in the Foo application that is named <emphasis remap='I'>button1</emphasis>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+The root of all application widget trees is the widget returned by
+<xref linkend='XtOpenApplication' xrefstyle='select: title'/>.  Even though this is actually an
+ApplicationShell widget, the toolkit replaces its widget class with the
+class name of the application.  The name of this widget is either
+the name used to invoke the application (<function>argv[0]</function>) or the name of
+the application specified using the standard <emphasis remap='I'>-name</emphasis> command line
+option supported by the Intrinsics.
+</para>
+<para>
+<!-- .LP -->
+The last step in constructing the resource name is to append the name of
+the resource with either a period or asterisk to the full or partial
+widget name already constructed.
+<variablelist>
+  <varlistentry>
+    <term>
+      *foreground:Blue
+    </term>
+    <listitem>
+      <para>
+Specifies that all widgets in all applications will have a foreground
+color of blue.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      Xman*borderWidth:10
+    </term>
+    <listitem>
+      <para>
+Specifies that all widgets in an application whose class is Xman will
+have a border width of 10 (pixels).
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      xman.form.button1.label:Testing
+    </term>
+    <listitem>
+      <para>
+Specifies that a particular widget in the xman application will have a
+label named <emphasis remap='I'>Testing</emphasis>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+An exclamation point (!) in the first column of a line indicates
+that the rest of the line should be treated as a comment.
+</para>
+<para>
+<!-- .LP -->
+<function>Final Words</function>
+</para>
+<para>
+<!-- .LP -->
+The Resource manager is a powerful tool that can be used very
+effectively to customize X Toolkit applications at run time by either the
+application programmer or the user.  Some final points to note:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+An application programmer may add new resources to their
+application.  These resources are associated with the global
+application, and not any particular widget.  The X Toolkit function used for
+adding the application resources is <function>XtGetApplicationResources</function>.
+<indexterm><primary>XtGetApplicationResources</primary></indexterm>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Be careful when creating resource files.  Since widgets will
+ignore resources that they do not understand, any spelling
+errors will cause a resource to have no effect.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Only one resource line will match any given resource.  There is a set
+of precedence rules, which take the following general stance.
+<!-- .ta 10n -->
+    </para>
+  </listitem>
+  <listitem>
+    <itemizedlist>
+      <listitem>
+        <para>
+More specific overrides less specific, thus period always overrides asterisk.
+        </para>
+      </listitem>
+      <listitem>
+        <para>
+Names on the left are more specific and override names on the right.
+        </para>
+      </listitem>
+      <listitem>
+        <para>
+When resource specifications are exactly the same, user defaults
+will override program defaults.
+        </para>
+      </listitem>
+    </itemizedlist>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+For a complete explanation of the rules of precedence, and
+other specific topics see
+
+<citetitle>X Toolkit Intrinsics - C Language Interface</citetitle> and 
+<citetitle>Xlib - C Language Interface</citetitle>.
+</para>
+</sect4>
+<sect4 id="Creating_Argument_Lists">
+<title>Creating Argument Lists</title>
+<indexterm significance="preferred"><primary>argument lists</primary></indexterm>
+<para>
+<!-- .LP -->
+To set up an argument list for the inline specification of widget attributes,
+you may use any of the four approaches discussed in this section.
+Each resource name has a global symbol associated with it.  This
+global symbol has the form XtN<emphasis remap='I'>resource name</emphasis>.  For example, the
+symbol for <quote>foreground</quote> is <function>XtNforeground</function>. For further information,
+see the 
+<citetitle>X Toolkit Intrinsics - C Language Interface</citetitle>.
+</para>
+<para>
+<!-- .LP -->
+Argument are specified by using the following structure:
+<indexterm significance="preferred"><primary>ArgList</primary></indexterm>
+<indexterm significance="preferred"><primary>Arg</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i 1.5i -->
+<!-- .ta .5i 1.5i -->
+typedef struct {
+	String name;
+	XtArgVal value;
+} Arg, *ArgList;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+The first approach is to statically initialize the argument list.
+For example:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+static Arg arglist[] = {
+	{XtNwidth, (XtArgVal) 400},
+	{XtNheight, (XtArgVal) 300},
+};
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+This approach is convenient for lists that do not need to be computed
+at runtime and makes adding or deleting new elements easy.
+The
+<indexterm><primary>XtNumber</primary></indexterm>
+<function>XtNumber</function>
+macro is used to compute the number of elements in the argument list,
+preventing simple programming errors:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+XtCreateWidget(<emphasis remap='I'>name</emphasis>, <emphasis remap='I'>class</emphasis>, <emphasis remap='I'>parent</emphasis>, <emphasis remap='I'>arglist</emphasis>, XtNumber(<emphasis remap='I'>arglist</emphasis>));
+</literallayout>
+<indexterm significance="preferred"><primary>XtSetArg</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+The second approach is to use the
+<function>XtSetArg</function>
+macro.
+For example:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+Arg arglist[10];
+XtSetArg(arglist[1], XtNwidth, 400);
+XtSetArg(arglist[2], XtNheight, 300);
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+To make it easier to insert and delete entries,
+you also can use a variable index:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+Arg arglist[10];
+Cardinal i=0;
+XtSetArg(arglist[i], XtNwidth,  400);       i++;
+XtSetArg(arglist[i], XtNheight, 300);       i++;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+The i variable can then be used as the argument list count in the widget
+create function.
+In this example,
+<indexterm><primary>XtNumber</primary></indexterm>
+<function>XtNumber</function>
+would return 10, not 2, and therefore is not useful.
+<!-- .NT -->
+You should not use auto-increment or auto-decrement
+within the first argument to
+<function>XtSetArg</function>.
+As it is currently implemented,
+<function>XtSetArg</function>
+is a macro that dereferences the first argument twice.
+<!-- .NE -->
+</para>
+<para>
+<!-- .LP -->
+The third approach is to individually set the elements of the
+argument list array:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+Arg arglist[10];
+arglist[0].name  = XtNwidth;
+arglist[0].value = (XtArgVal) 400;
+arglist[1].name  = XtNheight;
+arglist[1].value = (XtArgVal) 300;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+Note that in this example, as in the previous example,
+<indexterm><primary>XtNumber</primary></indexterm>
+<function>XtNumber</function>
+would return 10, not 2, and therefore would not be useful.
+</para>
+<para>
+<!-- .LP -->
+The fourth approach is to use a mixture of the first and third approaches:
+you can statically define the argument list but modify some entries at runtime.
+For example:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+static Arg arglist[] = {
+	{XtNwidth, (XtArgVal) 400},
+	{XtNheight, (XtArgVal) NULL},
+};
+arglist[1].value = (XtArgVal) 300;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+In this example,
+<indexterm><primary>XtNumber</primary></indexterm>
+<function>XtNumber</function>
+can be used, as in the first approach, for easier code maintenance.
+</para>
+</sect4>
+</sect3>
+</sect2>
+<sect2 id="Example_Programs">
+<title>Example Programs</title>
+<!-- .XS -->
+<!-- 	Example Programs -->
+<!-- .XE -->
+<indexterm><primary>examples</primary></indexterm>
+<para>
+<!-- .LP -->
+The best way to understand how to use any programming library is by
+trying some simple examples.  A collection of example programs that
+introduces each of the widgets in that Athena widget set, as well as many
+important toolkit programming concepts, is available in the X11R5 contrib
+release as distributed by the X Consortium.  It can be found in the
+directory <filename>contrib/examples/Xaw</filename> in the archive
+at <ulink url="http://www.x.org/releases/X11R5/contrib-1.tar.Z" />
+See the <filename>README</filename> file from that directory for a guide
+to the examples.
+</para>
+</sect2>
+</sect1>
+</chapter>
Index: lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs/CH6.xml
===================================================================
--- lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs/CH6.xml	(nonexistent)
+++ lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs/CH6.xml	(revision 5)
@@ -0,0 +1,119 @@
+<chapter id='Composite_and_Constraint_Widgets'>
+<title>Composite and Constraint Widgets</title>
+<para>
+These widgets may contain arbitrary widget children.  They implement a
+policy for the size and location of their children.
+</para>
+<para>
+<variablelist>
+  <varlistentry>
+    <term>Box</term>
+    <listitem>
+      <para>
+This widget will pack its children as tightly as possible in non-overlapping rows.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Dialog</term>
+    <listitem>
+      <para>
+An implementation of a commonly used interaction semantic to prompt for
+auxiliary input from the user, such as a filename.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Form</term>
+    <listitem>
+      <para>
+A more sophisticated layout widget that allows the children to specify
+their positions relative to the other children, or to the edges of the Form.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Paned</term>
+    <listitem>
+      <para>
+Allows children to be tiled vertically or horizontally.  Controls are
+also provided to allow the user to dynamically resize the individual panes.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Porthole</term>
+    <listitem>
+      <para>
+Allows viewing of a managed child which is as large as, or larger than its
+parent, typically under control of a Panner widget.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Tree</term>
+    <listitem>
+      <para>
+Provides geometry management of widgets arranged in a directed, acyclic graph.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Viewport</term>
+    <listitem>
+      <para>
+Consists of a frame, one or two scrollbars, and an inner window.  The
+inner window can contain all the data that is to be displayed.  This inner
+window will be clipped by the frame with the scrollbars controlling
+which section of the inner window is currently visible.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<note>
+<para>
+<!-- .LP -->
+The geometry management semantics provided by the X Toolkit give full
+control of the size and position of a widget to the parent of that
+widget.  While the children are allowed to request a certain size or
+location, it is the parent who makes the final decision.  Many of the
+composite widgets here will deny any geometry request from their
+children by default.  If a child widget is not getting the expected size
+or location, it is most likely the parent disallowing a request, or
+implementing semantics slightly different than those expected by the
+application programmer.
+</para>
+<para>
+<!-- .LP -->
+If the application wishes to change the size or location of
+any widget it should make a call to <xref linkend='XtSetValues' xrefstyle='select: title'/>.  This will
+<indexterm><primary>XtSetValues</primary></indexterm>
+allow the widget to ask its parent for the new size or location.
+As noted above the parent is allowed to refuse this request,
+and the child must live with the result.  If the
+application is unable to achieve the desired semantics, then perhaps it
+should use a different composite widget.  Under no circumstances
+should an application programmer resort to <function>XtMoveWidget</function> or
+<indexterm><primary>XtMoveWidget</primary></indexterm>
+<function>XtResizeWidget</function>; these functions are exclusively for the use of
+<indexterm><primary>XtResizeWidget</primary></indexterm>
+Composite widget implementors.
+</para>
+<para>
+<!-- .LP -->
+For more information on geometry management consult the
+
+<citetitle>X Toolkit Intrinsics - C Language Interface</citetitle>.
+</para>
+</note>
+
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"  href="Box.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"  href="Dialog.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"  href="Form.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"  href="Paned.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"  href="Porthole.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"  href="Tree.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"  href="Viewport.xml"/>
+
+</chapter>
Index: lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs/CH7.xml
===================================================================
--- lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs/CH7.xml	(nonexistent)
+++ lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs/CH7.xml	(revision 5)
@@ -0,0 +1,170 @@
+<chapter id='Creating_New_Widgets_Subclassing'>
+<title>Creating New Widgets (Subclassing)</title>
+<para>
+Although the task of creating a new widget may at first appear a little
+daunting, there is a basic simple pattern that all widgets follow.  The
+Athena Widget library contains a special widget called the
+<emphasis remap='I'>Template</emphasis> widget that is intended to assist
+the novice widget programmer in writing a custom widget.
+</para>
+<para>
+Reasons for wishing to write a custom widget include:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Providing a graphical interface not currently supported by any existing
+widget set.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Convenient access to resource management procedures to obtain fonts,
+colors, etc., even if user customization is not desired.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Convenient access to user input dispatch and translation management procedures.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Access to callback mechanism for building higher-level application libraries.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Customizing the interface or behavior of an existing widget to suit a
+special application need.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Desire to allow user customization of resources such as fonts, colors,
+etc., or to allow convenient re-binding of keys and buttons to internal
+functions.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Converting a non-Toolkit application to use the Toolkit.
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+In each of these cases, the operation needed to create a new widget is
+to "subclass" an existing one.  If the desired semantics of the new
+widget are similar to an existing one, then the implementation of the
+existing widget should be examined to see how much work would be
+required to create a subclass that will then be
+able to share the existing class methods.  Much time will be saved in
+writing the new widget if an existing widget class Expose, Resize and/or
+GeometryManager method can be used by the subclass.
+</para>
+<para>
+Note that some trivial uses of a <quote>bare-bones</quote> widget may be achieved by
+simply creating an instance of the Core
+widget.  The class variable to use when creating a Core widget is
+<function>widgetClass</function>.
+The geometry of the Core widget is determined entirely by the parent
+widget.
+</para>
+<para>
+It is very often the case than an application will have a special need
+for a certain set of functions and that many copies of these functions
+will be needed.  For example, when converting an older application to use
+the Toolkit, it may be desirable to have a "Window Widget" class that
+might have the following semantics:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Allocate 2 drawing colors in addition to a background color.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Allocate a text font.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Execute an application-supplied function to handle exposure events.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Execute an application-supplied function to handle user input events.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+It is obvious that a completely general-purpose WindowWidgetClass could
+be constructed that would export all class methods as callbacks lists,
+but such a widget would be very large and would have to choose some
+arbitrary number of resources such as colors to allocate.  An application
+that used many instances of the general-purpose widget would therefore
+un-necessarily waste many resources.
+</para>
+<para>
+In this section, an outline will be given of the procedure to follow to
+construct a special-purpose widget to address the items listed above.
+The reader should refer to the appropriate sections of the
+
+<citetitle>X Toolkit Intrinsics - C Language Interface</citetitle>
+for complete details of the material outlined here.
+
+Section 1.4 of the <citetitle>Intrinsics</citetitle>
+should be read in
+conjunction with this section.
+</para>
+<para>
+All Athena widgets have three separate files associated with them:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+A "public" header file containing declarations needed by applications programmers
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A "private" header file containing additional declarations needed by the
+widget and any subclasses
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A source code file containing the implementation of the widget
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+This separation of functions into three files is suggested for all
+widgets, but nothing in the Toolkit actually requires this format.  In
+particular, a private widget created for a single application may easily
+combine the "public" and "private" header files into a single file, or
+merge the contents into another application header file.  Similarly, the
+widget implementation can be merged into other application code.
+</para>
+
+<para>
+In the following example, the public header file
+<filename class="headerfile">&lt;X11/Xaw/Template.h&gt;</filename>,
+the private header file
+<filename class="headerfile">&lt;X11/Xaw/TemplateP.h&gt;</filename>
+and the source code file
+<filename class="headerfile">&lt;X11/Xaw/Template.c&gt;</filename>
+will be modified to produce the "WindowWidget" described above.
+In each case, the files have been designed so that a global string
+replacement of "Template" and "template"
+with the name of your new widget, using
+the appropriate case, can be done.
+</para>
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"  href="Template_public_header_file.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"  href="Template_private_header_file.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"  href="Template_widget_source_file.xml"/>
+</chapter>
Index: lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs/Grip.xml
===================================================================
--- lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs/Grip.xml	(nonexistent)
+++ lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs/Grip.xml	(revision 5)
@@ -0,0 +1,358 @@
+<sect1 id="Grip_Widget">
+<title>Grip Widget</title>
+<!-- .XS -->
+<!-- 	Grip Widget -->
+<!-- .XE -->
+<indexterm significance="preferred"><primary>Grip widget</primary></indexterm>
+<literallayout class="monospaced">
+<!-- .TA 2.0i -->
+<!-- .ta 2.0i -->
+<!-- .sp -->
+Application header file	&lt;X11/Xaw/Grip.h&gt;
+<indexterm><primary>Grip.h</primary></indexterm>
+Class header file	&lt;X11/Xaw/GripP.h&gt;
+<indexterm><primary>GripP.h</primary></indexterm>
+Class	gripWidgetClass
+<indexterm><primary>gripWidgetClass</primary></indexterm>
+Class Name	Grip
+<indexterm><primary>Grip widget</primary><secondary>class name</secondary></indexterm>
+Superclass	Simple
+<!-- .sp -->
+</literallayout>
+<para>
+<!-- .LP -->
+The Grip widget provides a small rectangular region in which user input
+events (such as ButtonPress or ButtonRelease) may be handled.  The most
+common use for the Grip widget is as an attachment point for visually
+repositioning an object, such as the pane border in a Paned widget.
+</para>
+<sect2 id='Grip::Resources'>
+<title>Resources</title>
+<para>
+<!-- .LP -->
+When creating a Grip widget instance, the following resources are
+retrieved from the argument list or from the resource database:
+</para>
+<para>
+<!-- .LP -->
+<indexterm><primary>Grip widget</primary><secondary>resources</secondary></indexterm>
+<informaltable>
+  <tgroup cols='5' align='center'>
+  <colspec colname='c1'/>
+  <colspec colname='c2'/>
+  <colspec colname='c3'/>
+  <colspec colname='c4'/>
+  <colspec colname='c5'/>
+  <thead>
+    <row>
+      <entry>Name</entry>
+      <entry>Class</entry>
+      <entry>Type</entry>
+      <entry>Notes</entry>
+      <entry>Default Value</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>accelerators</entry>
+      <entry>Accelerators</entry>
+      <entry>AcceleratorTable</entry>
+      <entry></entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>ancestorSensitive</entry>
+      <entry>AncestorSensitive</entry>
+      <entry>Boolean</entry>
+      <entry>D</entry>
+      <entry>True</entry>
+    </row>
+    <row>
+      <entry>background</entry>
+      <entry>Background</entry>
+      <entry>Pixel</entry>
+      <entry></entry>
+      <entry>XtDefaultBackground</entry>
+    </row>
+    <row>
+      <entry>backgroundPixmap</entry>
+      <entry>Pixmap</entry>
+      <entry>Pixmap</entry>
+      <entry></entry>
+      <entry>XtUnspecifiedPixmap</entry>
+    </row>
+    <row>
+      <entry>borderColor</entry>
+      <entry>BorderColor</entry>
+      <entry>Pixel</entry>
+      <entry></entry>
+      <entry>XtDefaultForeground</entry>
+    </row>
+    <row>
+      <entry>borderPixmap</entry>
+      <entry>Pixmap</entry>
+      <entry>Pixmap</entry>
+      <entry></entry>
+      <entry>XtUnspecifiedPixmap</entry>
+    </row>
+    <row>
+      <entry>borderWidth</entry>
+      <entry>BorderWidth</entry>
+      <entry>Dimension</entry>
+      <entry></entry>
+      <entry>0</entry>
+    </row>
+    <row>
+      <entry>callback</entry>
+      <entry>Callback</entry>
+      <entry>Callback</entry>
+      <entry></entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>colormap</entry>
+      <entry>Colormap</entry>
+      <entry>Colormap</entry>
+      <entry></entry>
+      <entry>Parent's Colormap</entry>
+    </row>
+    <row>
+      <entry>cursor</entry>
+      <entry>Cursor</entry>
+      <entry>Cursor</entry>
+      <entry></entry>
+      <entry>None</entry>
+    </row>
+    <row>
+      <entry>cursorName</entry>
+      <entry>Cursor</entry>
+      <entry>String</entry>
+      <entry></entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>depth</entry>
+      <entry>Depth</entry>
+      <entry>int</entry>
+      <entry>C</entry>
+      <entry>Parent's Depth</entry>
+    </row>
+    <row>
+      <entry>destroyCallback</entry>
+      <entry>Callback</entry>
+      <entry>XtCallbackList</entry>
+      <entry></entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>foreground</entry>
+      <entry>Foreground</entry>
+      <entry>Pixel</entry>
+      <entry></entry>
+      <entry>XtDefaultForeground</entry>
+    </row>
+    <row>
+      <entry>height</entry>
+      <entry>Height</entry>
+      <entry>Dimension</entry>
+      <entry></entry>
+      <entry>8</entry>
+    </row>
+    <row>
+      <entry>insensitiveBorder</entry>
+      <entry>Insensitive</entry>
+      <entry>Pixmap</entry>
+      <entry></entry>
+      <entry>GreyPixmap</entry>
+    </row>
+    <row>
+      <entry>international</entry>
+      <entry>International</entry>
+      <entry>Boolean</entry>
+      <entry>C</entry>
+      <entry>False</entry>
+    </row>
+    <row>
+      <entry>mappedWhenManaged</entry>
+      <entry>MappedWhenManaged</entry>
+      <entry>Boolean</entry>
+      <entry></entry>
+      <entry>True</entry>
+    </row>
+    <row>
+      <entry>pointerColor</entry>
+      <entry>Foreground</entry>
+      <entry>Pixel</entry>
+      <entry></entry>
+      <entry>XtDefaultForeground</entry>
+    </row>
+    <row>
+      <entry>pointerColorBackground</entry>
+      <entry>Background</entry>
+      <entry>Pixel</entry>
+      <entry></entry>
+      <entry>XtDefaultBackground</entry>
+    </row>
+    <row>
+      <entry>screen</entry>
+      <entry>Screen</entry>
+      <entry>Screen</entry>
+      <entry>R</entry>
+      <entry>Parent's Screen</entry>
+    </row>
+    <row>
+      <entry>sensitive</entry>
+      <entry>Sensitive</entry>
+      <entry>Boolean</entry>
+      <entry></entry>
+      <entry>True</entry>
+    </row>
+    <row>
+      <entry>translations</entry>
+      <entry>Translations</entry>
+      <entry>TranslationTable</entry>
+      <entry></entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>width</entry>
+      <entry>Width</entry>
+      <entry>Dimension</entry>
+      <entry></entry>
+      <entry>8</entry>
+    </row>
+    <row>
+      <entry>x</entry>
+      <entry>Position</entry>
+      <entry>Position</entry>
+      <entry></entry>
+      <entry>0</entry>
+    </row>
+    <row>
+      <entry>y</entry>
+      <entry>Position</entry>
+      <entry>Position</entry>
+      <entry></entry>
+      <entry>0</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+<!-- .Ac -->
+<!-- .As -->
+<!-- .Bg -->
+<!-- .Gp -->
+<!-- .Bc -->
+<!-- .Bp -->
+<!-- .Bw -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <function>callback</function>
+    </term>
+    <listitem>
+      <para>
+All routines on this list are called whenever the <function>GripAction</function>
+action routine is invoked.  The <emphasis remap='I'>call_data</emphasis> contains all
+information passed to the action routine.  A detailed description
+is given below in the <function>Grip Actions</function> section.
+<!-- .Cm -->
+<!-- .Cu -->
+<!-- .Cn -->
+<!-- .Dp -->
+<!-- .Dc -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <function>foreground</function>
+    </term>
+    <listitem>
+      <para>
+A pixel value which indexes the widget's colormap to derive the color
+used to flood fill the entire Grip widget.
+<!-- .Hw -->
+<!-- .Ib -->
+<!-- .Ix -->
+<!-- .Mm -->
+<!-- .Pf -->
+<!-- .Pb -->
+<!-- .Sc -->
+<!-- .Se -->
+<!-- .Tr -->
+<!-- .Xy -->
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+</sect2>
+<sect2 id="Grip_Actions">
+<title>Grip Actions</title>
+<indexterm><primary>Grip widget</primary><secondary>actions</secondary></indexterm>
+<para>
+<!-- .LP -->
+The Grip widget does not declare any default event translation bindings,
+but it does declare a single action routine named <function>GripAction</function>.  The
+<indexterm><primary>Grip widget</primary><secondary>GripAction routine</secondary></indexterm>
+client specifies an arbitrary event translation table, optionally giving
+parameters to the <function>GripAction</function> routine.
+</para>
+<para>
+<!-- .LP -->
+The <function>GripAction</function> routine executes the callbacks on the
+<function>callback</function> list, passing as <function>call_data</function> a pointer to a
+<function>XawGripCallData</function> structure, defined in the Grip widget's application
+header file.
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i 2.25i -->
+<!-- .ta .5i 2.25i -->
+<indexterm significance="preferred"><primary>XawGripCallData</primary></indexterm>
+<indexterm significance="preferred"><primary>XawGripCallDataRec</primary></indexterm>
+<!-- .sp -->
+typedef struct _XawGripCallData {
+	XEvent *event;
+	String *params;
+	Cardinal num_params;
+} XawGripCallDataRec, *XawGripCallData,
+  GripCallDataRec, *GripCallData; /* supported for R4 compatibility */
+<indexterm><primary>XawGripCallDataRec</primary></indexterm>
+<indexterm><primary>XawGripCallData</primary></indexterm>
+<indexterm><primary>GripCallData</primary></indexterm>
+<!-- .sp -->
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+In this structure, the <emphasis remap='I'>event</emphasis> is a pointer to the input event that
+triggered the action.  <emphasis remap='I'>params</emphasis> and <emphasis remap='I'>num_params</emphasis> give the string
+parameters specified in the translation table for the particular event
+binding.
+<indexterm><primary>Grip widget</primary><secondary>GripAction table</secondary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+The following is an example of a translation table that uses the GripAction:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i 2.5i -->
+<!-- .ta .5i 2.5i -->
+<!-- .sp -->
+	&lt;Btn1Down&gt;:	GripAction(press)
+	&lt;Btn1Motion&gt;:	GripAction(move)
+	&lt;Btn1Up&gt;:	GripAction(release)
+<!-- .sp -->
+</literallayout>
+For a complete description of the format of translation tables, see the
+
+<citetitle>X Toolkit Intrinsics - C Language Interface</citetitle>.
+
+</para>
+</sect2>
+</sect1>
Index: lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs/SimpleMenu.xml
===================================================================
--- lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs/SimpleMenu.xml	(nonexistent)
+++ lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs/SimpleMenu.xml	(revision 5)
@@ -0,0 +1,791 @@
+<sect1 id="SimpleMenu_Widget">
+<title>SimpleMenu Widget</title>
+<!-- .XS -->
+<!-- 	SimpleMenu Widget -->
+<!-- .XE -->
+<indexterm significance="preferred"><primary>SimpleMenu widget</primary></indexterm>
+<literallayout class="monospaced">
+<!-- .TA 2.0i -->
+<!-- .ta 2.0i -->
+<!-- .sp -->
+Application Header file	&lt;X11/Xaw/SimpleMenu.h&gt;
+<indexterm><primary>SimpleMenu.h</primary></indexterm>
+Class Header file	&lt;X11/Xaw/SimpleMenP.h&gt;
+<indexterm><primary>SimpleMenP.h</primary></indexterm>
+Class		simpleMenuWidgetClass
+<indexterm><primary>simpleMenuWidgetClass</primary></indexterm>
+Class Name	SimpleMenu
+<indexterm><primary>SimpleMenu widget</primary><secondary>class name</secondary></indexterm>
+Superclass	OverrideShell
+<!-- .sp -->
+</literallayout>
+<para>
+<!-- .LP -->
+The SimpleMenu widget is a container for the menu entries.  It is a
+direct subclass of shell, and is should be created with
+<function>XtCreatePopupShell</function>, not <xref linkend='XtCreateManagedWidget' xrefstyle='select: title'/>.  This is the
+only part of the menu that
+actually is associated with a window.  The SimpleMenu serves as the glue to bind
+the individual menu entries together into a menu.
+</para>
+<sect2 id="SimpleMenu::Resources">
+<title>Resources</title>
+<para>
+<!-- .LP -->
+<indexterm><primary>SimpleMenu widget</primary><secondary>resources</secondary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+The resources associated with the SimpleMenu widget control aspects
+that will affect the entire menu.
+<informaltable>
+  <tgroup cols='5' align='center'>
+  <colspec colname='c1'/>
+  <colspec colname='c2'/>
+  <colspec colname='c3'/>
+  <colspec colname='c4'/>
+  <colspec colname='c5'/>
+  <thead>
+    <row>
+      <entry>Name</entry>
+      <entry>Class</entry>
+      <entry>Type</entry>
+      <entry>Notes</entry>
+      <entry>Default Value</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>accelerators</entry>
+      <entry>Accelerators</entry>
+      <entry>AcceleratorTable</entry>
+      <entry></entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>ancestorSensitive</entry>
+      <entry>AncestorSensitive</entry>
+      <entry>Boolean</entry>
+      <entry>D</entry>
+      <entry>True</entry>
+    </row>
+    <row>
+      <entry>allowShellResize</entry>
+      <entry>AllowShellResize</entry>
+      <entry>Boolean</entry>
+      <entry></entry>
+      <entry>True</entry>
+    </row>
+    <row>
+      <entry>background</entry>
+      <entry>Background</entry>
+      <entry>Pixel</entry>
+      <entry></entry>
+      <entry>XtDefaultBackground</entry>
+    </row>
+    <row>
+      <entry>backgroundPixmap</entry>
+      <entry>Pixmap</entry>
+      <entry>Pixmap</entry>
+      <entry></entry>
+      <entry>XtUnspecifiedPixmap</entry>
+    </row>
+    <row>
+      <entry>backingStore</entry>
+      <entry>BackingStore</entry>
+      <entry>BackingStore</entry>
+      <entry></entry>
+      <entry>see below</entry>
+    </row>
+    <row>
+      <entry>borderColor</entry>
+      <entry>BorderColor</entry>
+      <entry>Pixel</entry>
+      <entry></entry>
+      <entry>XtDefaultForeground</entry>
+    </row>
+    <row>
+      <entry>borderPixmap</entry>
+      <entry>Pixmap</entry>
+      <entry>Pixmap</entry>
+      <entry></entry>
+      <entry>XtUnspecifiedPixmap</entry>
+    </row>
+    <row>
+      <entry>borderWidth</entry>
+      <entry>BorderWidth</entry>
+      <entry>Dimension</entry>
+      <entry></entry>
+      <entry>1</entry>
+    </row>
+    <row>
+      <entry>bottomMargin</entry>
+      <entry>VerticalMargins</entry>
+      <entry>Dimension</entry>
+      <entry></entry>
+      <entry>0</entry>
+    </row>
+    <row>
+      <entry>children</entry>
+      <entry>ReadOnly</entry>
+      <entry>WidgetList</entry>
+      <entry>R</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>createPopupChildProc</entry>
+      <entry>CreatePopupChildProc</entry>
+      <entry>Function</entry>
+      <entry></entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>colormap</entry>
+      <entry>Colormap</entry>
+      <entry>Colormap</entry>
+      <entry></entry>
+      <entry>Parent's Colormap</entry>
+    </row>
+    <row>
+      <entry>cursor</entry>
+      <entry>Cursor</entry>
+      <entry>Cursor</entry>
+      <entry></entry>
+      <entry>None</entry>
+    </row>
+    <row>
+      <entry>depth</entry>
+      <entry>Depth</entry>
+      <entry>int</entry>
+      <entry>C</entry>
+      <entry>Parent's Depth</entry>
+    </row>
+    <row>
+      <entry>destroyCallback</entry>
+      <entry>Callback</entry>
+      <entry>XtCallbackList</entry>
+      <entry></entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>geometry</entry>
+      <entry>Geometry</entry>
+      <entry>String</entry>
+      <entry></entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>height</entry>
+      <entry>Height</entry>
+      <entry>Dimension</entry>
+      <entry></entry>
+      <entry>Enough space to contain all entries</entry>
+    </row>
+    <row>
+      <entry>label</entry>
+      <entry>Label</entry>
+      <entry>String</entry>
+      <entry></entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>labelClass</entry>
+      <entry>LabelClass</entry>
+      <entry>Pointer</entry>
+      <entry></entry>
+      <entry>SmeBSBObjectClass</entry>
+    </row>
+    <row>
+      <entry>mappedWhenManaged</entry>
+      <entry>MappedWhenManaged</entry>
+      <entry>Boolean</entry>
+      <entry></entry>
+      <entry>True</entry>
+    </row>
+    <row>
+      <entry>menuOnScreen</entry>
+      <entry>MenuOnScreen</entry>
+      <entry>Boolean</entry>
+      <entry></entry>
+      <entry>True</entry>
+    </row>
+    <row>
+      <entry>numChildren</entry>
+      <entry>ReadOnly</entry>
+      <entry>Cardinal</entry>
+      <entry>R</entry>
+      <entry>0</entry>
+    </row>
+    <row>
+      <entry>overrideRedirect</entry>
+      <entry>OverrideRedirect</entry>
+      <entry>Boolean</entry>
+      <entry></entry>
+      <entry>True</entry>
+    </row>
+    <row>
+      <entry>popdownCallback</entry>
+      <entry>Callback</entry>
+      <entry>XtCallbackList</entry>
+      <entry></entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>popupCallback</entry>
+      <entry>Callback</entry>
+      <entry>XtCallbackList</entry>
+      <entry></entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>popupOnEntry</entry>
+      <entry>PopupOnEntry</entry>
+      <entry>Widget</entry>
+      <entry>A</entry>
+      <entry>Label or first entry</entry>
+    </row>
+    <row>
+      <entry>rowHeight</entry>
+      <entry>RowHeight</entry>
+      <entry>Dimension</entry>
+      <entry></entry>
+      <entry>0</entry>
+    </row>
+    <row>
+      <entry>saveUnder</entry>
+      <entry>SaveUnder</entry>
+      <entry>Boolean</entry>
+      <entry></entry>
+      <entry>False</entry>
+    </row>
+    <row>
+      <entry>screen</entry>
+      <entry>Screen</entry>
+      <entry>Screen</entry>
+      <entry>R</entry>
+      <entry>Parent's Screen</entry>
+    </row>
+    <row>
+      <entry>sensitive</entry>
+      <entry>Sensitive</entry>
+      <entry>Boolean</entry>
+      <entry></entry>
+      <entry>True</entry>
+    </row>
+    <row>
+      <entry>topMargin</entry>
+      <entry>VerticalMargins</entry>
+      <entry>Dimension</entry>
+      <entry></entry>
+      <entry>0</entry>
+    </row>
+    <row>
+      <entry>translations</entry>
+      <entry>Translations</entry>
+      <entry>TranslationTable</entry>
+      <entry></entry>
+      <entry>See below</entry>
+    </row>
+    <row>
+      <entry>visual</entry>
+      <entry>Visual</entry>
+      <entry>Visual</entry>
+      <entry></entry>
+      <entry>CopyFromParent</entry>
+    </row>
+    <row>
+      <entry>width</entry>
+      <entry>Width</entry>
+      <entry>Dimension</entry>
+      <entry></entry>
+      <entry>Width of widest entry</entry>
+    </row>
+    <row>
+      <entry>x</entry>
+      <entry>Position</entry>
+      <entry>Position</entry>
+      <entry></entry>
+      <entry>0</entry>
+    </row>
+    <row>
+      <entry>y</entry>
+      <entry>Position</entry>
+      <entry>Position</entry>
+      <entry></entry>
+      <entry>0</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+<!-- .Ac -->
+<!-- .As -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <function>backingStore</function>
+    </term>
+    <listitem>
+      <para>
+<indexterm><primary>conversions</primary><secondary>BackingStore</secondary></indexterm>
+Determines what type of backing store will be used for the menu.  Legal
+values for this resource are <function>NotUseful</function>, <function>WhenMapped</function>, and
+<function>Always</function>.  These values are the backing-store integers defined in
+&lt;X11/X.h&gt;.
+<!-- .Rs "notUseful, whenMapped, always, \fPand\fP default" -->
+If <function>default</function> is specified (the default behavior) the server will use
+whatever it thinks is appropriate.
+<!-- .Bg -->
+<!-- .Gp -->
+<!-- .Bc -->
+<!-- .Bp -->
+<!-- .Bw -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <function>bottomMargin</function>
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <function>topMargin</function>
+    </term>
+    <listitem>
+      <para>
+The amount of space between the top or bottom of the menu and the menu entry
+closest to that edge.
+<!-- .Ch -->
+<!-- .Cm -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <function>cursor</function>
+    </term>
+    <listitem>
+      <para>
+The shape of the mouse pointer whenever it is in this widget.
+<!-- .Dp -->
+<!-- .Dc -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      geometry
+    </term>
+    <listitem>
+      <para>
+If this resource is specified it will override the x, y, width and
+height of this widget.  The format of this string is
+[&lt;<emphasis remap='I'>width</emphasis>&gt;x&lt;<emphasis remap='I'>height</emphasis>&gt;][{+ -} &lt;<emphasis remap='I'>xoffset</emphasis>&gt; {+ -}&lt;<emphasis remap='I'>yoffset</emphasis>&gt;].
+<!-- .Hw -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <function>label</function>
+    </term>
+    <listitem>
+      <para>
+This label will be placed at the top of the SimpleMenu, and may not be
+highlighted.  The name of the
+label object is <function>menuLabel</function>.  Using this name it is possible to
+modify the label's attributes through the resource database.  When the label
+is created, the <function>label</function> is hard coded to the value of <function>label</function>, and
+<function>justify</function> is hard coded as <function>XtJustifyCenter</function>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <function>labelClass</function>
+    </term>
+    <listitem>
+      <para>
+Specifies the type of Sme object created as the menu label.
+<!-- .Mm -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <function>menuOnScreen</function>
+    </term>
+    <listitem>
+      <para>
+If the menu is automatically positioned under the cursor with the
+<function>XawPositionSimpleMenu</function> action, and this resource is <function>True</function>,
+then the menu will always be fully visible on the screen.
+<!-- .Nc -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      overrideRedirect
+    </term>
+    <listitem>
+      <para>
+Determines the value of the override_redirect attribute of the
+SimpleMenu's window.  The override_redirect attribute of a window
+determines whether or not a window manager may interpose itself between
+this window and the root window of the display.  For more information
+see the 
+<citetitle>Interclient Communications Conventions Manual</citetitle>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      popdownCallback
+    </term>
+    <listitem>
+      <para>
+<!-- .br -->
+<!-- .ns -->
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      popupCallback
+    </term>
+    <listitem>
+      <para>
+These callback functions are called by the Xt Intrinsics whenever the
+shell is popped up or down (See <emphasis remap='I'>(xT</emphasis> for details).
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <function>popupOnEntry</function>
+    </term>
+    <listitem>
+      <para>
+The <function>XawPositionSimpleMenu</function> action will, by default, popup the
+SimpleMenu with its label (or first entry) directly under the
+pointer.  To popup the menu under
+another entry, set this resource to the menu entry that should be
+under the pointer, when the menu is popped up.  This allows the
+application to offer the user a default menu entry that can be selected
+with out moving the pointer.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <function>rowHeight</function>
+    </term>
+    <listitem>
+      <para>
+If this resources is zero (the default) then each menu entry will be
+given its desired height.  If this resource has any other value then
+all menu entries will be forced to be <function>rowHeight</function> pixels high.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      saveUnder
+    </term>
+    <listitem>
+      <para>
+If this is <function>True</function> then save unders will be active on the menu's window.
+<!-- .Sc -->
+<!-- .Se -->
+<!-- .Tr -->
+<!-- .Xy -->
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+</sect2>
+<sect2 id="SimpleMenu_Actions">
+<title>SimpleMenu Actions</title>
+<indexterm><primary>SimpleMenu widget</primary><secondary>actions</secondary></indexterm>
+<para>
+<!-- .LP -->
+The SimpleMenu widget supports the following actions:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Switching the entry under the mouse pointer between
+the foreground and background colors with <function>highlight</function>
+and <function>unhighlight</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Processing menu entry callbacks with <function>notify</function>
+<!-- .sp -->
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+<indexterm><primary>SimpleMenu widget</primary><secondary>default translations</secondary></indexterm>
+The following are the default translation bindings used
+by the SimpleMenu widget:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+<literallayout class="monospaced">
+<!-- .TA .5i 2.25i -->
+<!-- .ta .5i 2.25i -->
+	&lt;EnterWindow&gt;:	highlight(&#x2006;)
+	&lt;LeaveWindow&gt;:	unhighlight(&#x2006;)
+	&lt;BtnMotion&gt;:	highlight(&#x2006;)
+	&lt;BtnUp&gt;:	MenuPopdown(&#x2006;) notify(&#x2006;) unhighlight(&#x2006;)
+</literallayout>
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+<indexterm><primary>SimpleMenu widget</primary><secondary>MenuPopdown routine</secondary></indexterm>
+The user can pop down the menu without activating any of the callback
+functions by releasing the pointer button when no menu item is
+highlighted.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+The full list of actions supported by SimpleMenu is:
+<variablelist>
+  <varlistentry>
+    <term>
+      <function>highlight</function>()
+    </term>
+    <listitem>
+      <para>
+Highlight the menu entry that is currently under the pointer.
+Only a item that is highlighted will be notified when the <function>notify</function>
+action is invoked.  The look of a highlighted entry is determined by
+the menu entry.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <function>unhighlight</function>(&#x2006;)
+    </term>
+    <listitem>
+      <para>
+Unhighlights the currently highlighted menu item, and returns it to
+its normal look.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <function>notify</function>(&#x2006;)
+    </term>
+    <listitem>
+      <para>
+Notifies the menu entry that is currently highlighted that is has been
+selected.  It is the responsibility of the menu entry to take the
+appropriate action.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <function>MenuPopdown</function>(<emphasis remap='I'>menu</emphasis>)
+    </term>
+    <listitem>
+      <para>
+This action is defined in <emphasis remap='I'>(xT</emphasis>.
+<indexterm><primary>SimpleMenu widget</primary><secondary>MenuPopdown routine</secondary></indexterm>
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+</sect2>
+<sect2 id="Positioning_the_SimpleMenu">
+<title>Positioning the SimpleMenu</title>
+<indexterm significance="preferred"><primary>XawPositionSimpleMenu</primary></indexterm>
+<indexterm significance="preferred"><primary>SimpleMenu widget</primary><secondary>positioning</secondary></indexterm>
+<para>
+<!-- .LP -->
+If the SimpleMenu widget is to be used as a pulldown menu then the
+MenuButton widget, or some other outside means should be used to place
+the menu when it is popped up.
+</para>
+<para>
+<!-- .LP -->
+If popup menus are desired it will be necessary to add the
+<function>XawPositionSimpleMenu</function> and <function>MenuPopup</function> actions to the
+translation table of the widget that will be popping up the menu.  The
+<function>MenuPopup</function> action is described in <emphasis remap='I'>(xT</emphasis>.
+<function>XawPositionSimpleMenu</function> is a global action procedure registered by
+the SimpleMenu widget when the first one is created or the convenience
+routine <xref linkend='XawSimpleMenuAddGlobalActions' xrefstyle='select: title'/> is called.
+</para>
+<para>
+<!-- .LP -->
+Translation writers should be aware that Xt does not register grabs on
+<quote>don't care</quote> modifiers, and therefore the left hand side of the
+production should be written to exclude unspecified modifiers.
+For example these are the translations needed to popup some of
+<function>xterm's</function> menus:
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i 2.25i -->
+<!-- .ta .5i 2.25i -->
+	!Ctrl&lt;Btn1Down&gt;: XawPositionSimpleMenu(xterm) MenuPopup(xterm)
+	!Ctrl&lt;Btn2Down&gt;: XawPositionSimpleMenu(modes) MenuPopup(modes)
+</literallayout>
+<!-- .sp 1 -->
+</para>
+<para>
+<!-- .LP -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <function>XawPositionSimpleMenu</function>(<emphasis remap='I'>menu</emphasis>)
+    </term>
+    <listitem>
+      <para>
+The <function>XawPositionSimpleMenu</function> routine will search for the menu name
+passed to it using <function>XtNameToWidget</function> starting with the widget
+invoking the action as the reference widget.  If it is unsuccessful it
+will continue up the widget tree using each of the invoking widget's
+ancestors as the reference widget.  If it is still unsuccessful it will
+print a warning message and give up.  <function>XawPositionSimpleMenu</function> will
+position the menu directly under the pointer cursor.  The menu will be
+placed so that the pointer cursor is centered on the entry named by the
+<function>popupOnEntry</function> resource.  If the <function>menuOnScreen</function> resource is
+<function>True</function> then the menu will always be fully visible on the screen.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+</sect2>
+<sect2 id="SimpleMenu::Convenience_Routines">
+<title>Convenience Routines</title>
+<sect3 id="Registering_the_Global_Action_Routines">
+<title>Registering the Global Action Routines</title>
+<para>
+<!-- .LP -->
+<indexterm><primary>XawPositionSimpleMenu</primary></indexterm>
+The <function>XawPositionSimpleMenu</function> action routine may often be invoked
+before any menus have been created.  This can occur when an
+application uses dynamic menu creation.  In these cases an application will
+need to register this global action routine by calling
+<xref linkend='XawSimpleMenuAddGlobalActions' xrefstyle='select: title'/>:
+<indexterm significance="preferred"><primary>XawSimpleMenuAddGlobalActions</primary></indexterm>
+<funcsynopsis id='XawSimpleMenuAddGlobalActions'>
+<funcprototype>
+  <funcdef>void<function> XawSimpleMenuAddGlobalActions</function></funcdef>
+  <paramdef>XtAppContext<parameter> app_con</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_con</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context in which this action should be registered.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+This function need only be called once per application and must be
+called before any widget that uses <function>XawPositionSimpleMenu</function> action
+is realized.
+</para>
+</sect3>
+<sect3 id="Getting_and_Clearing_the_Current_Menu_Entry">
+<title>Getting and Clearing the Current Menu Entry</title>
+<para>
+<!-- .LP -->
+To get the currently highlighted menu entry use
+<xref linkend='XawSimpleMenuGetActiveEntry' xrefstyle='select: title'/>:
+<indexterm significance="preferred"><primary>XawSimpleMenuGetActiveEntry</primary></indexterm>
+<funcsynopsis id='XawSimpleMenuGetActiveEntry'>
+<funcprototype>
+  <funcdef>Widget<function> XawSimpleMenuGetActiveEntry</function></funcdef>
+  <paramdef>Widget<parameter> w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the SimpleMenu widget.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+This function returns the menu entry that is
+currently highlighted, or NULL if no entry is highlighted.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To clear the SimpleMenu widget's internal information about the
+currently highlighted menu entry use
+<xref linkend='XawSimpleMenuClearActiveEntry' xrefstyle='select: title'/>:
+<indexterm significance="preferred"><primary>XawSimpleMenuClearActiveEntry</primary></indexterm>
+<funcsynopsis id='XawSimpleMenuClearActiveEntry'>
+<funcprototype>
+  <funcdef>Widget<function> XawSimpleMenuClearActiveEntry</function></funcdef>
+  <paramdef>Widget<parameter> w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the SimpleMenu widget.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+This function unsets all internal references to the currently
+highlighted menu entry.  It does not <emphasis remap='I'>unhighlight</emphasis> or otherwise
+alter the appearance of the active entry.  This function is primarily
+for use by implementors of menu entries.
+
+</para>
+</sect3>
+</sect2>
+</sect1>
Index: lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs/TextSink.xml
===================================================================
--- lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs/TextSink.xml	(nonexistent)
+++ lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs/TextSink.xml	(revision 5)
@@ -0,0 +1,917 @@
+<sect1 id="TextSink_Object">
+<title>TextSink Object</title>
+<para>
+<!-- .LP -->
+<!-- .XS -->
+<!-- 	TextSink Object -->
+<!-- .XE -->
+<indexterm significance="preferred"><primary>TextSink object</primary></indexterm>
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA 2.0i -->
+<!-- .ta 2.0i -->
+Application Header file	&lt;X11/Xaw/TextSink.h&gt;
+<indexterm><primary>TextSink.h</primary></indexterm>
+Class Header file	&lt;X11/Xaw/TextSinkP.h&gt;
+<indexterm><primary>TextSinkP.h</primary></indexterm>
+Class		textSinkObjectClass
+<indexterm><primary>textSinkObjectClass</primary></indexterm>
+Class Name	TextSink
+<indexterm><primary>TextSink object</primary><secondary>class name</secondary></indexterm>
+Superclass	Object
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+The TextSink object is the root object for all text sinks.  Any new text
+sink objects should be subclasses of the TextSink Object.  The TextSink
+Class contains all methods that the Text widget expects a text sink to
+export.
+</para>
+<para>
+<!-- .LP -->
+Since all text sinks will have some resources in common, the TextSink
+defines a few new resources.
+</para>
+<sect2 id='TextSink::Resources'>
+<title>Resources</title>
+<para>
+<!-- .LP -->
+When creating an TextSink object instance, the following resources are
+retrieved from the argument list or from the resource database:
+</para>
+<para>
+<!-- .LP -->
+<indexterm><primary>AsciiSink object</primary><secondary>resources</secondary></indexterm>
+<informaltable>
+  <tgroup cols='5' align='center'>
+  <colspec colname='c1'/>
+  <colspec colname='c2'/>
+  <colspec colname='c3'/>
+  <colspec colname='c4'/>
+  <colspec colname='c5'/>
+  <thead>
+    <row>
+      <entry>Name</entry>
+      <entry>Class</entry>
+      <entry>Type</entry>
+      <entry>Notes</entry>
+      <entry>Default Value</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>background</entry>
+      <entry>Background</entry>
+      <entry>Pixel</entry>
+      <entry></entry>
+      <entry>XtDefaultBackground</entry>
+    </row>
+    <row>
+      <entry>destroyCallback</entry>
+      <entry>Callback</entry>
+      <entry>XtCallbackList</entry>
+      <entry></entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>foreground</entry>
+      <entry>Foreground</entry>
+      <entry>Pixel</entry>
+      <entry></entry>
+      <entry>XtDefaultForeground</entry>
+    </row>
+    <row>
+      <entry>_</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+<!-- .Bg Bold -->
+<!-- .Dc -->
+<!-- .Sg Bold -->
+</para>
+</sect2>
+<sect2 id="Subclassing_the_TextSink">
+<title>Subclassing the TextSink</title>
+<indexterm significance="preferred"><primary>TextSink object</primary><secondary>subclassing</secondary></indexterm>
+<para>
+<!-- .LP -->
+The only purpose of the TextSink Object is to be subclassed.  It
+contains the minimum set of class methods that all text sinks must have.
+While all may be inherited, the direct descendant of TextSink <function>must
+specify</function> some of them as TextSink does contain enough information to
+be a valid text sink by itself.  Do not try to use
+the TextSink as a valid sink for the Text widget; it is not intended
+to be used as a sink by itself.
+<informaltable>
+  <tgroup cols='4' align='center'>
+  <colspec colname='c1'/>
+  <colspec colname='c2'/>
+  <colspec colname='c3'/>
+  <colspec colname='c4'/>
+  <thead>
+    <row>
+      <entry>Function</entry>
+      <entry>Inherit with</entry>
+      <entry>Public Interface</entry>
+      <entry>must specify</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>DisplayText</entry>
+      <entry>XtInheritDisplayText</entry>
+      <entry>XawTextSinkDisplayText</entry>
+      <entry>yes</entry>
+    </row>
+    <row>
+      <entry>InsertCursor</entry>
+      <entry>XtInheritInsertCursor</entry>
+      <entry>XawTextSinkInsertCursor</entry>
+      <entry>yes</entry>
+    </row>
+    <row>
+      <entry>ClearToBackground</entry>
+      <entry>XtInheritClearToBackground</entry>
+      <entry>XawTextSinkClearToBackground</entry>
+      <entry>no</entry>
+    </row>
+    <row>
+      <entry>FindPosition</entry>
+      <entry>XtInheritFindPosition</entry>
+      <entry>XawTextSinkFindPosition</entry>
+      <entry>yes</entry>
+    </row>
+    <row>
+      <entry>FindDistance</entry>
+      <entry>XtInheritFindDistance</entry>
+      <entry>XawTextSinkFindDistance</entry>
+      <entry>yes</entry>
+    </row>
+    <row>
+      <entry>Resolve</entry>
+      <entry>XtInheritResolve</entry>
+      <entry>XawTextSinkResolve</entry>
+      <entry>yes</entry>
+    </row>
+    <row>
+      <entry>MaxLines</entry>
+      <entry>XtInheritMaxLines</entry>
+      <entry>XawTextSinkMaxLines</entry>
+      <entry>no</entry>
+    </row>
+    <row>
+      <entry>MaxHeight</entry>
+      <entry>XtInheritMaxHeight</entry>
+      <entry>XawTextSinkMaxHeight</entry>
+      <entry>no</entry>
+    </row>
+    <row>
+      <entry>SetTabs</entry>
+      <entry>XtInheritSetTabs</entry>
+      <entry>XawTextSinkSetTabs</entry>
+      <entry>no</entry>
+    </row>
+    <row>
+      <entry>GetCursorBounds</entry>
+      <entry>XtInheritGetCursorBounds</entry>
+      <entry>XawTextSinkGetCursorBounds</entry>
+      <entry>yes</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+</para>
+<sect3 id="Displaying_Text">
+<title>Displaying Text</title>
+<para>
+<!-- .LP -->
+To display a section of the text buffer contained in the text source
+use the function <xref linkend='DisplayText' xrefstyle='select: title'/>:
+<indexterm significance="preferred"><primary>TextSink object</primary><secondary>DisplayText</secondary></indexterm>
+<funcsynopsis id='DisplayText'>
+<funcprototype>
+  <funcdef>void<function> DisplayText</function></funcdef>
+  <paramdef>Widget<parameter> w</parameter></paramdef>
+  <paramdef>Positionx,<parameter> y</parameter></paramdef>
+  <paramdef>XawTextPositionpos1,<parameter> pos2</parameter></paramdef>
+  <paramdef>Boolean<parameter> highlight</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the TextSink object.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the x location to start drawing the text.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the y location to start drawing text.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>pos1</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the location within the text source of the first character
+to be printed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>pos2</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the location within the text source of the last character
+to be printed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>highlight</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies whether or not to paint the text region highlighted.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+The Text widget will only pass one line at a time to the text sink, so
+this function does not need to know how to line feed the text.  It is
+acceptable for this function to just ignore Carriage Returns.  <emphasis remap='I'>x</emphasis>
+and <emphasis remap='I'>y</emphasis> denote the upper left hand corner of the first character to
+be displayed.
+</para>
+</sect3>
+<sect3 id="Displaying_the_Insert_Point">
+<title>Displaying the Insert Point</title>
+<para>
+<!-- .LP -->
+The function that controls the display of the text cursor is
+<xref linkend='InsertCursor' xrefstyle='select: title'/>.  This function will be called whenever the text
+widget desires to change the state of, or move the insert point.
+<funcsynopsis id='InsertCursor'>
+<funcprototype>
+  <funcdef>void<function> InsertCursor</function></funcdef>
+  <paramdef>Widget<parameter> w</parameter></paramdef>
+  <paramdef>Positionx,<parameter> y</parameter></paramdef>
+  <paramdef>XawTextInsertState<parameter> state</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the TextSink object.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the x location of the cursor in Pixels.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the y location of the cursor in Pixels.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>state</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the state of the cursor, may be one of <function>XawisOn</function> or
+<function>XawisOff</function>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<emphasis remap='I'>X</emphasis> and <emphasis remap='I'>y</emphasis> denote the upper left hand corner of the insert point.
+</para>
+</sect3>
+<sect3 id="Clearing_Portions_of_the_Text_window">
+<title>Clearing Portions of the Text window</title>
+<para>
+<!-- .LP -->
+To clear a portion of the Text window to its background color, the Text
+widget will call <xref linkend='ClearToBackground' xrefstyle='select: title'/>.  The TextSink object already
+defines this function as calling 
+<function>XClearArea</function>
+on the region passed.
+This behavior will be used if you specify
+<function>XtInheritClearToBackground</function> for this method.
+<indexterm><primary>XtInheritClearToBackground</primary></indexterm>
+<indexterm significance="preferred"><primary>TextSink object</primary><secondary>ClearToBackground</secondary></indexterm>
+<funcsynopsis id='ClearToBackground'>
+<funcprototype>
+  <funcdef>void<function> ClearToBackground</function></funcdef>
+  <paramdef>Widget<parameter> w</parameter></paramdef>
+  <paramdef>Positionx,<parameter> y</parameter></paramdef>
+  <paramdef>Dimensionwidth,<parameter> height</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the TextSink object.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the x location, in pixels, of the Region to clear.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the y location, in pixels, of the Region to clear.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the width, in pixels, of the Region to clear.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the height, in pixels, of the Region to clear.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<emphasis remap='I'>X</emphasis> and <emphasis remap='I'>y</emphasis> denote the upper left hand corner of region to clear.
+</para>
+</sect3>
+<sect3 id="Finding_a_Text_Position_Given_Pixel_Values">
+<title>Finding a Text Position Given Pixel Values</title>
+<para>
+<!-- .LP -->
+To find the text character position that will be rendered at a given x
+location the Text widget uses the function <xref linkend='FindPosition' xrefstyle='select: title'/>:
+<indexterm significance="preferred"><primary>TextSink object</primary><secondary>FindPosition</secondary></indexterm>
+<funcsynopsis id='FindPosition'>
+<funcprototype>
+  <funcdef>void<function> FindPosition</function></funcdef>
+  <paramdef>Widget<parameter> w</parameter></paramdef>
+  <paramdef>XawTextPosition<parameter> fromPos</parameter></paramdef>
+  <paramdef>intfromX,<parameter> width</parameter></paramdef>
+  <paramdef>Boolean<parameter> stopAtWordBreak</parameter></paramdef>
+  <paramdef>XawTextPosition<parameter> *pos_return</parameter></paramdef>
+  <paramdef>int*width_return,<parameter> *height_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the TextSink object.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>fromPos</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a reference position, usually the first character in this line.
+This character is always to the left of the desired character location.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>fromX</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the distance that the left edge of <emphasis remap='I'>fromPos</emphasis> is from the
+left edge of the window.  This is the reference x location for the
+reference position.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the distance, in pixels, from the reference position to the
+desired character position.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>stopAtWordBreak</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies whether or not the position that is returned should be forced
+to be on a word boundary.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>pos_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the character position that corresponds to the location that has
+been specified, or the work break immediately to the left of the
+position if <emphasis remap='I'>stopAtWordBreak</emphasis> is <function>True</function>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the actual distance between <emphasis remap='I'>fromPos</emphasis> and <emphasis remap='I'>pos_return</emphasis>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the maximum height of the text between <emphasis remap='I'>fromPos</emphasis> and
+<emphasis remap='I'>pos_return</emphasis>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+This function need make no attempt to deal with line feeds.  The text
+widget will only call it one line at a time.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+Another means of finding a text position is provided by the <xref linkend='Resolve' xrefstyle='select: title'/>
+function:
+<indexterm significance="preferred"><primary>TextSink object</primary><secondary>Resolve</secondary></indexterm>
+<funcsynopsis id='Resolve'>
+<funcprototype>
+  <funcdef>void<function> Resolve</function></funcdef>
+  <paramdef>Widget<parameter> w</parameter></paramdef>
+  <paramdef>XawTextPosition<parameter> fromPos</parameter></paramdef>
+  <paramdef>intfromX,<parameter> width</parameter></paramdef>
+  <paramdef>XawTextPosition<parameter> *pos_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the TextSink object.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>fromPos</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a reference position, usually the first character in this line.
+This character is always to the left of the desired character location.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>fromX</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the distance that the left edge of <emphasis remap='I'>fromPos</emphasis> is from the
+left edge of the window.  This is the reference x location for the
+reference position.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the distance, in pixels, from the reference position to the
+desired character position.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>pos_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the character position that corresponds to the
+location that has been specified, or the word break immediately to the left
+if <emphasis remap='I'>stopAtWordBreak</emphasis> is <function>True</function>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+This function need make no attempt to deal with line feeds.  The text
+widget will only call it one line at a time.  This is a more convenient
+interface to the <xref linkend='FindPosition' xrefstyle='select: title'/> function, and provides a subset of its
+functionality.
+<indexterm><primary>FindPosition</primary></indexterm>
+</para>
+</sect3>
+<sect3 id="Finding_the_Distance_Between_two_Text_Positions">
+<title>Finding the Distance Between two Text Positions</title>
+<para>
+<!-- .LP -->
+To find the distance in pixels between two text positions on the same
+line use the function <xref linkend='FindDistance' xrefstyle='select: title'/>.
+<indexterm significance="preferred"><primary>TextSink object</primary><secondary>FindDistance</secondary></indexterm>
+<funcsynopsis id='FindDistance'>
+<funcprototype>
+  <funcdef>void<function> FindDistance</function></funcdef>
+  <paramdef>Widget<parameter> w</parameter></paramdef>
+  <paramdef>XawTextPositionfromPos,<parameter> toPos</parameter></paramdef>
+  <paramdef>int<parameter> fromX</parameter></paramdef>
+  <paramdef>XawTextPosition<parameter> *pos_return</parameter></paramdef>
+  <paramdef>int*width_return,<parameter> *height_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the TextSink object.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>fromPos</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the text buffer position, in characters, of the first position.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>fromX</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the distance that the left edge of <emphasis remap='I'>fromPos</emphasis> is from the
+left edge of the window.  This is the reference x location for the
+reference position.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>toPos</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the text buffer position, in characters, of the second position.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>resWidth</emphasis>
+    </term>
+    <listitem>
+      <para>
+Return the actual distance between <emphasis remap='I'>fromPos</emphasis>
+and <emphasis remap='I'>pos_return</emphasis>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>resPos</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the character position that corresponds to the actual character
+position used for <emphasis remap='I'>toPos</emphasis> in the calculations.  This may be
+different than <emphasis remap='I'>toPos</emphasis>, for example if <emphasis remap='I'>fromPos</emphasis> and <emphasis remap='I'>toPos</emphasis>
+are on different lines in the file.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the maximum height of the text between <emphasis remap='I'>fromPos</emphasis> and
+<emphasis remap='I'>pos_return</emphasis>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+This function need make no attempt to deal with line feeds.  The Text
+widget will only call it one line at a time.
+</para>
+</sect3>
+<sect3 id="Finding_the_Size_of_the_Drawing_area">
+<title>Finding the Size of the Drawing area</title>
+<para>
+<!-- .LP -->
+To find the maximum number of lines that will fit into the current Text
+widget, use the function <xref linkend='MaxLines' xrefstyle='select: title'/>.  The TextSink already defines
+this function to compute the maximum number of lines by using the height
+of <function>font</function>.
+<indexterm significance="preferred"><primary>TextSink object</primary><secondary>MaxLines</secondary></indexterm>
+<funcsynopsis id='MaxLines'>
+<funcprototype>
+  <funcdef>int<function> MaxLines</function></funcdef>
+  <paramdef>Widget<parameter> w</parameter></paramdef>
+  <paramdef>Dimension<parameter> height</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the TextSink object.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the height of the current drawing area.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+Returns the maximum number of lines that will fit in <emphasis remap='I'>height</emphasis>.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sp -->
+To find the height required for a given number of text lines, use
+the function <xref linkend='MaxHeight' xrefstyle='select: title'/>.  The TextSink already defines this
+function to compute the maximum height of the window by using the
+height of <function>font</function>.
+<indexterm significance="preferred"><primary>TextSink object</primary><secondary>MaxHeight</secondary></indexterm>
+<funcsynopsis id='MaxHeight'>
+<funcprototype>
+  <funcdef>int<function> MaxHeight</function></funcdef>
+  <paramdef>Widget<parameter> w</parameter></paramdef>
+  <paramdef>int<parameter> lines</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the TextSink object.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the height of the current drawing area.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+Returns the height that will be taken up by the number of lines passed.
+</para>
+</sect3>
+<sect3 id="Setting_the_Tab_Stops">
+<title>Setting the Tab Stops</title>
+<para>
+<!-- .LP -->
+To set the tab stops for a text sink use the <xref linkend='SetTabs' xrefstyle='select: title'/> function.
+The TextSink already defines this function to set the tab x location in
+pixels to be the number of characters times the figure width of
+<function>font</function>.
+<indexterm significance="preferred"><primary>TextSink object</primary><secondary>SetTabs</secondary></indexterm>
+<funcsynopsis id='SetTabs'>
+<funcprototype>
+  <funcdef>void<function> SetTabs</function></funcdef>
+  <paramdef>Widget<parameter> w</parameter></paramdef>
+  <paramdef>inttab_count,<parameter> *tabs</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the TextSink object.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>tab_count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of tabs passed in <emphasis remap='I'>tabs</emphasis>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>tabs</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the position, in characters, of the tab stops.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+This function is responsible for the converting character positions passed
+to it into whatever internal positions the TextSink uses for tab placement.
+</para>
+</sect3>
+<sect3 id='Getting_the_Insert_Points_Size_and_Location'>
+<title>Getting the Insert Point's Size and Location</title>
+<para>
+<!-- .LP -->
+To get the size and location of the insert point use the
+<xref linkend='GetCursorBounds' xrefstyle='select: title'/> function.
+<indexterm significance="preferred"><primary>TextSink object</primary><secondary>GetCursorBounds</secondary></indexterm>
+<funcsynopsis id='GetCursorBounds'>
+<funcprototype>
+  <funcdef>void<function> GetCursorBounds</function></funcdef>
+  <paramdef>Widget<parameter> w</parameter></paramdef>
+  <paramdef>XRectangle<parameter> *rect_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the TextSinkObject.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>rect_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the location and size of the insert point.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<emphasis remap='I'>Rect</emphasis> will be filled with the current size and location of the
+insert point.
+
+</para>
+</sect3>
+</sect2>
+</sect1>
Index: lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs
===================================================================
--- lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs	(nonexistent)
+++ lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs	(revision 5)

Property changes on: lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new/specs
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new
===================================================================
--- lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new	(nonexistent)
+++ lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new	(revision 5)

Property changes on: lib/libXaw/create-1.0.14-docbook-patch/libXaw-1.0.14-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXaw/create-1.0.14-docbook-patch
===================================================================
--- lib/libXaw/create-1.0.14-docbook-patch	(nonexistent)
+++ lib/libXaw/create-1.0.14-docbook-patch	(revision 5)

Property changes on: lib/libXaw/create-1.0.14-docbook-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXaw/patches/README
===================================================================
--- lib/libXaw/patches/README	(nonexistent)
+++ lib/libXaw/patches/README	(revision 5)
@@ -0,0 +1,6 @@
+
+/* begin *
+
+   TODO: Leave some comment here.
+
+ * end */
Index: lib/libXaw/patches
===================================================================
--- lib/libXaw/patches	(nonexistent)
+++ lib/libXaw/patches	(revision 5)

Property changes on: lib/libXaw/patches
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXaw
===================================================================
--- lib/libXaw	(nonexistent)
+++ lib/libXaw	(revision 5)

Property changes on: lib/libXaw
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXaw3d/Makefile
===================================================================
--- lib/libXaw3d/Makefile	(nonexistent)
+++ lib/libXaw3d/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXaw3d
+
+versions    = 1.6.4
+pkgname     = libXaw3d
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXaw3d
===================================================================
--- lib/libXaw3d	(nonexistent)
+++ lib/libXaw3d	(revision 5)

Property changes on: lib/libXaw3d
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXcm/Makefile
===================================================================
--- lib/libXcm/Makefile	(nonexistent)
+++ lib/libXcm/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXcm
+
+versions    = 0.5.4
+pkgname     = libXcm
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXcm
===================================================================
--- lib/libXcm	(nonexistent)
+++ lib/libXcm	(revision 5)

Property changes on: lib/libXcm
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXcomposite/Makefile
===================================================================
--- lib/libXcomposite/Makefile	(nonexistent)
+++ lib/libXcomposite/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXcomposite
+
+versions    = 0.4.6
+pkgname     = libXcomposite
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXcomposite
===================================================================
--- lib/libXcomposite	(nonexistent)
+++ lib/libXcomposite	(revision 5)

Property changes on: lib/libXcomposite
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXcursor/Makefile
===================================================================
--- lib/libXcursor/Makefile	(nonexistent)
+++ lib/libXcursor/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXcursor
+
+versions    = 1.2.1
+pkgname     = libXcursor
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXcursor
===================================================================
--- lib/libXcursor	(nonexistent)
+++ lib/libXcursor	(revision 5)

Property changes on: lib/libXcursor
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXdamage/Makefile
===================================================================
--- lib/libXdamage/Makefile	(nonexistent)
+++ lib/libXdamage/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXdamage
+
+versions    = 1.1.6
+pkgname     = libXdamage
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXdamage
===================================================================
--- lib/libXdamage	(nonexistent)
+++ lib/libXdamage	(revision 5)

Property changes on: lib/libXdamage
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXdmcp/Makefile
===================================================================
--- lib/libXdmcp/Makefile	(nonexistent)
+++ lib/libXdmcp/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXdmcp
+
+versions    = 1.1.4
+pkgname     = libXdmcp
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXdmcp
===================================================================
--- lib/libXdmcp	(nonexistent)
+++ lib/libXdmcp	(revision 5)

Property changes on: lib/libXdmcp
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXevie/Makefile
===================================================================
--- lib/libXevie/Makefile	(nonexistent)
+++ lib/libXevie/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXevie
+
+versions    = 1.0.3
+pkgname     = libXevie
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXevie
===================================================================
--- lib/libXevie	(nonexistent)
+++ lib/libXevie	(revision 5)

Property changes on: lib/libXevie
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXext/Makefile
===================================================================
--- lib/libXext/Makefile	(nonexistent)
+++ lib/libXext/Makefile	(revision 5)
@@ -0,0 +1,56 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXext
+
+versions    = 1.3.5
+pkgname     = libXext
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+patches     = $(CURDIR)/patches/libXext-1.3.5-docbook.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-1.3.5-docbook-patch ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s) $(patches)
Index: lib/libXext/create-1.3.5-docbook-patch/create.patch.sh
===================================================================
--- lib/libXext/create-1.3.5-docbook-patch/create.patch.sh	(nonexistent)
+++ lib/libXext/create-1.3.5-docbook-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=1.3.5
+
+tar --files-from=file.list -xJvf ../libXext-$VERSION.tar.xz
+mv libXext-$VERSION libXext-$VERSION-orig
+
+cp -rf ./libXext-$VERSION-new ./libXext-$VERSION
+
+diff --unified -Nr  libXext-$VERSION-orig  libXext-$VERSION > libXext-$VERSION-docbook.patch
+
+mv libXext-$VERSION-docbook.patch ../patches
+
+rm -rf ./libXext-$VERSION
+rm -rf ./libXext-$VERSION-orig

Property changes on: lib/libXext/create-1.3.5-docbook-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: lib/libXext/create-1.3.5-docbook-patch/file.list
===================================================================
--- lib/libXext/create-1.3.5-docbook-patch/file.list	(nonexistent)
+++ lib/libXext/create-1.3.5-docbook-patch/file.list	(revision 5)
@@ -0,0 +1,2 @@
+libXext-1.3.5/specs/dbelib.xml
+libXext-1.3.5/specs/shapelib.xml
Index: lib/libXext/create-1.3.5-docbook-patch/libXext-1.3.5-new/specs/dbelib.xml
===================================================================
--- lib/libXext/create-1.3.5-docbook-patch/libXext-1.3.5-new/specs/dbelib.xml	(nonexistent)
+++ lib/libXext/create-1.3.5-docbook-patch/libXext-1.3.5-new/specs/dbelib.xml	(revision 5)
@@ -0,0 +1,741 @@
+<?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"
+[
+<!ENTITY % defs SYSTEM "defs.ent"> %defs;
+]>
+
+
+<!-- lifted from troff+ms+XMan by doclifter -->
+<book id="dbelib">
+
+<bookinfo>
+   <title>Double Buffer Extension Library</title>
+   <subtitle>X Consortium Standard</subtitle>
+   <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
+   <releaseinfo>Version 1.0</releaseinfo>
+   <authorgroup>
+      <author>
+         <firstname>Ian</firstname><surname>Elliot</surname>
+         <affiliation><orgname>Hewlett-Packard Company</orgname></affiliation>
+      </author>
+      <othercredit>
+         <firstname>David</firstname><othername>P.</othername><surname>Wiggins</surname>
+         <affiliation><orgname>X Consortium, Inc</orgname></affiliation>
+      </othercredit>
+   </authorgroup>
+   <copyright><year>1989</year>
+     <holder>X Consortium Inc</holder>
+     <holder>Digital Equipment Corporation</holder>
+   </copyright>
+   <copyright><year>1992</year>
+     <holder>X Consortium Inc</holder>
+     <holder>Intergraph Corporation</holder>
+   </copyright>
+   <copyright><year>1993</year>
+     <holder>X Consortium Inc</holder>
+     <holder>Silicon Graphics, Inc.</holder>
+   </copyright>
+   <copyright><year>1994</year><year>1995</year>
+     <holder>X Consortium Inc</holder>
+     <holder>Hewlett-Packard Company</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. 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 CreateWindow 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.
+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 ClearArea 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
+<function>DRAWABLE</function> is
+unchanged by this extension. The window and front buffer are synonymous
+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 window’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 IncludeInferiors, 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 window’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 window’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.
+If the core GetGeometry 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 remap='Ds'>
+        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>
+<function>DBEBeginIdiom</function> 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 <function>PolyFillRectangle</function> request to the back buffer of one window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Core X <function>PolyFillRectangle</function> request to the back buffer of the other
+window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>DBEEndIdiom</function> 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 <function>Copied</function> 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 <function>Untouched</function>, and if a
+<function>PolyFillRectangle</function> using a client clip
+rectangle is done to the window’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='C_Language_Binding'>
+<title>C Language Binding</title>
+<para>
+All identifier The header for this extension is &lt;X11/extensions/Xdbe.h&gt;.
+names provided by this header begin with Xdbe.
+</para>
+
+<sect1 id='Types'>
+<title>Types</title>
+
+<para>
+The type <function>XdbeBackBuffer</function> is a <function>Drawable</function>.
+</para>
+
+<para>
+The type <function>XdbeSwapAction</function> can be one of the constants
+<function>XdbeUndefined</function>,
+<function>XdbeBackground</function>,
+<function>XdbeUntouched</function>, or
+<function>XdbeCopied</function>.
+</para>
+
+</sect1>
+
+<sect1 id='C_Functions'>
+<title>C Functions</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 replacing Xdbe at the
+start of the function name with DBE. All functions that have return type
+<function>Status</function> will return nonzero for success and
+zero for failure.
+</para>
+
+<funcsynopsis id='XdbeQueryExtension'>
+<funcprototype>
+  <funcdef>Status <function>XdbeQueryExtension</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>XdbeQueryExtension</function> sets major version return and minor
+version return to the major and minor DBE protocol version supported by
+the server. If the DBE library is compatible with the version returned by
+the server, it returns nonzero. If dpy does not support the DBE 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 Xdbe functions may be called before this function. If a client
+violates this rule, the effects of all subsequent Xdbe calls that it makes
+are undefined.
+</para>
+
+<funcsynopsis id='XdbeGetVisualInfo'>
+<funcprototype>
+  <funcdef>XdbeScreenVisualInfo *<function>XdbeGetVisualInfo</function></funcdef>
+    <paramdef>Display <parameter> *dpy</parameter></paramdef>
+    <paramdef>Drawable <parameter> *screen_specifiers</parameter></paramdef>
+    <paramdef>int <parameter> *num_screens</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+
+<function>XdbeGetVisualInfo</function> returns information about which
+visuals support double buffering. The argument num_screens specifies how
+many elements there are in the screen_specifiers list. Each drawable in
+screen_specifiers designates a screen for which the supported visuals are
+being requested. If num_screens is zero, information for all screens is
+requested. In this case, upon return from this function, num_screens will
+be set to the number of screens that were found. If an error occurs,
+this function returns NULL; otherwise, it returns a pointer to a list of
+<function>XdbeScreenVisualInfo</function>
+structures of length num_screens.  The nth element in the returned list
+corresponds to the nth drawable in the screen_specifiers list, unless
+
+element in the returned list corresponds to the nth screen of the server,
+starting with screen zero.
+</para>
+
+
+<para>
+The XdbeScreenVisualInfo structure has the following fields:
+</para>
+<literallayout remap='Ds'>
+int                     count      number of items in visinfo
+XdbeVisualInfo*    visinfo     list of visuals and depths for this screen
+</literallayout>
+
+<para>
+The <function>XdbeVisualInfo</function> structure has the following fields:
+</para>
+
+<literallayout remap='Ds'>
+VisualID         visual    one visual ID that supports double-buffering
+int              depth     depth of visual in bits
+int              perflevel  performance level of visual
+</literallayout>
+
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>void XdbeFreeVisualInfo <function>XdbeGetVisualInfo</function></funcdef>
+    <paramdef>XdbeScreenVisualInfo <parameter> *visual_info</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+<function>XdbeFreeVisualInfo</function> frees the list of
+<function>XdbeScreenVisualInfo</function> returned by
+<function>XdbeGetVisualInfo</function>.
+</para>
+
+
+<funcsynopsis id='XdbeAllocateBackBufferName'>
+<funcprototype>
+  <funcdef>XdbeBackBuffer <function>XdbeAllocateBackBufferName</function></funcdef>
+    <paramdef>Display <parameter> *dpy</parameter></paramdef>
+    <paramdef>Window <parameter> *window</parameter></paramdef>
+    <paramdef>XdbeSwapAction <parameter> swap_action</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+
+<para>
+<function>XdbeAllocateBackBufferName</function> returns a drawable ID used
+to refer to the back buffer of the specified window. The swap_action is a
+hint to indicate the swap_action that will likely be used in subsequent
+calls to <function>XdbeSwapBuffers</function>.  The actual swap_action
+used in calls to <function>XdbeSwapBuffers</function> does not have to be
+the same as the swap_action passed to this function, though clients are
+encouraged to provide accurate information whenever possible.
+</para>
+
+<funcsynopsis id='XdbeDeallocateBackBufferName'>
+<funcprototype>
+  <funcdef>Status <function>XdbeDeallocateBackBufferName</function></funcdef>
+    <paramdef>Display <parameter> *dpy</parameter></paramdef>
+    <paramdef>XdbeBackBuffer <parameter> buffer</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+<function>XdbeDeallocateBackBufferName</function> frees the specified
+drawable ID, buffer, that was obtained via
+<function>XdbeAllocateBackBufferName</function>. The buffer must be a valid
+name for the back buffer of a window, or an
+<function>XdbeBadBuffer</function> error results.
+</para>
+
+<funcsynopsis id='XdbeSwapBuffers'>
+<funcprototype>
+  <funcdef>Status <function>XdbeSwapBuffers</function></funcdef>
+    <paramdef>Display <parameter> *dpy</parameter></paramdef>
+    <paramdef>XdbeSwapInfo <parameter> *swap_info</parameter></paramdef>
+    <paramdef>int <parameter> num_windows</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+<function>XdbeSwapBuffers</function> swaps the front and back buffers
+for a list of windows. The argument num_windows specifies how many windows
+are to have their buffers swapped; it is the number of elements in the
+swap_info array. The argument swap_info specifies the information needed
+per window to do the swap.
+</para>
+<para>
+The XdbeSwapInfo structure has the following fields:
+</para>
+
+<literallayout remap='Ds'>
+Window              swap_window    window for which to swap buffers
+XdbeSwapAction      swap_action    swap action to use for this swap window
+</literallayout>
+
+<funcsynopsis id='XdbeBeginIdiom'>
+<funcprototype>
+  <funcdef>Status <function>XdbeBeginIdiom</function></funcdef>
+    <paramdef>Display <parameter> *dpy</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+<function>XdbeBeginIdiom</function> marks the beginning of an idiom
+sequence. See
+<link linkend='Complex_Swap_Actions'>
+<xref linkend='Complex_Swap_Actions'></xref></link>
+for a complete discussion of idioms.
+</para>
+
+<funcsynopsis id='XdbeEndIdiom'>
+<funcprototype>
+  <funcdef>Status <function>XdbeEndIdiom</function></funcdef>
+    <paramdef>Display <parameter> *dpy</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+<function>XdbeEndIdiom</function> marks the end of an idiom sequence.
+</para>
+
+<funcsynopsis id='XdbeGetBackBufferAttributes'>
+<funcprototype>
+  <funcdef>XdbeBackBufferAttributes *<function>XdbeGetBackBufferAttributes</function></funcdef>
+    <paramdef>Display <parameter> *dpy</parameter></paramdef>
+    <paramdef>XdbeBackBuffer <parameter> buffer</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+<function>XdbeGetBackBufferAttributes</function> returns the attributes associated with
+the specified buffer.
+</para>
+<para>
+The XdbeBackBufferAttributes structure has the following fields:
+</para>
+
+<literallayout remap='Ds'>
+Window           window           window that buffer belongs to
+</literallayout>
+
+<para>
+If buffer is not a valid <function>XdbeBackBuffer</function>, window is
+set to None.
+</para>
+<para>
+The returned <function>XdbeBackBufferAttributes</function> structure
+can be freed with the Xlib function <function>XFree</function>.
+</para>
+</sect1>
+
+<sect1 id='Errors'>
+<title>Errors</title>
+<para>
+The <function>XdbeBufferError</function> structure has the following fields:
+</para>
+<literallayout remap='Ds'>
+int                 type
+Display *           display       Display the event was read from
+XdbeBackBuffer      buffer        resource id
+unsigned long       serial        serial number of failed request
+unsigned char       error code    error base + <function>XdbeBadBuffer</function>
+unsigned char       request code  Major op-code of failed request
+unsigned char       minor code    Minor op-code of failed request
+</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>
Index: lib/libXext/create-1.3.5-docbook-patch/libXext-1.3.5-new/specs/shapelib.xml
===================================================================
--- lib/libXext/create-1.3.5-docbook-patch/libXext-1.3.5-new/specs/shapelib.xml	(nonexistent)
+++ lib/libXext/create-1.3.5-docbook-patch/libXext-1.3.5-new/specs/shapelib.xml	(revision 5)
@@ -0,0 +1,577 @@
+<?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"
+[
+<!ENTITY % defs SYSTEM "defs.ent"> %defs;
+]>
+
+<!-- lifted from troff+ms+XMan by doclifter -->
+<book id="shapelib">
+
+<bookinfo>
+   <title>X Nonrectangular Window Shape Extension Library</title>
+   <subtitle>X Consortium Standard</subtitle>
+   <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
+   <releaseinfo>Version 1.0</releaseinfo>
+   <authorgroup>
+      <author>
+         <firstname>Keith</firstname><surname>Packard</surname>
+         <affiliation><orgname>MIT X Consortium</orgname></affiliation>
+      </author>
+   </authorgroup>
+   <copyright><year>1989</year><holder>X Consortium</holder></copyright>
+
+<legalnotice>
+
+<para>
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files
+(the &ldquo;Software&rdquo;), 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>
+<para>X Window System is a trademark of The OpenGroup.</para>
+</legalnotice>
+</bookinfo>
+
+<chapter id='overview'>
+<title>Overview</title>
+
+<para>This extension provides arbitrary window and border shapes within
+the X11 protocol.
+</para>
+
+<para>
+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
+&ldquo;drop shadow&rdquo; 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>
+This extension provides mechanisms for changing the visible shape of a
+window to an arbitrary, possibly disjoint, nonrectangular form.  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>
+</chapter>
+
+<chapter id='description'>
+<title>Description</title>
+
+<para>
+Each window (even with no shapes specified) is defined by two regions:  the
+bounding region
+and the
+clip region.
+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.
+</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).  In this document,
+these areas are referred to as the
+default bounding region and the
+default clip region.  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 and clip
+regions are the rectangles (relative to the window origin):
+</para>
+
+<literallayout remap='Ds'>
+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>
+</literallayout>
+
+<para>
+This extension allows a client to modify either or both of the bounding or
+clip regions by specifying new regions that combine with the default
+regions.  These new regions are called the
+client bounding region and the
+client clip region.  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 effective bounding region 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 effective clip region 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>
+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>An InputOnly window can have its bounding region set, but it is a
+Match error to attempt to set a clip region on an
+InputOnly window or to specify its clip region as a source to a request
+in this extension.
+</para>
+
+<para>
+The server must accept changes to the clip region 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>
+</chapter>
+
+<chapter id='c_language_binding'>
+<title>C Language Binding</title>
+
+<para>
+The C functions provide direct access to the protocol and add no additional
+semantics.
+</para>
+
+<para>The include file for this extension is
+&lt;<symbol role='Pn'>X11/extensions/shape.h</symbol>&gt;.
+The defined shape kinds are
+<function>ShapeBounding</function>
+and
+<function>ShapeClip</function>
+The defined region operations are
+<function>ShapeSet</function>
+<function>ShapeUnion</function>
+<function>ShapeIntersect</function>
+<function>ShapeSubtract</function>
+and
+<function>ShapeInvert</function>.</para>
+
+<funcsynopsis id='xshapequeryextension'>
+<funcprototype>
+<funcdef>Bool<function> XShapeQueryExtension</function></funcdef>
+<paramdef>Display <parameter>*display</parameter></paramdef>
+<paramdef>int <parameter>*event_base</parameter></paramdef>
+<paramdef>int <parameter>*error_base</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+<function>XShapeQueryExtension</function>
+returns
+<function>True</function>
+if the specified display supports the SHAPE extension else
+<function>False</function>
+If the extension is supported, *event_base is set to the event number for
+<function>ShapeNotify</function>
+events and *error_base would be set to the error number for the first error for
+this extension.  Because no errors are defined for this version of
+the extension, the value returned here is not defined (nor useful).
+</para>
+
+<funcsynopsis id='xshapequeryversion'>
+<funcprototype>
+<funcdef>Status<function> XShapeQueryVersion</function></funcdef>
+<paramdef>Display<parameter> *display</parameter></paramdef>
+<paramdef>int<parameter> *major_version</parameter></paramdef>
+<paramdef>int<parameter> *minor_version</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+If the extension is supported,
+<function>XShapeQueryVersion</function>
+sets the major and minor version numbers of the
+extension supported by the display and returns a nonzero value.
+Otherwise, the arguments are not set and zero is returned.
+</para>
+
+<funcsynopsis id='xshapecombineregion'>
+<funcprototype>
+<funcdef><function>XShapeCombineRegion</function></funcdef>
+<paramdef>Display<parameter> *display</parameter></paramdef>
+<paramdef>Window<parameter> dest</parameter></paramdef>
+<paramdef>int<parameter> dest_kind</parameter></paramdef>
+<paramdef>int<parameter> x_off</parameter></paramdef>
+<paramdef>int<parameter> y_off</parameter></paramdef>
+<paramdef>int<parameter> region</parameter></paramdef>
+<paramdef>int<parameter> op</parameter></paramdef>
+<paramdef>REGION<parameter> *region</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+<function>XShapeCombineRegion</function>
+converts the specified region into a list of rectangles and calls
+<function>XShapeCombineRectangles</function>
+</para>
+
+<funcsynopsis id='xshapecombinerectangles'>
+<funcprototype>
+<funcdef><function>XShapeCombineRectangles</function></funcdef>
+<paramdef>Display<parameter> *display</parameter></paramdef>
+<paramdef>Window<parameter> dest</parameter></paramdef>
+<paramdef>int<parameter> dest_kind</parameter></paramdef>
+<paramdef>int<parameter> x_off</parameter></paramdef>
+<paramdef>int<parameter> y_off</parameter></paramdef>
+<paramdef>XRectangle<parameter> *rectangles</parameter></paramdef>
+<paramdef>int<parameter> n_rects</parameter></paramdef>
+<paramdef>int<parameter> op</parameter></paramdef>
+<paramdef>int<parameter> ordering</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+If the extension is supported,
+<function>XShapeCombineRectangles</function>
+performs a
+<function>ShapeRectangles</function>
+operation; otherwise, the request is ignored.
+</para>
+
+<funcsynopsis id='xshapecombinemask'>
+<funcprototype>
+<funcdef><function>XShapeCombineMask</function></funcdef>
+<paramdef>Display<parameter> *display</parameter></paramdef>
+<paramdef>int<parameter> dest</parameter></paramdef>
+<paramdef>int<parameter> dest_kind</parameter></paramdef>
+<paramdef>int<parameter> x_off</parameter></paramdef>
+<paramdef>int<parameter> y_off</parameter></paramdef>
+<paramdef>Pixmap<parameter> src</parameter></paramdef>
+<paramdef>int<parameter> op</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+If the extension is supported,
+<function>XShapeCombineMask</function>
+performs a
+<function>ShapeMask</function>
+operation; otherwise, the request is ignored.
+</para>
+
+<funcsynopsis id='xshapecombineshape'>
+<funcprototype>
+<funcdef><function>XShapeCombineShape</function></funcdef>
+<paramdef>Display<parameter> *display</parameter></paramdef>
+<paramdef>Window<parameter> dest</parameter></paramdef>
+<paramdef>int<parameter> dest_kind</parameter></paramdef>
+<paramdef>int<parameter> x_off</parameter></paramdef>
+<paramdef>int<parameter> y_off</parameter></paramdef>
+<paramdef>Window<parameter> src</parameter></paramdef>
+<paramdef>int<parameter> src_kind</parameter></paramdef>
+<paramdef>int<parameter> op</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+If the extension is supported,
+<function>XShapeCombineShape</function>
+performs a
+<function>ShapeCombine</function>
+operation; otherwise, the request is ignored.
+</para>
+
+<funcsynopsis id='xshapeoffsetshape'>
+<funcprototype>
+<funcdef><function>XShapeOffsetShape</function></funcdef>
+<paramdef><parameter>display</parameter></paramdef>
+<paramdef><parameter>dest</parameter></paramdef>
+<paramdef><parameter>dest_kind</parameter></paramdef>
+<paramdef><parameter>x_off</parameter></paramdef>
+<paramdef><parameter>y_off</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+If the extension is supported,
+<function>XShapeOffsetShape</function>
+performs a
+<function>ShapeOffset</function>
+operation; otherwise, the request is ignored.
+</para>
+
+<funcsynopsis id='xshapequeryextents'>
+<funcprototype>
+<funcdef>Status <function>XShapeQueryExtents</function></funcdef>
+<paramdef>Display<parameter> *display</parameter></paramdef>
+<paramdef>Window<parameter> window</parameter></paramdef>
+<paramdef>Bool<parameter> *bounding_shaped</parameter></paramdef>
+<paramdef>int<parameter> *x_bounding</parameter></paramdef>
+<paramdef>int<parameter> *y_bounding</parameter></paramdef>
+<paramdef>unsigned int<parameter> *w_bounding</parameter></paramdef>
+<paramdef>unsigned int<parameter> *h_bounding</parameter></paramdef>
+<paramdef>Bool<parameter> *clip_shaped</parameter></paramdef>
+<paramdef>int<parameter> *x_clip</parameter></paramdef>
+<paramdef>int<parameter> *y_clip</parameter></paramdef>
+<paramdef>unsigned int<parameter> *w_clip</parameter></paramdef>
+<paramdef>unsigned int<parameter> *h_clip</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+If the extension is supported,
+<function>XShapeQueryExtents</function>
+sets x_bounding, y_bounding, w_bounding, h_bounding to the extents of the
+bounding shape and sets x_clip, y_clip, w_clip, h_clip to the extents of
+the clip shape.  For unspecified client regions, the extents of the
+corresponding default region are used.
+</para>
+
+<para>
+If the extension is supported, a nonzero value is returned; otherwise,
+zero is returned.
+</para>
+
+<funcsynopsis id='xshapeselectinput'>
+<funcprototype>
+<funcdef><function>XShapeSelectInput</function></funcdef>
+<paramdef>Display<parameter> *display</parameter></paramdef>
+<paramdef>Window<parameter> window</parameter></paramdef>
+<paramdef>unsigned long<parameter> mask</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+To make this extension more compatible with other interfaces, although
+only one event type can be selected via the extension,
+<function>XShapeSelectInput</function>
+provides a general mechanism similar to the standard Xlib binding for
+window events.  A mask value has been defined,
+<function>ShapeNotifyMask</function>
+that is the only valid bit in mask that may be specified.
+The structure for this event is defined as follows:
+</para>
+
+<literallayout remap='Ds'>
+typedef struct {
+    int type;     /* of event */
+    unsigned long serial;     /* # of last request processed by server */
+    Bool send_event;     /* true if this came from a SendEvent request */
+    Display *display;     /* Display the event was read from */
+    Window window;     /* window of event */
+    int kind;     /* ShapeBounding or ShapeClip */
+    int x, y;     /* extents of new region */
+    unsigned width, height;
+    Time time;     /* server timestamp when region changed */
+    Bool shaped;     /* true if the region exists */
+} XShapeEvent;
+</literallayout>
+
+<funcsynopsis id='xshapeinputselected'>
+<funcprototype>
+<funcdef>unsigned long <function>XShapeInputSelected</function></funcdef>
+<paramdef>Display<parameter> *display</parameter></paramdef>
+<paramdef>Window<parameter> window</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+<function>XShapeInputSelected</function>
+returns the current input mask for extension events on the specified
+window; the value returned if
+<function>ShapeNotify</function>
+is selected for is
+<function>ShapeNotifyMask</function>
+otherwise, it returns zero.
+If the extension is not supported, it returns zero.
+</para>
+
+<funcsynopsis id='xshapegetrectangles'>
+<funcprototype>
+<funcdef>XRectangle<function> *XShapeGetRectangles</function></funcdef>
+<paramdef>Display<parameter> *display</parameter></paramdef>
+<paramdef>Window<parameter> window</parameter></paramdef>
+<paramdef>int<parameter> kind</parameter></paramdef>
+<paramdef>int<parameter> *count</parameter></paramdef>
+<paramdef>int<parameter> *ordering</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+If the extension is not supported,
+<function>XShapeGetRectangles</function>
+returns NULL.  Otherwise, it returns a list of rectangles that describe the
+region specified by kind.
+</para>
+</chapter>
+
+<glossary id='glossary'>
+
+<glossentry id='bounding_region'>
+  <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.</para>
+  </glossdef>
+</glossentry>
+
+<glossentry id='clip_region'>
+  <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.</para></glossdef>
+</glossentry>
+
+<glossentry id='default_bounding_region'>
+  <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.</para>
+  </glossdef>
+</glossentry>
+
+<glossentry id='default_clip_region'>
+  <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.
+  </para></glossdef>
+</glossentry>
+
+<glossentry id='client_bounding_region'>
+  <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.</para></glossdef>
+</glossentry>
+
+<glossentry id='client_clip_region'>
+  <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.</para>
+  </glossdef>
+</glossentry>
+
+<glossentry id='effective_bounding_region'>
+  <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.</para>
+  </glossdef>
+</glossentry>
+
+<glossentry id='effective_clip_region'>
+  <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.</para>
+  </glossdef>
+</glossentry>
+</glossary>
+</book>
Index: lib/libXext/create-1.3.5-docbook-patch/libXext-1.3.5-new/specs
===================================================================
--- lib/libXext/create-1.3.5-docbook-patch/libXext-1.3.5-new/specs	(nonexistent)
+++ lib/libXext/create-1.3.5-docbook-patch/libXext-1.3.5-new/specs	(revision 5)

Property changes on: lib/libXext/create-1.3.5-docbook-patch/libXext-1.3.5-new/specs
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXext/create-1.3.5-docbook-patch/libXext-1.3.5-new
===================================================================
--- lib/libXext/create-1.3.5-docbook-patch/libXext-1.3.5-new	(nonexistent)
+++ lib/libXext/create-1.3.5-docbook-patch/libXext-1.3.5-new	(revision 5)

Property changes on: lib/libXext/create-1.3.5-docbook-patch/libXext-1.3.5-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXext/create-1.3.5-docbook-patch
===================================================================
--- lib/libXext/create-1.3.5-docbook-patch	(nonexistent)
+++ lib/libXext/create-1.3.5-docbook-patch	(revision 5)

Property changes on: lib/libXext/create-1.3.5-docbook-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXext/patches/README
===================================================================
--- lib/libXext/patches/README	(nonexistent)
+++ lib/libXext/patches/README	(revision 5)
@@ -0,0 +1,6 @@
+
+/* begin *
+
+   TODO: Leave some comment here.
+
+ * end */
Index: lib/libXext/patches
===================================================================
--- lib/libXext/patches	(nonexistent)
+++ lib/libXext/patches	(revision 5)

Property changes on: lib/libXext/patches
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXext
===================================================================
--- lib/libXext	(nonexistent)
+++ lib/libXext	(revision 5)

Property changes on: lib/libXext
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXfixes/Makefile
===================================================================
--- lib/libXfixes/Makefile	(nonexistent)
+++ lib/libXfixes/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXfixes
+
+versions    = 6.0.0
+pkgname     = libXfixes
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXfixes
===================================================================
--- lib/libXfixes	(nonexistent)
+++ lib/libXfixes	(revision 5)

Property changes on: lib/libXfixes
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXfont/Makefile
===================================================================
--- lib/libXfont/Makefile	(nonexistent)
+++ lib/libXfont/Makefile	(revision 5)
@@ -0,0 +1,56 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXfont
+
+versions    = 1.5.4
+pkgname     = libXfont
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+patches     = $(CURDIR)/patches/libXfont-1.5.4-docbook.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-1.5.4-docbook-patch ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s) $(patches)
Index: lib/libXfont/create-1.5.4-docbook-patch/create.patch.sh
===================================================================
--- lib/libXfont/create-1.5.4-docbook-patch/create.patch.sh	(nonexistent)
+++ lib/libXfont/create-1.5.4-docbook-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=1.5.4
+
+tar --files-from=file.list -xjvf ../libXfont-$VERSION.tar.bz2
+mv libXfont-$VERSION libXfont-$VERSION-orig
+
+cp -rf ./libXfont-$VERSION-new ./libXfont-$VERSION
+
+diff --unified -Nr  libXfont-$VERSION-orig  libXfont-$VERSION > libXfont-$VERSION-docbook.patch
+
+mv libXfont-$VERSION-docbook.patch ../patches
+
+rm -rf ./libXfont-$VERSION
+rm -rf ./libXfont-$VERSION-orig

Property changes on: lib/libXfont/create-1.5.4-docbook-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: lib/libXfont/create-1.5.4-docbook-patch/file.list
===================================================================
--- lib/libXfont/create-1.5.4-docbook-patch/file.list	(nonexistent)
+++ lib/libXfont/create-1.5.4-docbook-patch/file.list	(revision 5)
@@ -0,0 +1 @@
+libXfont-1.5.4/doc/fontlib.xml
Index: lib/libXfont/create-1.5.4-docbook-patch/libXfont-1.5.4-new/doc/fontlib.xml
===================================================================
--- lib/libXfont/create-1.5.4-docbook-patch/libXfont-1.5.4-new/doc/fontlib.xml	(nonexistent)
+++ lib/libXfont/create-1.5.4-docbook-patch/libXfont-1.5.4-new/doc/fontlib.xml	(revision 5)
@@ -0,0 +1,621 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+            "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
+[
+<!ENTITY % defs SYSTEM "defs.ent"> %defs;
+]>
+<!-- lifted from troff+ms by doclifter -->
+<!-- previous version was in xorg-docs/specs/Xserver/fontlib.ms -->
+
+  <article id='fontlib'>
+<!-- .ps 12 -->
+<!-- .EF 'Font Library Interface'\- % \-'July 27, 1991' -->
+<!-- .OF 'Font Library Interface'\- % \-'July 27, 1991' -->
+<!-- .EH '''' -->
+<!-- .OH '''' -->
+<!-- body begins here -->
+    <articleinfo>
+      <title>
+	The X Font Library
+      </title>
+      <authorgroup>
+	<author>
+	  <firstname>Keith</firstname>
+	  <surname>Packard</surname>
+	  <affiliation>
+	    <orgname>MIT X Consortium</orgname>
+	  </affiliation>
+	</author>
+	<author>
+	  <firstname>David</firstname>
+	  <surname>Lemke</surname>
+	  <affiliation>
+	    <orgname>Network Computing Devices</orgname>
+	  </affiliation>
+	</author>
+      </authorgroup>
+      <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
+      <copyright><year>1993</year><holder>Network Computing Devices</holder></copyright>
+
+      <legalnotice>
+	<para>
+	  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 Network Computing
+	  Devices not be used in advertising or publicity pertaining
+	  to distribution of the software without specific, written
+	  prior permission.  Network Computing Devices makes no
+	  representations about the suitability of this software for
+	  any purpose.  It is provided &ldquo;as is&rdquo; without
+	  express or implied warranty.
+	</para>
+	<para role="multiLicensing">
+	  Copyright &copy; 1993, 1994 X Consortium
+	</para>
+	<para>
+	  Permission is hereby granted, free of charge, to any person
+	  obtaining a copy of this software and associated
+	  documentation files (the &ldquo;Software&rdquo;), 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>
+        <para>X Window System is a trademark of The Open Group.</para>
+      </legalnotice>
+      <pubdate>July 27, 1991</pubdate>
+    </articleinfo>
+
+    <warning>
+      <para>
+	This document has not been updated since X11R6, and is likely
+	to be somewhat out of date for the current libXfont.
+      </para>
+    </warning>
+
+    <para>
+      This document describes the data structures and interfaces for
+      using the X Font library.  It is intended as a reference for
+      programmers building X and Font servers.  You may want to refer
+      to the following documents:
+    </para>
+
+    <itemizedlist>
+      <listitem>
+	<para>
+	  <citetitle pubwork="article">Definition of the Porting Layer for
+	    the X v11 Sample Server</citetitle> for a discussion on how this
+	  library interacts with the X server
+	</para>
+      </listitem>
+      <listitem>
+	<para>
+	  <citetitle pubwork="article">Font Server Implementation
+	    Overview</citetitle> which discusses the design of the font
+	  server.
+	</para>
+      </listitem>
+      <listitem>
+	<para>
+	  <citetitle pubwork="article">Bitmap Distribution Format</citetitle>
+	  which covers the contents of the bitmap font files which this
+	  library reads; although the library is capable of reading other
+	  formats as well, including non-bitmap fonts.
+	</para>
+      </listitem>
+      <listitem>
+	<para>
+	  <citetitle pubwork="article">The X Font Service Protocol</citetitle>
+	  for a description of the constraints placed  on the design by
+	  including support for this font service mechanism.
+	</para>
+      </listitem>
+    </itemizedlist>
+
+    <para>
+      This document assumes the reader is familiar with the X server design,
+      the X protocol as it relates to fonts and the C programming language.
+      As with most MIT produced documentation, this relies heavily on the
+      source code, so have a listing handy.
+    </para>
+
+    <sect1 id='Requirements_for_the_Font_library'>
+<title>Requirements for the Font library</title>
+
+      <para>
+	To avoid miles of duplicate code in the X server, the font server
+	and the various font manipulation tools, the font library should
+	provide interfaces appropriate for all of these	tasks.  In
+	particular, the X server and font server should be able to both
+	use the library to access disk based fonts, and	to communicate
+	with a font server.  By providing a general library, we hoped to
+	avoid duplicating code between the X server and font server.
+      </para>
+
+      <para>
+	Another requirement is that the X server (or even a font server)
+	be able to continue servicing requests from other clients while
+	awaiting a response from the font server on behalf of one client.
+	This is the strongest requirement placed on the	font library, and
+	has warped the design in curious ways.	Because both the X server
+	and font server are single threaded, the font library must not
+	suspend internally, rather it returns an indication of suspension
+	to the application which continues processing other things, until
+	the font data is ready, at which time it restarts the suspended
+	request.
+      </para>
+
+      <para>
+	Because the code for reading and manipulating bitmap font data is
+	used by the font applications <command>mkfontdir</command> and
+	<command>bdftopcf</command>, the font library includes
+	bitmap-font specific interfaces which those applications use,
+	instead of the more general interfaces used by the X and font
+	servers, which are unaware of the source of the font data.
+	These routines will be refered to as the bitmap font access
+	methods.
+      </para>
+
+    </sect1>
+
+    <sect1 id='General_Font_Library_Interface_details'>
+<title>General Font Library Interface details.</title>
+
+      <para>
+	To avoid collision between the #define name space for errors, the Font
+	library defines a new set of return values:
+      </para>
+
+      <programlisting remap='.nf'>
+#define AllocError      80
+#define StillWorking    81
+#define FontNameAlias   82
+#define BadFontName     83
+#define Suspended       84
+#define Successful      85
+#define BadFontPath     86
+#define BadCharRange    87
+#define BadFontFormat   88
+#define FPEResetFailed  89
+      </programlisting> <!-- .fi -->
+
+      <para>
+	Whenever a routine returns <errorname>Suspended</errorname>,
+	the font library will notify the caller (via the ClientSignal
+	interface described below) who should then reinvoke the same routine
+	again with the same arguments.
+      </para>
+
+    </sect1>
+
+    <sect1 id='Font_Path_Elements'>
+<title>Font Path Elements</title>
+
+      <para>
+	At the center of the general font access methods used by X and
+	<command>xfs</command> is the Font Path Element data structure.
+	Like most structures in the X server, this contains a collection
+	of data and some function pointers for manipulating this data:
+      </para>
+
+      <programlisting remap='.nf'>
+/* External view of font paths */
+typedef struct _FontPathElement {
+    int         name_length;
+    char       *name;
+    int         type;
+    int         refcount;
+    pointer     private;
+} FontPathElementRec, *FontPathElementPtr;
+
+typedef struct _FPEFunctions {
+    int         (*name_check) ( /* name */ );
+    int         (*init_fpe) ( /* fpe */ );
+    int         (*reset_fpe) ( /* fpe */ );
+    int         (*free_fpe) ( /* fpe */ );
+    int         (*open_font) (  /* client, fpe, flags,
+                        name, namelen, format,
+                        fid,  ppfont, alias */ );
+    int         (*close_font) ( /* pfont */ );
+    int         (*list_fonts) ( /* client, fpe, pattern,
+                        patlen, maxnames, paths */ );
+    int         (*start_list_fonts_with_info) (
+                        /* client, fpe, name, namelen,
+                           maxnames, data */ );
+    int         (*list_next_font_with_info) (
+                        /* client, fpe, name, namelen,
+                           info, num, data */ );
+    int         (*wakeup_fpe) ( /* fpe, mask */ );
+    int         (*client_died) ( /* client, fpe */ );
+} FPEFunctionsRec, FPEFunctions;
+      </programlisting> <!-- .fi -->
+
+      <para>
+	The function pointers are split out from the data structure to
+	save memory; additionally, this avoids any complications when
+	initializing the data structure as there would not be any way
+	to discover the appropriate function to	call (a chicken and
+	egg problem).
+      </para>
+
+      <para>
+	When a font path type is initialized, it passes the function
+	pointers to the server which are then stored in an
+	<structname>FPEFunctionsRec</structname>. Each function is
+	described below in turn.
+      </para>
+
+      <sect2 id='name_check'>
+	<title>(*name_check)</title>
+
+	<para>
+	  Each new font path member is passed to this function; if
+	  the return value is <errorname>Successful</errorname>, then
+	  the FPE recognises the format of the string.  This does not
+	  guarantee that the FPE will be able to successfully use this
+	  member.  For example, the disk-based font directory file
+	  <filename>fonts.dir</filename> may be corrupted, this will
+	  not be detected until the font path is initialized.  This
+	  routine never returns <errorname>Suspended</errorname>.
+	</para>
+      </sect2>
+
+      <sect2 id='init_fpe'>
+	<title>(*init_fpe)</title>
+
+	<para>
+	  Initialize a new font path element.  This function prepares
+	  a new font path element for other requests: the disk font
+	  routine reads the <filename>fonts.dir</filename> and
+	  <filename>fonts.alias</filename> files into the internal
+	  format, while the font server routine connects to the
+	  requested font server and prepares for using it.  This
+	  routine returns <errorname>Successful</errorname> if
+	  everything went OK, otherwise the return value indicates the
+	  source of the problem.  This routine never returns
+	  <errorname>Suspended</errorname>.
+	</para>
+      </sect2>
+
+      <sect2 id='reset_fpe'>
+	<title>(*reset_fpe)</title>
+
+	<para>
+	  When the X font path is reset, and some of the new members
+	  are also in the old font path, this function is called to
+	  reinitialize those FPEs.  This routine returns
+	  <errorname>Successful</errorname> if everything went OK.  It
+	  returns <errorname>FPEResetFailed</errorname> if (for some
+	  reason) the reset failed, and the caller should remove the
+	  old FPE and simply create a new one in its place.  This is
+	  used by the disk-based fonts routine as resetting the
+	  internal directory structures would be more complicated than
+	  simply having destroying the old and creating a new.
+	</para>
+      </sect2>
+
+      <sect2 id='free_fpe'>
+	<title>(*free_fpe)</title>
+
+	<para>
+	  When the server is finished with an FPE, this function is
+	  called to dispose of any internal state.  It should return
+	  <errorname>Successful</errorname>, unless something terrible
+	  happens.
+	</para>
+      </sect2>
+
+      <sect2 id='open_font'>
+	<title>(*open_font)</title>
+
+	<para>
+	  This routine requests that a font be opened.  The <parameter
+	  class='function'>client</parameter> argument is used by the
+	  font library only in connection with suspending/restarting
+	  the request.  The <parameter class='function'>flags</parameter>
+	  argument specifies some behaviour for the library and can be
+	  any of:
+	</para>
+
+	<programlisting remap='.nf'>
+/* OpenFont flags */
+#define FontLoadInfo    0x0001
+#define FontLoadProps   0x0002
+#define FontLoadMetrics 0x0004
+#define FontLoadBitmaps 0x0008
+#define FontLoadAll     0x000f
+#define FontOpenSync    0x0010
+	</programlisting> <!-- .fi -->
+
+	<para>
+	  The various fields specify which portions of the font should
+	  be loaded at this time.  When <constant>FontOpenSync</constant>
+	  is specified, this routine will not return until all of the
+	  requested portions are loaded.  Otherwise, this routine may
+	  return <errorname>Suspended</errorname>.  When the presented
+	  font name is actually an alias for some other font name,
+	  <errorname>FontNameAlias</errorname> is returned, and the
+	  actual font name is stored in the location pointed to by the
+	  <parameter class='function'>alias</parameter> argument as a
+	  null-terminated string.
+	</para>
+      </sect2>
+
+      <sect2 id='close_font'>
+	<title>(*close_font)</title>
+
+	<para>
+	  When the server is finished with a font, this routine
+	  disposes of any internal state and frees the font data
+	  structure.
+	</para>
+      </sect2>
+
+      <sect2 id='list_fonts'>
+	<title>(*list_fonts)</title>
+
+	<para>
+	  The <parameter class='function'>paths</parameter> argument is
+	  a data structure which will be filled with all of the font names
+	  from this directory which match the specified
+	  <parameter class='function'>pattern</parameter>.  At
+	  most <parameter class='function'>maxnames</parameter> will be added.
+	  This routine may return <errorname>Suspended</errorname>.
+	</para>
+      </sect2>
+
+      <sect2 id='start_list_fonts_with_info'>
+	<title>(*start_list_fonts_with_info)</title>
+
+	<para>
+	  This routine sets any internal state for a verbose listing of
+	  all fonts matching the specified pattern.  This routine may
+	  return <errorname>Suspended</errorname>.
+	</para>
+      </sect2>
+
+      <sect2 id='list_next_font_with_info'>
+	<title>(*list_next_font_with_info)</title>
+
+	<para>
+	  To avoid storing huge amounts of data, the interface for
+	  ListFontsWithInfo allows the server to get one reply at a time
+	  and forward that to the client.  When the font name returned
+	  is actually an alias for some other font,
+	  <errorname>FontNameAlias</errorname> will be returned.  The
+	  actual font name is return instead, and the font alias which
+	  matched the pattern is returned in the location pointed to by
+	  data as a null-terminated string.  The caller can then get the
+	  information by recursively listing that font name with a
+	  maxnames of 1.  When <errorname>Successful</errorname> is
+	  returned, the matching font name is returned, and a
+	  FontInfoPtr is stored in the location pointed to by
+	  <parameter class='function'>data</parameter>.
+	  <parameter class='function'>Data</parameter> must be initialized
+	  with a pointer to a FontInfoRec allocated by the caller.  When the
+	  pointer pointed to by <parameter class='function'>data</parameter>
+	  is not left pointing at that storage, the caller mustn't free the
+	  associated property data. This routine may return
+	  <errorname>Suspended</errorname>.
+	</para>
+      </sect2>
+
+      <sect2 id='wakeup_fpe'>
+	<title>(*wakeup_fpe)</title>
+
+	<para>
+	  Whenever an FPE function has returned
+	  <errorname>Suspended</errorname>, this routine is called
+	  whenever the application wakes up from waiting for input
+	  (from <citerefentry><refentrytitle>select</refentrytitle>
+	    <manvolnum>2</manvolnum></citerefentry>).  This
+	    <parameter class='function'>mask</parameter> argument should be
+	    the value returned from <function>select(2)</function>.
+	</para>
+      </sect2>
+
+      <sect2 id='client_died'>
+	<title>(*client_died)</title>
+
+	<para>
+	  When an FPE function has returned <errorname>Suspended</errorname>
+	  and the associated client is being destroyed, this function
+	  allows the font library to dispose of any state associated
+	  with that client.
+	</para>
+      </sect2>
+    </sect1>
+
+    <sect1 id='Fonts'>
+<title>Fonts</title>
+
+      <para>
+	The data structure which actually contains the font information has
+	changed significantly since previous releases; it now attempts to
+	hide the actual storage format for the data from the application,
+	providing accessor functions to get at the data.  This allows a
+	range of internal details for different font sources.  The structure
+	is split into two pieces, so that ListFontsWithInfo can share
+	information from the font when it has been loaded.  The
+	<structname>FontInfo</structname> structure, then, contains only
+	information germane to LFWI.
+      </para>
+
+      <programlisting remap='.nf'>
+typedef struct _FontInfo {
+    unsigned short firstCol;            /* range of glyphs for this font */
+    unsigned short lastCol;
+    unsigned short firstRow;
+    unsigned short lastRow;
+    unsigned short defaultCh;           /* default character index */
+    unsigned int noOverlap:1;           /* no combination of glyphs overlap */
+    unsigned int terminalFont:1;        /* Character cell font */
+    unsigned int constantMetrics:1;     /* all metrics are the same */
+    unsigned int constantWidth:1;       /* all character widths are the same*/
+    unsigned int inkInside:1;           /* all ink inside character cell */
+    unsigned int inkMetrics:1;          /* font has ink metrics */
+    unsigned int allExist:1;            /* no missing chars in range */
+    unsigned int drawDirection:2;       /* left-to-right/right-to-left*/
+    unsigned int cachable:1;            /* font needn't be opened each time*/
+    unsigned int anamorphic:1;          /* font is strangely scaled */
+    short       maxOverlap;             /* maximum overlap amount */
+    short       pad;                    /* unused */
+    xCharInfo   maxbounds;              /* glyph metrics maximums */
+    xCharInfo   minbounds;              /* glyph metrics minimums */
+    xCharInfo   ink_maxbounds;          /* ink metrics maximums */
+    xCharInfo   ink_minbounds;          /* ink metrics minimums */
+    short       fontAscent;             /* font ascent amount */
+    short       fontDescent;            /* font descent amount */
+    int         nprops;                 /* number of font properties */
+    FontPropPtr props;                  /* font properties */
+    char       *isStringProp;           /* boolean array */
+}           FontInfoRec, *FontInfoPtr;
+      </programlisting> <!-- .fi -->
+
+      <para>
+	The font structure, then, contains a font info record, the format of
+	the bits in each bitmap and the functions which access the font
+	records (which are stored in an opaque format hung off of
+	<structfield>fontPrivate</structfield>).
+      </para>
+
+      <programlisting remap='.nf'>
+typedef struct _Font {
+    int         refcnt;
+    FontInfoRec info;
+    char        bit;                    /* bit order: LSBFirst/MSBFirst */
+    char        byte;                   /* byte order: LSBFirst/MSBFirst */
+    char        glyph;                  /* glyph pad: 1, 2, 4 or 8 */
+    char        scan;                   /* glyph scan unit: 1, 2 or 4 */
+    fsBitmapFormat format;              /* FS-style format (packed) */
+    int         (*get_glyphs)  ( /* font, count, chars, encoding, count, glyphs */ );
+    int         (*get_metrics) ( /* font, count, chars, encoding, count, glyphs */ );
+    int         (*get_bitmaps) ( /* client, font, flags, format,
+                                    flags, nranges, ranges, data_sizep,
+                                    num_glyphsp, offsetsp, glyph_datap,
+                                    free_datap */ );
+    int         (*get_extents) ( /* client, font, flags, nranges,
+                                    ranges, nextentsp, extentsp */);
+    void        (*unload_font) ( /* font */ );
+    FontPathElementPtr fpe;             /* FPE associated with this font */
+    pointer     svrPrivate;             /* X/FS private data */
+    pointer     fontPrivate;            /* private to font */
+    pointer     fpePrivate;             /* private to FPE */
+    int         maxPrivate;             /* devPrivates (see below) */
+    pointer     *devPrivates;           /*  ... */
+}           FontRec, *FontPtr;
+      </programlisting> <!-- .fi -->
+
+      <para>
+	Yes, there are several different private pointers in the
+	<structfield>Font</structfield> structure; they were added
+	haphazardly until the devPrivate pointers were added.  Future
+	releases may remove some (or all) of the specific pointers,
+	leaving only the <structfield>devPrivates</structfield>mechanism.
+      </para>
+
+      <para>
+	There are two similar interfaces implemented -
+	<structfield>get_glyphs</structfield>/<structfield>get_metrics</structfield>
+	and
+	<structfield>get_bitmaps</structfield>/<structfield>get_extents</structfield>.
+	Too little time caused the font-server specific interfaces to
+	be placed in the font library (and portions duplicated in each
+	renderer) instead of having them integrated into the font server
+	itself.  This may change.  The X server uses only
+	<structfield>get_glyphs</structfield>/<structfield>get_metrics</structfield>,
+	and those will not change dramatically.  Each of the routines
+	is described below.
+      </para>
+
+      <sect2 id='get_glyphs'>
+	<title>(*get_glyphs)</title>
+
+	<para>
+	  This routine returns <structname>CharInfoPtrs</structname>
+	  for each of the requested characters in the font.  If the
+	  character does not exist in the font, the default character
+	  will be returned, unless no default character exists in
+	  which case that character is skipped.  Thus, the number of
+	  glyphs returned will not always be the same as the number of
+	  characters passed in.
+	</para>
+      </sect2>
+
+      <sect2 id='get_metrics'>
+	<title>(*get_metrics)</title>
+
+	<para>
+	  This is similar to <structfield>(*get_glyphs)</structfield>
+	  except that pointers to <structname>xCharInfo</structname>
+	  structures are returned, and, if the font has ink metrics,
+	  those are returned instead of the bitmap metrics.
+	</para>
+      </sect2>
+
+      <sect2 id='get_bitmaps'>
+<title>(*get_bitmaps)</title>
+
+	<para>
+	  This packs the glyph image data in the requested
+	  <parameter class='function'>format</parameter> and returns it.  The
+	  <parameter class='function'>ranges</parameter>/<parameter class='function'>nranges</parameter>
+	  argument specify the set of glyphs from the font to pack together.
+	</para>
+      </sect2>
+
+      <sect2 id='get_extents'>
+	<title>(*get_extents)</title>
+
+	<para>
+	  This returns the metrics for the specified font from the
+	  specified <parameter class='function'>ranges</parameter>.
+	</para>
+
+      </sect2>
+
+      <sect2 id='unload_font'>
+	<title>(*unload_font)</title>
+
+	<para>
+	  This is called from the FPE routine
+	  <function>(*close_font)</function>, and so should not ever be
+	  called from the application.
+	</para>
+      </sect2>
+
+      <sect2 id='maxPrivate'>
+<title>maxPrivate</title>
+
+	<para>
+	  When initializing a new font structure,
+	  <structfield>maxPrivate</structfield> should be set to -1 so
+	  that the <function>FontSetPrivate()</function> macro works
+	  properly with an index of 0.  Initializing
+	  <structfield>maxPrivate</structfield> to 0 can cause
+	  problems if the server tries to set something at index 0.
+	</para>
+      </sect2>
+    </sect1>
+  </article>
Index: lib/libXfont/create-1.5.4-docbook-patch/libXfont-1.5.4-new/doc
===================================================================
--- lib/libXfont/create-1.5.4-docbook-patch/libXfont-1.5.4-new/doc	(nonexistent)
+++ lib/libXfont/create-1.5.4-docbook-patch/libXfont-1.5.4-new/doc	(revision 5)

Property changes on: lib/libXfont/create-1.5.4-docbook-patch/libXfont-1.5.4-new/doc
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXfont/create-1.5.4-docbook-patch/libXfont-1.5.4-new
===================================================================
--- lib/libXfont/create-1.5.4-docbook-patch/libXfont-1.5.4-new	(nonexistent)
+++ lib/libXfont/create-1.5.4-docbook-patch/libXfont-1.5.4-new	(revision 5)

Property changes on: lib/libXfont/create-1.5.4-docbook-patch/libXfont-1.5.4-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXfont/create-1.5.4-docbook-patch
===================================================================
--- lib/libXfont/create-1.5.4-docbook-patch	(nonexistent)
+++ lib/libXfont/create-1.5.4-docbook-patch	(revision 5)

Property changes on: lib/libXfont/create-1.5.4-docbook-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXfont/patches/README
===================================================================
--- lib/libXfont/patches/README	(nonexistent)
+++ lib/libXfont/patches/README	(revision 5)
@@ -0,0 +1,6 @@
+
+/* begin *
+
+   TODO: Leave some comment here.
+
+ * end */
Index: lib/libXfont/patches
===================================================================
--- lib/libXfont/patches	(nonexistent)
+++ lib/libXfont/patches	(revision 5)

Property changes on: lib/libXfont/patches
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXfont
===================================================================
--- lib/libXfont	(nonexistent)
+++ lib/libXfont	(revision 5)

Property changes on: lib/libXfont
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXfont2/Makefile
===================================================================
--- lib/libXfont2/Makefile	(nonexistent)
+++ lib/libXfont2/Makefile	(revision 5)
@@ -0,0 +1,56 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXfont2
+
+versions    = 2.0.6
+pkgname     = libXfont2
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+patches     = $(CURDIR)/patches/libXfont2-2.0.6-docbook.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-2.0.6-docbook-patch ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s) $(patches)
Index: lib/libXfont2/create-2.0.6-docbook-patch/create.patch.sh
===================================================================
--- lib/libXfont2/create-2.0.6-docbook-patch/create.patch.sh	(nonexistent)
+++ lib/libXfont2/create-2.0.6-docbook-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=2.0.6
+
+tar --files-from=file.list -xJvf ../libXfont2-$VERSION.tar.xz
+mv libXfont2-$VERSION libXfont2-$VERSION-orig
+
+cp -rf ./libXfont2-$VERSION-new ./libXfont2-$VERSION
+
+diff --unified -Nr  libXfont2-$VERSION-orig  libXfont2-$VERSION > libXfont2-$VERSION-docbook.patch
+
+mv libXfont2-$VERSION-docbook.patch ../patches
+
+rm -rf ./libXfont2-$VERSION
+rm -rf ./libXfont2-$VERSION-orig

Property changes on: lib/libXfont2/create-2.0.6-docbook-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: lib/libXfont2/create-2.0.6-docbook-patch/file.list
===================================================================
--- lib/libXfont2/create-2.0.6-docbook-patch/file.list	(nonexistent)
+++ lib/libXfont2/create-2.0.6-docbook-patch/file.list	(revision 5)
@@ -0,0 +1 @@
+libXfont2-2.0.6/doc/fontlib.xml
Index: lib/libXfont2/create-2.0.6-docbook-patch/libXfont2-2.0.6-new/doc/fontlib.xml
===================================================================
--- lib/libXfont2/create-2.0.6-docbook-patch/libXfont2-2.0.6-new/doc/fontlib.xml	(nonexistent)
+++ lib/libXfont2/create-2.0.6-docbook-patch/libXfont2-2.0.6-new/doc/fontlib.xml	(revision 5)
@@ -0,0 +1,621 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+            "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
+[
+<!ENTITY % defs SYSTEM "defs.ent"> %defs;
+]>
+<!-- lifted from troff+ms by doclifter -->
+<!-- previous version was in xorg-docs/specs/Xserver/fontlib.ms -->
+
+  <article id='fontlib'>
+<!-- .ps 12 -->
+<!-- .EF 'Font Library Interface'\- % \-'July 27, 1991' -->
+<!-- .OF 'Font Library Interface'\- % \-'July 27, 1991' -->
+<!-- .EH '''' -->
+<!-- .OH '''' -->
+<!-- body begins here -->
+    <articleinfo>
+      <title>
+	The X Font Library
+      </title>
+      <authorgroup>
+	<author>
+	  <firstname>Keith</firstname>
+	  <surname>Packard</surname>
+	  <affiliation>
+	    <orgname>MIT X Consortium</orgname>
+	  </affiliation>
+	</author>
+	<author>
+	  <firstname>David</firstname>
+	  <surname>Lemke</surname>
+	  <affiliation>
+	    <orgname>Network Computing Devices</orgname>
+	  </affiliation>
+	</author>
+      </authorgroup>
+      <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
+      <copyright><year>1993</year><holder>Network Computing Devices</holder></copyright>
+
+      <legalnotice>
+	<para>
+	  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 Network Computing
+	  Devices not be used in advertising or publicity pertaining
+	  to distribution of the software without specific, written
+	  prior permission.  Network Computing Devices makes no
+	  representations about the suitability of this software for
+	  any purpose.  It is provided &ldquo;as is&rdquo; without
+	  express or implied warranty.
+	</para>
+	<para role="multiLicensing">
+	  Copyright &copy; 1993, 1994 X Consortium
+	</para>
+	<para>
+	  Permission is hereby granted, free of charge, to any person
+	  obtaining a copy of this software and associated
+	  documentation files (the &ldquo;Software&rdquo;), 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>
+        <para>X Window System is a trademark of The Open Group.</para>
+      </legalnotice>
+      <pubdate>July 27, 1991</pubdate>
+    </articleinfo>
+
+    <warning>
+      <para>
+	This document has not been updated since X11R6, and is likely
+	to be somewhat out of date for the current libXfont.
+      </para>
+    </warning>
+
+    <para>
+      This document describes the data structures and interfaces for
+      using the X Font library.  It is intended as a reference for
+      programmers building X and Font servers.  You may want to refer
+      to the following documents:
+    </para>
+
+    <itemizedlist>
+      <listitem>
+	<para>
+	  <citetitle pubwork="article">Definition of the Porting Layer for
+	    the X v11 Sample Server</citetitle> for a discussion on how this
+	  library interacts with the X server
+	</para>
+      </listitem>
+      <listitem>
+	<para>
+	  <citetitle pubwork="article">Font Server Implementation
+	    Overview</citetitle> which discusses the design of the font
+	  server.
+	</para>
+      </listitem>
+      <listitem>
+	<para>
+	  <citetitle pubwork="article">Bitmap Distribution Format</citetitle>
+	  which covers the contents of the bitmap font files which this
+	  library reads; although the library is capable of reading other
+	  formats as well, including non-bitmap fonts.
+	</para>
+      </listitem>
+      <listitem>
+	<para>
+	  <citetitle pubwork="article">The X Font Service Protocol</citetitle>
+	  for a description of the constraints placed  on the design by
+	  including support for this font service mechanism.
+	</para>
+      </listitem>
+    </itemizedlist>
+
+    <para>
+      This document assumes the reader is familiar with the X server design,
+      the X protocol as it relates to fonts and the C programming language.
+      As with most MIT produced documentation, this relies heavily on the
+      source code, so have a listing handy.
+    </para>
+
+    <sect1 id='Requirements_for_the_Font_library'>
+<title>Requirements for the Font library</title>
+
+      <para>
+	To avoid miles of duplicate code in the X server, the font server
+	and the various font manipulation tools, the font library should
+	provide interfaces appropriate for all of these	tasks.  In
+	particular, the X server and font server should be able to both
+	use the library to access disk based fonts, and	to communicate
+	with a font server.  By providing a general library, we hoped to
+	avoid duplicating code between the X server and font server.
+      </para>
+
+      <para>
+	Another requirement is that the X server (or even a font server)
+	be able to continue servicing requests from other clients while
+	awaiting a response from the font server on behalf of one client.
+	This is the strongest requirement placed on the	font library, and
+	has warped the design in curious ways.	Because both the X server
+	and font server are single threaded, the font library must not
+	suspend internally, rather it returns an indication of suspension
+	to the application which continues processing other things, until
+	the font data is ready, at which time it restarts the suspended
+	request.
+      </para>
+
+      <para>
+	Because the code for reading and manipulating bitmap font data is
+	used by the font applications <command>mkfontdir</command> and
+	<command>bdftopcf</command>, the font library includes
+	bitmap-font specific interfaces which those applications use,
+	instead of the more general interfaces used by the X and font
+	servers, which are unaware of the source of the font data.
+	These routines will be referred to as the bitmap font access
+	methods.
+      </para>
+
+    </sect1>
+
+    <sect1 id='General_Font_Library_Interface_details'>
+<title>General Font Library Interface details.</title>
+
+      <para>
+	To avoid collision between the #define name space for errors, the Font
+	library defines a new set of return values:
+      </para>
+
+      <programlisting remap='.nf'>
+#define AllocError      80
+#define StillWorking    81
+#define FontNameAlias   82
+#define BadFontName     83
+#define Suspended       84
+#define Successful      85
+#define BadFontPath     86
+#define BadCharRange    87
+#define BadFontFormat   88
+#define FPEResetFailed  89
+      </programlisting> <!-- .fi -->
+
+      <para>
+	Whenever a routine returns <errorname>Suspended</errorname>,
+	the font library will notify the caller (via the ClientSignal
+	interface described below) who should then reinvoke the same routine
+	again with the same arguments.
+      </para>
+
+    </sect1>
+
+    <sect1 id='Font_Path_Elements'>
+<title>Font Path Elements</title>
+
+      <para>
+	At the center of the general font access methods used by X and
+	<command>xfs</command> is the Font Path Element data structure.
+	Like most structures in the X server, this contains a collection
+	of data and some function pointers for manipulating this data:
+      </para>
+
+      <programlisting remap='.nf'>
+/* External view of font paths */
+typedef struct _FontPathElement {
+    int         name_length;
+    char       *name;
+    int         type;
+    int         refcount;
+    pointer     private;
+} FontPathElementRec, *FontPathElementPtr;
+
+typedef struct _FPEFunctions {
+    int         (*name_check) ( /* name */ );
+    int         (*init_fpe) ( /* fpe */ );
+    int         (*reset_fpe) ( /* fpe */ );
+    int         (*free_fpe) ( /* fpe */ );
+    int         (*open_font) (  /* client, fpe, flags,
+                        name, namelen, format,
+                        fid,  ppfont, alias */ );
+    int         (*close_font) ( /* pfont */ );
+    int         (*list_fonts) ( /* client, fpe, pattern,
+                        patlen, maxnames, paths */ );
+    int         (*start_list_fonts_with_info) (
+                        /* client, fpe, name, namelen,
+                           maxnames, data */ );
+    int         (*list_next_font_with_info) (
+                        /* client, fpe, name, namelen,
+                           info, num, data */ );
+    int         (*wakeup_fpe) ( /* fpe, mask */ );
+    int         (*client_died) ( /* client, fpe */ );
+} FPEFunctionsRec, FPEFunctions;
+      </programlisting> <!-- .fi -->
+
+      <para>
+	The function pointers are split out from the data structure to
+	save memory; additionally, this avoids any complications when
+	initializing the data structure as there would not be any way
+	to discover the appropriate function to	call (a chicken and
+	egg problem).
+      </para>
+
+      <para>
+	When a font path type is initialized, it passes the function
+	pointers to the server which are then stored in an
+	<structname>FPEFunctionsRec</structname>. Each function is
+	described below in turn.
+      </para>
+
+      <sect2 id='name_check'>
+	<title>(*name_check)</title>
+
+	<para>
+	  Each new font path member is passed to this function; if
+	  the return value is <errorname>Successful</errorname>, then
+	  the FPE recognises the format of the string.  This does not
+	  guarantee that the FPE will be able to successfully use this
+	  member.  For example, the disk-based font directory file
+	  <filename>fonts.dir</filename> may be corrupted, this will
+	  not be detected until the font path is initialized.  This
+	  routine never returns <errorname>Suspended</errorname>.
+	</para>
+      </sect2>
+
+      <sect2 id='init_fpe'>
+	<title>(*init_fpe)</title>
+
+	<para>
+	  Initialize a new font path element.  This function prepares
+	  a new font path element for other requests: the disk font
+	  routine reads the <filename>fonts.dir</filename> and
+	  <filename>fonts.alias</filename> files into the internal
+	  format, while the font server routine connects to the
+	  requested font server and prepares for using it.  This
+	  routine returns <errorname>Successful</errorname> if
+	  everything went OK, otherwise the return value indicates the
+	  source of the problem.  This routine never returns
+	  <errorname>Suspended</errorname>.
+	</para>
+      </sect2>
+
+      <sect2 id='reset_fpe'>
+	<title>(*reset_fpe)</title>
+
+	<para>
+	  When the X font path is reset, and some of the new members
+	  are also in the old font path, this function is called to
+	  reinitialize those FPEs.  This routine returns
+	  <errorname>Successful</errorname> if everything went OK.  It
+	  returns <errorname>FPEResetFailed</errorname> if (for some
+	  reason) the reset failed, and the caller should remove the
+	  old FPE and simply create a new one in its place.  This is
+	  used by the disk-based fonts routine as resetting the
+	  internal directory structures would be more complicated than
+	  simply having destroying the old and creating a new.
+	</para>
+      </sect2>
+
+      <sect2 id='free_fpe'>
+	<title>(*free_fpe)</title>
+
+	<para>
+	  When the server is finished with an FPE, this function is
+	  called to dispose of any internal state.  It should return
+	  <errorname>Successful</errorname>, unless something terrible
+	  happens.
+	</para>
+      </sect2>
+
+      <sect2 id='open_font'>
+	<title>(*open_font)</title>
+
+	<para>
+	  This routine requests that a font be opened.  The <parameter
+	  class='function'>client</parameter> argument is used by the
+	  font library only in connection with suspending/restarting
+	  the request.  The <parameter class='function'>flags</parameter>
+	  argument specifies some behaviour for the library and can be
+	  any of:
+	</para>
+
+	<programlisting remap='.nf'>
+/* OpenFont flags */
+#define FontLoadInfo    0x0001
+#define FontLoadProps   0x0002
+#define FontLoadMetrics 0x0004
+#define FontLoadBitmaps 0x0008
+#define FontLoadAll     0x000f
+#define FontOpenSync    0x0010
+	</programlisting> <!-- .fi -->
+
+	<para>
+	  The various fields specify which portions of the font should
+	  be loaded at this time.  When <constant>FontOpenSync</constant>
+	  is specified, this routine will not return until all of the
+	  requested portions are loaded.  Otherwise, this routine may
+	  return <errorname>Suspended</errorname>.  When the presented
+	  font name is actually an alias for some other font name,
+	  <errorname>FontNameAlias</errorname> is returned, and the
+	  actual font name is stored in the location pointed to by the
+	  <parameter class='function'>alias</parameter> argument as a
+	  null-terminated string.
+	</para>
+      </sect2>
+
+      <sect2 id='close_font'>
+	<title>(*close_font)</title>
+
+	<para>
+	  When the server is finished with a font, this routine
+	  disposes of any internal state and frees the font data
+	  structure.
+	</para>
+      </sect2>
+
+      <sect2 id='list_fonts'>
+	<title>(*list_fonts)</title>
+
+	<para>
+	  The <parameter class='function'>paths</parameter> argument is
+	  a data structure which will be filled with all of the font names
+	  from this directory which match the specified
+	  <parameter class='function'>pattern</parameter>.  At
+	  most <parameter class='function'>maxnames</parameter> will be added.
+	  This routine may return <errorname>Suspended</errorname>.
+	</para>
+      </sect2>
+
+      <sect2 id='start_list_fonts_with_info'>
+	<title>(*start_list_fonts_with_info)</title>
+
+	<para>
+	  This routine sets any internal state for a verbose listing of
+	  all fonts matching the specified pattern.  This routine may
+	  return <errorname>Suspended</errorname>.
+	</para>
+      </sect2>
+
+      <sect2 id='list_next_font_with_info'>
+	<title>(*list_next_font_with_info)</title>
+
+	<para>
+	  To avoid storing huge amounts of data, the interface for
+	  ListFontsWithInfo allows the server to get one reply at a time
+	  and forward that to the client.  When the font name returned
+	  is actually an alias for some other font,
+	  <errorname>FontNameAlias</errorname> will be returned.  The
+	  actual font name is return instead, and the font alias which
+	  matched the pattern is returned in the location pointed to by
+	  data as a null-terminated string.  The caller can then get the
+	  information by recursively listing that font name with a
+	  maxnames of 1.  When <errorname>Successful</errorname> is
+	  returned, the matching font name is returned, and a
+	  FontInfoPtr is stored in the location pointed to by
+	  <parameter class='function'>data</parameter>.
+	  <parameter class='function'>Data</parameter> must be initialized
+	  with a pointer to a FontInfoRec allocated by the caller.  When the
+	  pointer pointed to by <parameter class='function'>data</parameter>
+	  is not left pointing at that storage, the caller mustn't free the
+	  associated property data. This routine may return
+	  <errorname>Suspended</errorname>.
+	</para>
+      </sect2>
+
+      <sect2 id='wakeup_fpe'>
+	<title>(*wakeup_fpe)</title>
+
+	<para>
+	  Whenever an FPE function has returned
+	  <errorname>Suspended</errorname>, this routine is called
+	  whenever the application wakes up from waiting for input
+	  (from <citerefentry><refentrytitle>select</refentrytitle>
+	    <manvolnum>2</manvolnum></citerefentry>).  This
+	    <parameter class='function'>mask</parameter> argument should be
+	    the value returned from <function>select(2)</function>.
+	</para>
+      </sect2>
+
+      <sect2 id='client_died'>
+	<title>(*client_died)</title>
+
+	<para>
+	  When an FPE function has returned <errorname>Suspended</errorname>
+	  and the associated client is being destroyed, this function
+	  allows the font library to dispose of any state associated
+	  with that client.
+	</para>
+      </sect2>
+    </sect1>
+
+    <sect1 id='Fonts'>
+<title>Fonts</title>
+
+      <para>
+	The data structure which actually contains the font information has
+	changed significantly since previous releases; it now attempts to
+	hide the actual storage format for the data from the application,
+	providing accessor functions to get at the data.  This allows a
+	range of internal details for different font sources.  The structure
+	is split into two pieces, so that ListFontsWithInfo can share
+	information from the font when it has been loaded.  The
+	<structname>FontInfo</structname> structure, then, contains only
+	information germane to LFWI.
+      </para>
+
+      <programlisting remap='.nf'>
+typedef struct _FontInfo {
+    unsigned short firstCol;            /* range of glyphs for this font */
+    unsigned short lastCol;
+    unsigned short firstRow;
+    unsigned short lastRow;
+    unsigned short defaultCh;           /* default character index */
+    unsigned int noOverlap:1;           /* no combination of glyphs overlap */
+    unsigned int terminalFont:1;        /* Character cell font */
+    unsigned int constantMetrics:1;     /* all metrics are the same */
+    unsigned int constantWidth:1;       /* all character widths are the same*/
+    unsigned int inkInside:1;           /* all ink inside character cell */
+    unsigned int inkMetrics:1;          /* font has ink metrics */
+    unsigned int allExist:1;            /* no missing chars in range */
+    unsigned int drawDirection:2;       /* left-to-right/right-to-left*/
+    unsigned int cachable:1;            /* font needn't be opened each time*/
+    unsigned int anamorphic:1;          /* font is strangely scaled */
+    short       maxOverlap;             /* maximum overlap amount */
+    short       pad;                    /* unused */
+    xCharInfo   maxbounds;              /* glyph metrics maximums */
+    xCharInfo   minbounds;              /* glyph metrics minimums */
+    xCharInfo   ink_maxbounds;          /* ink metrics maximums */
+    xCharInfo   ink_minbounds;          /* ink metrics minimums */
+    short       fontAscent;             /* font ascent amount */
+    short       fontDescent;            /* font descent amount */
+    int         nprops;                 /* number of font properties */
+    FontPropPtr props;                  /* font properties */
+    char       *isStringProp;           /* boolean array */
+}           FontInfoRec, *FontInfoPtr;
+      </programlisting> <!-- .fi -->
+
+      <para>
+	The font structure, then, contains a font info record, the format of
+	the bits in each bitmap and the functions which access the font
+	records (which are stored in an opaque format hung off of
+	<structfield>fontPrivate</structfield>).
+      </para>
+
+      <programlisting remap='.nf'>
+typedef struct _Font {
+    int         refcnt;
+    FontInfoRec info;
+    char        bit;                    /* bit order: LSBFirst/MSBFirst */
+    char        byte;                   /* byte order: LSBFirst/MSBFirst */
+    char        glyph;                  /* glyph pad: 1, 2, 4 or 8 */
+    char        scan;                   /* glyph scan unit: 1, 2 or 4 */
+    fsBitmapFormat format;              /* FS-style format (packed) */
+    int         (*get_glyphs)  ( /* font, count, chars, encoding, count, glyphs */ );
+    int         (*get_metrics) ( /* font, count, chars, encoding, count, glyphs */ );
+    int         (*get_bitmaps) ( /* client, font, flags, format,
+                                    flags, nranges, ranges, data_sizep,
+                                    num_glyphsp, offsetsp, glyph_datap,
+                                    free_datap */ );
+    int         (*get_extents) ( /* client, font, flags, nranges,
+                                    ranges, nextentsp, extentsp */);
+    void        (*unload_font) ( /* font */ );
+    FontPathElementPtr fpe;             /* FPE associated with this font */
+    pointer     svrPrivate;             /* X/FS private data */
+    pointer     fontPrivate;            /* private to font */
+    pointer     fpePrivate;             /* private to FPE */
+    int         maxPrivate;             /* devPrivates (see below) */
+    pointer     *devPrivates;           /*  ... */
+}           FontRec, *FontPtr;
+      </programlisting> <!-- .fi -->
+
+      <para>
+	Yes, there are several different private pointers in the
+	<structfield>Font</structfield> structure; they were added
+	haphazardly until the devPrivate pointers were added.  Future
+	releases may remove some (or all) of the specific pointers,
+	leaving only the <structfield>devPrivates</structfield>mechanism.
+      </para>
+
+      <para>
+	There are two similar interfaces implemented -
+	<structfield>get_glyphs</structfield>/<structfield>get_metrics</structfield>
+	and
+	<structfield>get_bitmaps</structfield>/<structfield>get_extents</structfield>.
+	Too little time caused the font-server specific interfaces to
+	be placed in the font library (and portions duplicated in each
+	renderer) instead of having them integrated into the font server
+	itself.  This may change.  The X server uses only
+	<structfield>get_glyphs</structfield>/<structfield>get_metrics</structfield>,
+	and those will not change dramatically.  Each of the routines
+	is described below.
+      </para>
+
+      <sect2 id='get_glyphs'>
+	<title>(*get_glyphs)</title>
+
+	<para>
+	  This routine returns <structname>CharInfoPtrs</structname>
+	  for each of the requested characters in the font.  If the
+	  character does not exist in the font, the default character
+	  will be returned, unless no default character exists in
+	  which case that character is skipped.  Thus, the number of
+	  glyphs returned will not always be the same as the number of
+	  characters passed in.
+	</para>
+      </sect2>
+
+      <sect2 id='get_metrics'>
+	<title>(*get_metrics)</title>
+
+	<para>
+	  This is similar to <structfield>(*get_glyphs)</structfield>
+	  except that pointers to <structname>xCharInfo</structname>
+	  structures are returned, and, if the font has ink metrics,
+	  those are returned instead of the bitmap metrics.
+	</para>
+      </sect2>
+
+      <sect2 id='get_bitmaps'>
+<title>(*get_bitmaps)</title>
+
+	<para>
+	  This packs the glyph image data in the requested
+	  <parameter class='function'>format</parameter> and returns it.  The
+	  <parameter class='function'>ranges</parameter>/<parameter class='function'>nranges</parameter>
+	  argument specify the set of glyphs from the font to pack together.
+	</para>
+      </sect2>
+
+      <sect2 id='get_extents'>
+	<title>(*get_extents)</title>
+
+	<para>
+	  This returns the metrics for the specified font from the
+	  specified <parameter class='function'>ranges</parameter>.
+	</para>
+
+      </sect2>
+
+      <sect2 id='unload_font'>
+	<title>(*unload_font)</title>
+
+	<para>
+	  This is called from the FPE routine
+	  <function>(*close_font)</function>, and so should not ever be
+	  called from the application.
+	</para>
+      </sect2>
+
+      <sect2 id='maxPrivate'>
+<title>maxPrivate</title>
+
+	<para>
+	  When initializing a new font structure,
+	  <structfield>maxPrivate</structfield> should be set to -1 so
+	  that the <function>FontSetPrivate()</function> macro works
+	  properly with an index of 0.  Initializing
+	  <structfield>maxPrivate</structfield> to 0 can cause
+	  problems if the server tries to set something at index 0.
+	</para>
+      </sect2>
+    </sect1>
+  </article>
Index: lib/libXfont2/create-2.0.6-docbook-patch/libXfont2-2.0.6-new/doc
===================================================================
--- lib/libXfont2/create-2.0.6-docbook-patch/libXfont2-2.0.6-new/doc	(nonexistent)
+++ lib/libXfont2/create-2.0.6-docbook-patch/libXfont2-2.0.6-new/doc	(revision 5)

Property changes on: lib/libXfont2/create-2.0.6-docbook-patch/libXfont2-2.0.6-new/doc
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXfont2/create-2.0.6-docbook-patch/libXfont2-2.0.6-new
===================================================================
--- lib/libXfont2/create-2.0.6-docbook-patch/libXfont2-2.0.6-new	(nonexistent)
+++ lib/libXfont2/create-2.0.6-docbook-patch/libXfont2-2.0.6-new	(revision 5)

Property changes on: lib/libXfont2/create-2.0.6-docbook-patch/libXfont2-2.0.6-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXfont2/create-2.0.6-docbook-patch
===================================================================
--- lib/libXfont2/create-2.0.6-docbook-patch	(nonexistent)
+++ lib/libXfont2/create-2.0.6-docbook-patch	(revision 5)

Property changes on: lib/libXfont2/create-2.0.6-docbook-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXfont2/patches/README
===================================================================
--- lib/libXfont2/patches/README	(nonexistent)
+++ lib/libXfont2/patches/README	(revision 5)
@@ -0,0 +1,6 @@
+
+/* begin *
+
+   TODO: Leave some comment here.
+
+ * end */
Index: lib/libXfont2/patches
===================================================================
--- lib/libXfont2/patches	(nonexistent)
+++ lib/libXfont2/patches	(revision 5)

Property changes on: lib/libXfont2/patches
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXfont2
===================================================================
--- lib/libXfont2	(nonexistent)
+++ lib/libXfont2	(revision 5)

Property changes on: lib/libXfont2
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXfontcache/Makefile
===================================================================
--- lib/libXfontcache/Makefile	(nonexistent)
+++ lib/libXfontcache/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXfontcache
+
+versions    = 1.0.5
+pkgname     = libXfontcache
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXfontcache
===================================================================
--- lib/libXfontcache	(nonexistent)
+++ lib/libXfontcache	(revision 5)

Property changes on: lib/libXfontcache
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXft/Makefile
===================================================================
--- lib/libXft/Makefile	(nonexistent)
+++ lib/libXft/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXft
+
+versions    = 2.3.7
+pkgname     = libXft
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXft
===================================================================
--- lib/libXft	(nonexistent)
+++ lib/libXft	(revision 5)

Property changes on: lib/libXft
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXi/Makefile
===================================================================
--- lib/libXi/Makefile	(nonexistent)
+++ lib/libXi/Makefile	(revision 5)
@@ -0,0 +1,56 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXi
+
+versions    = 1.8
+pkgname     = libXi
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+patches     = $(CURDIR)/patches/libXi-1.8-docbook.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-1.8-docbook-patch ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s) $(patches)
Index: lib/libXi/create-1.8-docbook-patch/create.patch.sh
===================================================================
--- lib/libXi/create-1.8-docbook-patch/create.patch.sh	(nonexistent)
+++ lib/libXi/create-1.8-docbook-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=1.8
+
+tar --files-from=file.list -xjvf ../libXi-$VERSION.tar.bz2
+mv libXi-$VERSION libXi-$VERSION-orig
+
+cp -rf ./libXi-$VERSION-new ./libXi-$VERSION
+
+diff --unified -Nr  libXi-$VERSION-orig  libXi-$VERSION > libXi-$VERSION-docbook.patch
+
+mv libXi-$VERSION-docbook.patch ../patches
+
+rm -rf ./libXi-$VERSION
+rm -rf ./libXi-$VERSION-orig

Property changes on: lib/libXi/create-1.8-docbook-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: lib/libXi/create-1.8-docbook-patch/file.list
===================================================================
--- lib/libXi/create-1.8-docbook-patch/file.list	(nonexistent)
+++ lib/libXi/create-1.8-docbook-patch/file.list	(revision 5)
@@ -0,0 +1 @@
+libXi-1.8/specs/library.xml
Index: lib/libXi/create-1.8-docbook-patch/libXi-1.8-new/specs/library.xml
===================================================================
--- lib/libXi/create-1.8-docbook-patch/libXi-1.8-new/specs/library.xml	(nonexistent)
+++ lib/libXi/create-1.8-docbook-patch/libXi-1.8-new/specs/library.xml	(revision 5)
@@ -0,0 +1,8559 @@
+<chapter><title>Input Extension</title>
+<sect1 id='Overview'>
+<title>Overview</title>
+<!-- .XS -->
+<!-- (SN Input Extension Overview -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+This document describes an extension to
+the X11 server.  The purpose of this extension is to support the use
+of additional input devices beyond the pointer and keyboard devices
+defined by the core X protocol.  This first section gives an overview
+of the input extension.  The following sections correspond to 
+chapters 9, 10, and 11, ``Window and Session Manager Functions'',
+``Events'', and ``Event Handling Functions'' of the
+``Xlib - C Language Interface'' manual
+and describe how to use the input device extension.
+</para>
+<sect2 id="Design_Approach">
+<title>Design Approach</title>
+<!-- .XS -->
+<!-- (SN Design Approach -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The design approach of the extension is to define functions
+and events analogous to the core functions and events.
+This allows extension input devices and events to be individually
+distinguishable from each other and from the core input devices and events.
+These functions and events make use of a device identifier and support the
+reporting of <emphasis remap='I'>n</emphasis>-dimensional motion data as well as other data that
+is not currently reportable via the core input events.
+</para>
+</sect2>
+<sect2 id="Core_Input_Devices">
+<title>Core Input Devices</title>
+<!-- .XS -->
+<!-- (SN Core Input Devices -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The X server core protocol supports two input devices:  a pointer and a
+keyboard.  The pointer device has two major functions. 
+First, it may be used to generate motion information
+that client programs can detect. Second, it may also be used to indicate the
+current location and focus of the X keyboard.  To accomplish this, the server 
+echoes a cursor at the current position of the X pointer.  Unless the X
+keyboard has been explicitly focused, this cursor also shows the current
+location and focus of the X keyboard.
+</para>
+<para>
+<!-- .LP -->
+The X keyboard is used to generate input that client programs can detect.
+</para>
+<para>
+<!-- .LP -->
+The X keyboard and X pointer are referred to in this document as 
+the <emphasis remap='I'>core devices</emphasis>, and the input
+events they generate 
+<function>( KeyPress ,</function>
+<function>KeyRelease ,</function>
+<function>ButtonPress ,</function>
+<function>ButtonRelease ,</function>
+and
+<function>MotionNotify )</function>
+are known as the <emphasis remap='I'>core input events</emphasis>.  All other
+input devices are referred to as <emphasis remap='I'>extension input devices</emphasis>, and the 
+input events they generate are referred to as <emphasis remap='I'>extension input events</emphasis>.
+<!-- .NT -->
+This input extension does not change the behavior or functionality of the
+core input devices, core events, or core protocol requests, with the
+exception of the core grab requests.  These requests may affect the
+synchronization of events from extension devices.  See the explanation
+in the section titled ``Event Synchronization and Core Grabs.''
+<!-- .NE -->
+</para>
+<para>
+<!-- .LP -->
+Selection of the physical devices to be initially used by the server as the 
+core devices is left implementation dependent.  Functions are defined that
+allow client programs to change which physical devices are used as the
+core devices.
+</para>
+</sect2>
+<sect2 id="Extension_Input_Devices">
+<title>Extension Input Devices</title>
+<!-- .XS -->
+<!-- (SN Extension Input Devices -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The input extension controls access to input devices other than the X keyboard
+and X pointer.  It allows client programs to select input from these devices 
+independently
+from each other and independently from the core devices.  Input events from
+these devices are of extension types 
+<function>( DeviceKeyPress ,</function>
+<function>DeviceKeyRelease ,</function>
+<function>DeviceButtonPress ,</function>
+<function>DeviceButtonRelease ,</function>
+<function>DeviceMotionNotify ,</function>
+and so on) and contain
+a device identifier so that events of the same type coming from different
+input devices can be distinguished.
+</para>
+<para>
+<!-- .LP -->
+Extension input events are not limited in size by the size of the server
+32-byte wire events.  Extension input events
+may be constructed by the server sending as many
+wire-sized events as necessary to return the information required for
+that event.
+The library event reformatting routines
+are responsible for combining these into one or more client XEvents.
+</para>
+<para>
+<!-- .LP -->
+Any input device that generates key, button, or motion data may be used as
+an extension input device.
+Extension input devices may have zero or more keys, zero or more buttons,
+and may report zero or more axes of motion.  Motion may be reported 
+as relative movements from a previous position or as an absolute
+position.  All valuators reporting motion information for a given
+extension input device must report the same kind of motion information
+(absolute or relative).
+</para>
+<para>
+<!-- .LP -->
+This extension is designed to accommodate new types of input devices that
+may be added in the future.  The protocol requests that refer to
+specific characteristics of input devices organize that information
+by <emphasis remap='I'>input device classes</emphasis>.  Server implementors may add new
+classes of input devices without changing the protocol requests.
+</para>
+<para>
+<!-- .LP -->
+All extension input
+devices are treated like the core X keyboard in determining their location
+and focus.  The server does not track the location of these devices on an
+individual basis and, therefore,
+does not echo a cursor to indicate their current location.
+Instead, their location is determined by the location of the core X pointer.
+Like the core X keyboard, some may be explicitly focused. If they are
+not explicitly focused,  their focus
+is determined by the location of the core X pointer.
+</para>
+<sect3 id="Input_Device_Classes">
+<title>Input Device Classes</title>
+<!-- .XS -->
+<!-- (SN Input Device Classes -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Some of the input extension requests divide input devices into classes
+based on their functionality.  This is intended to allow new classes of input
+devices to be defined at a later time without changing the semantics of 
+these functions.  The following input device classes are currently
+defined:
+<variablelist>
+  <varlistentry>
+    <term>KEY</term>
+    <listitem>
+      <para>
+The device reports key events.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>BUTTON</term>
+    <listitem>
+      <para>
+The device reports button events.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>VALUATOR</term>
+    <listitem>
+      <para>
+The device reports valuator data in motion events.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>PROXIMITY</term>
+    <listitem>
+      <para>
+The device reports proximity events.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>FOCUS</term>
+    <listitem>
+      <para>
+The device can be focused.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>FEEDBACK</term>
+    <listitem>
+      <para>
+The device supports feedbacks.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+Additional classes may be added in the future.
+Functions that support multiple input classes, such as the 
+<xref linkend='XListInputDevices' xrefstyle='select: title'/>
+function that lists all available input devices,
+organize the data they return by input class.  Client programs that
+use these functions should not access data unless it matches a 
+class defined at the time those clients were compiled.  In this way,
+new classes can be added without forcing existing clients that use
+these functions to be recompiled.
+</para>
+</sect3>
+</sect2>
+<sect2 id="Using_Extension_Input_Devices">
+<title>Using Extension Input Devices</title>
+<!-- .XS -->
+<!-- (SN Using Extension Input Devices -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+A client that wishes to access an input device does so through the library
+functions defined in the following sections.  A typical sequence of requests
+that a client would make is as follows:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+<xref linkend='XListInputDevices' xrefstyle='select: title'/>
+- lists all of the available input devices.  From the 
+information returned by this request, determine whether the desired input
+device is attached to the server.  For a description of the 
+<xref linkend='XListInputDevices' xrefstyle='select: title'/>
+request, see the section entitled ``Listing Available Devices.''
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XOpenDevice' xrefstyle='select: title'/>
+- requests that the server open the device for access by this client.
+This request returns an 
+<function>XDevice</function>
+structure that is used
+by most other input extension requests to identify the specified device.
+For a description of the 
+<xref linkend='XOpenDevice' xrefstyle='select: title'/>
+request, see the section entitled ``Enabling and Disabling Extension Devices.''
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Determine the event types and event classes needed to select the desired
+input extension events, and identify them when they are received.
+This is done via macros whose name corresponds to the desired event, for
+example,
+<function>DeviceKeyPress .</function>
+For a description of these macros,
+see the section entitled ``Selecting Extension Device Events.''
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XSelectExtensionEvent' xrefstyle='select: title'/>
+- selects the desired events from the server.
+For a description of the 
+<function>XSelextExtensionEvent</function>
+request, see the section entitled ``Selecting Extension Device Events.''
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>XNextEvent</function>
+- receives the next available event.  This is the core
+<function>XNextEvent</function>
+function provided by the standard X libarary.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+Other requests are defined to grab and focus extension devices, to
+change their key, button, or modifier mappings, to control the
+propagation of input extension events, to get motion history from an
+extension device, and to send input extension events to another client.
+These functions are described in the following sections.
+</para>
+</sect2>
+</sect1>
+<sect1 id="Library_Extension_Requests">
+<title>Library Extension Requests</title>
+<!-- .XS -->
+<!-- (SN Library Extension Requests -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Extension input devices are accessed by client programs through the 
+use of new protocol requests.
+The following requests are provided as extensions to Xlib.  Constants
+and structures referenced by these functions may be found in the 
+files <function>&lt;X11/extensions/XI.h&gt;</function> and <function>&lt;X11/extensions/XInput.h&gt;</function>,
+which are attached to this document as 
+Appendix A.<!-- xref -->
+</para>
+<para>
+<!-- .LP -->
+The library will return <function>NoSuchExtension</function> if an extension request
+is made to a server that does not support the input extension.
+</para>
+<para>
+<!-- .LP -->
+Input extension requests cannot be used to access the X keyboard and
+X pointer devices.
+</para>
+<sect2 id="Window_Manager_Functions">
+<title>Window Manager Functions</title>
+<!-- .XS -->
+<!-- (SN Window Manager Functions -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+This section discusses the following X Input Extension Window Manager topics:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Changing the core devices
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Event synchronization and core grabs
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Extension active grabs
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Passively grabbing a key
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Passively grabbing a button
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Thawing a device
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Controlling device focus
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Controlling device feedback
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Ringing a bell on an input device
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Controlling device encoding
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Controlling button mapping
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Obtaining the state of a device
+    </para>
+  </listitem>
+</itemizedlist>
+<sect3 id="Changing_the_Core_Devices">
+<title>Changing the Core Devices</title>
+<!-- .XS -->
+<!-- (SN Changing the Core Devices -->
+<!-- .XE -->
+
+<para>
+<!-- .LP -->
+These functions are provided to change which physical device is used
+as the X pointer or X keyboard.
+</para>
+<!-- .NT -->
+<note><para>
+Using these functions may change the characteristics of the core devices.
+The new pointer device may have a different number of buttons from the 
+old one, or the new keyboard device may have a different number of
+keys or report a different range of keycodes.  Client programs may be
+running that depend on those characteristics.  For example, a client
+program could allocate an array based on the number of buttons on the
+pointer device and then use the button numbers received in button events
+as indices into that array.  Changing the core devices could cause
+such client programs to behave improperly or to terminate abnormally
+if they ignore the 
+<function>ChangeDeviceNotify</function>
+event generated by these requests.
+</para></note>
+<!-- .NE -->
+
+<para>
+<!-- .LP -->
+These functions change the X keyboard or X pointer device and generate an
+<function>XChangeDeviceNotify</function>
+event and a
+<function>MappingNotify</function>
+event.  
+The specified device becomes the
+new X keyboard or X pointer device.  The location of the core device
+does not change as a result of this request.
+</para>
+<para>
+<!-- .LP -->
+These requests fail and return 
+<function>AlreadyGrabbed</function>
+if either the specified
+device or the core device it would replace are grabbed by some other client.
+They fail and return 
+<function>GrabFrozen</function>
+if either device is frozen by the active grab of another client.
+</para>
+<para>
+<!-- .LP -->
+These requests fail with a
+<function>BadDevice</function>
+error if the specified device is invalid, has not previously been opened via
+<function>XOpenDevice ,</function>
+or is
+not supported as a core device by the server implementation.
+</para>
+<para>
+<!-- .LP -->
+Once the device has successfully replaced one of the core devices, it
+is treated as a core device until it is in turn replaced by another
+<function>ChangeDevice</function>
+request or until the server terminates.  The termination
+of the client that changed the device will not cause it to change back.
+Attempts to use the
+<xref linkend='XCloseDevice' xrefstyle='select: title'/>
+request to close the new core device will fail with a
+<function>BadDevice</function>
+error.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To change which physical device is used as the X keyboard, use the 
+<xref linkend='XChangeKeyboardDevice' xrefstyle='select: title'/>
+function.
+The specified device must support input class 
+<function>Keys</function>
+(as reported in the
+<function>ListInputDevices</function>
+request) or the request will fail with a 
+<function>BadMatch</function>
+error.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<funcsynopsis id='XChangeKeyboardDevice'>
+<funcprototype>
+  <funcdef>int <function> XChangeKeyboardDevice</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired device.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+If no error occurs, 
+<xref linkend='XChangeKeyboardDevice' xrefstyle='select: title'/>
+returns 
+<function>Success .</function>
+A 
+<function>ChangeDeviceNotify</function>
+event with the request field set to 
+<function>NewKeyboard</function>
+is sent to all clients selecting that event.
+A 
+<function>MappingNotify</function>
+event with the request field set to
+<function>MappingKeyboard</function>
+is sent to all clients.
+The requested device becomes the X keyboard, and the old keyboard becomes 
+available as an extension input device.
+The focus state of the new keyboard is the same as
+the focus state of the old X keyboard.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XChangeKeyboardDevice' xrefstyle='select: title'/>
+can generate
+<function>AlreadyGrabbed ,</function>
+<function>BadDevice ,</function>
+<function>BadMatch ,</function>
+and 
+<function>GrabFrozen</function>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To change which physical device is used as the X pointer,
+use the
+<xref linkend='XChangePointerDevice' xrefstyle='select: title'/>
+function.
+The specified device must support input class 
+<function>Valuators</function>
+(as reported in the
+<xref linkend='XListInputDevices' xrefstyle='select: title'/>
+request) and report at least two axes of motion,
+or the request will fail with a 
+<function>BadMatch</function>
+error.
+If the specified device reports more than two axes, the two specified in
+the xaxis and yaxis arguments will be used.  Data from other
+valuators on the device will be ignored.
+</para>
+<para>
+<!-- .LP -->
+If the specified device reports absolute positional information, and the 
+server implementation does not allow such a device to be used as the 
+X pointer, the request will fail with a 
+<function>BadDevice</function>
+error.
+<!-- .sM -->
+<funcsynopsis id='XChangePointerDevice'>
+<funcprototype>
+  <funcdef>int <function> XChangePointerDevice</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>int<parameter> xaxis</parameter></paramdef>
+  <paramdef>int<parameter> yaxis</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>xaxis</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the zero-based index of the axis to be used as the x-axis of the 
+pointer device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>yaxis</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the zero-based index of the axis to be used as the y-axis of the 
+pointer device.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+If no error occurs, 
+<xref linkend='XChangePointerDevice' xrefstyle='select: title'/>
+returns 
+<function>Success .</function>
+A 
+<function>ChangeDeviceNotify</function>
+event with the request field set to 
+<function>NewPointer</function>
+is sent to all clients selecting that event.
+A
+<function>MappingNotify</function>
+event with the request field set to
+<function>MappingPointer</function>
+is sent to all clients.
+The requested device becomes the X pointer, and the old pointer becomes 
+available as an extension input device.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XChangePointerDevice' xrefstyle='select: title'/>
+can generate
+<function>AlreadyGrabbed ,</function>
+<function>BadDevice ,</function>
+<function>BadMatch ,</function>
+and 
+<function>GrabFrozen</function>
+errors.
+</para>
+</sect3>
+<sect3 id="Event_Synchronization_and_Core_Grabs">
+<title>Event Synchronization and Core Grabs</title>
+<!-- .XS -->
+<!-- (SN Event Synchronization and Core Grabs -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Implementation of the input extension requires an extension of the
+meaning of event synchronization for the core grab requests.  This is
+necessary in order to allow window managers to freeze all input devices
+with a single request.
+</para>
+<para>
+<!-- .LP -->
+The core grab requests require a pointer_mode and keyboard_mode
+argument.  The meaning of these modes is changed by the input extension.
+For the
+<function>XGrabPointer</function>
+and 
+<function>XGrabButton</function>
+requests, pointer_mode controls synchronization of the pointer device, 
+and keyboard_mode controls the synchronization of all other input devices.  
+For the 
+<function>XGrabKeyboard</function>
+and
+<function>XGrabKey</function>
+requests, pointer_mode controls the synchronization
+of all input devices, except the X keyboard, while keyboard_mode controls
+the synchronization of the keyboard.  When using one of the core grab
+requests, the synchronization of extension devices
+is controlled by the mode specified for the device not being grabbed.
+</para>
+</sect3>
+<sect3 id="Extension_Active_Grabs">
+<title>Extension Active Grabs</title>
+<!-- .XS -->
+<!-- (SN Extension Active Grabs -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Active grabs of
+extension devices are supported via the 
+<xref linkend='XGrabDevice' xrefstyle='select: title'/>
+function in the same way that core devices are grabbed using the core 
+<function>XGrabKeyboard</function>
+function, except that an extension input device
+is passed as a function parameter.  
+The 
+<xref linkend='XUngrabDevice' xrefstyle='select: title'/>
+function allows a previous active grab for an extension device to be released.
+</para>
+<para>
+<!-- .LP -->
+Passive grabs of buttons and keys on extension devices are supported
+via the 
+<xref linkend='XGrabDeviceButton' xrefstyle='select: title'/>
+and 
+<xref linkend='XGrabDeviceKey' xrefstyle='select: title'/>
+functions.
+These passive grabs are released via the
+<xref linkend='XUngrabDeviceKey' xrefstyle='select: title'/>
+and
+<xref linkend='XUngrabDeviceButton' xrefstyle='select: title'/>
+functions.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To grab an extension device, use the
+<xref linkend='XGrabDevice' xrefstyle='select: title'/>
+function.
+The device must have previously been opened using the
+<xref linkend='XOpenDevice' xrefstyle='select: title'/>
+function.
+<!-- .sM -->
+<funcsynopsis id='XGrabDevice'>
+<funcprototype>
+  <funcdef>int <function> XGrabDevice</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>Window<parameter> grab_window</parameter></paramdef>
+  <paramdef>Bool<parameter> owner_events</parameter></paramdef>
+  <paramdef>int<parameter> event_count</parameter></paramdef>
+  <paramdef>XEventClass<parameter> *event_list</parameter></paramdef>
+  <paramdef>int<parameter> this_device_mode</parameter></paramdef>
+  <paramdef>int<parameter> other_device_mode</parameter></paramdef>
+  <paramdef>Time<parameter> time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>grab_window</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the ID of a window associated with the device specified above.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>owner_events</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a boolean value of either 
+<function>True</function>
+or 
+<function>False .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of elements in the event_list array.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_list</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to a list of event classes that indicate which events
+the client wishes to receive.  
+These event classes must have been obtained
+using the device being grabbed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>this_device_mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Controls further processing of events from this device.  You can pass one
+of these constants: 
+<function>GrabModeSync</function>
+or 
+<function>GrabModeAsync .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>other_device_mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Controls further processing of events from all other devices.  You can pass one
+of these constants:
+<function>GrabModeSync</function>
+or 
+<function>GrabModeAsync .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the time.  This may be either a timestamp expressed in
+milliseconds or
+<function>CurrentTime .</function>
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XGrabDevice' xrefstyle='select: title'/>
+actively grabs an extension input device and generates 
+<function>DeviceFocusIn</function>
+and 
+<function>DeviceFocusOut</function>
+events.
+Further input events from this device are reported only to the grabbing client.
+This function overrides any previous active grab by this client for this device.
+</para>
+<para>
+<!-- .LP -->
+The event_list parameter is a pointer to a list of event classes.  This list
+indicates which events the client wishes to receive while the grab is active.
+If owner_events is 
+<function>False ,</function>
+input events from this device are reported with respect to 
+grab_window and are reported only if specified in event_list.
+If owner_events is
+<function>True ,</function>
+then if a generated event would normally be reported to this client,
+it is reported normally.
+Otherwise, the event is reported with respect to the grab_window and is only
+reported if specified in event_list.
+</para>
+<para>
+<!-- .LP -->
+The this_device_mode argument controls the further processing 
+of events from this device, and the other_device_mode argument controls
+the further processing of input events from all other devices.
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+If the this_device_mode argument is 
+<function>GrabModeAsync ,</function>
+device event processing continues
+normally; if the device is currently frozen by this client, then
+processing of device events is resumed.
+If the this_device_mode  argument is
+<function>GrabModeSync ,</function>
+the state of the grabbed device
+(as seen by client applications) appears to freeze,
+and no further device events are generated by the server until the
+grabbing client issues a releasing 
+<xref linkend='XAllowDeviceEvents' xrefstyle='select: title'/>
+call or until the device grab is released.
+Actual device input events are not lost while the device is frozen; they are
+simply queued for later processing.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the other_device_mode is 
+<function>GrabModeAsync ,</function>
+event processing from other input devices is unaffected
+by activation of the grab.  
+If other_device_mode is 
+<function>GrabModeSync ,</function>
+the state of all devices except the grabbed device
+(as seen by client applications) appears to freeze, and no further
+events are generated by the server until the grabbing client issues a
+releasing 
+<function>XAllowEvents</function>
+or 
+<xref linkend='XAllowDeviceEvents' xrefstyle='select: title'/>
+call or until the device grab is released.
+Actual events are not lost
+while the other devices are frozen; they are simply queued for later
+processing.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+<xref linkend='XGrabDevice' xrefstyle='select: title'/>
+fails on the following conditions:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+If the device is actively grabbed by some other client, it returns
+<function>AlreadyGrabbed .</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If grab_window is not viewable, it returns
+<function>GrabNotViewable .</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the specified time is earlier
+than the last-grab-time for the specified device
+or later than the current X server time, it returns
+<function>GrabInvalidTime .</function>
+Otherwise,
+the last-grab-time for the specified device is set
+to the specified time and 
+<function>CurrentTime</function>
+is replaced by the current X server time.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the device is frozen by an active grab of another client, it returns
+<function>GrabFrozen .</function>
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+If a grabbed device is closed by a client while an active grab by that 
+client is in effect, that active grab will be released. 
+Any passive grabs established by that client will be released.
+If the device is frozen only by an active grab
+of the requesting client, it is thawed.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGrabDevice' xrefstyle='select: title'/>
+can generate
+<function>BadClass ,</function>
+<function>BadDevice ,</function>
+<function>BadValue ,</function>
+and
+<function>BadWindow</function>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To release a grab of an extension device, use the
+<xref linkend='XUngrabDevice' xrefstyle='select: title'/>
+function.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<funcsynopsis id='XUngrabDevice'>
+<funcprototype>
+  <funcdef>int <function> XUngrabDevice</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>Time<parameter> time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the time.  This may be either a timestamp expressed in
+milliseconds, or 
+<function>CurrentTime .</function>
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XUngrabDevice' xrefstyle='select: title'/>
+allows a client to release an extension input device and any
+queued events if this client has it grabbed from either
+<xref linkend='XGrabDevice' xrefstyle='select: title'/>
+or
+<function>XGrabDeviceKey .</function>
+If any other devices are frozen by the grab,
+<xref linkend='XUngrabDevice' xrefstyle='select: title'/>
+thaws them. 
+This function does not release the device and any
+queued events if the specified time is earlier than the last-device-grab
+time or is later than the current X server time.  It also generates 
+<function>DeviceFocusIn</function>
+and 
+<function>DeviceFocusOut</function>
+events.  The X server automatically performs an
+<xref linkend='XUngrabDevice' xrefstyle='select: title'/>
+if the event window for an active device grab becomes not viewable
+or if the client terminates without releasing the grab.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XUngrabDevice' xrefstyle='select: title'/>
+can generate
+<function>BadDevice</function>
+errors.
+</para>
+</sect3>
+<sect3 id="Passively_Grabbing_a_Key">
+<title>Passively Grabbing a Key</title>
+<!-- .XS -->
+<!-- (SN Passively Grabbing a Key -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To passively grab a single key on an extension device, use
+<function>XGrabDeviceKey .</function>
+That device must have previously been opened using the
+<xref linkend='XOpenDevice' xrefstyle='select: title'/>
+function, or the request will fail with a
+<function>BadDevice</function>
+error.  
+If the specified device does not support input class
+<function>Keys ,</function>
+the request will fail with a
+<function>BadMatch</function>
+error.
+<!-- .sM -->
+<funcsynopsis id='XGrabDeviceKey'>
+<funcprototype>
+  <funcdef>int <function> XGrabDeviceKey</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>int<parameter> keycode</parameter></paramdef>
+  <paramdef>unsignedint<parameter> modifiers</parameter></paramdef>
+  <paramdef>XDevice<parameter> *modifier_device</parameter></paramdef>
+  <paramdef>Window<parameter> grab_window</parameter></paramdef>
+  <paramdef>Bool<parameter> owner_events</parameter></paramdef>
+  <paramdef>int<parameter> event_count</parameter></paramdef>
+  <paramdef>XEventClass<parameter> *event_list</parameter></paramdef>
+  <paramdef>int<parameter> this_device_mode</parameter></paramdef>
+  <paramdef>int<parameter> other_device_mode</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keycode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the keycode of the key that is to be grabbed.  You can pass
+either the keycode or 
+<function>AnyKey .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modifiers</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the set of keymasks.  This mask is the bitwise inclusive OR
+of these keymask bits:  
+<function>ShiftMask ,</function>
+<function>LockMask ,</function>
+<function>ControlMask ,</function>
+<function>Mod1Mask ,</function>
+<function>Mod2Mask ,</function>
+<function>Mod3Mask ,</function>
+<function>Mod4Mask ,</function>
+and
+<function>Mod5Mask .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      
+    </term>
+    <listitem>
+      <para>
+You can also pass 
+<function>AnyModifier ,</function>
+which is equivalent to issuing the grab key request 
+for all possible modifier combinations (including the combination
+of no modifiers).
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modifier_device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the device whose modifiers are to be used.  If NULL is 
+specified, the core X keyboard is used as the modifier_device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>grab_window</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the ID of a window associated with the device specified above.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>owner_events</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a boolean value of either
+<function>True</function>
+or
+<function>False .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of elements in the event_list array.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_list</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to a list of event classes that indicate which events
+the client wishes to receive.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>this_device_mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Controls further processing of events from this device.
+You can pass one of these constants:
+<function>GrabModeSync</function>
+or
+<function>GrabModeAsync .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>other_device_mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Controls further processing of events from all other devices.
+You can pass one of these constants: 
+<function>GrabModeSync</function>
+or
+<function>GrabModeAsync .</function>
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XGrabDeviceKey' xrefstyle='select: title'/>
+is analogous to the core 
+<function>XGrabKey</function>
+function.  It creates an
+explicit passive grab for a key on an extension device.
+The 
+<xref linkend='XGrabDeviceKey' xrefstyle='select: title'/>
+function establishes a passive grab on a device.
+Consequently, in the future, 
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+IF the device is not grabbed and the specified key, 
+which itself can be a modifier key, is logically pressed
+when the specified modifier keys logically are down on the specified
+modifier device (and no other keys are down),
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+AND no other modifier keys logically are down,
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+AND EITHER the grab window is an ancestor of (or is) the focus window
+or the grab window is a descendent of the focus window and contains the pointer,
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+AND a passive grab on the same device and key combination does not exist on any
+ancestor of the grab window,
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+THEN the device is actively grabbed, as for
+<function>XGrabDevice ,</function>
+the last-device-grab time is set to the time at which the key was pressed
+(as transmitted in the 
+<function>DeviceKeyPress</function>
+event), and the 
+<function>DeviceKeyPress</function>
+event is reported.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+The interpretation of the remaining arguments is as for
+<function>XGrabDevice .</function>
+The active grab is terminated automatically when the logical state of the
+device has the specified key released
+(independent of the logical state of the modifier keys).
+</para>
+<para>
+<!-- .LP -->
+Note that the logical state of a device (as seen by means of the X protocol)
+may lag the physical state if device event processing is frozen.
+</para>
+<para>
+<!-- .LP -->
+A modifier of 
+<function>AnyModifier</function>
+is equivalent to issuing the request for all
+possible modifier combinations (including the combination of no modifiers).  
+It is not required that all modifiers specified have
+currently assigned keycodes.
+A key of 
+<function>AnyKey</function>
+is equivalent to issuing
+the request for all possible keycodes.  Otherwise, the key must be in
+the range specified by min_keycode and max_keycode in the 
+information returned by the
+<xref linkend='XListInputDevices' xrefstyle='select: title'/>
+function.
+If it is not within that range, 
+<xref linkend='XGrabDeviceKey' xrefstyle='select: title'/>
+generates a
+<function>BadValue</function>
+error.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGrabDeviceKey' xrefstyle='select: title'/>
+generates a
+<function>BadAccess</function>
+error if some other client has issued a 
+<xref linkend='XGrabDeviceKey' xrefstyle='select: title'/>
+with the same device and key combination on the same window.
+When using
+<function>AnyModifier</function>
+or
+<function>AnyKey ,</function>
+the request fails completely and the X server generates a
+<function>BadAccess</function>
+error, and no grabs are established if there is a conflicting grab
+for any combination.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGrabDeviceKey' xrefstyle='select: title'/>
+returns
+<function>Success</function>
+upon successful completion of the request.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGrabDeviceKey' xrefstyle='select: title'/>
+can generate
+<function>BadAccess ,</function>
+<function>BadClass ,</function>
+<function>BadDevice ,</function>
+<function>BadMatch ,</function>
+<function>BadValue ,</function>
+and
+<function>BadWindow</function>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To release a passive grab of a single key on an extension device, use
+<function>XUngrabDeviceKey .</function>
+<!-- .sM -->
+<funcsynopsis id='XUngrabDeviceKey'>
+<funcprototype>
+  <funcdef>int <function> XUngrabDeviceKey</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>int<parameter> keycode</parameter></paramdef>
+  <paramdef>unsignedint<parameter> modifiers</parameter></paramdef>
+  <paramdef>XDevice<parameter> *modifier_device</parameter></paramdef>
+  <paramdef>Window<parameter> ungrab_window</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keycode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the keycode of the key that is to be ungrabbed.  You can pass
+either the keycode or
+<function>AnyKey .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modifiers</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the set of keymasks.  This mask is the bitwise inclusive OR
+of these keymask bits:
+<function>ShiftMask ,</function>
+<function>LockMask ,</function>
+<function>ControlMask , </function>
+<function>Mod1Mask ,</function>
+<function>Mod2Mask ,</function>
+<function>Mod3Mask ,</function>
+<function>Mod4Mask ,</function>
+and
+<function>Mod5Mask .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      
+    </term>
+    <listitem>
+      <para>
+You can also pass
+<function>AnyModifier ,</function>
+which is equivalent to issuing the ungrab key 
+request for all possible modifier combinations (including the combination
+of no modifiers).
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modifier_device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the device whose modifiers are to be used.  If NULL is 
+specified, the core X keyboard is used as the modifier_device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ungrab_window</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the ID of a window associated with the device specified above.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XUngrabDeviceKey' xrefstyle='select: title'/>
+is analogous to the core
+<function>XUngrabKey</function>
+function.  It releases an explicit passive grab for a key 
+on an extension input device.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XUngrabDeviceKey' xrefstyle='select: title'/>
+can generate
+<function>BadAlloc ,</function>
+<function>BadDevice ,</function>
+<function>BadMatch ,</function>
+<function>BadValue ,</function>
+and 
+<function>BadWindow</function>
+errors.
+</para>
+</sect3>
+<sect3 id="Passively_Grabbing_a_Button">
+<title>Passively Grabbing a Button</title>
+<!-- .XS -->
+<!-- (SN Passively Grabbing a Button -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To establish a passive grab for a single button on an extension device, use
+<function>XGrabDeviceButton .</function>
+The specified device must have previously been opened using the
+<xref linkend='XOpenDevice' xrefstyle='select: title'/>
+function, or the request will fail with a 
+<function>BadDevice</function>
+error.  If the specified device does not support input class
+<function>Buttons ,</function>
+the request will fail with a 
+<function>BadMatch</function>
+error.
+<!-- .sM -->
+<funcsynopsis id='XGrabDeviceButton'>
+<funcprototype>
+  <funcdef>int <function> XGrabDeviceButton</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>unsignedint<parameter> button</parameter></paramdef>
+  <paramdef>unsignedint<parameter> modifiers</parameter></paramdef>
+  <paramdef>XDevice*modifier_device<parameter> </parameter></paramdef>
+  <paramdef>Window<parameter> grab_window</parameter></paramdef>
+  <paramdef>Bool<parameter> owner_events</parameter></paramdef>
+  <paramdef>int<parameter> event_count</parameter></paramdef>
+  <paramdef>XEventClass<parameter> *event_list</parameter></paramdef>
+  <paramdef>int<parameter> this_device_mode</parameter></paramdef>
+  <paramdef>int<parameter> other_device_mode</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>button</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the code of the button that is to be grabbed.  You can pass
+either the button or
+<function>AnyButton .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modifiers</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the set of keymasks.  This mask is the bitwise inclusive OR
+of these keymask bits:
+<function>ShiftMask ,</function>
+<function>LockMask ,</function>
+<function>ControlMask , </function>
+<function>Mod1Mask ,</function>
+<function>Mod2Mask ,</function>
+<function>Mod3Mask ,</function>
+<function>Mod4Mask ,</function>
+and
+<function>Mod5Mask .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      
+    </term>
+    <listitem>
+      <para>
+You can also pass 
+<function>AnyModifier ,</function>
+which is equivalent to issuing the grab request 
+for all possible modifier combinations (including the combination
+of no modifiers).
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modifier_device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the device whose modifiers are to be used.  If NULL is 
+specified, the core X keyboard is used as the modifier_device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>grab_window</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the ID of a window associated with the device specified above.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>owner_events</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a boolean value of either
+<function>True</function>
+or
+<function>False .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of elements in the event_list array.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_list</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a list of event classes that indicates which device events are to be 
+reported to the client.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>this_device_mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Controls further processing of events from this device.  You can pass one
+of these constants:
+<function>GrabModeSync</function>
+or
+<function>GrabModeAsync .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>other_device_mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Controls further processing of events from all other devices.  You can pass one
+of these constants:
+<function>GrabModeSync</function>
+or
+<function>GrabModeAsync .</function>
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XGrabDeviceButton' xrefstyle='select: title'/>
+is analogous to the core
+<function>XGrabButton</function>
+function.  
+It creates an explicit passive grab for a button on an extension input device.
+Because the server does not track extension devices,
+no cursor is specified with this request.
+For the same reason, there is no confine_to parameter.
+The device must have previously been opened using the
+<xref linkend='XOpenDevice' xrefstyle='select: title'/>
+function.
+</para>
+<para>
+<!-- .LP -->
+The
+<xref linkend='XGrabDeviceButton' xrefstyle='select: title'/>
+function establishes a passive grab on a device.
+Consequently, in the future, 
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+IF the device is not grabbed and the specified button is logically pressed
+when the specified modifier keys logically are down 
+(and no other buttons or modifier keys are down),
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+AND EITHER the grab window is an ancestor of (or is) the focus window
+OR the grab window is a descendent of the focus window and contains the pointer,
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+AND a passive grab on the same device and button/key combination does not 
+exist on any ancestor of the grab window,
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+THEN the device is actively grabbed, as for
+<function>XGrabDevice ,</function>
+the last-grab time is set to the time at which the button was pressed
+(as transmitted in the
+<function>DeviceButtonPress</function>
+event), and the 
+<function>DeviceButtonPress</function>
+event is reported.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+The interpretation of the remaining arguments is as for 
+<function>XGrabDevice .</function>
+The active grab is terminated automatically when logical state of the
+device has all buttons released (independent of the logical state of 
+the modifier keys).
+</para>
+<para>
+<!-- .LP -->
+Note that the logical state of a device (as seen by means of the X protocol)
+may lag the physical state if device event processing is frozen.
+</para>
+<para>
+<!-- .LP -->
+A modifier of
+<function>AnyModifier</function>
+is equivalent to issuing the request for all
+possible modifier combinations (including the combination of no
+modifiers).  
+It is not required that all modifiers specified have
+currently assigned keycodes.
+A button of
+<function>AnyButton</function>
+is equivalent to issuing
+the request for all possible buttons.
+Otherwise, it is not required that the 
+specified button be assigned to a physical button.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGrabDeviceButton' xrefstyle='select: title'/>
+generates a
+<function>BadAccess</function>
+error if some other client has issued a 
+<xref linkend='XGrabDeviceButton' xrefstyle='select: title'/>
+with the same device and button combination on the same window.  
+When using
+<function>AnyModifier</function>
+or
+<function>AnyButton ,</function>
+the request fails completely and the X server generates a
+<function>BadAccess</function>
+error and no grabs are
+established if there is a conflicting grab for any combination.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGrabDeviceButton' xrefstyle='select: title'/>
+can generate
+<function>BadAccess , </function>
+<function>BadClass ,</function>
+<function>BadDevice ,</function>
+<function>BadMatch ,</function>
+<function>BadValue ,</function>
+and
+<function>BadWindow</function>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To release a passive grab of a button on an extension device, use 
+<function>XUngrabDeviceButton .</function>
+<!-- .sM -->
+<funcsynopsis id='XUngrabDeviceButton'>
+<funcprototype>
+  <funcdef>int <function> XUngrabDeviceButton</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>unsignedint<parameter> button</parameter></paramdef>
+  <paramdef>unsignedint<parameter> modifiers</parameter></paramdef>
+  <paramdef>XDevice<parameter> *modifier_device</parameter></paramdef>
+  <paramdef>Window<parameter> ungrab_window</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>button</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the code of the button that is to be ungrabbed.  You can pass
+either a button or
+<function>AnyButton .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modifiers</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the set of keymasks.  This mask is the bitwise inclusive OR
+of these keymask bits:
+<function>ShiftMask ,</function>
+<function>LockMask ,</function>
+<function>ControlMask , </function>
+<function>Mod1Mask ,</function>
+<function>Mod2Mask ,</function>
+<function>Mod3Mask ,</function>
+<function>Mod4Mask ,</function>
+and
+<function>Mod5Mask .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      
+    </term>
+    <listitem>
+      <para>
+You can also pass
+<function>AnyModifier ,</function>
+which is equivalent to issuing the ungrab key 
+request for all possible modifier combinations (including the combination
+of no modifiers).
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modifier_device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the device whose modifiers are to be used.  If NULL is 
+specified, the core X keyboard is used as the modifier_device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ungrab_window</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the ID of a window associated with the device specified above.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XUngrabDeviceButton' xrefstyle='select: title'/>
+is analogous to the core
+<function>XUngrabButton</function>
+function.  It releases an explicit passive grab for a button
+on an extension device.
+That device must have previously been opened using the
+<xref linkend='XOpenDevice' xrefstyle='select: title'/>
+function, or a
+<function>BadDevice</function>
+error will result.
+</para>
+<para>
+<!-- .LP -->
+A modifier of
+<function>AnyModifier</function>
+is equivalent to issuing the request for all
+possible modifier combinations (including the combination of no
+modifiers).  
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XUngrabDeviceButton' xrefstyle='select: title'/>
+can generate
+<function>BadAlloc , </function>
+<function>BadDevice ,</function>
+<function>BadMatch ,</function>
+<function>BadValue ,</function>
+and
+<function>BadWindow</function>
+errors.
+</para>
+</sect3>
+<sect3 id="Thawing_a_Device">
+<title>Thawing a Device</title>
+<!-- .XS -->
+<!-- (SN Thawing a Device -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To allow further events to be processed when a device has been frozen, use
+<function>XAllowDeviceEvents .</function>
+<!-- .sM -->
+<funcsynopsis id='XAllowDeviceEvents'>
+<funcprototype>
+  <funcdef>int <function> XAllowDeviceEvents</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>int<parameter> event_mode</parameter></paramdef>
+  <paramdef>Time<parameter> time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the event mode.  You can pass one of these constants:
+<function>AsyncThisDevice ,</function>
+<function>SyncThisDevice ,</function>
+<function>AsyncOtherDevices ,</function>
+<function>ReplayThisDevice ,</function>
+<function>AsyncAll ,</function>
+or
+<function>SyncAll .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the time.  This may be either a timestamp expressed in
+milliseconds, or
+<function>CurrentTime .</function>
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XAllowDeviceEvents' xrefstyle='select: title'/>
+releases some queued events if the client has caused a device to freeze.
+It has no effect if the specified time is earlier than the last-grab 
+time of the most recent active grab for the client and device, 
+or if the specified time is later than the current X server time.
+The following describes the processing that occurs depending on what constant
+you pass to the event_mode argument:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+<function>AsyncThisDevice</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the specified device is frozen by the client, event processing for that 
+continues as usual.  If the device is frozen multiple times by the client on 
+behalf of multiple separate grabs, 
+<function>AsyncThisDevice</function>
+thaws for all.
+<function>AsyncThisDevice</function>
+has no effect if the specified device is not frozen by the 
+client, but the device need not be grabbed by the client.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>SyncThisDevice</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the specified device is frozen and actively grabbed by the client,
+event processing for that device continues normally until the next 
+key or button event is reported to the client.
+At this time, 
+the specified device again appears to freeze.
+However, if the reported event causes the grab to be released,
+the specified device does not freeze.
+<function>SyncThisDevice</function>
+has no effect if the specified device is not frozen by the client
+or is not grabbed by the client.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>ReplayThisDevice</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the specified device is actively grabbed by the client
+and is frozen as the result of an event having been sent to the client
+(either from the activation of a 
+<function>GrabDeviceButton</function>
+or from a previous
+<function>AllowDeviceEvents</function>
+with mode 
+<function>SyncThisDevice , </function>
+but not from a
+<function>Grab ),</function>
+the grab is released and that event is completely reprocessed.
+This time, however, the request ignores any passive grabs at or above 
+(toward the root) the grab-window of the grab just released.
+The request has no effect if the specified device is not grabbed by the client
+or if it is not frozen as the result of an event.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>AsyncOtherDevices</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the remaining devices are frozen by the client,
+event processing for them continues as usual.
+If the other devices are frozen multiple times  by the client on behalf of 
+multiple separate grabs,
+<function>AsyncOtherDevices</function>
+``thaws'' for all.
+<function>AsyncOtherDevices</function>
+has no effect if the devices are not frozen by the client,
+but those devices need not be grabbed by the client.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>SyncAll</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If all devices are frozen by the client,
+event processing (for all devices) continues normally until the next
+button or key event is reported
+to the client for a grabbed device,
+at which time the devices again appear to
+freeze.  However, if the reported event causes the grab to be released,
+then the devices do not freeze (but if any device is still
+grabbed, then a subsequent event for it will still cause all devices
+to freeze).  
+<function>SyncAll</function>
+has no effect unless all devices are frozen by the client.
+If any device is frozen twice
+by the client on behalf of two separate grabs, 
+<function>SyncAll</function>
+"thaws" for both (but a subsequent freeze for 
+<function>SyncAll</function>
+will freeze each device only once).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>AsyncAll</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If all devices are frozen by the
+client, event processing (for all devices) continues normally.
+If any device is frozen multiple times by the client on behalf of multiple
+separate grabs, 
+<function>AsyncAll</function>
+``thaws ''for all.
+If any device is frozen twice by the client on behalf of two separate grabs,
+<function>AsyncAll</function>
+``thaws'' for both.
+<function>AsyncAll</function>
+has no effect unless all devices are frozen by the client.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+<function>AsyncThisDevice ,</function>
+<function>SyncThisDevice ,</function>
+and
+<function>ReplayThisDevice </function>
+have no effect on the processing of events from the remaining devices.
+<function>AsyncOtherDevices</function>
+has no effect on the processing of events from the specified device.
+When the event_mode is
+<function>SyncAll</function>
+or
+<function>AsyncAll ,</function>
+the device parameter is ignored.
+</para>
+<para>
+<!-- .LP -->
+It is possible for several grabs of different devices (by the same 
+or different clients) to be active simultaneously.
+If a device is frozen on behalf of any grab,
+no event processing is performed for the device.
+It is possible for a single device to be frozen because of several grabs.
+In this case,
+the freeze must be released on behalf of each grab before events can 
+again be processed.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XAllowDeviceEvents' xrefstyle='select: title'/>
+can generate
+<function>BadDevice</function>
+and 
+<function>BadValue</function>
+errors.
+</para>
+</sect3>
+<sect3 id="Controlling_Device_Focus">
+<title>Controlling Device Focus</title>
+<!-- .XS -->
+<!-- (SN Controlling Device Focus -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The current focus window for an extension input device can be 
+determined using the
+<xref linkend='XGetDeviceFocus' xrefstyle='select: title'/>
+function.
+Extension devices are focused using the
+<xref linkend='XSetDeviceFocus' xrefstyle='select: title'/>
+function in the same way that the keyboard is focused using the core
+<function>XSetInputFocus</function>
+function, except that a device ID is passed as
+a function parameter.  One additional focus state,
+<function>FollowKeyboard ,</function>
+is provided for extension devices.
+</para>
+<para>
+<!-- .LP -->
+To get the current focus state, revert state,
+and focus time of an extension device, use
+<function>XGetDeviceFocus .</function>
+<!-- .sM -->
+<funcsynopsis id='XGetDeviceFocus'>
+<funcprototype>
+  <funcdef>int <function> XGetDeviceFocus</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>Window<parameter> *focus_return</parameter></paramdef>
+  <paramdef>int<parameter> *revert_to_return</parameter></paramdef>
+  <paramdef>Time<parameter> *focus_time_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>focus_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the address of a variable into which the server can return the ID of
+the window that contains the device focus or one of the constants
+<function>None ,</function>
+<function>PointerRoot ,</function>
+or
+<function>FollowKeyboard .  </function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>revert_to_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the address of a variable into which the server can
+return the current revert_to status for the device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>focus_time_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the address of a variable into which the server can
+return the focus time last set for the device.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XGetDeviceFocus' xrefstyle='select: title'/>
+returns the focus state, the revert-to state,
+and the last-focus-time for an extension input device.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetDeviceFocus' xrefstyle='select: title'/>
+can generate
+<function>BadDevice</function>
+and
+<function>BadMatch</function>
+errors.
+<!-- .sp  -->
+</para>
+<para>
+<!-- .LP -->
+To set the focus of an extension device, use
+<function>XSetDeviceFocus .</function>
+<!-- .sM -->
+<funcsynopsis id='XSetDeviceFocus'>
+<funcprototype>
+  <funcdef>int <function> XSetDeviceFocus</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>Window<parameter> focus</parameter></paramdef>
+  <paramdef>int<parameter> revert_to</parameter></paramdef>
+  <paramdef>Time<parameter> time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>focus</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the ID of the window to which the device's focus should be set.
+This may be a window ID, or
+<function>PointerRoot ,</function>
+<function>FollowKeyboard ,</function>
+or
+<function>None .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>revert_to</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies to which window the focus of the device should revert
+if the focus window becomes not viewable.  One of the following
+constants may be passed:
+<function>RevertToParent ,</function>
+<function>RevertToPointerRoot ,</function>
+<function>RevertToNone ,</function>
+or
+<function>RevertToFollowKeyboard .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the time.  You can pass either a timestamp, expressed in
+milliseconds, or
+<function>CurrentTime .</function>
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XSetDeviceFocus' xrefstyle='select: title'/>
+changes the focus for an extension input device and the 
+last-focus-change-time.  It has no effect if the specified 
+time is earlier than the last-focus-change-time or is later than the
+current X server time.  Otherwise, the last-focus-change-time is set to the
+specified time.
+This function causes the X server to generate
+<function>DeviceFocusIn</function>
+and 
+<function>DeviceFocusOut</function>
+events.
+</para>
+<para>
+<!-- .LP -->
+The action taken by the server when this function is requested depends
+on the value of the focus argument:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+If the focus argument is
+<function>None ,</function>
+all input events from this device will be discarded until a new focus window
+is set.  In this case, the revert_to argument is ignored.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the focus argument is a window ID, it becomes the focus
+window of the device.  If an input event from the device would normally
+be reported to this window or to one of its inferiors, the event is 
+reported normally.  Otherwise, the event is reported relative to the focus 
+window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the focus argument is
+<function>PointerRoot ,</function>
+the focus window is dynamically taken to be the root window 
+of whatever screen the pointer is on at each input event.
+In this case, the revert_to argument is ignored.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the focus argument is
+<function>FollowKeyboard ,   </function>
+the focus window is dynamically taken to be the same as the focus
+of the X keyboard at each input event.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+The specified focus window must be viewable at the time
+<xref linkend='XSetDeviceFocus' xrefstyle='select: title'/>
+is called.  Otherwise, it generates a
+<function>BadMatch</function>
+error.
+If the focus window later becomes not viewable,
+the X server evaluates the revert_to argument
+to determine the new focus window.
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+If the revert_to argument is
+<function>RevertToParent ,</function>
+the focus reverts to the parent (or the closest viewable ancestor),
+and the new revert_to value is taken to be
+<function>RevertToNone .  </function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the revert_to argument is
+<function>RevertToPointerRoot ,</function>
+<function>RevertToFollowKeyboard ,</function>
+or
+<function>RevertToNone ,</function>
+the focus reverts to that value.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+When the focus reverts,
+the X server generates
+<function>DeviceFocusIn</function>
+and
+<function>DeviceFocusOut</function>
+events, but the last-focus-change time is not affected.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetDeviceFocus' xrefstyle='select: title'/>
+can generate
+<function>BadDevice ,</function>
+<function>BadMatch , </function>
+<function>BadValue ,</function>
+and
+<function>BadWindow</function>
+errors.
+</para>
+</sect3>
+<sect3 id="Controlling_Device_Feedback">
+<title>Controlling Device Feedback</title>
+<!-- .XS -->
+<!-- (SN Controlling Device Feedback -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To determine the current feedback settings of an extension input device, use
+<function>XGetFeedbackControl .</function>
+<!-- .sM -->
+<funcsynopsis id='XGetFeedbackControl'>
+<funcprototype>
+  <funcdef>XFeedbackState * <function> XGetFeedbackControl</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>int<parameter> *num_feedbacks_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_feedbacks_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of feedbacks supported by the device.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XGetFeedbackControl' xrefstyle='select: title'/>
+returns a list of
+<function>FeedbackState</function>
+structures that describe the feedbacks supported by the specified device.
+There is an
+<function>XFeedbackState</function>
+structure for each class of feedback.  These are of 
+variable length, but the first three members are common to all.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     XID class;
+     int length;
+     XID id;
+} XFeedbackState;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The common members are as follows:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+The class member identifies the class of feedback.
+It may be compared to constants defined in the file
+<function>&lt; X11/extensions/XI.h &gt;.</function>
+Currently defined feedback constants include:
+<function>KbdFeedbackClass , </function>
+<function>PtrFeedbackClass ,</function>
+<function>StringFeedbackClass ,</function>
+<function>IntegerFeedbackClass , </function>
+<function>LedFeedbackClass ,</function>
+and
+<function>BellFeedbackClass .</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The length member specifies the length of the
+<function>FeedbackState</function>
+structure and can be used by clients to traverse the list.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The id member uniquely identifies a feedback for a given device and class.
+This allows a device to support more than one feedback of the same class.
+Other feedbacks of other classes or devices may have the same ID.
+<!-- .sp -->
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+Those feedbacks equivalent to those
+supported by the core keyboard are reported in class
+<function>KbdFeedback</function>
+using the
+<function>XKbdFeedbackState</function>
+structure, which is defined as follows:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     XID class;
+     int length;
+     XID id;
+     int click;
+     int percent;
+     int pitch;
+     int duration;
+     int led_mask;
+     int global_auto_repeat;
+     char auto_repeats[32];
+} XKbdFeedbackState;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The additional members of the
+<function>XKbdFeedbackState</function>
+structure report the current state of the feedback:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+The click member specifies the key-click volume and has a value in the range
+0 (off) to 100 (loud).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The percent member specifies the bell volume and has a value in the range
+0 (off) to 100 (loud).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The pitch member specifies the bell pitch in Hz. The range of the value is 
+implementation-dependent.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The duration member specifies the duration in milliseconds of the bell.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The led_mask member is a bit mask that describes the current state of up to 
+32 LEDs.  A value of 1 in a bit indicates that the corresponding LED is on.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The global_auto_repeat member has a value of
+<function>AutoRepeatModeOn</function>
+or
+<function>AutoRepeatModeOff .</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The auto_repeats member is a bit vector.  Each bit set to 1 indicates
+that auto-repeat is enabled for the corresponding key.  The vector is
+represented as 32 bytes.  Byte N (from 0) contains the bits for keys
+8N to 8N + 7, with the least significant bit in the byte representing
+key 8N.
+<!-- .sp -->
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+Those feedbacks equivalent to those
+supported by the core pointer are reported in class
+<function>PtrFeedback</function>
+using the
+<function>XPtrFeedbackState</function>
+structure, which is defined as follows:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     XID class;
+     int length;
+     XID id;
+     int accelNum;
+     int accelDenom;
+     int threshold;
+} XPtrFeedbackState;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The additional members of the
+<function>XPtrFeedbackState</function>
+structure report the current state of the feedback:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+The accelNum member returns the numerator for the acceleration multiplier.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The accelDenom member returns the denominator for the acceleration multiplier.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The accelDenom member returns the threshold for the acceleration.
+<!-- .sp -->
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+Integer feedbacks are those capable of displaying integer numbers
+and reported via the
+<function>XIntegerFeedbackState</function>
+structure.
+The minimum and maximum values that they can display are reported.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     XID class;
+     int length;
+     XID id;
+     int resolution;
+     int minVal;
+     int maxVal;
+} XIntegerFeedbackState;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The additional members of the
+<function>XIntegerFeedbackState</function>
+structure report the capabilities of the feedback:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+The resolution member specifies the number of digits that the feedback
+can display.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The minVal member specifies the minimum value that the feedback can display.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The maxVal specifies the maximum value that the feedback can display.
+<!-- .sp -->
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+String feedbacks are those that can display character information
+and are reported via the
+<function>XStringFeedbackState</function>
+structure.
+Clients set these feedbacks by passing a list of 
+<function>KeySyms</function>
+to be displayed.
+The 
+<xref linkend='XGetFeedbackControl' xrefstyle='select: title'/>
+function returns the
+set of key symbols that the feedback can display, as well as the 
+maximum number of symbols that can be displayed.
+The
+<function>XStringFeedbackState</function>
+structure is defined as follows:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     XID class;
+     int length;
+     XID id;
+     int max_symbols;
+     int  num_syms_supported;
+     KeySym *syms_supported;
+} XStringFeedbackState;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The additional members of the
+<function>XStringFeedbackState</function>
+structure report the capabilities of the feedback:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+The max_symbols member specifies the maximum number of symbols
+that can be displayed.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The syms_supported member is a pointer to the list of supported symbols.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The num_syms_supported member specifies the length of the list of supported symbols.
+<!-- .sp -->
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+Bell feedbacks are those that can generate a sound
+and are reported via the
+<function>XBellFeedbackState</function>
+structure.
+Some implementations may support a bell as part of a
+<function>KbdFeedback</function>
+feedback.  Class
+<function>BellFeedback</function>
+is provided for implementations that do not choose to do
+so and for devices that support multiple feedbacks that can produce sound.
+The meaning of the members is the same as that of the corresponding fields in
+the 
+<function>XKbdFeedbackState</function>
+structure.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     XID class;
+     int length;
+     XID id;
+     int percent;
+     int pitch;
+     int duration;
+} XBellFeedbackState;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Led feedbacks are those that can generate a light and are reported via the
+<function>XLedFeedbackState</function>
+structure.
+Up to 32 lights per feedback are supported.  
+Each bit in led_mask
+corresponds to one supported light, and the corresponding bit in led_values
+indicates whether that light is currently on (1) or off (0).
+Some implementations may support leds as part of a
+<function>KbdFeedback</function>
+feedback.
+Class 
+<function>LedFeedback</function>
+is provided for implementations that do not choose to do
+so and for devices that support multiple led feedbacks.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     XID class;
+     int length;
+     XID id;
+     Mask led_values;
+     Mask led_mask;
+} XLedFeedbackState;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XGetFeedbackControl' xrefstyle='select: title'/>
+can generate
+<function>BadDevice</function>
+and
+<function>BadMatch</function>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To free the information returned by the
+<xref linkend='XGetFeedbackControl' xrefstyle='select: title'/>
+function, use 
+<function>XFreeFeedbackList .</function>
+<!-- .sM -->
+<funcsynopsis id='XFreeFeedbackList'>
+<funcprototype>
+  <funcdef>void <function> XFreeFeedbackList</function></funcdef>
+  <paramdef>XFeedbackState<parameter> *list</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>list</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the pointer to the 
+<function>XFeedbackState</function>
+structure returned by
+a previous call to
+<function>XGetFeedbackControl .</function>
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XFreeFeedbackList' xrefstyle='select: title'/>
+frees the list of feedback control information.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To change the settings of a feedback on an extension device, use
+<function>XChangeFeedbackControl .</function>
+This function modifies the current control values of the specified feedback
+using information passed in the appropriate
+<function>XFeedbackControl</function>
+structure for the feedback.
+Which values are modified depends on the valuemask passed.
+<!-- .sM -->
+<funcsynopsis id='XChangeFeedbackControl'>
+<funcprototype>
+  <funcdef>int <function> XChangeFeedbackControl</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>unsignedlong<parameter> valuemask</parameter></paramdef>
+  <paramdef>XFeedbackControl<parameter> *value</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>valuemask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies one value for each bit in the mask (least to most significant
+bit).  The values are associated with the feedbacks for the specified
+device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>value</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to the
+<function>XFeedbackControl</function>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XChangeFeedbackControl' xrefstyle='select: title'/>
+controls the device characteristics described by the
+<function>XFeedbackControl</function>
+structure. 
+There is an
+<function>XFeedbackControl</function>
+structure for each class of feedback.  
+These are of variable length, but the first 
+three members are common to all and are as follows:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     XID class;
+     int length;
+     XID id;
+} XFeedbackControl;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Feedback class 
+<function>KbdFeedback</function>
+controls feedbacks equivalent to those provided by the core keyboard using the
+<function>KbdFeedbackControl</function>
+structure, which is defined as follows:.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     XID class;
+     int length;
+     XID id;
+     int click;
+     int percent;
+     int pitch;
+     int duration;
+     int led_mask;
+     int led_value;
+     int key;
+     int auto_repeat_mode;
+} XKbdFeedbackControl;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+This class controls the device characteristics described by the
+<function>XKbdFeedbackControl</function>
+structure.  These include the key_click_percent,
+global_auto_repeat, and individual key auto-repeat.  Valid modes
+are
+<function>AutoRepeatModeOn ,</function>
+<function>AutoRepeatModeOff ,</function>
+and
+<function>AutoRepeatModeDefault .</function>
+</para>
+<para>
+<!-- .LP -->
+Valid masks are as follows:
+<!-- .sM -->
+</para>
+
+<literallayout class="monospaced">
+
+#define   DvKeyClickPercent           (1>&lt;&lt;0)
+#define   DvPercent                   (1>&lt;&lt;0)
+#define   DvPitch                     (1>&lt;&lt;0)
+#define   DvDuration                  (1>&lt;&lt;0)
+#define   DvLed                       (1>&lt;&lt;0)
+#define   DvLedMode                   (1>&lt;&lt;0)
+#define   DvKey                       (1>&lt;&lt;0)
+#define   DvAutoRepeatMode            (1>&lt;&lt;0)
+</literallayout>
+
+<para>
+<!-- .LP -->
+Feedback class
+<function>PtrFeedback</function>
+controls feedbacks equivalent to those provided by the core pointer using the
+<function>PtrFeedbackControl</function>
+structure, which is defined as follows:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     XID class;
+     int length;
+     XID id;
+     int accelNum;
+     int accelDenom;
+     int threshold;
+} XPtrFeedbackControl;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Which values are modified depends on the valuemask passed.
+</para>
+<para>
+<!-- .LP -->
+Valid masks are as follows:
+<!-- .sM -->
+</para>
+
+<literallayout class="monospaced">
+#define    DvAccelnum        (1L&lt;&lt;0)
+#define    DvAccelDenom      (1L&lt;&lt;1)
+#define    DvThreshold       (1L&lt;&lt;2)
+</literallayout>
+
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The acceleration, expressed as a fraction, is a multiplier for movement. 
+For example,
+specifying 3/1 means that the device moves three times as fast as normal.
+The fraction may be rounded arbitrarily by the X server.  
+Acceleration takes effect only if the device moves more than threshold pixels at
+once and applies only to the amount beyond the value in the threshold argument.
+Setting a value to -1 restores the default.
+The values of the accelNumerator and threshold fields must be nonzero for
+the pointer values to be set.
+Otherwise, the parameters will be unchanged.
+Negative values generate a
+<function>BadValue</function>
+error, as does a zero value
+for the accelDenominator field.
+</para>
+<para>
+<!-- .LP -->
+This request fails with a
+<function>BadMatch</function>
+error if the specified device is not currently reporting relative motion.
+If a device that is capable of reporting both relative and absolute motion
+has its mode changed from
+<function>Relative</function>
+to
+<function>Absolute</function>
+by an
+<xref linkend='XSetDeviceMode' xrefstyle='select: title'/>
+request, valuator control values
+will be ignored by the server while the device is in that mode.
+</para>
+<para>
+<!-- .LP -->
+Feedback class
+<function>IntegerFeedback</function>
+controls integer feedbacks displayed on input devices and are
+reported via the
+<function>IntegerFeedbackControl</function>
+structure, which is defined as follows:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     XID class;
+     int length;
+     XID id;
+     int int_to_display;
+} XIntegerFeedbackControl;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Valid masks are as follows:
+<!-- .sM -->
+</para>
+
+<literallayout class="monospaced">
+
+#define   DvInteger           (1L&lt;&lt;0)
+</literallayout>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Feedback class
+<function>StringFeedback</function>
+controls string feedbacks displayed on input devices
+and reported via the
+<function>StringFeedbackControl</function>
+structure, which is defined as follows:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     XID class;
+     int length;
+     XID id;
+     int num_keysyms;
+     KeySym *syms_to_display;
+} XStringFeedbackControl;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Valid masks are as follows:
+<!-- .sM -->
+</para>
+<literallayout class="monospaced">
+
+#define   DvString           (1L&lt;&lt;0)
+</literallayout>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Feedback class
+<function>BellFeedback</function>
+controls a bell on an input device and is reported via the
+<function>BellFeedbackControl</function>
+structure, which is defined as follows:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     XID class;
+     int length;
+     XID id;
+     int percent;
+     int pitch;
+     int duration;
+} XBellFeedbackControl;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Valid masks are as follows:
+<!-- .sM -->
+</para>
+
+
+<literallayout class="monospaced">
+
+#define   DvPercent                   (1L&lt;&lt;1)
+#define   DvPitch                     (1L&lt;&lt;2)
+#define   DvDuration                  (1L&lt;&lt;3)
+</literallayout>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Feedback class
+<function>LedFeedback</function>
+controls lights on an input device and are reported via the
+<function>LedFeedbackControl</function>
+structure, which is defined as follows:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     XID class;
+     int length;
+     XID id;
+     int led_mask;
+     int led_values;
+} XLedFeedbackControl;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+Valid masks are as follows:
+<!-- .sM -->
+</para>
+
+<literallayout class="monospaced">
+
+#define   DvLed                       (1L&lt;&lt;4)
+#define   DvLedMode                   (1L&lt;&lt;5)
+</literallayout>
+
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XChangeFeedbackControl' xrefstyle='select: title'/>
+can generate
+<function>BadDevice ,</function>
+<function>BadFeedBack ,</function>
+<function>BadMatch ,</function>
+and
+<function>BadValue</function>
+errors.
+</para>
+</sect3>
+<sect3 id="Ringing_a_Bell_on_an_Input_Device">
+<title>Ringing a Bell on an Input Device</title>
+<!-- .XS -->
+<!-- (SN Ringing a Bell on an Input Device -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To ring a bell on an extension input device, use
+<function>XDeviceBell .</function>
+<!-- .sM -->
+<funcsynopsis id='XDeviceBell'>
+<funcprototype>
+  <funcdef>int <function> XDeviceBell</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>XIDfeedbackclass,<parameter> feedbackid</parameter></paramdef>
+  <paramdef>int<parameter> percent</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>feedbackclass</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the feedbackclass.  Valid values are
+<function>KbdFeedbackClass</function>
+and
+<function>BellFeedbackClass .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>feedbackid</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the ID of the feedback that has the bell.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>percent</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the volume in the range -100 (quiet) to 100 percent (loud).
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XDeviceBell' xrefstyle='select: title'/>
+is analogous to the core 
+<function>XBell</function>
+function.  It rings the specified bell on the specified input device feedback,
+using the specified volume.
+The specified volume is relative to the base volume for the feedback.
+If the value for the percent argument is not in the range -100 to 100
+inclusive, a
+<function>BadValue</function>
+error results.
+The volume at which the bell rings when the percent argument is nonnegative is:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+       base - [(base * percent) / 100] + percent
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+The volume at which the bell rings
+when the percent argument is negative is:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+       base + [(base * percent) / 100]
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+To change the base volume of the bell, use
+<function>XChangeFeedbackControl .</function>
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XDeviceBell' xrefstyle='select: title'/>
+can generate
+<function>BadDevice</function>
+and
+<function>BadValue</function>
+errors.
+</para>
+</sect3>
+<sect3 id="Controlling_Device_Encoding">
+<title>Controlling Device Encoding</title>
+<!-- .XS -->
+<!-- (SN Controlling Device Encoding -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To get the key mapping of an extension device that supports input class 
+<function>Keys ,</function>
+use 
+<function>XGetDeviceKeyMapping .</function>
+<!-- .sM -->
+<funcsynopsis id='XGetDeviceKeyMapping'>
+<funcprototype>
+  <funcdef>KeySym * <function> XGetDeviceKeyMapping</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>KeyCode<parameter> first_keycode_wanted</parameter></paramdef>
+  <paramdef>int<parameter> keycode_count</parameter></paramdef>
+  <paramdef>int<parameter> *keysyms_per_keycode_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>first_keycode_wanted</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the first keycode that is to be returned.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keycode_count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of keycodes that are to be returned.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keysyms_per_keycode_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of keysyms per keycode.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XGetDeviceKeyMapping' xrefstyle='select: title'/>
+is analogous to the core
+<function>XGetKeyboardMapping</function>
+function.  
+It returns the symbols for the specified number of keycodes for the 
+specified extension device.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetDeviceKeyMapping' xrefstyle='select: title'/>
+returns the symbols for the 
+specified number of keycodes for the 
+specified extension device, starting with the specified keycode.
+The first_keycode_wanted must be greater than or equal to
+min-keycode as returned 
+by the
+<xref linkend='XListInputDevices' xrefstyle='select: title'/>
+request (else a 
+<function>BadValue</function>
+error results). The following value:
+<literallayout class="monospaced">
+first_keycode_wanted + keycode_count - 1
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+must be less than or equal to max-keycode as returned 
+by the 
+<xref linkend='XListInputDevices' xrefstyle='select: title'/>
+request (else a 
+<function>BadValue</function>
+error results).
+</para>
+<para>
+<!-- .LP -->
+The number of elements in the keysyms list is as follows:
+<literallayout class="monospaced">
+keycode_count * keysyms_per_keycode_return
+</literallayout>
+And KEYSYM number N (counting from zero) for keycode K has an index
+(counting from zero), in keysyms, of the following:
+<literallayout class="monospaced">
+(K - first_keycode_wanted) * keysyms_per_keycode_return + N
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+The keysyms_per_keycode_return value is chosen arbitrarily by the server
+to be large enough to report all requested symbols.
+A special KEYSYM value of
+<function>NoSymbol</function>
+is used to fill in unused elements for individual keycodes.
+</para>
+<para>
+<!-- .LP -->
+To free the data returned by this function, use
+<function>XFree</function>.
+</para>
+<para>
+<!-- .LP -->
+If the specified device has not first been opened by this client via
+<function>XOpenDevice ,</function>
+this request will fail with a
+<function>BadDevice</function>
+error.
+If that device does not support input class
+<function>Keys ,</function>
+this request will fail with a 
+<function>BadMatch</function>
+error.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetDeviceKeyMapping' xrefstyle='select: title'/>
+can generate
+<function>BadDevice ,</function>
+<function>BadMatch ,</function>
+and
+<function>BadValue</function>
+errors.
+<!-- .sp  -->
+</para>
+<para>
+<!-- .LP -->
+To change the keyboard mapping of an extension device that supports input class 
+<function>Keys ,</function>
+use 
+<function>XChangeDeviceKeyMapping .</function>
+<!-- .sM -->
+<funcsynopsis id='XChangeDeviceKeyMapping'>
+<funcprototype>
+  <funcdef>int <function> XChangeDeviceKeyMapping</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>int<parameter> first_keycode</parameter></paramdef>
+  <paramdef>int<parameter> keysyms_per_keycode</parameter></paramdef>
+  <paramdef>KeySym<parameter> *keysyms</parameter></paramdef>
+  <paramdef>int<parameter> num_codes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>first_keycode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the first keycode that is to be changed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keysyms_per_keycode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the keysyms that are to be used.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keysyms</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to an array of keysyms.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_codes</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of keycodes that are to be changed.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XChangeDeviceKeyMapping' xrefstyle='select: title'/>
+is analogous to the core
+<function>XChangeKeyboardMapping</function>
+function.  
+It defines the symbols for the specified number of keycodes for the 
+specified extension keyboard device.
+</para>
+<para>
+<!-- .LP -->
+If the specified device has not first been opened by this client via
+<function>XOpenDevice ,</function>
+this request will fail with a
+<function>BadDevice</function>
+error.
+If the specified device does not support input class
+<function>Keys ,</function>
+this request will fail with a
+<function>BadMatch</function>
+error.
+</para>
+<para>
+<!-- .LP -->
+The number of elements in the keysyms list must be a multiple of
+keysyms_per_keycode.  Otherwise,
+<xref linkend='XChangeDeviceKeyMapping' xrefstyle='select: title'/>
+generates a
+<function>BadLength</function>
+error.
+The specified first_keycode must be greater than or equal to
+the min_keycode value returned by the
+<function>ListInputDevices</function>
+request, or this request will fail with a
+<function>BadValue</function>
+error.  In addition, if the following expression is not less than
+the max_keycode value returned by the
+<function>ListInputDevices</function>
+request, the request will fail with a
+<function>BadValue</function>
+error:
+<literallayout class="monospaced">
+       first_keycode + (num_codes / keysyms_per_keycode) - 1
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XChangeDeviceKeyMapping' xrefstyle='select: title'/>
+can generate
+<function>BadAlloc ,</function>
+<function>BadDevice ,</function>
+<function>BadMatch ,</function>
+and
+<function>BadValue</function>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To obtain the keycodes that are used as modifiers on an 
+extension device that supports input class
+<function>Keys ,</function>
+use
+<function>XGetDeviceModifierMapping .</function>
+<!-- .sM -->
+<funcsynopsis id='XGetDeviceModifierMapping'>
+<funcprototype>
+  <funcdef>XModifierKeymap * <function> XGetDeviceModifierMapping</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired device.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XGetDeviceModifierMapping' xrefstyle='select: title'/>
+is analogous to the core
+<function>XGetModifierMapping</function>
+function.  
+The
+<xref linkend='XGetDeviceModifierMapping' xrefstyle='select: title'/>
+function returns a newly created
+<function>XModifierKeymap</function>
+structure that contains the keys being used as
+modifiers for the specified device.
+The structure should be freed after use with
+<function>XFreeModifierMapping .</function>
+If only zero values appear in the set for any modifier,
+that modifier is disabled.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetDeviceModifierMapping' xrefstyle='select: title'/>
+can generate
+<function>BadDevice</function>
+and
+<function>BadMatch</function>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To set which keycodes are to be used as modifiers for an extension device, use
+<function>XSetDeviceModifierMapping .</function>
+<!-- .sM -->
+<funcsynopsis id='XSetDeviceModifierMapping'>
+<funcprototype>
+  <funcdef>int <function> XSetDeviceModifierMapping</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>XModifierKeymap<parameter> *modmap</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modmap</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to the
+<function>XModifierKeymap</function>
+structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XSetDeviceModifierMapping' xrefstyle='select: title'/>
+is analogous to the core
+<function>XSetModifierMapping</function>
+function.  
+The 
+<xref linkend='XSetDeviceModifierMapping' xrefstyle='select: title'/>
+function specifies the keycodes of the keys, if any, 
+that are to be used as modifiers.  A zero value means
+that no key should be used.  No two arguments can have the same nonzero
+keycode value.  Otherwise,
+<xref linkend='XSetDeviceModifierMapping' xrefstyle='select: title'/>
+generates a
+<function>BadValue</function>
+error.
+There are eight modifiers, and the modifiermap member of the 
+<function>XModifierKeymap</function>
+structure contains eight sets of max_keypermod 
+keycodes, one for each modifier in the order 
+<function>Shift ,</function>
+<function>Lock ,</function>
+<function>Control ,</function>
+<function>Mod1 ,</function>
+<function>Mod2 ,</function>
+<function>Mod3 ,</function>
+<function>Mod4 ,</function>
+and
+<function>Mod5 .</function>
+Only nonzero keycodes have meaning in each set, and zero keycodes
+are ignored.
+In addition, all of the nonzero keycodes must be in the range specified by 
+min_keycode and max_keycode reported by the
+<xref linkend='XListInputDevices' xrefstyle='select: title'/>
+function.
+Otherwise,
+<function>XSetModifierMapping</function>
+generates a
+<function>BadValue</function>
+error.
+No keycode may appear twice in the entire map. 
+Otherwise, it generates a
+<function>BadValue</function>
+error.
+</para>
+<para>
+<!-- .LP -->
+A X server can impose restrictions on how modifiers can be changed, 
+for example,
+if certain keys do not generate up transitions in hardware or if multiple
+modifier keys are not supported.  
+If some such restriction is violated, 
+the status reply is
+<function>MappingFailed ,</function>
+and none of the modifiers are changed.
+If the new keycodes specified for a modifier differ from those
+currently defined and any (current or new) keys for that modifier are
+in the logically down state, 
+the status reply is
+<function>MappingBusy , </function>
+and none of the modifiers are changed.
+<function>XSetModifierMapping</function>
+generates a
+<function>DeviceMappingNotify</function>
+event on a
+<function>MappingSuccess</function>
+status.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetDeviceModifierMapping' xrefstyle='select: title'/>
+can generate
+<function>BadAlloc ,</function>
+<function>BadDevice ,</function>
+<function>BadMatch ,</function>
+and
+<function>BadValue</function>
+errors.
+</para>
+</sect3>
+<sect3 id="Controlling_Button_Mapping">
+<title>Controlling Button Mapping</title>
+<!-- .XS -->
+<!-- (SN Controlling Button Mapping -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To set the mapping of the buttons on an extension device, use
+<function>XSetDeviceButtonMapping .</function>
+<!-- .sM -->
+<funcsynopsis id='XSetDeviceButtonMapping'>
+<funcprototype>
+  <funcdef>int <function> XSetDeviceButtonMapping</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>unsignedchar<parameter> map[]</parameter></paramdef>
+  <paramdef>int<parameter> nmap</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>map</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the mapping list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nmap</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of items in the mapping list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XSetDeviceButtonMapping' xrefstyle='select: title'/>
+sets the mapping of the buttons on an extension device.
+If it succeeds, the X server generates a
+<function>DeviceMappingNotify</function>
+event, and
+<xref linkend='XSetDeviceButtonMapping' xrefstyle='select: title'/>
+returns
+<function>MappingSuccess .</function>
+Elements of the list are indexed starting from one.
+The length of the list must be the same as
+<xref linkend='XGetDeviceButtonMapping' xrefstyle='select: title'/>
+would return, or a 
+<function>BadValue</function>
+error results.
+The index is a button number, and the element of the list
+defines the effective number.
+A zero element disables a button, and elements are not restricted in
+value by the number of physical buttons.
+However, no two elements can have the same nonzero value, or a
+<function>BadValue</function>
+error results.
+If any of the buttons to be altered are logically in the down state,
+<xref linkend='XSetDeviceButtonMapping' xrefstyle='select: title'/>
+returns
+<function>MappingBusy ,</function>
+and the mapping is not changed.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetDeviceButtonMapping' xrefstyle='select: title'/>
+can generate
+<function>BadDevice ,</function>
+<function>BadMatch ,</function>
+and
+<function>BadValue</function>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To get the button mapping, use
+<function>XGetDeviceButtonMapping .</function>
+<!-- .sM -->
+<funcsynopsis id='XGetDeviceButtonMapping'>
+<funcprototype>
+  <funcdef>int <function> XGetDeviceButtonMapping</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>unsignedchar<parameter> map_return[]</parameter></paramdef>
+  <paramdef>int<parameter> nmap</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>map_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the mapping list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nmap</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of items in the mapping list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XGetDeviceButtonMapping' xrefstyle='select: title'/>
+returns the current mapping of the specified extension device.
+Elements of the list are indexed starting from one.
+<xref linkend='XGetDeviceButtonMapping' xrefstyle='select: title'/>
+returns the number of physical buttons actually on the pointer.
+The nominal mapping for the buttons is the identity mapping: map[i]=i.
+The nmap argument specifies the length of the array where the button
+mapping is returned, and only the first nmap elements are returned 
+in map_return.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetDeviceButtonMapping' xrefstyle='select: title'/>
+can generate
+<function>BadDevice</function>
+and
+<function>BadMatch</function>
+errors.
+</para>
+</sect3>
+<sect3 id="Obtaining_the_State_of_a_Device">
+<title>Obtaining the State of a Device</title>
+<!-- .XS -->
+<!-- (SN Obtaining the State of a Device -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To obtain information that describes the state of the keys, buttons, and 
+valuators of an extension device, use
+<function>XQueryDeviceState .</function>
+<!-- .sM -->
+<funcsynopsis id='XQueryDeviceState'>
+<funcprototype>
+  <funcdef>XDeviceState * <function> XQueryDeviceState</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired device.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XQueryDeviceState' xrefstyle='select: title'/>
+returns a pointer to an
+<function>XDeviceState</function>
+structure, which points to a list of
+structures that describe the state of the keys, buttons, and valuators 
+on the device:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     XID device_id;
+     int num_classes;
+     XInputClass *data;
+} XDeviceState;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The structures are of variable length, but the first 
+two members are common to all and are as follows:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     unsigned char class;
+     unsigned char length;
+} XInputClass;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The class member contains a class identifier.  This identifier can be
+compared with constants defined in the file 
+<function>&lt; X11/extensions/XI.h &gt;.</function>
+Currently defined constants are:
+<function>KeyClass ,</function>
+<function>ButtonClass ,</function>
+and
+<function>ValuatorClass .</function>
+</para>
+<para>
+<!-- .LP -->
+The length member contains the length of the structure and can be used
+by clients to traverse the list.
+</para>
+<para>
+<!-- .LP -->
+The 
+<function>XValuatorState</function>
+structure describes the current state of the valuators
+on the device.
+The num_valuators member contains the number of valuators
+on the device.
+The mode member is a mask whose bits report the data mode
+and other state information for the device.
+The following bits are currently defined:
+<literallayout class="monospaced">
+<!-- .TA .5i 1.5i 2.5i -->
+<!-- .ta .5i 1.5i 2.5i -->
+     DeviceMode     1 &lt;&lt; 0     Relative = 0, Absolute = 1
+     ProximityState     1 &lt;&lt; 1     InProximity = 0, OutOfProximity = 1
+</literallayout>
+The valuators member contains a pointer to an array of integers that
+describe the current value of the valuators.
+If the mode is 
+<function>Relative ,</function>
+these values are undefined.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     unsigned char class;
+     unsigned char length;
+     unsigned char num_valuators;
+     unsigned char mode;
+     int *valuators;
+} XValuatorState;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<function>XKeyState</function>
+structure describes the current state of the keys
+on the device.  Byte N (from 0) contains the
+bits for key 8N to 8N + 7 with the least significant bit in the
+byte representing key 8N.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     unsigned char class;
+     unsigned char length;
+     short num_keys;
+     char keys[32];
+} XKeyState;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<function>XButtonState</function>
+structure describes the current state of the buttons
+on the device.  Byte N (from 0) contains the bits for button 8N to 8N + 7
+with the least significant bit in the
+byte representing button 8N.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     unsigned char class;
+     unsigned char length;
+     short num_buttons;
+     char buttons[32];
+} XButtonState;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XQueryDeviceState' xrefstyle='select: title'/>
+can generate
+<function>BadDevice</function>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To free the data returned by this function, use
+<function>XFreeDeviceState .</function>
+<!-- .sM -->
+<funcsynopsis id='XFreeDeviceState'>
+<funcprototype>
+  <funcdef>void <function> XFreeDeviceState</function></funcdef>
+  <paramdef>XDeviceState<parameter> *state</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>state</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the pointer to the
+<function>XDeviceState</function>
+data returned by a previous call to
+<function>XQueryDeviceState .</function>
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XFreeDeviceState' xrefstyle='select: title'/>
+frees the device state data.
+</para>
+</sect3>
+</sect2>
+<sect2 id="Events">
+<title>Events</title>
+<!-- .XS -->
+<!-- (SN Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+The input extension creates input events analogous to the core input events.
+These extension input events are generated by manipulating one of the
+extension input devices.
+The remainder of this section discusses the following X Input Extension
+event topics:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Event types
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Event classes
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Event structures
+    </para>
+  </listitem>
+</itemizedlist>
+<sect3 id="Event_Types">
+<title>Event Types</title>
+<!-- .XS -->
+<!-- (SN Event Types -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Event types are integer numbers that a client can use to determine what
+kind of event it has received.  The client compares the type field of 
+the event structure with known event types to make this determination.
+</para>
+<para>
+<!-- .LP -->
+The core input event types are constants and are defined in the header file
+<function>&lt; X11/X.h &gt;.</function>
+Extension event types are not constants.  Instead, they
+are dynamically allocated by the extension's request to the X server
+when the extension is initialized.  Because of this, extension event
+types must be obtained by the client from the server.
+</para>
+<para>
+<!-- .LP -->
+The client program determines the event type for an extension event by using
+the information returned by the
+<xref linkend='XOpenDevice' xrefstyle='select: title'/>
+request.
+This type can then be used for comparison with the type field
+of events received by the client.
+</para>
+<para>
+<!-- .LP -->
+Extension events propagate up the window hierarchy in the same manner
+as core events.  If a window is not interested in an extension event, 
+it usually propagates to the closest ancestor that is interested,
+unless the dont_propagate list prohibits it.
+Grabs of extension devices may alter the set of windows that receive a particular
+extension event.
+</para>
+<para>
+<!-- .LP -->
+The following table lists the event category and its associated event
+type or types.
+</para>
+
+<informaltable>
+  <tgroup cols='2' align='center'>
+  <colspec colname='c1'/>
+  <colspec colname='c2'/>
+  <thead>
+    <row>
+      <entry>Event Category</entry>
+      <entry>Event Type</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>Device key</entry>
+      <entry><function>DeviceKeyPress</function></entry>
+    </row>
+    <row>
+      <entry></entry>
+      <entry><function>DeviceKeyRelease</function></entry>
+    </row>
+    <row>
+      <entry>Device motion</entry>
+      <entry><function>DeviceButtonPress</function></entry>
+    </row>
+    <row>
+      <entry></entry>
+      <entry><function>DeviceButtonRelease</function></entry>
+    </row>
+    <row>
+      <entry></entry>
+      <entry><function>DeviceMotionNotify</function></entry>
+    </row>
+    <row>
+      <entry>Device input focus</entry>
+      <entry><function>DeviceFocusIn</function></entry>
+    </row>
+    <row>
+      <entry></entry>
+      <entry><function>DeviceFocusOut</function></entry>
+    </row>
+    <row>
+      <entry>Device state notification</entry>
+      <entry><function>DeviceStateNotify</function></entry>
+    </row>
+    <row>
+      <entry>Device proximity</entry>
+      <entry><function>ProximityIn</function></entry>
+    </row>
+    <row>
+      <entry></entry>
+      <entry><function>ProximityOut</function></entry>
+    </row>
+    <row>
+      <entry>Device mapping</entry>
+      <entry><function>DeviceMappingNotify</function></entry>
+    </row>
+    <row>
+      <entry>Device change</entry>
+      <entry><function>ChangeDeviceNotify</function></entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+</sect3>
+<sect3 id="Event_Classes">
+<title>Event Classes</title>
+<!-- .XS -->
+<!-- (SN Event Classes -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Event classes are integer numbers that are used in the same way as the
+core event masks.  They are used by a client program to indicate to the
+server which events that client program wishes to receive.
+</para>
+<para>
+<!-- .LP -->
+The core input event masks are constants and are defined in the header file
+<function>&lt; X11/X.h &gt;.</function>
+Extension event classes are not constants.  Instead, they are dynamically
+allocated by the extension's request to the X server
+when the extension is initialized.  Because of this, extension event
+classes must be obtained by the client from the server.
+</para>
+<para>
+<!-- .LP -->
+The event class for an extension event and device is obtained from
+information returned by the 
+<xref linkend='XOpenDevice' xrefstyle='select: title'/>
+function. 
+This class can then be used in an
+<xref linkend='XSelectExtensionEvent' xrefstyle='select: title'/>
+request to ask that events of that type from that device be sent to
+the client program.
+</para>
+<para>
+<!-- .LP -->
+For
+<function>DeviceButtonPress</function>
+events, the client may specify whether
+or not an implicit passive grab should be done when the button is
+pressed.  If the client wants to guarantee that it will receive a
+<function>DeviceButtonRelease</function>
+event for each
+<function>DeviceButtonPress</function>
+event it receives, it should specify the
+<function>DeviceButtonPressGrab</function>
+class in addition to the
+<function>DeviceButtonPress</function>
+class.
+This restricts the client in that only one client at a time
+may request
+<function>DeviceButtonPress</function>
+events from the same device and
+window if any client specifies this class.
+</para>
+<para>
+<!-- .LP -->
+If any client has specified the
+<function>DeviceButtonPressGrab</function>
+class, any requests by any other client that specify the same device
+and window and specify either
+<function>DeviceButtonPress</function>
+or
+<function>DeviceButtonPressGrab</function>
+will cause an
+<function>Access</function>
+error to be generated.
+</para>
+<para>
+<!-- .LP -->
+If only the
+<function>DeviceButtonPress</function>
+class is specified, no implicit passive grab will be done when a button
+is pressed on the device.
+Multiple clients may use this class to specify the same device and
+window combination.
+</para>
+<para>
+<!-- .LP -->
+The client may also select
+<function>DeviceMotion</function>
+events only when a button is down.
+It does this by specifying the event classes 
+<function>DeviceButton1Motion</function>
+through
+<function>DeviceButton5Motion .  </function>
+An input device will support only
+as many button motion classes as it has buttons.
+</para>
+</sect3>
+<sect3 id="Event_Structures">
+<title>Event Structures</title>
+<!-- .XS -->
+<!-- (SN Event Structures -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Each extension event type has a corresponding structure declared in
+<function>&lt; X11/extensions/XInput.h &gt;.</function>
+All event structures have the following common members:
+<variablelist>
+  <varlistentry>
+    <term>
+      type
+    </term>
+    <listitem>
+      <para>
+Set to the event type number that uniquely identifies it.  For example,
+when the X server reports a
+<function>DeviceKeyPress</function>
+event to a client application, it sends an
+<function>XDeviceKeyPressEvent</function>
+structure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      serial
+    </term>
+    <listitem>
+      <para>
+Set from the serial number reported in the protocol but expanded from the
+16-bit least significant bits to a full 32-bit value.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      send_event
+    </term>
+    <listitem>
+      <para>
+Set to 
+<function>True</function>
+if the event came from an
+<function>XSendEvent</function>
+request.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      display
+    </term>
+    <listitem>
+      <para>
+Set to a pointer to a structure that defines the display 
+on which the event was read.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+Extension event structures report the current position of the X pointer.
+In addition, if the device reports motion data and is reporting absolute data,
+the current value of any valuators the device contains is also reported.
+</para>
+<sect4 id="Device_Key_Events">
+<title>Device Key Events</title>
+<!-- .XS -->
+<!-- (SN Device Key Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Key events from extension devices contain all the information that is
+contained in a key event from the X keyboard.  In addition, they contain
+a device ID and report the current value of any valuators on the device,
+if that device is reporting absolute data.
+If data for more than six valuators is being reported, more than one
+key event will be sent.
+The axes_count member contains the number of axes that are being
+reported.  The server sends as many of these events as are
+needed to report the device data.  Each event contains the total number
+of axes reported in the axes_count member and the first axis reported
+in the current event in the first_axis member.
+If the device supports input class
+<function>Valuators , </function>
+but is not reporting absolute mode data,
+the axes_count member  contains zero (0).
+</para>
+<para>
+<!-- .LP -->
+The location reported in 
+the x, y and x_root, y_root members is the location of the core X pointer.
+</para>
+<para>
+<!-- .LP -->
+The
+<function>XDeviceKeyEvent</function>
+structure is defined as follows:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int type;                      /* of event */
+     unsigned long serial;          /* # of last request processed */
+     Bool send_event;               /* true if from SendEvent request */
+     Display *display;              /* Display the event was read from */
+     Window window;                 /* "event" window reported relative to */
+     XID deviceid;
+     Window root;                   /* root window event occurred on */
+     Window subwindow;              /* child window */
+     Time time;                     /* milliseconds */
+     int x, y;                      /* x, y coordinates in event window */
+     int x_root;                    /* coordinates relative to root */
+     int y_root;                    /* coordinates relative to root */
+     unsigned int state;            /* key or button mask */
+     unsigned int keycode;          /* detail */
+     Bool same_screen;              /* same screen flag */
+     unsigned int device_state;     /* device key or button mask */
+     unsigned char axes_count;
+     unsigned char first_axis;
+     int axis_data[6];
+} XDeviceKeyEvent;
+
+typedef XDeviceKeyEvent XDeviceKeyPressedEvent;
+typedef XDeviceKeyEvent XDeviceKeyReleasedEvent;
+</literallayout>
+<!-- .eM -->
+</para>
+</sect4>
+<sect4 id="Device_Button_Events">
+<title>Device Button Events</title>
+<!-- .XS -->
+<!-- (SN Device Button Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Button events from extension devices contain all the information that is
+contained in a button event from the X pointer.  In addition, they contain
+a device ID and report the current value of any valuators on the device
+if that device is reporting absolute data.
+If data for more than six valuators is being reported, more than one
+button event may be sent.
+The axes_count member contains the number of axes that are being
+reported.  The server sends as many of these events as are
+needed to report the device data.  Each event contains the total number
+of axes reported in the axes_count member and the first axis reported
+in the current event in the first_axis member.
+If the device supports input class
+<function>Valuators , </function>
+but is not reporting absolute mode data,
+the axes_count member contains zero (0).
+</para>
+<para>
+<!-- .LP -->
+The location reported in 
+the x, y and x_root, y_root members is the location of the core X pointer.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int type;                      /* of event */
+     unsigned long serial;          /* # of last request processed by server */
+     Bool send_event;               /* true if from a SendEvent request */
+     Display *display;              /* Display the event was read from */
+     Window window;                 /* "event" window reported relative to */
+     XID deviceid;
+     Window root;                   /* root window that the event occurred on */
+     Window subwindow;              /* child window */
+     Time time;                     /* milliseconds */
+     int x, y;                      /* x, y coordinates in event window */
+     int x_root;                    /* coordinates relative to root */
+     int y_root;                    /* coordinates relative to root */
+     unsigned int state;            /* key or button mask */
+     unsigned int button;           /* detail */
+     Bool same_screen;              /* same screen flag */
+     unsigned int device_state;     /* device key or button mask */
+     unsigned char axes_count;
+     unsigned char first_axis;
+     int axis_data[6];
+} XDeviceButtonEvent;
+
+typedef XDeviceButtonEvent XDeviceButtonPressedEvent;
+typedef XDeviceButtonEvent XDeviceButtonReleasedEvent;
+</literallayout>
+<!-- .eM -->
+</para>
+</sect4>
+<sect4 id="Device_Motion_Events">
+<title>Device Motion Events</title>
+<!-- .XS -->
+<!-- (SN Device Motion Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Motion events from extension devices contain all the information that is
+contained in a motion event from the X pointer.  In addition, they contain
+a device ID and report the current value of any valuators on the device.
+</para>
+<para>
+<!-- .LP -->
+The location reported in 
+the x, y and x_root, y_root members is the location of the core X pointer, 
+and so is 2-dimensional.
+</para>
+<para>
+<!-- .LP -->
+Extension motion devices may report motion data for a variable number of 
+axes.  
+The axes_count member contains the number of axes that are being
+reported.  The server sends as many of these events as are
+needed to report the device data.  Each event contains the total number
+of axes reported in the axes_count member and the first axis reported
+in the current event in the first_axis member.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int type;                          /* of event */
+     unsigned long serial;              /* # of last request processed by server */
+     Bool send_event;                   /* true if from a SendEvent request */
+     Display *display;                  /* Display the event was read from */
+     Window window;                     /* "event" window reported relative to */
+     XID deviceid;
+     Window root;                       /* root window that the event occurred on */
+     Window subwindow;                  /* child window */
+     Time time;                         /* milliseconds */
+     int x, y;                          /* x, y coordinates in event window */
+     int x_root;                        /* coordinates relative to root */
+     int y_root;                        /* coordinates relative to root */
+     unsigned int state;                /* key or button mask */
+     char is_hint;                      /* detail */
+     Bool same_screen;                  /* same screen flag */
+     unsigned int device_state;         /* device key or button mask */
+     unsigned char axes_count;
+     unsigned char first_axis;
+     int axis_data[6];
+} XDeviceMotionEvent;
+</literallayout>
+<!-- .eM -->
+</para>
+</sect4>
+<sect4 id="Device_Focus_Events">
+<title>Device Focus Events</title>
+<!-- .XS -->
+<!-- (SN Device Focus Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+These events are equivalent to the core focus events.
+They contain the same information, with the addition
+of a device ID to identify which device has had a focus change,
+and a timestamp.
+</para>
+<para>
+<!-- .LP -->
+<function>DeviceFocusIn</function>
+and
+<function>DeviceFocusOut</function>
+events are generated for
+focus changes of extension devices in the same manner as core focus
+events are generated.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 2.5i -->
+<!-- .ta .5i 2.5i -->
+typedef struct {
+     int type;                      /* of event */
+     unsigned long serial;          /* # of last request processed by server */
+     Bool send_event;               /* true if this came from a SendEvent request */
+     Display *display;              /* Display the event was read from */
+     Window window;                 /* "event" window it is reported relative to */
+     XID deviceid;
+     int mode;                      /* NotifyNormal, NotifyGrab, NotifyUngrab */
+     int detail;
+                                    /*
+                                     * NotifyAncestor, NotifyVirtual, NotifyInferior, 
+                                     * NotifyNonLinear,NotifyNonLinearVirtual, NotifyPointer,
+                                     * NotifyPointerRoot, NotifyDetailNone 
+                                     */
+     Time time;
+} XDeviceFocusChangeEvent;
+
+typedef XDeviceFocusChangeEvent XDeviceFocusInEvent;
+typedef XDeviceFocusChangeEvent XDeviceFocusOutEvent;
+</literallayout>
+<!-- .eM -->
+</para>
+</sect4>
+<sect4 id="Device_StateNotify_Event">
+<title>Device StateNotify Event</title>
+<!-- .XS -->
+<!-- (SN Device StateNotify Event -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+This event is analogous to the core keymap event but
+reports the current state of the device for each
+input class that it supports.
+It is generated after every
+<function>DeviceFocusIn</function>
+event and
+<function>EnterNotify</function>
+event and is delivered to clients who have selected
+<function>XDeviceStateNotify</function>
+events.
+</para>
+<para>
+<!-- .LP -->
+If the device supports input class
+<function>Valuators ,</function>
+the mode member in the
+<function>XValuatorStatus</function>
+structure is a bitmask that reports the device mode,
+proximity state, and other state information.
+The following bits are currently defined:
+<literallayout class="monospaced">
+<!-- .TA .5i 1.5i -->
+<!-- .ta .5i 1.5i -->
+     0x01     Relative = 0, Absolute = 1
+     0x02     InProximity = 0, OutOfProximity = 1
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+If the device supports more valuators than can be reported in a single
+<function>XEvent ,</function>
+multiple
+<function>XDeviceStateNotify</function>
+events will be generated.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     unsigned char class;
+     unsigned char length;
+} XInputClass;
+
+typedef struct {
+     int type;
+     unsigned long serial;     /* # of last request processed by server */
+     Bool send_event;          /* true if this came from a SendEvent request */
+     Display *display;         /* Display the event was read from */
+     Window window;
+     XID deviceid;
+     Time time;
+     int num_classes;
+     char data[64];
+} XDeviceStateNotifyEvent;     
+
+typedef struct {
+     unsigned char class;
+     unsigned char length;
+     unsigned char num_valuators;
+     unsigned char mode;
+     int valuators[6];
+} XValuatorStatus;
+
+typedef struct {
+     unsigned char class;
+     unsigned char length;
+     short num_keys;
+     char keys[32];
+} XKeyStatus;
+
+typedef struct {
+     unsigned char class;
+     unsigned char length;
+     short num_buttons;
+     char buttons[32];
+} XButtonStatus;
+</literallayout>
+<!-- .eM -->
+</para>
+</sect4>
+<sect4 id="Device_Mapping_Event">
+<title>Device Mapping Event</title>
+<!-- .XS -->
+<!-- (SN Device Mapping Event -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+This event is equivalent to the core
+<function>MappingNotify</function>
+event.
+It notifies client programs when the mapping of keys,
+modifiers, or buttons on an extension device has changed.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int type;
+     unsigned long serial;     
+     Bool send_event;
+     Display *display;
+     Window window;
+     XID deviceid;
+     Time time;
+     int request;
+     int first_keycode;
+     int count;
+} XDeviceMappingEvent;
+</literallayout>
+<!-- .eM -->
+</para>
+</sect4>
+<sect4 id="ChangeDeviceNotify_Event">
+<title>ChangeDeviceNotify Event</title>
+<!-- .XS -->
+<!-- (SN ChangeDeviceNotify Event -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+This event has no equivalent in the core protocol.  It notifies client
+programs when one of the core devices has been changed.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int type;
+     unsigned long serial;
+     Bool send_event;
+     Display *display;
+     Window window;
+     XID deviceid;
+     Time time;
+     int request;
+} XChangeDeviceNotifyEvent;
+</literallayout>
+<!-- .eM -->
+</para>
+</sect4>
+<sect4 id="Proximity_Events">
+<title>Proximity Events</title>
+<!-- .XS -->
+<!-- (SN Proximity Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+These events have no equivalent in the core protocol.  Some input
+devices such as graphics tablets or touchscreens may send these
+events to indicate that a stylus has moved into or out of contact
+with a positional sensing surface.
+</para>
+<para>
+<!-- .LP -->
+The event contains the current value of any valuators on the device
+if that device is reporting absolute data.
+If data for more than six valuators is being reported, more than one
+proximity event may be sent.
+The axes_count member contains the number of axes that are being
+reported.  The server sends as many of these events as are
+needed to report the device data.  Each event contains the total number
+of axes reported in the axes_count member and the first axis reported
+in the current event in the first_axis member.
+If the device supports input class
+<function>Valuators , </function>
+but is not reporting absolute mode data,
+the axes_count member contains zero (0).
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i 3i -->
+<!-- .ta .5i 3i -->
+typedef struct {
+     int type;                 /* ProximityIn or ProximityOut */        
+     unsigned long serial;     /* # of last request processed by server */
+     Bool send_event;          /* true if this came from a SendEvent request */
+     Display *display;         /* Display the event was read from */
+     Window window;      
+     XID deviceid;
+     Window root;            
+     Window subwindow;      
+     Time time;            
+     int x, y;            
+     int x_root, y_root;  
+     unsigned int state;           
+     Bool same_screen;     
+     unsigned int device_state;   /* device key or button mask */
+     unsigned char axes_count;
+     unsigned char first_axis;
+     int axis_data[6];
+} XProximityNotifyEvent;
+
+typedef XProximityNotifyEvent XProximityInEvent;
+typedef XProximityNotifyEvent XProximityOutEvent;
+</literallayout>
+<!-- .eM -->
+</para>
+</sect4>
+</sect3>
+</sect2>
+<sect2 id="Event_Handling_Functions">
+<title>Event Handling Functions</title>
+<!-- .XS -->
+<!-- (SN Event Handling Functions -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+This section discusses the X Input Extension
+event handling functions that allow you to:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Determine the extension version
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+List the available devices
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Enable and disable extension devices
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Change the mode of a device
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Initialize valuators on an input device
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Get input device controls
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Change input device controls
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Select extension device events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Determine selected device events
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Control event propogation
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Send an event
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Get motion history
+    </para>
+  </listitem>
+</itemizedlist>
+<sect3 id="Determining_the_Extension_Version">
+<title>Determining the Extension Version</title>
+<!-- .XS -->
+<!-- (SN Determining the Extension Version -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<funcsynopsis id='XGetExtensionVersion'>
+<funcprototype>
+  <funcdef>XExtensionVersion * <function> XGetExtensionVersion</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>char<parameter> *name</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the name of the desired extension.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XGetExtensionVersion' xrefstyle='select: title'/>
+allows a client to determine whether a server supports
+the desired version of the input extension.
+</para>
+<para>
+<!-- .LP -->
+The 
+<function>XExtensionVersion</function>
+structure returns information about the version of the extension
+supported by the server and is defined as follows:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     Bool present;   
+     short major_version;
+     short minor_version;
+} XExtensionVersion;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The major and minor versions can be compared with constants defined in
+the header file 
+<function>&lt; X11/extensions/XI.h &gt;.</function>
+Each version is a superset of the previous versions.
+</para>
+<para>
+<!-- .LP -->
+You should use 
+<function>XFree</function>.
+to free the data returned by this function.
+</para>
+</sect3>
+<sect3 id="Listing_Available_Devices">
+<title>Listing Available Devices</title>
+<!-- .XS -->
+<!-- (SN Listing Available Devices -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+A client program that wishes to access a specific device
+must first determine whether that device is connected to the X server.  This
+is done through the
+<xref linkend='XListInputDevices' xrefstyle='select: title'/>
+function, which will return a list of all devices that can be opened
+by the X server.  The client program can use one
+of the names defined in the
+<function>&lt; X11/extensions/XI.h &gt;</function>
+header file in an
+<function>XInternAtom</function>
+request to determine the device type of the desired device.  This type 
+can then be compared with the device types returned by the 
+<xref linkend='XListInputDevices' xrefstyle='select: title'/>
+request.
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<funcsynopsis id='XListInputDevices'>
+<funcprototype>
+  <funcdef>XDeviceInfo * <function> XListInputDevices</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>int<parameter> *ndevices</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>ndevices</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the address of a variable into which the server
+can return the number of input devices available to the X server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XListInputDevices' xrefstyle='select: title'/>
+allows a client to determine which devices 
+are available for X input and information about those devices.
+An array of
+<function>XDeviceInfo</function>
+structures is returned, with one element in the array for each device.
+The number of devices is returned in the ndevices argument.
+</para>
+<para>
+<!-- .LP -->
+The X pointer device and X keyboard device are reported, as well as
+all available extension input devices.  The use member of the 
+<function>XDeviceInfo</function>
+structure specifies the current use of the device.
+If the value of this member is 
+<function>IsXPointer ,</function>
+the device is the X pointer device.  If the value is
+<function>IsXKeyboard ,</function>
+the device is the X keyboard device.  If the value is
+<function>IsXExtensionDevice ,</function>
+the device is available for use as an extension input device.
+</para>
+<para>
+<!-- .LP -->
+Each
+<function>XDeviceInfo</function>
+entry contains a pointer to a list of structures 
+that describe the characteristics of each class
+of input supported by that device.  The num_classes member
+contains the number of entries in that list.
+</para>
+<para>
+<!-- .LP -->
+If the device supports input class
+<function>Valuators ,</function>
+one of the structures pointed to by the
+<function>XDeviceInfo</function>
+structure will be an
+<function>XValuatorInfo</function>
+structure.  The axes member of that structure
+contains the address of an array of
+<function>XAxisInfo</function>
+structures.
+There is one element in this array for each axis of motion
+reported by the device.  The number of elements in this 
+array is contained in the num_axes element of the 
+<function>XValuatorInfo</function>
+structure.
+The size of the motion buffer for the device is
+reported in the motion_buffer member of the
+<function>XValuatorInfo</function>
+structure.
+</para>
+<para>
+<!-- .LP -->
+The
+<function>XDeviceInfo</function>
+structure is defined as follows:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct _XDeviceInfo {
+     XID id;        
+     Atom type;
+     char *name;
+     int num_classes;
+     int use;
+     XAnyClassPtr inputclassinfo;
+} XDeviceInfo;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The structures pointed to by the
+<function>XDeviceInfo</function>
+structure are defined as follows:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct _XKeyInfo {
+     XID class;
+     int length;
+     unsigned short min_keycode;
+     unsigned short max_keycode;
+     unsigned short num_keys;
+} XKeyInfo;
+
+typedef struct _XButtonInfo {
+     XID class;
+     int length;
+     short num_buttons;
+} XButtonInfo;
+
+typedef struct _XValuatorInfo {
+     XID class;
+     int length;
+     unsigned char num_axes;
+     unsigned char mode;
+     unsigned long motion_buffer;
+     XAxisInfoPtr axes;
+} XValuatorInfo;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<function>XAxisInfo</function>
+structure pointed to by the
+<function>XValuatorInfo</function>
+structure is defined as follows:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct _XAxisInfo {
+     int resolution;
+     int min_value;
+     int max_value;
+} XAxisInfo;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The following atom names are defined in the 
+<function>&lt; X11/extensions/XI.h &gt;</function>
+header file.
+<literallayout class="monospaced">
+<!-- .TA 2i -->
+<!-- .ta 2i -->
+MOUSE     QUADRATURE
+TABLET     SPACEBALL
+KEYBOARD     DATAGLOVE
+TOUCHSCREEN     EYETRACKER
+TOUCHPAD     CURSORKEYS
+BUTTONBOX     FOOTMOUSE
+BARCODE     ID_MODULE
+KNOB_BOX     ONE_KNOB
+TRACKBALL     NINE_KNOB\s+1
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+These names can be used in an
+<function>XInternAtom</function>
+request to return an atom that can be used for comparison
+with the type member of the 
+<function>XDeviceInfo</function>
+structure.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XListInputDevices' xrefstyle='select: title'/>
+returns NULL if there are no input devices to list.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To free the data returned by 
+<function>XListInputDevices ,</function>
+use
+<function>XFreeDeviceList .</function>
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<funcsynopsis id='XFreeDeviceList'>
+<funcprototype>
+  <funcdef>void <function> XFreeDeviceList</function></funcdef>
+  <paramdef>XDeviceInfo<parameter> *list</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>list</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the pointer to the
+<function>XDeviceInfo</function>
+array returned by a previous call to
+<function>XListInputDevices .</function>
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XFreeDeviceList' xrefstyle='select: title'/>
+frees the list of input device information.
+</para>
+</sect3>
+<sect3 id="Enabling_and_Disabling_Extension_Devices">
+<title>Enabling and Disabling Extension Devices</title>
+<!-- .XS -->
+<!-- (SN Enabling and Disabling Extension Devices -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Each client program that wishes to access an extension device must request
+that the server open that device by calling the
+<xref linkend='XOpenDevice' xrefstyle='select: title'/>
+function.
+<!-- .sM -->
+<funcsynopsis id='XOpenDevice'>
+<funcprototype>
+  <funcdef>XDevice * <function> XOpenDevice</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XID<parameter> device_id</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device_id</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the ID that uniquely identifies the device to be opened.
+This ID is obtained from the
+<xref linkend='XListInputDevices' xrefstyle='select: title'/>
+request.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XOpenDevice' xrefstyle='select: title'/>
+opens the device for the requesting client and, on success, returns an
+<function>XDevice</function>
+structure, which is defined as follows:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     XID device_id;
+     int num_classes;
+     XInputClassInfo *classes;
+} XDevice;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The
+<function>XDevice</function>
+structure contains a pointer to an array of
+<function>XInputClassInfo</function>
+structures.  Each element in that array
+contains information about events of a particular input class supported
+by the input device.
+</para>
+<para>
+<!-- .LP -->
+The
+<function>XInputClassInfo</function>
+structure is defined as follows:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     unsigned char input_class;
+     unsigned char event_type_base;
+} XInputClassInfo;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+A client program can determine the event
+type and event class for a given event by using macros defined by the 
+input extension.  The name of the macro corresponds to the desired event,
+and the macro is passed the structure that describes the device from which
+input is desired, for example:
+</para>
+<para>
+<!-- .LP -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+     DeviceKeyPress(XDevice *device, event_type, event_class)
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+The macro will fill in the values of the event class to be used in an
+<xref linkend='XSelectExtensionEvent' xrefstyle='select: title'/>
+request to select the event and the event type to be used in comparing
+with the event types of events received via
+<function>XNextEvent</function>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XOpenDevice' xrefstyle='select: title'/>
+can generate
+<function>BadDevice</function>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+Before terminating, the client program should request that the server close
+the device by calling the
+<xref linkend='XCloseDevice' xrefstyle='select: title'/>
+function.
+<!-- .sM -->
+<funcsynopsis id='XCloseDevice'>
+<funcprototype>
+  <funcdef>int <function> XCloseDevice</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the device to be closed.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XCloseDevice' xrefstyle='select: title'/>
+closes the device for the requesting client and frees the associated
+<function>XDevice</function>
+structure.
+</para>
+<para>
+<!-- .LP -->
+A client may open the same extension device more than once.  Requests
+after the first successful one return an additional
+<function>XDevice</function>
+structure
+with the same information as the first, but otherwise have no effect.
+A single
+<xref linkend='XCloseDevice' xrefstyle='select: title'/>
+request will terminate that client's access to the device.
+</para>
+<para>
+<!-- .LP -->
+Closing a device releases any active or passive grabs the requesting client
+has established.  If the device is frozen only by an active grab of the
+requesting client, any queued events are released.
+</para>
+<para>
+<!-- .LP -->
+If a client program terminates without closing a device, the server will
+automatically close that device on behalf of the client.  This does not
+affect any other clients that may be accessing that device.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XCloseDevice' xrefstyle='select: title'/>
+can generate
+<function>BadDevice</function>
+errors.
+</para>
+</sect3>
+<sect3 id="Changing_the_Mode_of_a_Device">
+<title>Changing the Mode of a Device</title>
+<!-- .XS -->
+<!-- (SN Changing the Mode of a Device -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Some devices are capable of reporting either relative or absolute motion
+data. 
+To change the mode of a device from relative to absolute, use
+<function>XSetDeviceMode .</function>
+<!-- .sM -->
+<funcsynopsis id='XSetDeviceMode'>
+<funcprototype>
+  <funcdef>int <function> XSetDeviceMode</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>int<parameter> mode</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the device whose mode should be changed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the mode.  You can pass
+<function>Absolute</function>
+or
+<function>Relative .</function>
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XSetDeviceMode' xrefstyle='select: title'/>
+allows a client to request the server to change the mode of a 
+device that is capable of reporting either absolute positional data or relative
+motion data.  If the device is invalid or if the client has not previously 
+requested that the server open the device via an
+<xref linkend='XOpenDevice' xrefstyle='select: title'/>
+request, this request will fail with a
+<function>BadDevice</function>
+error.
+If the device does not support input class
+<function>Valuators</function>
+or if it is not capable of reporting the specified mode,
+the request will fail with a 
+<function>BadMatch</function>
+error.
+</para>
+<para>
+<!-- .LP -->
+This request will fail and return
+<function>DeviceBusy</function>
+if another client has already opened the device and requested a different mode.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetDeviceMode' xrefstyle='select: title'/>
+can generate
+<function>BadDevice ,</function>
+<function>BadMatch ,</function>
+<function>BadMode ,</function>
+and
+<function>DeviceBusy</function>
+errors.
+</para>
+</sect3>
+<sect3 id="Initializing_Valuators_on_an_Input_Device">
+<title>Initializing Valuators on an Input Device</title>
+<!-- .XS -->
+<!-- (SN Initializing Valuators on an Input Device -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Some devices that report absolute positional data can be initialized to a 
+starting value.  Devices that are capable of reporting relative motion or
+absolute positional data may require that their valuators be initialized 
+to a starting value after the mode of the device is changed to
+<function>Absolute .</function>
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To initialize the valuators on such a device, use 
+<function>XSetDeviceValuators .</function>
+<!-- .sM -->
+<funcsynopsis id='XSetDeviceValuators'>
+<funcprototype>
+  <funcdef>Status <function> XSetDeviceValuators</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>int*valuators,first_valuator,<parameter> num_valuators</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the device whose valuators should be initialized.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>valuators</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the values to which each valuator should be set.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>first_valuator</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the first valuator to be set.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_valuators</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of valuators to be set.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XSetDeviceValuators' xrefstyle='select: title'/>
+initializes the specified valuators on the specified extension
+input device.  Valuators are numbered beginning with zero.  Only the valuators
+in the range specified by first_valuator and num_valuators are set.  
+A
+<function>BadValue</function>
+error results if the number of valuators supported by the device 
+is less than the following expression:
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+     first_valuator + num_valuators
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+If the request succeeds,
+<function>Success</function>
+is returned.  If the specified device is grabbed by some other client,
+the request will fail and a status of
+<function>AlreadyGrabbed</function>
+will be returned.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSetDeviceValuators' xrefstyle='select: title'/>
+can generate
+<function>BadDevice ,</function>
+<function>BadLength ,</function>
+<function>BadMatch ,</function>
+and 
+<function>BadValue</function>
+errors.
+</para>
+</sect3>
+<sect3 id="Getting_Input_Device_Controls">
+<title>Getting Input Device Controls</title>
+<!-- .XS -->
+<!-- (SN Getting Input Device Controls -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Some input devices support various configuration controls
+that can be queried or changed by clients.  The set of supported
+controls will vary from one input device to another.  Requests
+to manipulate these controls will fail if either the target
+X server or the target input device does not support the 
+requested device control.
+</para>
+<para>
+<!-- .LP -->
+Each device control has a unique identifier.  Information
+passed with each device control varies in length and is mapped
+by data structures unique to that device control.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To query a device control, use
+<function>XGetDeviceControl .</function>
+<!-- .sM -->
+<funcsynopsis id='XGetDeviceControl'>
+<funcprototype>
+  <funcdef>XDeviceControl * <function> XGetDeviceControl</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>int<parameter> control</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the device whose configuration control status is to be returned.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>control</emphasis>
+    </term>
+    <listitem>
+      <para>
+Identifies the specific device control to be queried.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XGetDeviceControl' xrefstyle='select: title'/>
+returns the current state of the specified device control.
+If the target X server does not support that device control, a
+<function>BadValue</function>
+error is returned.
+If the specified device does not support that device control, a
+<function>BadMatch</function>
+error
+is returned.
+</para>
+<para>
+<!-- .LP -->
+If the request is successful, a pointer to a generic 
+<function>XDeviceState</function>
+structure is returned.  The information returned varies according
+to the specified control and is mapped by a structure appropriate
+for that control.
+The first two members are common to all device controls
+and are defined as follows:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     XID control;
+     int length;
+} XDeviceState;
+\fP
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The control may be compared to constants defined in the file
+<function>&lt; X11/extensions/XI.h &gt;.</function>
+Currently defined device controls include DEVICE_RESOLUTION.
+</para>
+<para>
+<!-- .LP -->
+The information returned for the DEVICE_RESOLUTION control is
+defined in the 
+<function>XDeviceResolutionState</function>
+structure, which is defined as follows:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     XID control;
+     int length;
+     int num_valuators;
+     int *resolutions;
+     int *min_resolutions;
+     int *max_resolutions;
+} XDeviceResolutionState;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+This device control returns a list of valuators and the range of 
+valid resolutions allowed for each.  Valuators are numbered 
+beginning with zero (0).  Resolutions for all valuators on the device are 
+returned.  For each valuator i on the device, resolutions[i] returns 
+the current setting of the resolution, min_resolutions[i] returns 
+the minimum valid setting, and max_resolutions[i] returns the 
+maximum valid setting.
+</para>
+<para>
+<!-- .LP -->
+When this control is specified,
+<xref linkend='XGetDeviceControl' xrefstyle='select: title'/>
+fails with a
+<function>BadMatch</function>
+error if the specified device has no valuators.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetDeviceControl' xrefstyle='select: title'/>
+can generate
+<function>BadMatch</function>
+and
+<function>BadValue</function>
+errors.
+</para>
+</sect3>
+<sect3 id="Changing_Input_Device_Controls">
+<title>Changing Input Device Controls</title>
+<!-- .XS -->
+<!-- (SN Changing Input Device Controls -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Some input devices support various configuration controls
+that can be changed by clients.  Typically, this would be
+done to initialize the device to a known state or configuration.
+The set of supported controls will vary from one input device 
+to another.  Requests to manipulate these controls will fail if 
+either the target X server or the target input device does not 
+support the requested device control.  Setting the device control 
+will also fail if the target input device is grabbed by another 
+client or is open by another client and has been set to a conflicting
+state.
+</para>
+<para>
+<!-- .LP -->
+Each device control has a unique identifier.  Information
+passed with each device control varies in length and is mapped
+by data structures unique to that device control.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To change a device control, use
+<function>XChangeDeviceControl .</function>
+<!-- .sM -->
+<funcsynopsis id='XChangeDeviceControl'>
+<funcprototype>
+  <funcdef>Status <function> XChangeDeviceControl</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>int<parameter> control</parameter></paramdef>
+  <paramdef>XDeviceControl<parameter> *value</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the device whose configuration control status is to be modified.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>control</emphasis>
+    </term>
+    <listitem>
+      <para>
+Identifies the specific device control to be changed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>value</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to an
+<function>XDeviceControl</function>
+structure that describes which control is to be changed
+and how it is to be changed.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XChangeDeviceControl' xrefstyle='select: title'/>
+changes the current state of the specified device control.
+If the target X server does not support that device control, a
+<function>BadValue</function>
+error is returned.
+If the specified device does not support that device control, a
+<function>BadMatch</function>
+error is returned.
+If another client has the target device grabbed, a status of
+<function>AlreadyGrabbed</function>
+is returned.
+If another client has the device open and has set it to a 
+conflicting state, a status of
+<function>DeviceBusy</function>
+is returned.
+If the request fails for any reason, the device control will not
+be changed.
+</para>
+<para>
+<!-- .LP -->
+If the request is successful, the device control will be changed
+and a status of
+<function>Success</function>
+is returned.
+The information passed varies according to the specified control
+and is mapped by a structure appropriate for that control.
+The first two members are common to all device controls:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     XID control;
+     int length;
+} XDeviceControl;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The control may be set using constants defined in the 
+<function>&lt; X11/extensions/XI.h &gt;</function>
+header file.
+Currently defined device controls include DEVICE_RESOLUTION.
+</para>
+<para>
+<!-- .LP -->
+The information that can be changed by the DEVICE_RESOLUTION 
+control is defined in the 
+<function>XDeviceResolutionControl</function>
+structure, which is defined as follows:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     XID control;
+     int length;
+     int first_valuator;
+     int num_valuators;
+     int *resolutions;
+} XDeviceResolutionControl;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+This device control changes the resolution of the specified 
+valuators on the specified extension input device.  Valuators 
+are numbered beginning with zero.  Only the valuators in the range 
+specified by first_valuator and num_valuators are set.  A value 
+of -1 in the resolutions list indicates that the resolution for 
+this valuator is not to be changed.  The num_valuators member
+specifies the number of valuators in the resolutions list.
+</para>
+<para>
+<!-- .LP -->
+When this control is specified,
+<xref linkend='XChangeDeviceControl' xrefstyle='select: title'/>
+fails with a
+<function>BadMatch</function>
+error if the specified device has no valuators.
+If a resolution is specified that is not within the range of valid values 
+(as returned by
+<function>XGetDeviceControl ),</function>
+<xref linkend='XChangeDeviceControl' xrefstyle='select: title'/>
+fails with a
+<function>BadValue</function>
+error.
+A
+<function>BadValue</function>
+error results if the number of valuators supported by the device 
+is less than the following expression:
+</para>
+<para>
+<!-- .LP    -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+     first_valuator + num_valuators, 
+</literallayout>
+</para>
+<para>
+<!-- .LP   -->
+<xref linkend='XChangeDeviceControl' xrefstyle='select: title'/>
+can generate
+<function>BadMatch</function>
+and
+<function>BadValue</function>
+errors.
+</para>
+</sect3>
+<sect3 id="Selecting_Extension_Device_Events">
+<title>Selecting Extension Device Events</title>
+<!-- .XS -->
+<!-- (SN Selecting Extension Device Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To select device input events, use
+<function>XSelectExtensionEvent .</function>
+The parameters passed are a pointer to 
+a list of classes that define the desired event types and devices, a count
+of the number of elements in the list, and the ID of the window from which 
+events are desired.
+<!-- .sM -->
+<funcsynopsis id='XSelectExtensionEvent'>
+<funcprototype>
+  <funcdef>int <function> XSelectExtensionEvent</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>Window<parameter> window</parameter></paramdef>
+  <paramdef>XEventClass<parameter> *event_list</parameter></paramdef>
+  <paramdef>int<parameter> event_count</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>window</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the ID of the window from which the client wishes to receive events.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_list</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to an array of event classes
+that specify which events are desired.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of elements in the event_list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XSelectExtensionEvent' xrefstyle='select: title'/>
+requests the server to send events that match the events and
+devices described by the event list and that come from the requested 
+window.  
+The elements of the
+<function>XEventClass</function>
+array are the event_class values
+obtained by invoking a macro with the pointer to an
+<function>XDevice</function>
+structure returned by the
+<xref linkend='XOpenDevice' xrefstyle='select: title'/>
+request.
+For example, the
+<function>DeviceKeyPress</function>
+macro would return the
+<function>XEventClass</function>
+for
+<function>DeviceKeyPress</function>
+events from the specified device if it were invoked in the following form:
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+     DeviceKeyPress (XDevice *device, event_type, event_class)
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+Macros are defined for the following event classes: 
+<literallayout class="monospaced">
+<function>DeviceKeyPress</function>
+<function>DeviceKeyRelease</function>
+<function>DeviceButtonPress</function>
+<function>DeviceButtonRelease</function>
+<function>DeviceMotionNotify</function>
+<function>DeviceFocusIn</function>
+<function>DeviceFocusOut</function>
+<function>ProximityIn</function>
+<function>ProximityOut</function>
+<function>DeviceStateNotify</function>
+<function>DeviceMappingNotify</function>
+<function>ChangeDeviceNotify</function>
+<function>DevicePointerMotionHint</function>
+<function>DeviceButton1Motion </function>
+<function>DeviceButton2Motion</function>
+<function>DeviceButton3Motion, </function>
+<function>DeviceButton4Motion</function>
+<function>DeviceButton5Motion</function>
+<function>DeviceButtonMotion,</function>
+<function>DeviceOwnerGrabButton</function>
+<function>DeviceButtonPressGrab</function>
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+To get the next available event from within a client program, use the core
+<function>XNextEvent</function>
+function.  This returns the next event whether it
+came from a core device or an extension device.
+</para>
+<para>
+<!-- .LP -->
+Succeeding
+<xref linkend='XSelectExtensionEvent' xrefstyle='select: title'/>
+requests using event classes
+for the same device as was specified on a previous request will replace
+the previous set of selected events from that device with the new set.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSelectExtensionEvent' xrefstyle='select: title'/>
+can generate
+<function>BadAccess , </function>
+<function>BadClass ,</function>
+<function>BadLength ,</function>
+and
+<function>BadWindow</function>
+errors.
+</para>
+</sect3>
+<sect3 id="Determining_Selected_Device_Events">
+<title>Determining Selected Device Events</title>
+<!-- .XS -->
+<!-- (SN Determining Selected Device Events -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To determine which extension events are currently selected from a given
+window, use
+<function>XGetSelectedExtensionEvents .</function>
+<!-- .sM -->
+<funcsynopsis id='XGetSelectedExtensionEvents'>
+<funcprototype>
+  <funcdef>int <function> XGetSelectedExtensionEvents</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>Window<parameter> window</parameter></paramdef>
+  <paramdef>int<parameter> *this_client_count</parameter></paramdef>
+  <paramdef>XEventClass<parameter> **this_client</parameter></paramdef>
+  <paramdef>int<parameter> *all_clients_count</parameter></paramdef>
+  <paramdef>XEventClass<parameter> **all_clients</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>window</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the ID of the window from which the client wishes to receive events.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>this_client_count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of elements in the this_client list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>this_client</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns a list of
+<function>XEventClasses</function>
+that specify which events are
+selected by this client.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>all_clients_count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of elements in the all_clients list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>all_clients</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns a list of
+<function>XEventClasses</function>
+that specify which events are
+selected by all clients.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XGetSelectedExtensionEvents' xrefstyle='select: title'/>
+returns pointers to two event class arrays.  
+One lists the extension events selected by this client from
+the specified window.  The other lists the extension events selected by
+all clients from the specified window.  This information is analogous
+to that returned in your_event_mask and all_event_masks of the
+<function>XWindowAttributes</function>
+structure when an 
+<function>XGetWindowAttributes</function>
+request is made.
+To free the two arrays returned by this function, use
+<function>XFree</function>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetSelectedExtensionEvents' xrefstyle='select: title'/>
+can generate
+<function>BadWindow</function>
+errors.
+</para>
+</sect3>
+<sect3 id="Controlling_Event_Propagation">
+<title>Controlling Event Propagation</title>
+<!-- .XS -->
+<!-- (SN Controlling Event Propagation -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+Extension events propagate up the window hierarchy in the same manner
+as core events.  If a window is not interested in an extension event, 
+it usually propagates to the closest ancestor that is interested,
+unless the dont_propagate list prohibits it.
+Grabs of extension devices may alter the set of windows that receive a 
+particular extension event.
+</para>
+<para>
+<!-- .LP -->
+Client programs may control event propagation through the use
+of the following two functions:
+<xref linkend='XChangeDeviceDontPropagateList' xrefstyle='select: title'/>
+and
+<function>XGetDeviceDontPropagateList .  </function>
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<funcsynopsis id='XChangeDeviceDontPropagateList'>
+<funcprototype>
+  <funcdef>int <function> XChangeDeviceDontPropagateList</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>Window<parameter> window</parameter></paramdef>
+  <paramdef>int<parameter> event_count</parameter></paramdef>
+  <paramdef>XEventClass<parameter> *events</parameter></paramdef>
+  <paramdef>int<parameter> mode</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>window</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of elements in the events list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>events</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to the list of XEventClasses.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the mode.  You can pass
+<function>AddToList</function>
+or
+<function>DeleteFromList .</function>
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XChangeDeviceDontPropagateList' xrefstyle='select: title'/>
+adds an event to or deletes an event from the do_not_propagate list 
+of extension events for the specified window.
+There is one list per window, and the list remains for the life of the window.
+The list is not altered if a client that changed the list terminates.
+</para>
+<para>
+<!-- .LP -->
+Suppression of event propagation is not allowed for all events.  If a
+specified
+<function>XEventClass</function>
+is invalid because suppression of that event is not allowed, a
+<function>BadClass</function>
+error results.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XChangeDeviceDontPropagateList' xrefstyle='select: title'/>
+can generate
+<function>BadClass ,</function>
+<function>BadMode ,</function>
+and
+<function>BadWindow</function>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<funcsynopsis id='XGetDeviceDontPropagateList'>
+<funcprototype>
+  <funcdef>XEventClass * <function> XGetDeviceDontPropagateList</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>Window<parameter> window</parameter></paramdef>
+  <paramdef>int<parameter> *event_count</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>window</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired window.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of elements in the array returned by this function.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XGetDeviceDontPropagateList' xrefstyle='select: title'/>
+allows a client to determine the do_not_propagate list of extension events
+for the specified window.
+It returns an array of
+<function>XEventClass ,</function>
+each
+<function>XEventClass</function>
+representing a device/event type pair.
+To free the data returned by this function, use
+<function>XFree</function>.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetDeviceDontPropagateList' xrefstyle='select: title'/>
+can generate
+<function>BadWindow</function>
+errors.
+</para>
+</sect3>
+<sect3 id="Sending_an_Event">
+<title>Sending an Event</title>
+<!-- .XS -->
+<!-- (SN Sending an Event -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+To send an extension event to another client, use
+<function>XSendExtensionEvent .</function>
+<!-- .sM -->
+<funcsynopsis id='XSendExtensionEvent'>
+<funcprototype>
+  <funcdef>int <function> XSendExtensionEvent</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>Window<parameter> window</parameter></paramdef>
+  <paramdef>Bool<parameter> propagate</parameter></paramdef>
+  <paramdef>int<parameter> event_count</parameter></paramdef>
+  <paramdef>XEventClass<parameter> *event_list</parameter></paramdef>
+  <paramdef>XEvent<parameter> *event</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the device whose ID is recorded in the event.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>window</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the destination window ID.  You can pass a window ID,
+<function>PointerWindow</function>
+or
+<function>InputFocus .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>propagate</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a boolean value that is either
+<function>True</function>
+or 
+<function>False .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of elements in the event_list array.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_list</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to an array of
+<function>XEventClass .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to the event that is to be sent.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XSendExtensionEvent' xrefstyle='select: title'/>
+identifies the destination window, determines which clients should receive
+the specified event, and ignores any active grabs.
+It requires a list of
+<function>XEventClass</function>
+to be specified.
+These are obtained by opening an input device with the
+<xref linkend='XOpenDevice' xrefstyle='select: title'/>
+request.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSendExtensionEvent' xrefstyle='select: title'/>
+uses the window argument to identify the destination window as follows:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+If you pass
+<function>PointerWindow ,</function>
+the destination window is the window that contains the pointer.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If you pass
+<function>InputFocus</function>
+and if the focus window contains the pointer,
+the destination window is the window that contains the pointer.
+If the focus window does not contain the pointer,
+the destination window is the focus window.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+To determine which clients should receive the specified events, 
+<xref linkend='XSendExtensionEvent' xrefstyle='select: title'/>
+uses the propagate argument as follows:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+If propagate is
+<function>False ,</function>
+the event is sent to every client selecting
+from the destination window
+any of the events specified in the event_list array.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If propagate is
+<function>True </function>
+and no clients have selected from the destination window
+any of the events specified in the event_list array, the destination is 
+replaced with the closest ancestor of destination for which some client
+has selected one of the specified events and for which no intervening
+window has that event in its do_not_propagate mask.
+If no such window exists,
+or if the window is an ancestor of the focus window, and 
+<function>InputFocus</function>
+was originally specified as the destination,
+the event is not sent to any clients.  Otherwise, the event is reported to every
+client selecting on the final destination any of the events specified
+in event_list.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<!-- .LP -->
+The event in the
+<function>XEvent</function>
+structure must be one of the events defined
+by the input extension, so that the X server can correctly byte swap the
+contents as necessary.  The contents of the event are otherwise unaltered
+and unchecked by the X server except to force send_event to
+<function>True</function>
+in the forwarded event and to set the sequence number in the event correctly.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSendExtensionEvent' xrefstyle='select: title'/>
+returns zero if the conversion-to-wire protocol failed;
+otherwise, it returns nonzero.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XSendExtensionEvent' xrefstyle='select: title'/>
+can generate
+<function>BadClass ,</function>
+<function>BadDevice ,</function>
+<function>BadValue ,</function>
+and
+<function>BadWindow</function>
+errors.
+</para>
+</sect3>
+<sect3 id="Getting_Motion_History">
+<title>Getting Motion History</title>
+<!-- .XS -->
+<!-- (SN Getting Motion History -->
+<!-- .XE -->
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<funcsynopsis id='XGetDeviceMotionEvents'>
+<funcprototype>
+  <funcdef>XDeviceTimeCoord * <function> XGetDeviceMotionEvents</function></funcdef>
+  <paramdef><parameter> axis_count_return)</parameter></paramdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>XDevice<parameter> *device</parameter></paramdef>
+  <paramdef>Timestart,<parameter> stop</parameter></paramdef>
+  <paramdef>int<parameter> *nevents_return</parameter></paramdef>
+  <paramdef>int<parameter> *mode_return</parameter></paramdef>
+  <paramdef>int<parameter> *axis_count_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<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'>device</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired device.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>start</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the start time.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>stop</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the stop time.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nevents_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of positions in the motion buffer returned
+for this request.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>mode_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the mode of the nevents information.
+The mode will be one of the following:
+<function>Absolute</function>
+or
+<function>Relative .</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>axis_count_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of axes reported in each of the positions returned.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XGetDeviceMotionEvents' xrefstyle='select: title'/>
+returns all positions in the device's motion history buffer
+that fall between the specified start and stop times inclusive.
+If the start time is in the future or is later than the stop time,
+no positions are returned.
+</para>
+<para>
+<!-- .LP -->
+The return type for this function is an
+<function>XDeviceTimeCoord</function>
+structure, which is defined as follows:
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<literallayout class="monospaced">
+<!-- .TA .5i -->
+<!-- .ta .5i -->
+typedef struct {
+     Time time;
+     unsigned int *data;
+} XDeviceTimeCoord;
+</literallayout>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+The data member is a pointer to an array of data items.
+Each item is of type int, and there is one data item
+per axis of motion reported by the device.
+The number of axes reported by the device is returned in the axis_count variable.
+</para>
+<para>
+<!-- .LP -->
+The value of the data items depends on the mode of the device. 
+The mode is returned in the mode variable.  If the 
+mode is
+<function>Absolute ,</function>
+the data items are the raw values generated by the device.
+These may be scaled by the client program using the
+maximum values that the device can generate for each axis of motion
+that it reports.  The maximum value for each axis is reported in
+the max_val member of the
+<function>XAxisInfo</function>
+structure, which is part of the information returned by the
+<xref linkend='XListInputDevices' xrefstyle='select: title'/>
+request.
+</para>
+<para>
+<!-- .LP -->
+If the mode is
+<function>Relative ,</function>
+the data items are the relative values generated by the device.
+The client program must choose an initial
+position for the device and maintain a current position by 
+accumulating these relative values.
+</para>
+<para>
+<!-- .LP -->
+Consecutive calls to
+<xref linkend='XGetDeviceMotionEvents' xrefstyle='select: title'/>
+can return data of different modes, that is, if
+some client program has changed the mode of the device via an
+<xref linkend='XSetDeviceMode' xrefstyle='select: title'/>
+request.
+</para>
+<para>
+<!-- .LP -->
+<xref linkend='XGetDeviceMotionEvents' xrefstyle='select: title'/>
+can generate
+<function>BadDevice</function>
+and
+<function>BadMatch</function>
+errors.
+<!-- .sp -->
+</para>
+<para>
+<!-- .LP -->
+To free the data returned by
+<function>XGetDeviceMotionEvents ,</function>
+use
+<function>XFreeDeviceMotionEvents .</function>
+</para>
+<para>
+<!-- .LP -->
+<!-- .sM -->
+<funcsynopsis id='XFreeDeviceMotionEvents'>
+<funcprototype>
+  <funcdef>void <function> XFreeDeviceMotionEvents</function></funcdef>
+  <paramdef>XDeviceTimeCoord<parameter> *events</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<!-- .FN -->
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>events</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the pointer to the
+<function>XDeviceTimeCoord</function>
+array returned by a previous call to
+<function>XGetDeviceMotionEvents .</function>
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+<!-- .LP -->
+<!-- .eM -->
+<xref linkend='XFreeDeviceMotionEvents' xrefstyle='select: title'/>
+frees the specified array of motion information.
+<!-- .\" -->
+<!-- .\" -->
+<!-- .\"  Appendicies -->
+<!-- .\" -->
+<!-- .\" -->
+<!-- .bp -->
+<!-- .ds Ch ~ -->
+<!-- .sp 1 -->
+<!-- .ce 3 -->
+<function>Appendix A</function>
+<!-- .XS -->
+<!-- (SN Appendix A -->
+<!-- .XE -->
+</para>
+<para>
+<!-- .LP -->
+The following information is contained in the <function>&lt;X11/extensions/XInput.h&gt;</function>
+and <function>&lt;X11/extensions/XI.h&gt;</function> header files:
+<literallayout class="monospaced">
+<!-- .cs CW 20 -->
+
+<!-- .ps 8 -->
+/* Definitions used by the library and client */
+
+#ifndef _XINPUT_H_
+#define _XINPUT_H_
+
+#ifndef _XLIB_H_
+#include &lt;X11/Xlib.h&gt;
+#endif
+
+#ifndef _XI_H_
+#include "XI.h"
+#endif
+
+#define _deviceKeyPress          0
+#define _deviceKeyRelease     1
+
+#define _deviceButtonPress     0
+#define _deviceButtonRelease     1
+
+#define _deviceMotionNotify     0
+
+#define _deviceFocusIn          0
+#define _deviceFocusOut          1
+
+#define _proximityIn          0
+#define _proximityOut          1
+
+#define _deviceStateNotify     0
+#define _deviceMappingNotify     1
+#define _changeDeviceNotify     2
+
+#define FindTypeAndClass(d, type, class, classid, offset) \
+    { int i; XInputClassInfo *ip; \
+    type = 0; class = 0; \
+    for (i=0, ip= ((XDevice *) d)-&gt;classes; \
+      i&lt; ((XDevice *) d)-&gt;num_classes; \
+      i++, ip++) \
+     if (ip-&gt;input_class == classid) \
+         {type =  ip-&gt;event_type_base + offset; \
+          class =  ((XDevice *) d)-&gt;device_id &lt;&lt; 8 | type;}}
+
+#define DeviceKeyPress(d, type, class) \
+    FindTypeAndClass(d, type, class, KeyClass, _deviceKeyPress)
+
+#define DeviceKeyRelease(d, type, class) \
+    FindTypeAndClass(d, type, class, KeyClass, _deviceKeyRelease)
+
+#define DeviceButtonPress(d, type, class) \
+    FindTypeAndClass(d, type, class, ButtonClass, _deviceButtonPress)
+
+#define DeviceButtonRelease(d, type, class) \
+    FindTypeAndClass(d, type, class, ButtonClass, _deviceButtonRelease)
+
+#define DeviceMotionNotify(d, type, class) \
+    FindTypeAndClass(d, type, class, ValuatorClass, _deviceMotionNotify)
+
+#define DeviceFocusIn(d, type, class) \
+    FindTypeAndClass(d, type, class, FocusClass, _deviceFocusIn)
+
+#define DeviceFocusOut(d, type, class) \
+    FindTypeAndClass(d, type, class, FocusClass, _deviceFocusOut)
+
+#define ProximityIn(d, type, class) \
+    FindTypeAndClass(d, type, class, ProximityClass, _proximityIn)
+
+#define ProximityOut(d, type, class) \
+    FindTypeAndClass(d, type, class, ProximityClass, _proximityOut)
+
+#define DeviceStateNotify(d, type, class) \
+    FindTypeAndClass(d, type, class, OtherClass, _deviceStateNotify)
+
+#define DeviceMappingNotify(d, type, class) \
+    FindTypeAndClass(d, type, class, OtherClass, _deviceMappingNotify)
+
+#define ChangeDeviceNotify(d, type, class) \
+    FindTypeAndClass(d, type, class, OtherClass, _changeDeviceNotify)
+
+#define DevicePointerMotionHint(d, type, class) \
+    { class =  ((XDevice *) d)-&gt;device_id &lt;&lt; 8 | _devicePointerMotionHint;}
+
+#define DeviceButton1Motion(d, type, class) \
+    { class =  ((XDevice *) d)-&gt;device_id &lt;&lt; 8 | _deviceButton1Motion;}
+
+#define DeviceButton2Motion(d, type, class) \
+    { class =  ((XDevice *) d)-&gt;device_id &lt;&lt; 8 | _deviceButton2Motion;}
+
+#define DeviceButton3Motion(d, type, class) \
+    { class =  ((XDevice *) d)-&gt;device_id &lt;&lt; 8 | _deviceButton3Motion;}
+
+#define DeviceButton4Motion(d, type, class) \
+    { class =  ((XDevice *) d)-&gt;device_id &lt;&lt; 8 | _deviceButton4Motion;}
+
+#define DeviceButton5Motion(d, type, class) \
+    { class =  ((XDevice *) d)-&gt;device_id &lt;&lt; 8 | _deviceButton5Motion;}
+
+#define DeviceButtonMotion(d, type, class) \
+    { class =  ((XDevice *) d)-&gt;device_id &lt;&lt; 8 | _deviceButtonMotion;}
+
+#define DeviceOwnerGrabButton(d, type, class) \
+    { class =  ((XDevice *) d)-&gt;device_id &lt;&lt; 8 | _deviceOwnerGrabButton;}
+
+#define DeviceButtonPressGrab(d, type, class) \
+    { class =  ((XDevice *) d)-&gt;device_id &lt;&lt; 8 | _deviceButtonGrab;}
+
+#define NoExtensionEvent(d, type, class) \
+    { class =  ((XDevice *) d)-&gt;device_id &lt;&lt; 8 | _noExtensionEvent;}
+
+#define BadDevice(dpy, error) _xibaddevice(dpy, &amp;error)
+
+#define BadClass(dpy, error) _xibadclass(dpy, &amp;error)
+
+#define BadEvent(dpy, error) _xibadevent(dpy, &amp;error)
+
+#define BadMode(dpy, error) _xibadmode(dpy, &amp;error)
+
+#define DeviceBusy(dpy, error) _xidevicebusy(dpy, &amp;error)
+
+/***************************************************************
+ *
+ * DeviceKey events.  These events are sent by input devices that
+ * support input class Keys.
+ * The location of the X pointer is reported in the coordinate
+ * fields of the x,y and x_root,y_root fields.
+ *
+ */
+
+typedef struct 
+    {
+    int            type;         /* of event */
+    unsigned long  serial;       /* # of last request processed */
+    Bool           send_event;   /* true if from SendEvent request */
+    Display        *display;     /* Display the event was read from */
+    Window         window;       /* "event" window reported relative to */
+    XID            deviceid;
+    Window         root;         /* root window event occured on */
+    Window         subwindow;    /* child window */
+    Time           time;         /* milliseconds */
+    int            x, y;         /* x, y coordinates in event window */
+    int            x_root;       /* coordinates relative to root */
+    int            y_root;       /* coordinates relative to root */
+    unsigned int   state;        /* key or button mask */
+    unsigned int   keycode;      /* detail */
+    Bool           same_screen;  /* same screen flag */
+    unsigned int   device_state; /* device key or button mask */
+    unsigned char  axes_count;
+    unsigned char  first_axis;
+    int            axis_data[6];
+    } XDeviceKeyEvent;
+
+typedef XDeviceKeyEvent XDeviceKeyPressedEvent;
+typedef XDeviceKeyEvent XDeviceKeyReleasedEvent;
+
+/*******************************************************************
+ *
+ * DeviceButton events.  These events are sent by extension devices
+ * that support input class Buttons.
+ *
+ */
+
+typedef struct {
+    int           type;         /* of event */
+    unsigned long serial;       /* # of last request processed by server */
+    Bool          send_event;   /* true if from a SendEvent request */
+    Display       *display;     /* Display the event was read from */
+    Window        window;       /* "event" window reported relative to */
+    XID           deviceid;
+    Window        root;         /* root window that the event occured on */
+    Window        subwindow;    /* child window */
+    Time          time;         /* milliseconds */
+    int           x, y;         /* x, y coordinates in event window */
+    int           x_root;       /* coordinates relative to root */
+    int           y_root;       /* coordinates relative to root */
+    unsigned int  state;        /* key or button mask */
+    unsigned int  button;       /* detail */
+    Bool          same_screen;  /* same screen flag */
+    unsigned int  device_state; /* device key or button mask */
+    unsigned char axes_count;
+    unsigned char first_axis;
+    int           axis_data[6];
+    } XDeviceButtonEvent;
+
+typedef XDeviceButtonEvent XDeviceButtonPressedEvent;
+typedef XDeviceButtonEvent XDeviceButtonReleasedEvent;
+
+/*******************************************************************
+ *
+ * DeviceMotionNotify event.  These events are sent by extension devices
+ * that support input class Valuators.
+ *
+ */
+
+typedef struct 
+    {
+    int           type;        /* of event */
+    unsigned long serial;      /* # of last request processed by server */
+    Bool          send_event;  /* true if from a SendEvent request */
+    Display       *display;    /* Display the event was read from */
+    Window        window;      /* "event" window reported relative to */
+    XID           deviceid;
+    Window        root;        /* root window that the event occured on */
+    Window        subwindow;   /* child window */
+    Time          time;        /* milliseconds */
+    int           x, y;        /* x, y coordinates in event window */
+    int           x_root;      /* coordinates relative to root */
+    int           y_root;      /* coordinates relative to root */
+    unsigned int  state;       /* key or button mask */
+    char          is_hint;     /* detail */
+    Bool          same_screen; /* same screen flag */
+    unsigned int  device_state; /* device key or button mask */
+    unsigned char axes_count;
+    unsigned char first_axis;
+    int           axis_data[6];
+    } XDeviceMotionEvent;
+
+/*******************************************************************
+ *
+ * DeviceFocusChange events.  These events are sent when the focus
+ * of an extension device that can be focused is changed.
+ *
+ */
+
+typedef struct 
+    {
+    int           type;       /* of event */
+    unsigned long serial;     /* # of last request processed by server */
+    Bool          send_event; /* true if from a SendEvent request */
+    Display       *display;   /* Display the event was read from */
+    Window        window;     /* "event" window reported relative to */
+    XID           deviceid;
+    int           mode;       /* NotifyNormal, NotifyGrab, NotifyUngrab */
+    int           detail;
+     /*
+      * NotifyAncestor, NotifyVirtual, NotifyInferior, 
+      * NotifyNonLinear,NotifyNonLinearVirtual, NotifyPointer,
+      * NotifyPointerRoot, NotifyDetailNone 
+      */
+    Time                time;
+    } XDeviceFocusChangeEvent;
+
+typedef XDeviceFocusChangeEvent XDeviceFocusInEvent;
+typedef XDeviceFocusChangeEvent XDeviceFocusOutEvent;
+
+/*******************************************************************
+ *
+ * ProximityNotify events.  These events are sent by those absolute
+ * positioning devices that are capable of generating proximity information.
+ *
+ */
+
+typedef struct 
+    {
+    int             type;      /* ProximityIn or ProximityOut */        
+    unsigned long   serial;    /* # of last request processed by server */
+    Bool            send_event; /* true if this came from a SendEvent request */
+    Display         *display;  /* Display the event was read from */
+    Window          window;      
+    XID                 deviceid;
+    Window          root;            
+    Window          subwindow;      
+    Time            time;            
+    int             x, y;            
+    int             x_root, y_root;  
+    unsigned int    state;           
+    Bool            same_screen;     
+    unsigned int    device_state; /* device key or button mask */
+    unsigned char   axes_count;
+    unsigned char   first_axis;
+    int             axis_data[6];
+    } XProximityNotifyEvent;
+typedef XProximityNotifyEvent XProximityInEvent;
+typedef XProximityNotifyEvent XProximityOutEvent;
+
+/*******************************************************************
+ *
+ * DeviceStateNotify events are generated on EnterWindow and FocusIn 
+ * for those clients who have selected DeviceState.
+ *
+ */
+
+typedef struct
+    {
+    unsigned char     class;
+    unsigned char     length;
+    } XInputClass;
+
+typedef struct {
+    int           type;
+    unsigned long serial;       /* # of last request processed by server */
+    Bool          send_event;   /* true if this came from a SendEvent request */
+    Display       *display;     /* Display the event was read from */
+    Window        window;
+    XID           deviceid;
+    Time          time;
+    int           num_classes;
+    char       data[64];
+} XDeviceStateNotifyEvent;     
+
+typedef struct {
+    unsigned char     class;
+    unsigned char     length;
+    unsigned char     num_valuators;
+    unsigned char     mode;
+    int                  valuators[6];
+} XValuatorStatus;
+
+typedef struct {
+    unsigned char     class;
+    unsigned char     length;
+    short          num_keys;
+    char             keys[32];
+} XKeyStatus;
+
+typedef struct {
+    unsigned char     class;
+    unsigned char     length;
+    short          num_buttons;
+    char             buttons[32];
+} XButtonStatus;
+
+/*******************************************************************
+ *
+ * DeviceMappingNotify event.  This event is sent when the key mapping,
+ * modifier mapping, or button mapping of an extension device is changed.
+ *
+ */
+
+typedef struct {
+    int           type;
+    unsigned long serial;       /* # of last request processed by server */
+    Bool          send_event;   /* true if this came from a SendEvent request */
+    Display       *display;     /* Display the event was read from */
+    Window        window;       /* unused */
+    XID           deviceid;
+    Time          time;
+    int           request;      /* one of MappingModifier, MappingKeyboard,
+                                    MappingPointer */
+    int           first_keycode;/* first keycode */
+    int           count;        /* defines range of change w. first_keycode*/
+} XDeviceMappingEvent;
+
+/*******************************************************************
+ *
+ * ChangeDeviceNotify event.  This event is sent when an 
+ * XChangeKeyboard or XChangePointer request is made.
+ *
+ */
+
+typedef struct {
+    int           type;
+    unsigned long serial;       /* # of last request processed by server */
+    Bool          send_event;   /* true if this came from a SendEvent request */
+    Display       *display;     /* Display the event was read from */
+    Window        window;       /* unused */
+    XID           deviceid;
+    Time          time;
+    int           request;      /* NewPointer or NewKeyboard */
+} XChangeDeviceNotifyEvent;
+
+/*******************************************************************
+ *
+ * Control structures for input devices that support input class
+ * Feedback.  These are used by the XGetFeedbackControl and 
+ * XChangeFeedbackControl functions.
+ *
+ */
+
+typedef struct {
+     XID            class;
+     int            length;
+     XID            id;
+} XFeedbackState;
+
+typedef struct {
+    XID     class;
+    int     length;
+    XID     id;
+    int     click;
+    int     percent;
+    int     pitch;
+    int     duration;
+    int     led_mask;
+    int     global_auto_repeat;
+    char    auto_repeats[32];
+} XKbdFeedbackState;
+
+typedef struct {
+    XID     class;
+    int     length;
+    XID     id;
+    int     accelNum;
+    int     accelDenom;
+    int     threshold;
+} XPtrFeedbackState;
+
+typedef struct {
+    XID     class;
+    int     length;
+    XID     id;
+    int     resolution;
+    int     minVal;
+    int     maxVal;
+} XIntegerFeedbackState;
+
+typedef struct {
+    XID     class;
+    int     length;
+    XID     id;
+    int     max_symbols;
+    int     num_syms_supported;
+    KeySym  *syms_supported;
+} XStringFeedbackState;
+
+typedef struct {
+    XID     class;
+    int     length;
+    XID     id;
+    int     percent;
+    int     pitch;
+    int     duration;
+} XBellFeedbackState;
+
+typedef struct {
+    XID     class;
+    int     length;
+    XID     id;
+    int     led_values;
+    int     led_mask;
+} XLedFeedbackState;
+
+typedef struct {
+     XID            class;
+     int            length;
+     XID         id;
+} XFeedbackControl;
+
+typedef struct {
+    XID     class;
+    int     length;
+    XID     id;
+    int     accelNum;
+    int     accelDenom;
+    int     threshold;
+} XPtrFeedbackControl;
+
+typedef struct {
+    XID     class;
+    int     length;
+    XID     id;
+    int     click;
+    int     percent;
+    int     pitch;
+    int     duration;
+    int     led_mask;
+    int     led_value;
+    int     key;
+    int     auto_repeat_mode;
+} XKbdFeedbackControl;
+
+typedef struct {
+    XID     class;
+    int     length;
+    XID     id;
+    int     num_keysyms;
+    KeySym  *syms_to_display;
+} XStringFeedbackControl;
+
+typedef struct {
+    XID     class;
+    int     length;
+    XID     id;
+    int     int_to_display;
+} XIntegerFeedbackControl;
+
+typedef struct {
+    XID     class;
+    int     length;
+    XID     id;
+    int     percent;
+    int     pitch;
+    int     duration;
+} XBellFeedbackControl;
+
+typedef struct {
+    XID     class;
+    int     length;
+    XID     id;
+    int     led_mask;
+    int     led_values;
+} XLedFeedbackControl;
+
+/*******************************************************************
+ *
+ * Device control structures.
+ *
+ */
+
+typedef struct {
+     XID            control;
+     int            length;
+} XDeviceControl;
+
+typedef struct {
+     XID            control;
+     int            length;
+     int            first_valuator;
+     int            num_valuators;
+     int            *resolutions;
+} XDeviceResolutionControl;
+
+typedef struct {
+     XID            control;
+     int            length;
+     int            num_valuators;
+     int            *resolutions;
+     int            *min_resolutions;
+     int            *max_resolutions;
+} XDeviceResolutionState;
+
+/*******************************************************************
+ *
+ * An array of XDeviceList structures is returned by the 
+ * XListInputDevices function.  Each entry contains information
+ * about one input device.  Among that information is an array of 
+ * pointers to structures that describe the characteristics of 
+ * the input device.
+ *
+ */
+
+typedef struct _XAnyClassinfo *XAnyClassPtr;
+
+typedef struct _XAnyClassinfo {
+    XID      class;
+    int      length;
+    } XAnyClassInfo;
+
+typedef struct _XDeviceInfo *XDeviceInfoPtr;
+
+typedef struct _XDeviceInfo
+    {
+    XID                 id;        
+    Atom                type;
+    char                *name;
+    int                 num_classes;
+    int                 use;
+    XAnyClassPtr      inputclassinfo;
+    } XDeviceInfo;
+
+typedef struct _XKeyInfo *XKeyInfoPtr;
+
+typedef struct _XKeyInfo
+    {
+    XID               class;
+    int               length;
+    unsigned short      min_keycode;
+    unsigned short      max_keycode;
+    unsigned short      num_keys;
+    } XKeyInfo;
+
+typedef struct _XButtonInfo *XButtonInfoPtr;
+
+typedef struct _XButtonInfo {
+    XID          class;
+    int          length;
+    short      num_buttons;
+    } XButtonInfo;
+
+typedef struct _XAxisInfo *XAxisInfoPtr;
+
+typedef struct _XAxisInfo {
+    int      resolution;
+    int      min_value;
+    int      max_value;
+    } XAxisInfo;
+
+typedef struct _XValuatorInfo *XValuatorInfoPtr;
+
+typedef struct     _XValuatorInfo
+    {
+    XID               class;
+    int               length;
+    unsigned char       num_axes;
+    unsigned char       mode;
+    unsigned long       motion_buffer;
+    XAxisInfoPtr        axes;
+    } XValuatorInfo;
+
+
+/*******************************************************************
+ *
+ * An XDevice structure is returned by the XOpenDevice function.  
+ * It contains an array of pointers to XInputClassInfo structures.
+ * Each contains information about a class of input supported by the
+ * device, including a pointer to an array of data for each type of event
+ * the device reports.
+ *
+ */
+
+
+typedef struct {
+        unsigned char   input_class;
+        unsigned char   event_type_base;
+} XInputClassInfo;
+
+typedef struct {
+        XID                    device_id;
+        int                    num_classes;
+        XInputClassInfo        *classes;
+} XDevice;
+
+
+/*******************************************************************
+ *
+ * The following structure is used to return information for the 
+ * XGetSelectedExtensionEvents function.
+ *
+ */
+
+typedef struct {
+        XEventClass     event_type;
+        XID             device;
+} XEventList;
+
+/*******************************************************************
+ *
+ * The following structure is used to return motion history data from 
+ * an input device that supports the input class Valuators.
+ * This information is returned by the XGetDeviceMotionEvents function.
+ *
+ */
+
+typedef struct {
+        Time   time;
+        int    *data;
+} XDeviceTimeCoord;
+
+
+/*******************************************************************
+ *
+ * Device state structure.
+ * This is returned by the XQueryDeviceState request.
+ *
+ */
+
+typedef struct {
+        XID          device_id;
+        int          num_classes;
+        XInputClass     *data;
+} XDeviceState;
+
+/*******************************************************************
+ *
+ * Note that the mode field is a bitfield that reports the Proximity
+ * status of the device as well as the mode.  The mode field should
+ * be OR'd with the mask DeviceMode and compared with the values
+ * Absolute and Relative to determine the mode, and should be OR'd
+ * with the mask ProximityState and compared with the values InProximity
+ * and OutOfProximity to determine the proximity state.
+ *
+ */
+
+typedef struct {
+    unsigned char     class;
+    unsigned char     length;
+    unsigned char     num_valuators;
+    unsigned char     mode;
+    int                  *valuators;
+} XValuatorState;
+
+typedef struct {
+    unsigned char     class;
+    unsigned char     length;
+    short          num_keys;
+    char             keys[32];
+} XKeyState;
+
+typedef struct {
+    unsigned char     class;
+    unsigned char     length;
+    short          num_buttons;
+    char             buttons[32];
+} XButtonState;
+
+/*******************************************************************
+ *
+ * Function definitions.
+ *
+ */
+
+_XFUNCPROTOBEGIN
+
+extern int     XChangeKeyboardDevice(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */
+#endif
+);
+
+extern int     XChangePointerDevice(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    int               /* xaxis */,
+    int               /* yaxis */
+#endif
+);
+
+extern int     XGrabDevice(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    Window          /* grab_window */,
+    Bool          /* ownerEvents */,
+    int               /* event count */,
+    XEventClass*     /* event_list */,
+    int               /* this_device_mode */,
+    int               /* other_devices_mode */,
+    Time          /* time */
+#endif
+);
+
+extern int     XUngrabDevice(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    Time           /* time */
+#endif
+);
+
+extern int     XGrabDeviceKey(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    unsigned int     /* key */,
+    unsigned int     /* modifiers */,
+    XDevice*          /* modifier_device */,
+    Window          /* grab_window */,
+    Bool          /* owner_events */,
+    unsigned int     /* event_count */,
+    XEventClass*     /* event_list */,
+    int               /* this_device_mode */,
+    int               /* other_devices_mode */
+#endif
+);
+
+extern int     XUngrabDeviceKey(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    unsigned int     /* key */,
+    unsigned int     /* modifiers */,
+    XDevice*          /* modifier_dev */,
+    Window          /* grab_window */
+#endif
+);
+
+extern int     XGrabDeviceButton(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    unsigned int     /* button */,
+    unsigned int     /* modifiers */,
+    XDevice*          /* modifier_device */,
+    Window          /* grab_window */,
+    Bool          /* owner_events */,
+    unsigned int     /* event_count */,
+    XEventClass*     /* event_list */,
+    int               /* this_device_mode */,
+    int               /* other_devices_mode */
+#endif
+);
+
+extern int     XUngrabDeviceButton(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    unsigned int     /* button */,
+    unsigned int     /* modifiers */,
+    XDevice*          /* modifier_dev */,
+    Window          /* grab_window */
+#endif
+);
+
+extern int     XAllowDeviceEvents(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    int               /* event_mode */,
+    Time          /* time */
+#endif
+);
+
+extern int     XGetDeviceFocus(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    Window*          /* focus */,
+    int*          /* revert_to */,
+    Time*          /* time */
+#endif
+);
+
+extern int     XSetDeviceFocus(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    Window          /* focus */,
+    int               /* revert_to */,
+    Time          /* time */
+#endif
+);
+
+extern XFeedbackState     *XGetFeedbackControl(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    int*          /* num_feedbacks */
+#endif
+);
+
+extern int     XFreeFeedbackList(
+#if NeedFunctionPrototypes
+    XFeedbackState*     /* list */
+#endif
+);
+
+extern int     XChangeFeedbackControl(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    unsigned long     /* mask */,
+    XFeedbackControl*     /* f */
+#endif
+);
+
+extern int     XDeviceBell(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    XID               /* feedbackclass */,
+    XID               /* feedbackid */,
+    int               /* percent */
+#endif
+);
+
+extern KeySym     *XGetDeviceKeyMapping(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+#if NeedWidePrototypes
+    unsigned int     /* first */,
+#else
+    KeyCode          /* first */,
+#endif
+    int               /* keycount */,
+    int*          /* syms_per_code */
+#endif
+);
+
+extern int     XChangeDeviceKeyMapping(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    int               /* first */,
+    int               /* syms_per_code */,
+    KeySym*          /* keysyms */,
+    int               /* count */
+#endif
+);
+
+extern XModifierKeymap     *XGetDeviceModifierMapping(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */
+#endif
+);
+
+extern int     XSetDeviceModifierMapping(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    XModifierKeymap*     /* modmap */
+#endif
+);
+
+extern int     XSetDeviceButtonMapping(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    unsigned char*     /* map[] */,
+    int               /* nmap */
+#endif
+);
+
+extern int     XGetDeviceButtonMapping(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    unsigned char*     /* map[] */,
+    unsigned int     /* nmap */
+#endif
+);
+
+extern XDeviceState     *XQueryDeviceState(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */
+#endif
+);
+
+extern int     XFreeDeviceState(
+#if NeedFunctionPrototypes
+    XDeviceState*     /* list */
+#endif
+);
+
+extern XExtensionVersion *XGetExtensionVersion(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    _Xconst char*     /* name */
+#endif
+);
+
+extern XDeviceInfo     *XListInputDevices(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    int*          /* ndevices */
+#endif
+);
+
+extern int     XFreeDeviceList(
+#if NeedFunctionPrototypes
+    XDeviceInfo*     /* list */
+#endif
+);
+
+extern XDevice     *XOpenDevice(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XID               /* id */
+#endif
+);
+
+extern int     XCloseDevice(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */
+#endif
+);
+
+extern int     XSetDeviceMode(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    int               /* mode */
+#endif
+);
+
+extern int     XSetDeviceValuators(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    int*          /* valuators */,
+    int               /* first_valuator */,
+    int               /* num_valuators */
+#endif
+);
+
+extern XDeviceControl     *XGetDeviceControl(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    int               /* control */
+#endif
+);
+
+extern int     XChangeDeviceControl(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    int               /* control */,
+    XDeviceControl*     /* d */
+#endif
+);
+
+extern int     XSelectExtensionEvent(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    Window          /* w */,
+    XEventClass*     /* event_list */,
+    int               /* count */
+#endif
+);
+
+extern int     XGetSelectedExtensionEvents(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    Window          /* w */,
+    int*          /* this_client_count */,
+    XEventClass**     /* this_client_list */,
+    int*          /* all_clients_count */,
+    XEventClass**     /* all_clients_list */
+#endif
+);
+
+extern int     XChangeDeviceDontPropagateList(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    Window          /* window */,
+    int               /* count */,
+    XEventClass*     /* events */,
+    int               /* mode */
+#endif
+);
+
+extern XEventClass     *XGetDeviceDontPropagateList(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    Window          /* window */,
+    int*          /* count */
+#endif
+);
+
+extern Status     XSendExtensionEvent(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    Window          /* dest */,
+    Bool          /* prop */,
+    int               /* count */,
+    XEventClass*     /* list */,
+    XEvent*          /* event */
+#endif
+);
+
+extern XDeviceTimeCoord     *XGetDeviceMotionEvents(
+#if NeedFunctionPrototypes
+    Display*          /* display */,
+    XDevice*          /* device */,
+    Time          /* start */,
+    Time          /* stop */,
+    int*          /* nEvents */,
+    int*          /* mode */,
+    int*          /* axis_count */
+#endif
+);
+
+extern int     XFreeDeviceMotionEvents(
+#if NeedFunctionPrototypes
+    XDeviceTimeCoord*     /* events */
+#endif
+);
+
+extern int     XFreeDeviceControl(
+#if NeedFunctionPrototypes
+    XDeviceControl*     /* control */
+#endif
+);
+
+_XFUNCPROTOEND
+
+#endif /* _XINPUT_H_ */
+
+/* Definitions used by the server, library and client */
+
+#ifndef _XI_H_
+
+#define _XI_H_
+
+#define sz_xGetExtensionVersionReq          8
+#define sz_xGetExtensionVersionReply          32
+#define sz_xListInputDevicesReq               4
+#define sz_xListInputDevicesReply          32
+#define sz_xOpenDeviceReq               8
+#define sz_xOpenDeviceReply               32
+#define sz_xCloseDeviceReq               8
+#define sz_xSetDeviceModeReq               8
+#define sz_xSetDeviceModeReply               32
+#define sz_xSelectExtensionEventReq          12
+#define sz_xGetSelectedExtensionEventsReq     8
+#define sz_xGetSelectedExtensionEventsReply     32
+#define sz_xChangeDeviceDontPropagateListReq     12
+#define sz_xGetDeviceDontPropagateListReq     8
+#define sz_xGetDeviceDontPropagateListReply     32
+#define sz_xGetDeviceMotionEventsReq          16
+#define sz_xGetDeviceMotionEventsReply          32
+#define sz_xChangeKeyboardDeviceReq          8
+#define sz_xChangeKeyboardDeviceReply          32
+#define sz_xChangePointerDeviceReq          8
+#define sz_xChangePointerDeviceReply          32
+#define sz_xGrabDeviceReq               20
+#define sz_xGrabDeviceReply               32
+#define sz_xUngrabDeviceReq               12
+#define sz_xGrabDeviceKeyReq               20
+#define sz_xGrabDeviceKeyReply               32
+#define sz_xUngrabDeviceKeyReq               16
+#define sz_xGrabDeviceButtonReq               20
+#define sz_xGrabDeviceButtonReply          32
+#define sz_xUngrabDeviceButtonReq          16
+#define sz_xAllowDeviceEventsReq          12
+#define sz_xGetDeviceFocusReq               8
+#define sz_xGetDeviceFocusReply               32
+#define sz_xSetDeviceFocusReq               16
+#define sz_xGetFeedbackControlReq          8
+#define sz_xGetFeedbackControlReply          32
+#define sz_xChangeFeedbackControlReq          12
+#define sz_xGetDeviceKeyMappingReq          8
+#define sz_xGetDeviceKeyMappingReply          32
+#define sz_xChangeDeviceKeyMappingReq          8
+#define sz_xGetDeviceModifierMappingReq          8
+#define sz_xSetDeviceModifierMappingReq          8
+#define sz_xSetDeviceModifierMappingReply     32
+#define sz_xGetDeviceButtonMappingReq          8
+#define sz_xGetDeviceButtonMappingReply          32
+#define sz_xSetDeviceButtonMappingReq          8
+#define sz_xSetDeviceButtonMappingReply          32
+#define sz_xQueryDeviceStateReq               8
+#define sz_xQueryDeviceStateReply          32
+#define sz_xSendExtensionEventReq          16
+#define sz_xDeviceBellReq               8
+#define sz_xSetDeviceValuatorsReq          8
+#define sz_xSetDeviceValuatorsReply          32
+#define sz_xGetDeviceControlReq               8
+#define sz_xGetDeviceControlReply          32
+#define sz_xChangeDeviceControlReq          8
+#define sz_xChangeDeviceControlReply          32
+
+#define INAME                "XInputExtension"
+
+#define XI_KEYBOARD     "KEYBOARD"
+#define XI_MOUSE     "MOUSE"
+#define XI_TABLET     "TABLET"
+#define XI_TOUCHSCREEN     "TOUCHSCREEN"
+#define XI_TOUCHPAD     "TOUCHPAD"
+#define XI_BARCODE     "BARCODE"
+#define XI_BUTTONBOX     "BUTTONBOX"
+#define XI_KNOB_BOX     "KNOB_BOX"
+#define XI_ONE_KNOB     "ONE_KNOB"
+#define XI_NINE_KNOB     "NINE_KNOB"
+#define XI_TRACKBALL     "TRACKBALL"
+#define XI_QUADRATURE     "QUADRATURE"
+#define XI_ID_MODULE     "ID_MODULE"
+#define XI_SPACEBALL     "SPACEBALL"
+#define XI_DATAGLOVE     "DATAGLOVE"
+#define XI_EYETRACKER     "EYETRACKER"
+#define XI_CURSORKEYS     "CURSORKEYS"
+#define XI_FOOTMOUSE     "FOOTMOUSE"
+
+#define Dont_Check               0
+#define XInput_Initial_Release          1
+#define XInput_Add_XDeviceBell          2
+#define XInput_Add_XSetDeviceValuators     3
+#define XInput_Add_XChangeDeviceControl     4
+
+#define XI_Absent          0
+#define XI_Present          1
+
+#define XI_Initial_Release_Major          1
+#define XI_Initial_Release_Minor          0
+
+#define XI_Add_XDeviceBell_Major          1
+#define XI_Add_XDeviceBell_Minor          1
+
+#define XI_Add_XSetDeviceValuators_Major     1
+#define XI_Add_XSetDeviceValuators_Minor     2
+
+#define XI_Add_XChangeDeviceControl_Major     1
+#define XI_Add_XChangeDeviceControl_Minor     3
+
+#define DEVICE_RESOLUTION     1
+
+#define NoSuchExtension          1
+
+#define COUNT               0
+#define CREATE               1
+
+#define NewPointer          0
+#define NewKeyboard          1
+
+#define XPOINTER          0
+#define XKEYBOARD          1
+
+#define UseXKeyboard          0xFF
+
+#define IsXPointer          0
+#define IsXKeyboard          1
+#define IsXExtensionDevice     2
+
+#define AsyncThisDevice          0
+#define SyncThisDevice          1
+#define ReplayThisDevice     2
+#define AsyncOtherDevices     3
+#define AsyncAll          4
+#define SyncAll               5
+
+#define FollowKeyboard           3
+#define RevertToFollowKeyboard      3
+
+#define DvAccelNum              (1L &lt;&lt; 0)
+#define DvAccelDenom            (1L &lt;&lt; 1)
+#define DvThreshold             (1L &lt;&lt; 2)
+
+#define DvKeyClickPercent     (1L&lt;&lt;0)
+#define DvPercent          (1L&lt;&lt;1)
+#define DvPitch               (1L&lt;&lt;2)
+#define DvDuration          (1L&lt;&lt;3)
+#define DvLed               (1L&lt;&lt;4)
+#define DvLedMode          (1L&lt;&lt;5)
+#define DvKey               (1L&lt;&lt;6)
+#define DvAutoRepeatMode     (1L&lt;&lt;7)
+
+#define DvString                (1L &lt;&lt; 0)
+
+#define DvInteger               (1L &lt;&lt; 0)
+
+#define DeviceMode              (1L &lt;&lt; 0)
+#define Relative                0
+#define Absolute                1
+
+#define ProximityState          (1L &lt;&lt; 1)
+#define InProximity             (0L &lt;&lt; 1)
+#define OutOfProximity          (1L &lt;&lt; 1)
+
+#define AddToList               0
+#define DeleteFromList          1
+
+#define KeyClass            0
+#define ButtonClass            1
+#define ValuatorClass            2
+#define FeedbackClass            3
+#define ProximityClass       4
+#define FocusClass            5
+#define OtherClass            6
+
+#define KbdFeedbackClass       0
+#define PtrFeedbackClass       1
+#define StringFeedbackClass       2
+#define IntegerFeedbackClass       3
+#define LedFeedbackClass       4
+#define BellFeedbackClass       5
+
+#define _devicePointerMotionHint 0
+#define _deviceButton1Motion      1
+#define _deviceButton2Motion      2
+#define _deviceButton3Motion      3
+#define _deviceButton4Motion      4
+#define _deviceButton5Motion      5
+#define _deviceButtonMotion      6
+#define _deviceButtonGrab      7
+#define _deviceOwnerGrabButton      8
+#define _noExtensionEvent      9
+
+#define XI_BadDevice     0
+#define XI_BadEvent     1
+#define XI_BadMode     2
+#define XI_DeviceBusy     3
+#define XI_BadClass     4
+
+typedef     unsigned long     XEventClass;
+
+/*******************************************************************
+ *
+ * Extension version structure.
+ *
+ */
+
+typedef struct {
+        int        present;
+        short     major_version;
+        short     minor_version;
+} XExtensionVersion;
+
+#endif /* _XI_H_ */
+
+</literallayout>
+<!-- .\" print Table of Contents -->
+<!-- .if o .bp \" blank page to make count even -->
+<!-- .bp 1 -->
+<!-- .af PN i -->
+<!-- .PX -->
+
+
+</para>
+</sect3>
+</sect2>
+</sect1>
+</chapter>
Index: lib/libXi/create-1.8-docbook-patch/libXi-1.8-new/specs
===================================================================
--- lib/libXi/create-1.8-docbook-patch/libXi-1.8-new/specs	(nonexistent)
+++ lib/libXi/create-1.8-docbook-patch/libXi-1.8-new/specs	(revision 5)

Property changes on: lib/libXi/create-1.8-docbook-patch/libXi-1.8-new/specs
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXi/create-1.8-docbook-patch/libXi-1.8-new
===================================================================
--- lib/libXi/create-1.8-docbook-patch/libXi-1.8-new	(nonexistent)
+++ lib/libXi/create-1.8-docbook-patch/libXi-1.8-new	(revision 5)

Property changes on: lib/libXi/create-1.8-docbook-patch/libXi-1.8-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXi/create-1.8-docbook-patch
===================================================================
--- lib/libXi/create-1.8-docbook-patch	(nonexistent)
+++ lib/libXi/create-1.8-docbook-patch	(revision 5)

Property changes on: lib/libXi/create-1.8-docbook-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXi/patches/README
===================================================================
--- lib/libXi/patches/README	(nonexistent)
+++ lib/libXi/patches/README	(revision 5)
@@ -0,0 +1,6 @@
+
+/* begin *
+
+   TODO: Leave some comment here.
+
+ * end */
Index: lib/libXi/patches
===================================================================
--- lib/libXi/patches	(nonexistent)
+++ lib/libXi/patches	(revision 5)

Property changes on: lib/libXi/patches
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXi
===================================================================
--- lib/libXi	(nonexistent)
+++ lib/libXi	(revision 5)

Property changes on: lib/libXi
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXinerama/Makefile
===================================================================
--- lib/libXinerama/Makefile	(nonexistent)
+++ lib/libXinerama/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXinerama
+
+versions    = 1.1.5
+pkgname     = libXinerama
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXinerama
===================================================================
--- lib/libXinerama	(nonexistent)
+++ lib/libXinerama	(revision 5)

Property changes on: lib/libXinerama
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXmu/Makefile
===================================================================
--- lib/libXmu/Makefile	(nonexistent)
+++ lib/libXmu/Makefile	(revision 5)
@@ -0,0 +1,56 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXmu
+
+versions    = 1.1.4
+pkgname     = libXmu
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+patches     = $(CURDIR)/patches/libXmu-1.1.4-docbook.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-1.1.4-docbook-patch ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s) $(patches)
Index: lib/libXmu/create-1.1.4-docbook-patch/create.patch.sh
===================================================================
--- lib/libXmu/create-1.1.4-docbook-patch/create.patch.sh	(nonexistent)
+++ lib/libXmu/create-1.1.4-docbook-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=1.1.4
+
+tar --files-from=file.list -xJvf ../libXmu-$VERSION.tar.xz
+mv libXmu-$VERSION libXmu-$VERSION-orig
+
+cp -rf ./libXmu-$VERSION-new ./libXmu-$VERSION
+
+diff --unified -Nr  libXmu-$VERSION-orig  libXmu-$VERSION > libXmu-$VERSION-docbook.patch
+
+mv libXmu-$VERSION-docbook.patch ../patches
+
+rm -rf ./libXmu-$VERSION
+rm -rf ./libXmu-$VERSION-orig

Property changes on: lib/libXmu/create-1.1.4-docbook-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: lib/libXmu/create-1.1.4-docbook-patch/file.list
===================================================================
--- lib/libXmu/create-1.1.4-docbook-patch/file.list	(nonexistent)
+++ lib/libXmu/create-1.1.4-docbook-patch/file.list	(revision 5)
@@ -0,0 +1 @@
+libXmu-1.1.4/doc/Xmu.xml
Index: lib/libXmu/create-1.1.4-docbook-patch/libXmu-1.1.4-new/doc/Xmu.xml
===================================================================
--- lib/libXmu/create-1.1.4-docbook-patch/libXmu-1.1.4-new/doc/Xmu.xml	(nonexistent)
+++ lib/libXmu/create-1.1.4-docbook-patch/libXmu-1.1.4-new/doc/Xmu.xml	(revision 5)
@@ -0,0 +1,4728 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+ "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
+[
+<!ENTITY % defs SYSTEM "defs.ent"> %defs;
+]>
+<!-- lifted from troff+ms+XMan by doclifter -->
+
+<article id='xmu'>
+  <articleinfo>
+    <title>Xmu and Xmuu Library API Reference</title>
+    <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
+    <copyright><year>1989</year><holder>X Consortium</holder>
+    </copyright>
+    <abstract><para>&ldquo;Don't ask.&rdquo;</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 &ldquo;Software&rdquo;), 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>
+      <para>
+<trademark><emphasis>X Window System</emphasis></trademark>
+is a trademark of The Open Group.
+      </para>
+
+    </legalnotice>
+  </articleinfo>
+
+  <sect1 id='Introduction'>
+<title>Introduction</title>
+
+    <para>
+The Xmu Library is a collection of miscellaneous (some might say random)
+utility functions that have been useful in building various applications
+and widgets.  This library is required by the Athena Widgets.
+    </para>
+
+    <para>
+Starting in XFree86 4.1.0, and incorporated into X11R6.7 and later releases,
+a subset of the functions that do not rely on the Athena Widgets (libXaw)
+or X Toolkit Intrinsics (libXt) are provided in a second library, libXmuu.
+    </para>
+
+    <para>
+Programs using either of these libraries are encouraged to determine the
+correct compiler and linker options via the <userinput>xmu</userinput> or
+<userinput>xmuu</userinput> module names for <command>pkg-config</command>,
+<indexterm>
+<primary><command>pkg-config</command></primary>
+</indexterm>
+such as:
+
+      <screen>
+cc -c xapplication.c `pkg-config --cflags xmu`
+cc -o xapplication xapplication.o `pkg-config --libs xmu`
+      </screen>
+    </para>
+
+  </sect1>
+
+  <sect1 id='Atom_Functions'>
+<title>Atom Functions</title>
+
+    <para>
+To use the functions and macros defined in this section, you should include
+the header file
+&lt;<filename class='headerfile'>X11/Xmu/Atoms.h</filename>&gt;
+<indexterm>
+<primary><filename class='headerfile'>X11/Xmu/Atoms.h</filename></primary>
+</indexterm>
+and link against the libXmu library.
+    </para>
+
+    <funcsynopsis>
+      <funcprototype>
+	<funcdef><function>XA_ATOM_PAIR</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+	<funcdef><function>XA_CHARACTER_POSITION</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+	<funcdef><function>XA_CLASS</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+	<funcdef><function>XA_CLIENT_WINDOW</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+	<funcdef><function>XA_CLIPBOARD</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+	<funcdef><function>XA_COMPOUND_TEXT</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+	<funcdef><function>XA_DECNET_ADDRESS</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+	<funcdef><function>XA_DELETE</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+	<funcdef><function>XA_FILENAME</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+	<funcdef><function>XA_HOSTNAME</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+	<funcdef><function>XA_IP_ADDRESS</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+	<funcdef><function>XA_LENGTH</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+	<funcdef><function>XA_LIST_LENGTH</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+	<funcdef><function>XA_NAME</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+	<funcdef><function>XA_NET_ADDRESS</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+	<funcdef><function>XA_NULL</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+	<funcdef><function>XA_OWNER_OS</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+	<funcdef><function>XA_SPAN</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+	<funcdef><function>XA_TARGETS</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+	<funcdef><function>XA_TEXT</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+	<funcdef><function>XA_TIMESTAMP</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+	<funcdef><function>XA_USER</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+	<funcdef><function>XA_UTF8_STRING</function></funcdef>
+	<paramdef><parameter>d</parameter></paramdef>
+      </funcprototype>
+    </funcsynopsis>
+
+    <para>
+      <indexterm>
+	<primary><type>Atom</type></primary>
+      </indexterm>
+These macros take a display as argument and return an
+<type>Atom</type>.
+The name of the
+atom is obtained from the macro name by removing the leading characters
+&ldquo;<code>XA_</code>&rdquo;.  The
+<type>Atom</type>
+value is cached, such that subsequent requests do not cause
+another round-trip to the server.
+    </para>
+
+    <para>
+      <indexterm zone="XmuMakeAtom">
+	<primary><xref linkend='XmuMakeAtom' xrefstyle='select: title'/></primary>
+      </indexterm>
+      <funcsynopsis id='XmuMakeAtom'>
+	<funcprototype>
+	  <funcdef>AtomPtr <function>XmuMakeAtom</function></funcdef>
+	  <paramdef>const char *<parameter>name</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>name</parameter></term>
+	  <listitem><para>
+specifies the atom name
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function creates and initializes an opaque object, an
+<type>AtomPtr</type>,
+for an
+<type>Atom</type>
+with the
+given name.
+<xref linkend='XmuInternAtom' xrefstyle='select: title'/>
+can be used to cache the Atom value for one or more displays.
+    </para>
+
+    <para>
+      <indexterm zone="XmuNameOfAtom">
+	<primary><xref linkend='XmuNameOfAtom' xrefstyle='select: title'/></primary>
+      </indexterm>
+      <funcsynopsis id='XmuNameOfAtom'>
+	<funcprototype>
+	  <funcdef>char *<function>XmuNameOfAtom</function></funcdef>
+	  <paramdef>AtomPtr <parameter>atom_ptr</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>atom_ptr</parameter></term>
+	  <listitem><para>
+specifies the AtomPtr
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+The function returns the name of an AtomPtr.
+    </para>
+
+    <para>
+      <indexterm zone="XmuInternAtom">
+	<primary><xref linkend='XmuInternAtom' xrefstyle='select: title'/></primary>
+      </indexterm>
+      <funcsynopsis id='XmuInternAtom'>
+	<funcprototype>
+	  <funcdef>Atom <function>XmuInternAtom</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>AtomPtr <parameter>atom_ptr</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the connection to the X server
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>atom_ptr</parameter></term>
+	  <listitem><para>
+specifies the AtomPtr
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function returns the
+<type>Atom</type>
+for an
+<type>AtomPtr</type>.
+The
+<type>Atom</type>
+is cached,
+such that subsequent requests do not cause another round-trip to the server.
+    </para>
+
+    <para>
+      <indexterm zone="XmuGetAtomName">
+	<primary><xref linkend='XmuGetAtomName' xrefstyle='select: title'/></primary>
+      </indexterm>
+      <funcsynopsis id='XmuGetAtomName'>
+	<funcprototype>
+	  <funcdef>char *<function>XmuGetAtomName</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>Atom <parameter>atom</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the connection to the X server
+	   </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>atom</parameter></term>
+	  <listitem><para>
+specifies the atom whose name is desired
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function returns the name of an
+<type>Atom</type>.
+The result is cached, such that subsequent
+requests do not cause another round-trip to the server.
+    </para>
+
+    <para>
+      <indexterm zone="XmuInternStrings">
+	<primary><xref linkend='XmuInternStrings' xrefstyle='select: title'/></primary>
+      </indexterm>
+      <funcsynopsis id='XmuInternStrings'>
+	<funcprototype>
+	  <funcdef>void <function>XmuInternStrings</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>String *<parameter>names</parameter></paramdef>
+	  <paramdef>Cardinal <parameter>count</parameter></paramdef>
+	  <paramdef>Atom *<parameter>atoms</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the connection to the X server
+	   </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>names</parameter></term>
+	  <listitem><para>
+specifies the strings to intern
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>count</parameter></term>
+	  <listitem><para>
+specifies the number of strings
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>atoms</parameter></term>
+	  <listitem><para>
+returns the list of Atom values
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function converts a list of atom names into
+<type>Atom</type>
+values.  The results are cached, such
+that subsequent requests do not cause further round-trips to the server.
+The caller is responsible for preallocating the array pointed at by atoms.
+    </para>
+
+  </sect1>
+
+  <sect1 id='Error_Handler_Functions'>
+<title>Error Handler Functions</title>
+
+    <para>
+To use the functions defined in this section, you should include the header
+file
+&lt;<filename class='headerfile'>X11/Xmu/Error.h</filename>&gt;
+<indexterm>
+<primary><filename class='headerfile'>X11/Xmu/Error.h</filename></primary>
+</indexterm>
+and link against the libXmu or libXmuu library.
+    </para>
+
+    <para>
+      <indexterm zone="XmuPrintDefaultErrorMessage">
+	<primary><xref linkend='XmuPrintDefaultErrorMessage' xrefstyle='select: title'/></primary>
+      </indexterm>
+      <funcsynopsis id='XmuPrintDefaultErrorMessage'>
+	<funcprototype>
+	  <funcdef>int <function>XmuPrintDefaultErrorMessage</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>XErrorEvent *<parameter>event</parameter></paramdef>
+	  <paramdef>FILE *<parameter>fp</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the connection to the X server
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>event</parameter></term>
+	  <listitem><para>
+specifies the error
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>fp</parameter></term>
+	  <listitem><para>
+	      specifies where to print the error message
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function prints an error message, equivalent to Xlib's default error
+message for protocol errors.  It returns a non-zero value
+if the caller should consider exiting, otherwise it returns 0.
+This function can be used when you need to
+write your own error handler, but need to print out an error from within
+that handler.
+    </para>
+
+    <para id="XmuSimpleErrorHandler">
+      <indexterm zone="XmuSimpleErrorHandler">
+	<primary><function>XmuSimpleErrorHandler</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>int <function>XmuSimpleErrorHandler</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>XErrorEvent *<parameter>errorp</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the connection to the X server
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>errorp</parameter></term>
+	  <listitem><para>
+specifies the error
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function ignores errors for
+<errorname>BadWindow</errorname>
+errors for
+<function>XQueryTree</function>
+and
+<function>XGetWindowAttributes</function>,
+and ignores
+<errorname>BadDrawable</errorname>
+errors for
+<function>XGetGeometry</function>;
+it returns 0 in those cases.  Otherwise, it prints the default error message,
+and returns a non-zero value if the caller should consider exiting,
+and 0 if the caller should not exit.
+    </para>
+  </sect1>
+
+  <sect1 id='System_Utility_Functions'>
+<title>System Utility Functions</title>
+
+    <para>
+To use the functions defined in this section, you should include the header
+file
+&lt;<filename class='headerfile'>X11/Xmu/SysUtil.h</filename>&gt;
+<indexterm>
+<primary><filename class='headerfile'>X11/Xmu/SysUtil.h</filename></primary>
+</indexterm>
+and link against the libXmu or libXmuu library.
+    </para>
+
+    <para id="XmuGetHostname">
+      <indexterm zone="XmuGetHostname">
+	<primary><function>XmuGetHostname</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>int <function>XmuGetHostname</function></funcdef>
+	  <paramdef>char *<parameter>buf</parameter></paramdef>
+	  <paramdef>int <parameter>maxlen</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+     <variablelist>
+	<varlistentry>
+	  <term><parameter>buf</parameter></term>
+	  <listitem><para>
+returns the host name
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>maxlen</parameter></term>
+	  <listitem><para>
+specifies the length of <parameter>buf</parameter>
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function stores the null terminated name of the local host in
+<parameter>buf</parameter>, and
+returns length of the name.  This function hides operating system differences,
+such as whether to call <function>gethostname</function> or
+<function>uname</function>.
+    </para>
+
+    <para id="XmuSnprintf">
+      <indexterm zone="XmuSnprintf">
+	<primary><function>XmuSnprintf</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>int <function>XmuSnprintf</function></funcdef>
+	  <paramdef>char *<parameter>str</parameter></paramdef>
+	  <paramdef>int <parameter>size</parameter></paramdef>
+	  <paramdef><parameter>...</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+     <variablelist>
+	<varlistentry>
+	  <term><parameter>str</parameter></term>
+	  <listitem><para>
+string to write output to
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>size</parameter></term>
+	  <listitem><para>
+specifies the size of <parameter>str</parameter>
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function was provided as a portable implementation of
+<function>snprintf</function> before all platforms could be
+relied on to provide their own.   It is now deprecated in favor of
+calling <function>snprintf</function> directly and should only be used
+in software that needs to continue to support non-Unix98 compliant platforms.
+    </para>
+
+
+  </sect1>
+
+  <sect1 id='Window_Utility_Functions'>
+<title>Window Utility Functions</title>
+
+    <para>
+To use the functions defined in this section, you should include the header
+file
+&lt;<filename class='headerfile'>X11/Xmu/WinUtil.h</filename>&gt;
+<indexterm>
+<primary><filename class='headerfile'>X11/Xmu/WinUtil.h</filename></primary>
+</indexterm>.
+To use <function>XmuClientWindow</function>, you may link against either the
+libXmu or libXmuu libraries.   The other functions in this section require
+linking against the libXmu library.
+    </para>
+
+    <para id="XmuScreenOfWindow">
+      <indexterm zone="XmuScreenOfWindow">
+	<primary><function>XmuScreenOfWindow</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>Screen *<function>XmuScreenOfWindow</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>Window <parameter>w</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the connection to the X server
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>w</parameter></term>
+	  <listitem><para>
+specifies the window
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function returns the
+<type>Screen</type>
+on which the specified window was created.
+    </para>
+
+    <para id="XmuClientWindow">
+      <indexterm zone="XmuClientWindow">
+	<primary><function>XmuClientWindow</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>Window <function>XmuClientWindow</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>Window <parameter>win</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the connection to the X server
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>win</parameter></term>
+	  <listitem><para>
+specifies the window
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+      <indexterm zone="XmuClientWindow">
+	<primary><property>WM_STATE</property></primary>
+      </indexterm>
+This function finds a window, at or below the specified window, which has a
+<property>WM_STATE</property> property.  If such a window is found, it is
+returned, otherwise the
+argument window is returned.
+    </para>
+
+    <para id="XmuUpdateMapHints">
+      <indexterm zone="XmuUpdateMapHints">
+	<primary><function>XmuUpdateMapHints</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>Bool <function>XmuUpdateMapHints</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>Window <parameter>w</parameter></paramdef>
+	  <paramdef>XSizeHints *<parameter>hints</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the connection to the X server
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>win</parameter></term>
+	  <listitem><para>
+specifies the window
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>hints</parameter></term>
+	  <listitem><para>
+specifies the new hints, or <symbol>NULL</symbol>
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function clears the
+<symbol>PPosition</symbol>
+and
+<symbol>PSize</symbol>
+flags and sets the
+<symbol>USPosition</symbol>
+and
+<symbol>USSize</symbol>
+flags in the hints structure, and then stores the hints for the
+window using
+      <indexterm zone="XmuUpdateMapHints">
+	<primary><function>XSetWMNormalHints</function></primary>
+      </indexterm>
+<function>XSetWMNormalHints</function>
+and returns
+<symbol>True</symbol>.
+If <symbol>NULL</symbol> is passed for the
+hints structure, then the current hints are read back from the window using
+      <indexterm zone="XmuUpdateMapHints">
+	<primary><function>XGetWMNormalHints</function></primary>
+      </indexterm>
+<function>XGetWMNormalHints</function>
+and are used instead, and
+<symbol>True</symbol>
+is returned; otherwise
+<symbol>False</symbol>
+is returned.
+    </para>
+
+  </sect1>
+
+  <sect1 id='Cursor_Utility_Functions'>
+<title>Cursor Utility Functions</title>
+
+    <para>
+To use the functions defined in this section, you should include the header
+file
+&lt;<filename class='headerfile'>X11/Xmu/CurUtil.h</filename>&gt;
+<indexterm>
+<primary><filename class='headerfile'>X11/Xmu/CurUtil.h</filename></primary>
+</indexterm>
+and link against the libXmu or libXmuu library.
+    </para>
+
+    <para id="XmuCursorNameToIndex">
+      <indexterm zone="XmuCursorNameToIndex">
+	<primary><function>XmuCursorNameToIndex</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>int <function>XmuCursorNameToIndex</function></funcdef>
+	  <paramdef>const char *<parameter>name</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>name</parameter></term>
+	  <listitem><para>
+specifies the name of the cursor
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function takes the name of a standard cursor and returns its index
+in the standard cursor font.  The cursor names are formed by removing the
+&ldquo;<code>XC_</code>&rdquo; prefix from the cursor defines listed in
+Appendix B of the Xlib
+manual.
+    </para>
+
+  </sect1>
+
+  <sect1 id='Graphics_Functions'>
+<title>Graphics Functions</title>
+
+    <para>
+To use the functions defined in this section, you should include the header
+file
+&lt;<filename class='headerfile'>X11/Xmu/Drawing.h</filename>&gt;
+<indexterm>
+<primary><filename class='headerfile'>X11/Xmu/Drawing.h</filename></primary>
+</indexterm>
+and link against the libXmu library.
+    </para>
+
+    <para id="XmuDrawRoundedRectangle">
+      <indexterm zone="XmuDrawRoundedRectangle">
+	<primary><function>XmuDrawRoundedRectangle</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuDrawRoundedRectangle</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>Drawable <parameter>draw</parameter></paramdef>
+	  <paramdef>GC <parameter>gc</parameter></paramdef>
+	  <paramdef>int <parameter>x</parameter></paramdef>
+	  <paramdef>int <parameter>y</parameter></paramdef>
+	  <paramdef>int <parameter>w</parameter></paramdef>
+	  <paramdef>int <parameter>h</parameter></paramdef>
+	  <paramdef>int <parameter>ew</parameter></paramdef>
+	  <paramdef>int <parameter>eh</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the connection to the X server
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>draw</parameter></term>
+	  <listitem><para>
+specifies the drawable
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>gc</parameter></term>
+	  <listitem><para>
+specifies the GC
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>x</parameter></term>
+	  <listitem><para>
+specifies the upper left x coordinate
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>y</parameter></term>
+	  <listitem><para>
+specifies the upper left y coordinate
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>w</parameter></term>
+	  <listitem><para>
+specifies the rectangle width
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>h</parameter></term>
+	  <listitem><para>
+specifies the rectangle height
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>ew</parameter></term>
+	  <listitem><para>
+specifies the corner width
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>eh</parameter></term>
+	  <listitem><para>
+specifies the corner height
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function draws a rounded rectangle, where x, y, w, h are the dimensions
+of the overall rectangle, and ew and eh are the sizes of a bounding box that
+the corners are drawn inside of; ew should be no more than half of w, and eh
+should be no more than half of h.  The current GC line attributes control
+all attributes of the line.
+    </para>
+
+    <para id="XmuFillRoundedRectangle">
+      <indexterm zone="XmuFillRoundedRectangle">
+	<primary><function>XmuFillRoundedRectangle</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuFillRoundedRectangle</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>Drawable <parameter>draw</parameter></paramdef>
+	  <paramdef>GC <parameter>gc</parameter></paramdef>
+	  <paramdef>int <parameter>x</parameter></paramdef>
+	  <paramdef>int <parameter>y</parameter></paramdef>
+	  <paramdef>int <parameter>w</parameter></paramdef>
+	  <paramdef>int <parameter>h</parameter></paramdef>
+	  <paramdef>int <parameter>ew</parameter></paramdef>
+	  <paramdef>int <parameter>eh</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the connection to the X server
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>draw</parameter></term>
+	  <listitem><para>
+specifies the drawable
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>gc</parameter></term>
+	  <listitem><para>
+specifies the GC
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>x</parameter></term>
+	  <listitem><para>
+specifies the upper left x coordinate
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>y</parameter></term>
+	  <listitem><para>
+specifies the upper left y coordinate
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>w</parameter></term>
+	  <listitem><para>
+specifies the rectangle width
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>h</parameter></term>
+	  <listitem><para>
+specifies the rectangle height
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>ew</parameter></term>
+	  <listitem><para>
+specifies the corner width
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>eh</parameter></term>
+	  <listitem><para>
+specifies the corner height
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function draws a filled rounded rectangle, where x, y, w, h are the
+dimensions of the overall rectangle, and ew and eh are the sizes of a
+bounding box that the corners are drawn inside of; ew should be no more than
+half of w, and eh should be no more than half of h.  The current GC fill
+settings control all attributes of the fill contents.
+      </para>
+
+    <para id="XmuDrawLogo">
+      <indexterm zone="XmuDrawLogo">
+	<primary><function>XmuDrawLogo</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef><function>XmuDrawLogo</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>Drawable <parameter>drawable</parameter></paramdef>
+	  <paramdef>GC <parameter>gcFore</parameter></paramdef>
+	  <paramdef>GC <parameter>gcBack</parameter></paramdef>
+	  <paramdef>int <parameter>x</parameter></paramdef>
+	  <paramdef>int <parameter>y</parameter></paramdef>
+	  <paramdef>unsigned int <parameter>width</parameter></paramdef>
+	  <paramdef>unsigned int <parameter>height</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the connection to the X server
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>drawable</parameter></term>
+	  <listitem><para>
+specifies the drawable
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>gcFore</parameter></term>
+	  <listitem><para>
+specifies the foreground GC
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>gcBack</parameter></term>
+	  <listitem><para>
+specifies the background GC
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>x</parameter></term>
+	  <listitem><para>
+specifies the upper left x coordinate
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>y</parameter></term>
+	  <listitem><para>
+specifies the upper left y coordinate
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>width</parameter></term>
+	  <listitem><para>
+specifies the logo width
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>height</parameter></term>
+	  <listitem><para>
+specifies the logo height
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function draws the &ldquo;official&rdquo; X Window System logo
+(<xref linkend="xlogo"/>).  The bounding box
+of the logo in the drawable is given by x, y, width, and height.  The logo
+itself is filled using gcFore, and the rest of the rectangle is filled using
+gcBack.
+    </para>
+      <figure id="xlogo" pgwide="0">
+	<title>The X Logo</title>
+	<mediaobject>
+	  <imageobject>
+	    <imagedata id="xlogo-svg" format="SVG" fileref="xlogo.svg"/>
+	  </imageobject>
+	</mediaobject>
+      </figure>
+    <para id="XmuCreateStippledPixmap">
+      <indexterm zone="XmuCreateStippledPixmap">
+	<primary><function>XmuCreateStippledPixmap</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>Pixmap <function>XmuCreateStippledPixmap</function></funcdef>
+	  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+	  <paramdef>Pixel <parameter>fore</parameter></paramdef>
+	  <paramdef>Pixel <parameter>back</parameter></paramdef>
+	  <paramdef>unsigned int <parameter>depth</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>screen</parameter></term>
+	  <listitem><para>
+specifies the screen the pixmap is created on
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>fore</parameter></term>
+	  <listitem><para>
+specifies the foreground pixel value
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>back</parameter></term>
+	  <listitem><para>
+specifies the background pixel value
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>depth</parameter></term>
+	  <listitem><para>
+specifies the depth of the pixmap
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function creates a two pixel by one pixel stippled pixmap of specified
+depth on the specified screen.  The pixmap is cached so that multiple
+requests share the same pixmap.  The pixmap should be freed with
+<function>XmuReleaseStippledPixmap</function>
+to maintain correct reference counts.
+    </para>
+
+    <para id="XmuReleaseStippledPixmap">
+      <indexterm zone="XmuReleaseStippledPixmap">
+	<primary><function>XmuReleaseStippledPixmap</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuReleaseStippledPixmap</function></funcdef>
+	  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+	  <paramdef>Pixmap <parameter>pixmap</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>screen</parameter></term>
+	  <listitem><para>
+specifies the screen the pixmap was created on
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>pixmap</parameter></term>
+	  <listitem><para>
+specifies the pixmap to free
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function frees a pixmap created with
+<function>XmuCreateStippledPixmap</function>.
+    </para>
+
+    <para id="XmuReadBitmapData">
+      <indexterm zone="XmuReadBitmapData">
+	<primary><function>XmuReadBitmapData</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>int <function>XmuReadBitmapData</function></funcdef>
+	  <paramdef>FILE *<parameter>fstream</parameter></paramdef>
+	  <paramdef>unsigned int *<parameter>width</parameter></paramdef>
+	  <paramdef>unsigned int *<parameter>height</parameter></paramdef>
+	  <paramdef>unsigned char **<parameter>datap</parameter></paramdef>
+	  <paramdef>int *<parameter>x_hot</parameter></paramdef>
+	  <paramdef>int *<parameter>y_hot</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>fstream</parameter></term>
+	  <listitem><para>
+specifies the stream to read from
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>width</parameter></term>
+	  <listitem><para>
+returns the width of the bitmap
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>height</parameter></term>
+	  <listitem><para>
+returns the height of the bitmap
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>datap</parameter></term>
+	  <listitem><para>
+returns the parsed bitmap data
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>x_hot</parameter></term>
+	  <listitem><para>
+returns the x coordinate of the hotspot
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>y_hot</parameter></term>
+	  <listitem><para>
+returns the y coordinate of the hotspot
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function reads a standard bitmap file description from the specified
+stream, and returns the parsed data in a format suitable for passing to
+<function>XCreateBitmapFromData</function>.
+The return value of the function has the same
+interpretation as the return value for
+<function>XReadBitmapFile</function>.
+    </para>
+
+    <para id="XmuReadBitmapDataFromFile">
+      <indexterm zone="XmuReadBitmapDataFromFile">
+	<primary><function>XmuReadBitmapDataFromFile</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>int <function>XmuReadBitmapDataFromFile</function></funcdef>
+	  <paramdef>const char *<parameter>filename</parameter></paramdef>
+	  <paramdef>unsigned int *<parameter>width</parameter></paramdef>
+	  <paramdef>unsigned int *<parameter>height</parameter></paramdef>
+	  <paramdef>unsigned char **<parameter>datap</parameter></paramdef>
+	  <paramdef>int *<parameter>x_hot</parameter></paramdef>
+	  <paramdef>int *<parameter>y_hot</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>fstream</parameter></term>
+	  <listitem><para>
+specifies the file to read from
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>width</parameter></term>
+	  <listitem><para>
+returns the width of the bitmap
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>height</parameter></term>
+	  <listitem><para>
+returns the height of the bitmap
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>datap</parameter></term>
+	  <listitem><para>
+returns the parsed bitmap data
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>x_hot</parameter></term>
+	  <listitem><para>
+returns the x coordinate of the hotspot
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>y_hot</parameter></term>
+	  <listitem><para>
+returns the y coordinate of the hotspot
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function reads a standard bitmap file description from the specified
+file, and returns the parsed data in a format suitable for passing to
+<function>XCreateBitmapFromData</function>.
+The return value of the function has the same
+interpretation as the return value for
+<function>XReadBitmapFile</function>.
+    </para>
+
+    <para id="XmuLocateBitmapFile">
+      <indexterm zone="XmuLocateBitmapFile">
+	<primary><function>XmuLocateBitmapFile</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>Pixmap <function>XmuLocateBitmapFile</function></funcdef>
+	  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+	  <paramdef>const char *<parameter>name</parameter></paramdef>
+	  <paramdef>char *<parameter>srcname</parameter></paramdef>
+	  <paramdef>int <parameter>srcnamelen</parameter></paramdef>
+	  <paramdef>int *<parameter>widthp</parameter></paramdef>
+	  <paramdef>int *<parameter>heightp</parameter></paramdef>
+	  <paramdef>int *<parameter>xhotp</parameter></paramdef>
+	  <paramdef>int *<parameter>yhotp</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>screen</parameter></term>
+	  <listitem><para>
+specifies the screen the pixmap is created on
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>name</parameter></term>
+	  <listitem><para>
+specifies the file to read from
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>srcname</parameter></term>
+	  <listitem><para>
+returns the full filename of the bitmap
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>srcnamelen</parameter></term>
+	  <listitem><para>
+specifies the length of the srcname buffer
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>width</parameter></term>
+	  <listitem><para>
+returns the width of the bitmap
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>height</parameter></term>
+	  <listitem><para>
+returns the height of the bitmap
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>xhotp</parameter></term>
+	  <listitem><para>
+returns the x coordinate of the hotspot
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>yhotp</parameter></term>
+	  <listitem><para>
+returns the y coordinate of the hotspot
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function reads a file in standard bitmap file format, using
+<function>XReadBitmapFile</function>,
+and returns the created bitmap.  The filename may be
+absolute, or relative to the global resource named
+      <indexterm zone="XmuLocateBitmapFile">
+	<primary><systemitem class="resource">bitmapFilePath</systemitem></primary>
+      </indexterm>
+<systemitem class="resource">bitmapFilePath</systemitem> with class
+BitmapFilePath.  If the resource is not defined, the default value is the
+build symbol BITMAPDIR, which is typically
+"<filename class="directory">/usr/include/X11/bitmaps</filename>".
+If <parameter>srcnamelen</parameter> is greater than zero and
+<parameter>srcname</parameter> is not <symbol>NULL</symbol>,
+the null terminated filename will be copied into
+<parameter>srcname</parameter>.  The size and hotspot of the bitmap are
+also returned.
+    </para>
+
+    <para id="XmuCreatePixmapFromBitmap">
+      <indexterm zone="XmuCreatePixmapFromBitmap">
+	<primary><function>XmuCreatePixmapFromBitmap</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>Pixmap <function>XmuCreatePixmapFromBitmap</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>Drawable <parameter>d</parameter></paramdef>
+	  <paramdef>Pixmap <parameter>bitmap</parameter></paramdef>
+	  <paramdef>unsigned int <parameter>width</parameter></paramdef>
+	  <paramdef>unsigned int <parameter>height</parameter></paramdef>
+	  <paramdef>unsigned int <parameter>depth</parameter></paramdef>
+	  <paramdef>unsigned long <parameter>fore</parameter></paramdef>
+	  <paramdef>unsigned long <parameter>back</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the connection to the X server
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>screen</parameter></term>
+	  <listitem><para>
+specifies the screen the pixmap is created on
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>bitmap</parameter></term>
+	  <listitem><para>
+specifies the bitmap source
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>width</parameter></term>
+	  <listitem><para>
+specifies the width of the pixmap
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>height</parameter></term>
+	  <listitem><para>
+specifies the height of the pixmap
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>depth</parameter></term>
+	  <listitem><para>
+specifies the depth of the pixmap
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>fore</parameter></term>
+	  <listitem><para>
+specifies the foreground pixel value
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>back</parameter></term>
+	  <listitem><para>
+specifies the background pixel value
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function creates a pixmap of the specified width, height, and depth, on
+the same screen as the specified drawable, and then performs an
+<function>XCopyPlane</function>
+from the specified bitmap to the pixmap,
+using the specified foreground and background pixel values.
+The created pixmap is returned.
+    </para>
+
+  </sect1>
+
+  <sect1 id='Selection_Functions'>
+<title>Selection Functions</title>
+
+    <para>
+To use the functions defined in this section, you should include the header
+file
+&lt;<filename class='headerfile'>X11/Xmu/StdSel.h</filename>&gt;
+<indexterm>
+<primary><filename class='headerfile'>X11/Xmu/StdSel.h</filename></primary>
+</indexterm>
+and link against the libXmu library.
+    </para>
+
+    <para id="XmuConvertStandardSelection">
+      <indexterm zone="XmuConvertStandardSelection">
+	<primary><function>XmuConvertStandardSelection</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>Boolean <function>XmuConvertStandardSelection</function></funcdef>
+	  <paramdef>Widget <parameter>w</parameter></paramdef>
+	  <paramdef>Time <parameter>time</parameter></paramdef>
+	  <paramdef>Atom *<parameter>selection</parameter></paramdef>
+	  <paramdef>Atom *<parameter>target</parameter></paramdef>
+	  <paramdef>Atom *<parameter>type</parameter></paramdef>
+	  <paramdef>XPointer <parameter>value</parameter></paramdef>
+	  <paramdef>unsigned long *<parameter>length</parameter></paramdef>
+	  <paramdef>int *<parameter>format</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>w</parameter></term>
+	  <listitem><para>
+specifies the widget which currently owns the selection
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>time</parameter></term>
+	  <listitem><para>
+specifies the time at which the selection was established
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>selection</parameter></term>
+	  <listitem><para>
+this argument is ignored
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>target</parameter></term>
+	  <listitem><para>
+specifies the target type of the selection
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>type</parameter></term>
+	  <listitem><para>
+returns the property type of the converted value
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>value</parameter></term>
+	  <listitem><para>
+returns the converted value
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>length</parameter></term>
+	  <listitem><para>
+returns the number of elements in the converted value
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>format</parameter></term>
+	  <listitem><para>
+returns the size in bits of the elements</para>
+	  </listitem>
+	</varlistentry>
+      </variablelist>
+
+This function converts the following standard selections: CLASS,
+CLIENT_WINDOW, DECNET_ADDRESS, HOSTNAME, NAME, OWNER_OS,
+TARGETS, TIMESTAMP, and USER.  It returns
+<symbol>True</symbol>
+if the conversion was successful, else it returns
+<symbol>False</symbol>.
+    </para>
+  </sect1>
+
+  <sect1 id='Type_Converter_Functions'>
+<title>Type Converter Functions</title>
+
+    <para>
+To use the functions defined in this section, you should include the header
+file
+&lt;<filename class='headerfile'>X11/Xmu/Converters.h</filename>&gt;
+<indexterm>
+<primary><filename class='headerfile'>X11/Xmu/Converters.h</filename></primary>
+</indexterm>
+and link against the libXmu library.
+    </para>
+
+    <para id="XmuCvtFunctionToCallback">
+      <indexterm zone="XmuCvtFunctionToCallback">
+	<primary><function>XmuCvtFunctionToCallback</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuCvtFunctionToCallback</function></funcdef>
+	  <paramdef>XrmValue *<parameter>args</parameter></paramdef>
+	  <paramdef>Cardinal *<parameter>num_args</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>fromVal</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>toVal</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>args</parameter></term>
+	  <listitem><para>
+this argument is ignored
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>num_args</parameter></term>
+	  <listitem><para>
+this argument is ignored
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>fromVal</parameter></term>
+	  <listitem><para>
+the function to convert
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>toVal</parameter></term>
+	  <listitem><para>
+the place to store the converted value
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function converts a callback procedure to a callback list containing
+that procedure, with <symbol>NULL</symbol> closure data.  To use this converter, include the
+following in your widget's ClassInitialize procedure:
+
+      <programlisting>
+XtAddConverter(XtRCallProc, XtRCallback, XmuCvtFunctionToCallback, NULL, 0);
+      </programlisting>
+    </para>
+
+    <para id="XmuCvtStringToBackingStore">
+      <indexterm zone="XmuCvtStringToBackingStore">
+	<primary><function>XmuCvtStringToBackingStore</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuCvtStringToBackingStore</function></funcdef>
+	  <paramdef>XrmValue *<parameter>args</parameter></paramdef>
+	  <paramdef>Cardinal *<parameter>num_args</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>fromVal</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>toVal</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>args</parameter></term>
+	  <listitem><para>
+this argument is ignored
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>num_args</parameter></term>
+	  <listitem><para>
+this argument must be a pointer to a Cardinal containing the value 0
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>fromVal</parameter></term>
+	  <listitem><para>
+specifies the string to convert
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>toVal</parameter></term>
+	  <listitem><para>
+returns the converted value
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+      <indexterm zone="XmuCvtStringToBackingStore">
+	<primary>backing-store</primary>
+      </indexterm>
+This function converts a string to a backing-store integer as defined in
+&lt;<filename class='headerfile'>X11/X.h</filename>&gt;.
+The string "notUseful" converts to
+<symbol>NotUseful</symbol>,
+"whenMapped" converts to
+<symbol>WhenMapped</symbol>,
+and "always" converts to
+<symbol>Always</symbol>.
+The string "default" converts to the value
+<symbol>Always</symbol> +
+<symbol>WhenMapped</symbol> +
+<symbol>NotUseful</symbol>.
+The case of the string does not matter.
+To use this converter, include the following
+in your widget's ClassInitialize procedure:
+
+      <programlisting>
+XtAddConverter(XtRString, XtRBackingStore, XmuCvtStringToBackingStore, NULL, 0);
+      </programlisting>
+    </para>
+
+    <para id="XmuCvtStringToBitmap">
+      <indexterm zone="XmuCvtStringToBitmap">
+	<primary><function>XmuCvtStringToBitmap</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuCvtStringToBitmap</function></funcdef>
+	  <paramdef>XrmValue *<parameter>args</parameter></paramdef>
+	  <paramdef>Cardinal *<parameter>num_args</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>fromVal</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>toVal</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>args</parameter></term>
+	  <listitem><para>
+the sole argument specifies the Screen on which to create the bitmap
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>num_args</parameter></term>
+	  <listitem><para>
+must be the value 1
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>fromVal</parameter></term>
+	  <listitem><para>
+specifies the string to convert
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>toVal</parameter></term>
+	  <listitem><para>
+returns the converted value
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+      <indexterm zone="XmuCvtStringToBitmap">
+	<primary>window manager icons</primary>
+      </indexterm>
+This function creates a bitmap (a Pixmap of depth one) suitable for window
+manager icons.  The string argument is the name of a file in standard bitmap
+file format.  For the possible filename specifications, see
+<link linkend="XmuLocateBitmapFile"><function>XmuLocateBitmapFile</function></link>.
+To use this converter, include the following in your widget's
+ClassInitialize procedure:
+
+      <programlisting>
+static XtConvertArgRec screenConvertArg[] = {
+  {XtBaseOffset, (XtPointer)XtOffset(Widget, core.screen), sizeof(Screen *)}
+};
+
+XtAddConverter(XtRString, XtRBitmap, XmuCvtStringToBitmap,
+		 screenConvertArg, XtNumber(screenConvertArg));
+      </programlisting>
+    </para>
+
+    <para id="XmuCvtStringToColorCursor">
+      <indexterm zone="XmuCvtStringToColorCursor">
+	<primary><function>XmuCvtStringToColorCursor</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>Boolean <function>XmuCvtStringToColorCursor</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>args</parameter></paramdef>
+	  <paramdef>Cardinal *<parameter>num_args</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>fromVal</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>toVal</parameter></paramdef>
+	  <paramdef>XtPointer *<parameter>data</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the display to use for conversion warnings
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>args</parameter></term>
+	  <listitem><para>
+specifies the required conversion arguments
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>num_args</parameter></term>
+	  <listitem><para>
+specifies the number of required conversion arguments, which is 4
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>fromVal</parameter></term>
+	  <listitem><para>
+specifies the string to convert
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>toVal</parameter></term>
+	  <listitem><para>
+returns the converted value
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>data</parameter></term>
+	  <listitem><para>
+this argument is ignored
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+      <indexterm zone="XmuCvtStringToColorCursor">
+	<primary><type>Cursor</type></primary>
+      </indexterm>
+This function converts a string to a
+<type>Cursor</type>
+with the foreground and background pixels specified by the conversion
+arguments.  The string can either be a
+standard cursor name formed by removing the <code>&ldquo;XC_&rdquo;</code>
+prefix from any of the
+cursor defines listed in Appendix B of the Xlib Manual, a font name and
+glyph index in decimal of the form "FONT fontname index [[font] index]",
+or a bitmap filename acceptable to
+<link linkend="XmuLocateBitmapFile"><function>XmuLocateBitmapFile</function></link>.
+To use this converter, include
+the following in the widget ClassInitialize procedure:
+
+      <programlisting>
+static XtConvertArgRec colorCursorConvertArgs[] = {
+  {XtWidgetBaseOffset, (XtPointer) XtOffsetOf(WidgetRec, core.screen),
+   sizeof(Screen *)},
+  {XtResourceString, (XtPointer) XtNpointerColor, sizeof(Pixel)},
+  {XtResourceString, (XtPointer) XtNpointerColorBackground, sizeof(Pixel)},
+  {XtWidgetBaseOffset, (XtPointer) XtOffsetOf(WidgetRec, core.colormap),
+   sizeof(Colormap)}
+};
+
+
+XtSetTypeConverter(XtRString, XtRColorCursor, XmuCvtStringToColorCursor,
+		 colorCursorConvertArgs, XtNumber(colorCursorConvertArgs),
+                 XtCacheByDisplay, NULL);
+      </programlisting>
+
+The widget must recognize XtNpointerColor and XtNpointerColorBackground as
+resources, or specify other appropriate foreground and background resources.
+The widget's Realize and SetValues methods must cause the converter to be
+invoked with the appropriate arguments when one of the foreground,
+background, or cursor resources has changed, or when the window is created,
+and must assign the cursor to the window of the widget.
+    </para>
+
+    <para id="XmuCvtStringToCursor">
+      <indexterm zone="XmuCvtStringToCursor">
+	<primary><function>XmuCvtStringToCursor</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuCvtStringToCursor</function></funcdef>
+	  <paramdef>XrmValue *<parameter>args</parameter></paramdef>
+	  <paramdef>Cardinal *<parameter>num_args</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>fromVal</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>toVal</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>args</parameter></term>
+	  <listitem><para>
+specifies the required conversion argument, the screen
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>num_args</parameter></term>
+	  <listitem><para>
+specifies the number of required conversion arguments, which is 1
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>fromVal</parameter></term>
+	  <listitem><para>
+specifies the string to convert
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>toVal</parameter></term>
+	  <listitem><para>
+returns the converted value
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+      <indexterm zone="XmuCvtStringToCursor">
+	<primary><type>Cursor</type></primary>
+      </indexterm>
+This function converts a string to a
+<type>Cursor</type>.
+The string can either be a
+standard cursor name formed by removing the <code>&ldquo;XC_&rdquo;</code>
+prefix from any of the
+cursor defines listed in Appendix B of the Xlib Manual, a font name and
+glyph index in decimal of the form "FONT fontname index [[font] index]", or
+a bitmap filename acceptable to
+<link linkend="XmuLocateBitmapFile"><function>XmuLocateBitmapFile</function></link>.
+To use this converter, include
+the following in your widget's ClassInitialize procedure:
+
+      <programlisting>
+static XtConvertArgRec screenConvertArg[] = {
+  {XtBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.screen), sizeof(Screen *)}
+};
+
+XtAddConverter(XtRString, XtRCursor, XmuCvtStringToCursor,
+		 screenConvertArg, XtNumber(screenConvertArg));
+      </programlisting>
+    </para>
+
+    <para id="XmuCvtStringToGravity">
+      <indexterm zone="XmuCvtStringToGravity">
+	<primary><function>XmuCvtStringToGravity</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuCvtStringToGravity</function></funcdef>
+	  <paramdef>XrmValue *<parameter>args</parameter></paramdef>
+	  <paramdef>Cardinal *<parameter>num_args</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>fromVal</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>toVal</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>args</parameter></term>
+	  <listitem><para>
+this argument is ignored
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>num_args</parameter></term>
+	  <listitem><para>
+this argument must be a pointer to a Cardinal containing the value 0
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>fromVal</parameter></term>
+	  <listitem><para>
+specifies the string to convert
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>toVal</parameter></term>
+	  <listitem><para>
+returns the converted value
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+      <indexterm zone="XmuCvtStringToGravity">
+	<primary><type>XtGravity</type></primary>
+      </indexterm>
+This function converts a string to an
+<type>XtGravity</type>
+enumeration value.  The string "forget" and a <symbol>NULL</symbol> value convert to
+<symbol>ForgetGravity</symbol>,
+"NorthWestGravity" converts to
+<symbol>NorthWestGravity</symbol>,
+the strings "NorthGravity" and "top" convert to
+<symbol>NorthGravity</symbol>,
+"NorthEastGravity" converts to
+<symbol>NorthEastGravity</symbol>,
+the strings "West" and "left" convert to
+<symbol>WestGravity</symbol>,
+"CenterGravity" converts to
+<symbol>CenterGravity</symbol>,
+"EastGravity" and "right" convert to
+<symbol>EastGravity</symbol>,
+"SouthWestGravity" converts to
+<symbol>SouthWestGravity</symbol>,
+"SouthGravity" and "bottom" convert to
+<symbol>SouthGravity</symbol>,
+"SouthEastGravity" converts to
+<symbol>SouthEastGravity</symbol>,
+"StaticGravity" converts to
+<symbol>StaticGravity</symbol>,
+and "UnmapGravity" converts to
+<symbol>UnmapGravity</symbol>.
+The case of the string does not matter.  To use this converter, include
+the following in your widget's class initialize procedure:
+
+      <programlisting>
+XtAddConverter(XtRString, XtRGravity, XmuCvtStringToGravity, NULL, 0);
+      </programlisting>
+    </para>
+
+    <para id="XmuCvtStringToJustify">
+      <indexterm zone="XmuCvtStringToJustify">
+	<primary><function>XmuCvtStringToJustify</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuCvtStringToJustify</function></funcdef>
+	  <paramdef>XrmValue *<parameter>args</parameter></paramdef>
+	  <paramdef>Cardinal *<parameter>num_args</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>fromVal</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>toVal</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>args</parameter></term>
+	  <listitem><para>
+this argument is ignored
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>num_args</parameter></term>
+	  <listitem><para>
+this argument is ignored
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>fromVal</parameter></term>
+	  <listitem><para>
+specifies the string to convert
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>toVal</parameter></term>
+	  <listitem><para>
+returns the converted value
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+      <indexterm zone="XmuCvtStringToJustify">
+	<primary><type>XtJustify</type></primary>
+      </indexterm>
+This function converts a string to an
+<type>XtJustify</type>
+enumeration value.  The string "left" converts to
+<symbol>XtJustifyLeft</symbol>,
+"center" converts to
+<symbol>XtJustifyCenter</symbol>,
+and "right" converts to
+<symbol>XtJustifyRight</symbol>.
+The case of the string does not matter.  To use this converter,
+include the following in your widget's ClassInitialize procedure:
+
+      <programlisting>
+XtAddConverter(XtRString, XtRJustify, XmuCvtStringToJustify, NULL, 0);
+      </programlisting>
+    </para>
+
+    <para id="XmuCvtStringToLong">
+      <indexterm zone="XmuCvtStringToLong">
+	<primary><function>XmuCvtStringToLong</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuCvtStringToLong</function></funcdef>
+	  <paramdef>XrmValue *<parameter>args</parameter></paramdef>
+	  <paramdef>Cardinal *<parameter>num_args</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>fromVal</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>toVal</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>args</parameter></term>
+	  <listitem><para>
+this argument is ignored
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>num_args</parameter></term>
+	  <listitem><para>
+this argument must be a pointer to a Cardinal containing 0
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>fromVal</parameter></term>
+	  <listitem><para>
+specifies the string to convert
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>toVal</parameter></term>
+	  <listitem><para>
+returns the converted value
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function converts a string to an integer of type long.  It parses the
+string using
+<function>sscanf</function>
+with a format of "%ld".  To use this converter, include
+the following in your widget's ClassInitialize procedure:
+
+      <programlisting>
+XtAddConverter(XtRString, XtRLong, XmuCvtStringToLong, NULL, 0);
+      </programlisting>
+    </para>
+
+    <para id="XmuCvtStringToOrientation">
+      <indexterm zone="XmuCvtStringToOrientation">
+	<primary><function>XmuCvtStringToOrientation</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuCvtStringToOrientation</function></funcdef>
+	  <paramdef>XrmValue *<parameter>args</parameter></paramdef>
+	  <paramdef>Cardinal *<parameter>num_args</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>fromVal</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>toVal</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>args</parameter></term>
+	  <listitem><para>
+this argument is ignored
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>num_args</parameter></term>
+	  <listitem><para>
+this argument is ignored
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>fromVal</parameter></term>
+	  <listitem><para>
+specifies the string to convert
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>toVal</parameter></term>
+	  <listitem><para>
+returns the converted value
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+      <indexterm zone="XmuCvtStringToOrientation">
+	<primary><type>XtOrientation</type></primary>
+      </indexterm>
+This function converts a string to an
+<type>XtOrientation</type>
+enumeration value.  The string "horizontal" converts to
+<symbol>XtorientHorizontal</symbol>
+and "vertical" converts to
+<symbol>XtorientVertical</symbol>.
+The case of the string does not matter.  To use this converter,
+include the following in your widget's ClassInitialize procedure:
+
+      <programlisting>
+XtAddConverter(XtRString, XtROrientation, XmuCvtStringToOrientation, NULL, 0);
+      </programlisting>
+    </para>
+
+    <para id="XmuCvtStringToShapeStyle">
+      <indexterm zone="XmuCvtStringToShapeStyle">
+	<primary><function>XmuCvtStringToShapeStyle</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>Boolean <function>XmuCvtStringToShapeStyle</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>XrmValue *<parameter>args</parameter></paramdef>
+	  <paramdef>Cardinal *<parameter>num_args</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>fromVal</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>toVal</parameter></paramdef>
+	  <paramdef>XtPointer *<parameter>data</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+the display to use for conversion warnings
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>args</parameter></term>
+	  <listitem><para>
+this argument is ignored
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>num_args</parameter></term>
+	  <listitem><para>
+this argument is ignored
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>fromVal</parameter></term>
+	  <listitem><para>
+the value to convert from
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>toVal</parameter></term>
+	  <listitem><para>
+the place to store the converted value
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>data</parameter></term>
+	  <listitem><para>
+this argument is ignored
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function converts a string to an integer shape style.  The string
+"rectangle" converts to
+<symbol>XmuShapeRectangle</symbol>,
+"oval" converts to
+<symbol>XmuShapeOval</symbol>,
+"ellipse" converts to
+<symbol>XmuShapeEllipse</symbol>,
+and "roundedRectangle" converts to
+<symbol>XmuShapeRoundedRectangle</symbol>.
+The case of the string does not matter.  To use this converter,
+include the following in your widget's ClassInitialize procedure:
+
+      <programlisting>
+XtSetTypeConverter(XtRString, XtRShapeStyle, XmuCvtStringToShapeStyle,
+		     NULL, 0, XtCacheNone, NULL);
+      </programlisting>
+    </para>
+
+    <para id="XmuReshapeWidget">
+      <indexterm zone="XmuReshapeWidget">
+	<primary><function>XmuReshapeWidget</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>Boolean <function>XmuReshapeWidget</function></funcdef>
+	  <paramdef>Widget <parameter>w</parameter></paramdef>
+	  <paramdef>int <parameter>shape_style</parameter></paramdef>
+	  <paramdef>int <parameter>corner_width</parameter></paramdef>
+	  <paramdef>int <parameter>corner_height</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>w</parameter></term>
+	  <listitem><para>
+specifies the widget to reshape
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>shape_style</parameter></term>
+	  <listitem><para>
+specifies the new shape
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>corner_width</parameter></term>
+	  <listitem><para>
+specifies the width of the rounded rectangle corner
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>corner_height</parameter></term>
+	  <listitem><para>
+specified the height of the rounded rectangle corner
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+      <indexterm zone="XmuReshapeWidget">
+	<primary>Shape extension</primary>
+      </indexterm>
+This function reshapes the specified widget, using the Shape extension, to a
+rectangle, oval, ellipse, or rounded rectangle, as specified by shape_style
+(
+<symbol>XmuShapeRectangle</symbol>,
+<symbol>XmuShapeOval</symbol>,
+<symbol>XmuShapeEllipse</symbol>,
+and
+<symbol>XmuShapeRoundedRectangle</symbol>,
+respectively).
+The shape is bounded by the outside edges of the rectangular extents of the
+widget.  If the shape is a rounded rectangle, corner_width and corner_height
+specify the size of the bounding box that the corners are drawn inside of
+(see
+<link linkend="XmuFillRoundedRectangle"><function>XmuFillRoundedRectangle</function></link>);
+otherwise, corner_width and corner_height are ignored.
+The origin of the widget within its parent remains unchanged.
+    </para>
+
+    <para id="XmuCvtStringToWidget">
+      <indexterm zone="XmuCvtStringToWidget">
+	<primary><function>XmuCvtStringToWidget</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuCvtStringToWidget</function></funcdef>
+	  <paramdef>XrmValue *<parameter>args</parameter></paramdef>
+	  <paramdef>Cardinal *<parameter>num_args</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>fromVal</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>toVal</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>args</parameter></term>
+	  <listitem><para>
+the sole argument is the parent Widget
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>num_args</parameter></term>
+  <listitem><para>
+this argument must be 1
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>fromVal</parameter></term>
+  <listitem><para>
+specifies the string to convert
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>toVal</parameter></term>
+	  <listitem><para>
+returns the converted value
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function converts a string to an immediate child widget of the parent
+widget passed as an argument.  Note that this converter only works for
+child widgets that have already been created; there is no lazy evaluation.
+The string is first compared against the
+names of the normal and popup children, and if a match is found the
+corresponding child is returned.  If no match is found, the string is
+compared against the classes of the normal and popup children, and if a
+match is found the corresponding child is returned.  The case of the string
+is significant.  To use this converter, include the following in your
+widget's ClassInitialize procedure:
+
+      <programlisting>
+static XtConvertArgRec parentCvtArg[] = {
+  {XtBaseOffset, (XtPointer)XtOffset(Widget, core.parent), sizeof(Widget)},
+};
+
+XtAddConverter(XtRString, XtRWidget, XmuCvtStringToWidget,
+		 parentCvtArg, XtNumber(parentCvtArg));
+      </programlisting>
+    </para>
+
+    <para id="XmuNewCvtStringToWidget">
+      <indexterm zone="XmuNewCvtStringToWidget">
+	<primary><function>XmuNewCvtStringToWidget</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>Boolean <function>XmuNewCvtStringToWidget</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>args</parameter></paramdef>
+	  <paramdef>Cardinal *<parameter>num_args</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>fromVal</parameter></paramdef>
+	  <paramdef>XrmValuePtr <parameter>toVal</parameter></paramdef>
+	  <paramdef>XtPointer *<parameter>data</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+the display to use for conversion warnings
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>args</parameter></term>
+	  <listitem><para>
+the sole argument is the parent Widget
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>num_args</parameter></term>
+	  <listitem><para>
+this argument must be a pointer to a Cardinal containing the value 1
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>fromVal</parameter></term>
+	  <listitem><para>
+specifies the string to convert
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>toVal</parameter></term>
+	  <listitem><para>
+returns the converted value
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>data</parameter></term>
+	  <listitem><para>
+this argument is ignored
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This converter is identical in functionality to
+<link linkend="XmuCvtStringToWidget"><function>XmuCvtStringToWidget</function></link>, except
+that it is a new-style converter, allowing the specification of a cache type
+at the time of registration.
+Most widgets will not cache the conversion results, as the application may
+dynamically create and destroy widgets, which would cause cached values to
+become illegal.  To use this converter, include the following in the widget's
+class initialize procedure:
+
+    <programlisting>
+static XtConvertArgRec parentCvtArg[] = {
+  {XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.parent),
+   sizeof(Widget)}
+};
+
+XtSetTypeConverter(XtRString, XtRWidget, XmuNewCvtStringToWidget,
+		   parentCvtArg, XtNumber(parentCvtArg), XtCacheNone, NULL);
+      </programlisting>
+
+    </para>
+
+  </sect1>
+
+  <sect1 id='Character_Set_Functions'>
+<title>Character Set Functions</title>
+
+<para>
+To use the functions defined in this section, you should include the header
+file
+&lt;<filename class='headerfile'>X11/Xmu/CharSet.h</filename>&gt;
+<indexterm>
+<primary><filename class='headerfile'>X11/Xmu/CharSet.h</filename></primary>
+</indexterm>
+and link against the libXmu or libXmuu library.
+</para>
+
+    <warning><para>
+The functions in this section are <emphasis remap='B'>deprecated</emphasis>
+because they don't work in most locales now supported by X11; most platforms
+provide alternatives in their system libraries.
+      </para></warning>
+
+    <para id="XmuCopyISOLatin1Lowered">
+      <indexterm zone="XmuCopyISOLatin1Lowered">
+	<primary><function>XmuCopyISOLatin1Lowered</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuCopyISOLatin1Lowered</function></funcdef>
+	  <paramdef>char *<parameter>dst</parameter></paramdef>
+	  <paramdef>const char *<parameter>src</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dst</parameter></term>
+	  <listitem><para>
+returns the string copy
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>src</parameter></term>
+	  <listitem><para>
+specifies the string to copy
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function copies a null terminated string from src to dst (including the
+null), changing all Latin-1 uppercase letters to lowercase.  The string is
+assumed to be encoded using ISO 8859-1.
+    </para>
+
+    <para>
+Note that like <function>strcpy</function> the caller is responsible for
+ensuring the size of <parameter>dst</parameter> is at least as large as the
+size of <parameter>src</parameter>.
+    </para>
+
+    <para id="XmuNCopyISOLatin1Lowered">
+      <indexterm zone="XmuNCopyISOLatin1Lowered">
+	<primary><function>XmuNCopyISOLatin1Lowered</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuNCopyISOLatin1Lowered</function></funcdef>
+	  <paramdef>char *<parameter>dst</parameter></paramdef>
+	  <paramdef>const char *<parameter>src</parameter></paramdef>
+	  <paramdef>int <parameter>size</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dst</parameter></term>
+	  <listitem><para>
+returns the string copy
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>src</parameter></term>
+	  <listitem><para>
+specifies the string to copy
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>size</parameter></term>
+	  <listitem><para>
+maximum number of characters (including the null terminator) to write to dst
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function copies up to <code><parameter>size</parameter> - 1</code>
+characters of a null terminated string from <parameter>src</parameter>
+to <parameter>dst</parameter>, and terminates it with a null,
+changing all Latin-1 uppercase letters to lowercase.  The string is
+assumed to be encoded using ISO 8859-1.
+    </para>
+
+    <para id="XmuCopyISOLatin1Uppered">
+      <indexterm zone="XmuCopyISOLatin1Uppered">
+	<primary><function>XmuCopyISOLatin1Uppered</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuCopyISOLatin1Uppered</function></funcdef>
+	  <paramdef>char *<parameter>dst</parameter></paramdef>
+	  <paramdef>const char *<parameter>src</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dst</parameter></term>
+	  <listitem><para>
+returns the string copy
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>src</parameter></term>
+	  <listitem><para>
+specifies the string to copy
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function copies a null terminated string from src to dst (including the
+null), changing all Latin-1 lowercase letters to uppercase.  The string is
+assumed to be encoded using ISO 8859-1.
+    </para>
+
+    <para>
+Note that like <function>strcpy</function> the caller is responsible for
+ensuring the size of <parameter>dst</parameter> is at least as large as the
+size of <parameter>src</parameter>.
+    </para>
+
+    <para id="XmuNCopyISOLatin1Uppered">
+      <indexterm zone="XmuNCopyISOLatin1Uppered">
+	<primary><function>XmuNCopyISOLatin1Uppered</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuNCopyISOLatin1Uppered</function></funcdef>
+	  <paramdef>char *<parameter>dst</parameter></paramdef>
+	  <paramdef>const char *<parameter>src</parameter></paramdef>
+	  <paramdef>int <parameter>size</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dst</parameter></term>
+	  <listitem><para>
+returns the string copy
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>src</parameter></term>
+	  <listitem><para>
+specifies the string to copy
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>size</parameter></term>
+	  <listitem><para>
+maximum number of characters (including the null terminator) to write to dst
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function copies up to <code><parameter>size</parameter> - 1</code>
+characters of a null terminated string from <parameter>src</parameter>
+to <parameter>dst</parameter>, and terminates it with a null,
+changing all Latin-1 lowercase letters to uppercase.  The string is
+assumed to be encoded using ISO 8859-1.
+    </para>
+
+    <para id="XmuCompareISOLatin1">
+      <indexterm zone="XmuCompareISOLatin1">
+	<primary><function>XmuCompareISOLatin1</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>int <function>XmuCompareISOLatin1</function></funcdef>
+	  <paramdef>const char *<parameter>first</parameter></paramdef>
+	  <paramdef>const char *<parameter>second</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>first</parameter></term>
+	  <listitem><para>
+	      specifies a string to compare
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>second</parameter></term>
+	  <listitem><para>
+specifies a string to compare
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function compares two null terminated Latin-1 strings, ignoring case
+differences, and returns an integer greater than, equal to, or less than 0,
+according to whether first is lexicographically greater than, equal to, or
+less than second.  The two strings are assumed to be encoded using ISO
+8859-1.
+    </para>
+  </sect1>
+
+  <sect1 id='Keyboard_Event_Translation_Functions'>
+<title>Keyboard Event Translation Functions</title>
+
+    <para>
+To use the functions defined in this section, you should include the header
+file
+&lt;<filename class='headerfile'>X11/Xmu/Lookup.h</filename>&gt;
+<indexterm>
+<primary><filename class='headerfile'>X11/Xmu/Lookup.h</filename></primary>
+</indexterm>.
+and link against the libXmu library.
+    </para>
+
+    <warning><para>
+The functions in this section are <emphasis remap='B'>deprecated</emphasis> because they don't work
+in most locales now supported by X11; the function
+<function>XmbLookupString</function>
+provides a better alternative.
+      </para></warning>
+
+    <para id="XmuLookupLatin1">
+      <indexterm zone="XmuLookupLatin1">
+	<primary><function>XmuLookupLatin1</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>int <function>XmuLookupLatin1</function></funcdef>
+	  <paramdef>XKeyEvent *<parameter>event</parameter></paramdef>
+	  <paramdef>unsigned char *<parameter>buffer</parameter></paramdef>
+	  <paramdef>int <parameter>nbytes</parameter></paramdef>
+	  <paramdef>KeySym *<parameter>keysym</parameter></paramdef>
+	  <paramdef>XComposeStatus *<parameter>status</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>event</parameter></term>
+	  <listitem><para>
+specifies the key event
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>buffer</parameter></term>
+	  <listitem><para>
+returns the translated characters
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>nbytes</parameter></term>
+	  <listitem><para>
+specifies the length of the buffer
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>keysym</parameter></term>
+	  <listitem><para>
+returns the computed KeySym, or None
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>status</parameter></term>
+	  <listitem><para>
+specifies or returns the compose state
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function is identical to
+<function>XLookupString</function>,
+and exists only for naming symmetry with other functions.
+    </para>
+
+    <para id="XmuLookupLatin2">
+      <indexterm zone="XmuLookupLatin2">
+	<primary><function>XmuLookupLatin2</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>int <function>XmuLookupLatin2</function></funcdef>
+	  <paramdef>XKeyEvent *<parameter>event</parameter></paramdef>
+	  <paramdef>unsigned char *<parameter>buffer</parameter></paramdef>
+	  <paramdef>int <parameter>nbytes</parameter></paramdef>
+	  <paramdef>KeySym *<parameter>keysym</parameter></paramdef>
+	  <paramdef>XComposeStatus *<parameter>status</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>event</parameter></term>
+	  <listitem><para>
+specifies the key event
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>buffer</parameter></term>
+	  <listitem><para>
+returns the translated characters
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>nbytes</parameter></term>
+	  <listitem><para>
+specifies the length of the buffer
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>keysym</parameter></term>
+	  <listitem><para>
+returns the computed KeySym, or None
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>status</parameter></term>
+	  <listitem><para>
+specifies or returns the compose state
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function is similar to
+<function>XLookupString</function>,
+except that it maps a key event
+to an Latin-2 (ISO 8859-2) string, or to an ASCII control string.
+    </para>
+
+    <para id="XmuLookupLatin3">
+      <indexterm zone="XmuLookupLatin3">
+	<primary><function>XmuLookupLatin3</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>int <function>XmuLookupLatin3</function></funcdef>
+	  <paramdef>XKeyEvent *<parameter>event</parameter></paramdef>
+	  <paramdef>unsigned char *<parameter>buffer</parameter></paramdef>
+	  <paramdef>int <parameter>nbytes</parameter></paramdef>
+	  <paramdef>KeySym *<parameter>keysym</parameter></paramdef>
+	  <paramdef>XComposeStatus *<parameter>status</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>event</parameter></term>
+	  <listitem><para>
+specifies the key event
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>buffer</parameter></term>
+	  <listitem><para>
+returns the translated characters
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>nbytes</parameter></term>
+	  <listitem><para>
+specifies the length of the buffer
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>keysym</parameter></term>
+	  <listitem><para>
+returns the computed KeySym, or None
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>status</parameter></term>
+	  <listitem><para>
+specifies or returns the compose state
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function is similar to
+<function>XLookupString</function>,
+except that it maps a key event
+to an Latin-3 (ISO 8859-3) string, or to an ASCII control string.
+    </para>
+
+    <para id="XmuLookupLatin4">
+      <indexterm zone="XmuLookupLatin4">
+	<primary><function>XmuLookupLatin4</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>int <function>XmuLookupLatin4</function></funcdef>
+	  <paramdef>XKeyEvent *<parameter>event</parameter></paramdef>
+	  <paramdef>unsigned char *<parameter>buffer</parameter></paramdef>
+	  <paramdef>int <parameter>nbytes</parameter></paramdef>
+	  <paramdef>KeySym *<parameter>keysym</parameter></paramdef>
+	  <paramdef>XComposeStatus *<parameter>status</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>event</parameter></term>
+	  <listitem><para>
+specifies the key event
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>buffer</parameter></term>
+	  <listitem><para>
+returns the translated characters
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>nbytes</parameter></term>
+	  <listitem><para>
+specifies the length of the buffer
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>keysym</parameter></term>
+	  <listitem><para>
+returns the computed KeySym, or None
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>status</parameter></term>
+	  <listitem><para>
+specifies or returns the compose state
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function is similar to
+<function>XLookupString</function>,
+except that it maps a key event
+to an Latin-4 (ISO 8859-4) string, or to an ASCII control string.
+    </para>
+
+    <para id="XmuLookupKana">
+      <indexterm zone="XmuLookupKana">
+	<primary><function>XmuLookupKana</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>int <function>XmuLookupKana</function></funcdef>
+	  <paramdef>XKeyEvent *<parameter>event</parameter></paramdef>
+	  <paramdef>unsigned char *<parameter>buffer</parameter></paramdef>
+	  <paramdef>int <parameter>nbytes</parameter></paramdef>
+	  <paramdef>KeySym *<parameter>keysym</parameter></paramdef>
+	  <paramdef>XComposeStatus *<parameter>status</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>event</parameter></term>
+	  <listitem><para>
+specifies the key event
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>buffer</parameter></term>
+	  <listitem><para>
+returns the translated characters
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>nbytes</parameter></term>
+	  <listitem><para>
+specifies the length of the buffer
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>keysym</parameter></term>
+	  <listitem><para>
+returns the computed KeySym, or None
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>status</parameter></term>
+	  <listitem><para>
+specifies or returns the compose state
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function is similar to
+<function>XLookupString</function>,
+except that it maps a key event
+to a string in an encoding consisting of Latin-1 (ISO 8859-1) and ASCII
+control in the Graphics Left half (values 0 to 127), and Katakana in the
+Graphics Right half (values 128 to 255), using the values from JIS
+X201-1976.
+    </para>
+
+    <para id="XmuLookupJISX0201">
+      <indexterm zone="XmuLookupJISX0201">
+	<primary><function>XmuLookupJISX0201</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>int <function>XmuLookupJISX0201</function></funcdef>
+	  <paramdef>XKeyEvent *<parameter>event</parameter></paramdef>
+	  <paramdef>unsigned char *<parameter>buffer</parameter></paramdef>
+	  <paramdef>int <parameter>nbytes</parameter></paramdef>
+	  <paramdef>KeySym *<parameter>keysym</parameter></paramdef>
+	  <paramdef>XComposeStatus *<parameter>status</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>event</parameter></term>
+	  <listitem><para>
+specifies the key event
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>buffer</parameter></term>
+	  <listitem><para>
+returns the translated characters
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>nbytes</parameter></term>
+	  <listitem><para>
+specifies the length of the buffer
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>keysym</parameter></term>
+	  <listitem><para>
+returns the computed KeySym, or None
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>status</parameter></term>
+	  <listitem><para>
+specifies or returns the compose state
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function is similar to
+<function>XLookupString</function>,
+except that it maps a key event
+to a string in the JIS X0201-1976 encoding, including ASCII control.
+    </para>
+
+    <para id="XmuLookupArabic">
+      <indexterm zone="XmuLookupArabic">
+	<primary><function>XmuLookupArabic</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>int <function>XmuLookupArabic</function></funcdef>
+	  <paramdef>XKeyEvent *<parameter>event</parameter></paramdef>
+	  <paramdef>unsigned char *<parameter>buffer</parameter></paramdef>
+	  <paramdef>int <parameter>nbytes</parameter></paramdef>
+	  <paramdef>KeySym *<parameter>keysym</parameter></paramdef>
+	  <paramdef>XComposeStatus *<parameter>status</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>event</parameter></term>
+	  <listitem><para>
+specifies the key event
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>buffer</parameter></term>
+	  <listitem><para>
+returns the translated characters
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>nbytes</parameter></term>
+	  <listitem><para>
+specifies the length of the buffer
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>keysym</parameter></term>
+	  <listitem><para>
+returns the computed KeySym, or None
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>status</parameter></term>
+	  <listitem><para>
+specifies or returns the compose state
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function is similar to
+<function>XLookupString</function>,
+except that it maps a key event
+to a Latin/Arabic (ISO 8859-6) string, or to an ASCII control string.
+    </para>
+
+    <para id="XmuLookupCyrillic">
+      <indexterm zone="XmuLookupCyrillic">
+	<primary><function>XmuLookupCyrillic</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>int <function>XmuLookupCyrillic</function></funcdef>
+	  <paramdef>XKeyEvent *<parameter>event</parameter></paramdef>
+	  <paramdef>unsigned char *<parameter>buffer</parameter></paramdef>
+	  <paramdef>int <parameter>nbytes</parameter></paramdef>
+	  <paramdef>KeySym *<parameter>keysym</parameter></paramdef>
+	  <paramdef>XComposeStatus *<parameter>status</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>event</parameter></term>
+	  <listitem><para>
+specifies the key event
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>buffer</parameter></term>
+	  <listitem><para>
+returns the translated characters
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>nbytes</parameter></term>
+	  <listitem><para>
+specifies the length of the buffer
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>keysym</parameter></term>
+	  <listitem><para>
+returns the computed KeySym, or None
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>status</parameter></term>
+	  <listitem><para>
+specifies or returns the compose state
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function is similar to
+<function>XLookupString</function>,
+except that it maps a key event
+to a Latin/Cyrillic (ISO 8859-5) string, or to an ASCII control string.
+    </para>
+
+    <para id="XmuLookupGreek">
+      <indexterm zone="XmuLookupGreek">
+	<primary><function>XmuLookupGreek</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>int <function>XmuLookupGreek</function></funcdef>
+	  <paramdef>XKeyEvent *<parameter>event</parameter></paramdef>
+	  <paramdef>unsigned char *<parameter>buffer</parameter></paramdef>
+	  <paramdef>int <parameter>nbytes</parameter></paramdef>
+	  <paramdef>KeySym *<parameter>keysym</parameter></paramdef>
+	  <paramdef>XComposeStatus *<parameter>status</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>event</parameter></term>
+	  <listitem><para>
+specifies the key event
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>buffer</parameter></term>
+	  <listitem><para>
+returns the translated characters
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>nbytes</parameter></term>
+	  <listitem><para>
+specifies the length of the buffer
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>keysym</parameter></term>
+	  <listitem><para>
+returns the computed KeySym, or None
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>status</parameter></term>
+	  <listitem><para>
+specifies or returns the compose state
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function is similar to
+<function>XLookupString</function>,
+except that it maps a key event
+to a Latin/Greek (ISO 8859-7) string, or to an ASCII control string.
+    </para>
+
+    <para id="XmuLookupHebrew">
+      <indexterm zone="XmuLookupHebrew">
+	<primary><function>XmuLookupHebrew</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>int <function>XmuLookupHebrew</function></funcdef>
+	  <paramdef>XKeyEvent *<parameter>event</parameter></paramdef>
+	  <paramdef>unsigned char *<parameter>buffer</parameter></paramdef>
+	  <paramdef>int <parameter>nbytes</parameter></paramdef>
+	  <paramdef>KeySym *<parameter>keysym</parameter></paramdef>
+	  <paramdef>XComposeStatus *<parameter>status</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>event</parameter></term>
+	  <listitem><para>
+specifies the key event
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>buffer</parameter></term>
+	  <listitem><para>
+returns the translated characters
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>nbytes</parameter></term>
+	  <listitem><para>
+specifies the length of the buffer
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>keysym</parameter></term>
+	  <listitem><para>
+returns the computed KeySym, or None
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>status</parameter></term>
+	  <listitem><para>
+specifies or returns the compose state
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function is similar to
+<function>XLookupString</function>,
+except that it maps a key event
+to a Latin/Hebrew (ISO 8859-8) string, or to an ASCII control string.
+    </para>
+
+    <para id="XmuLookupAPL">
+      <indexterm zone="XmuLookupAPL">
+	<primary><function>XmuLookupAPL</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>int <function>XmuLookupAPL</function></funcdef>
+	  <paramdef>XKeyEvent *<parameter>event</parameter></paramdef>
+	  <paramdef>unsigned char *<parameter>buffer</parameter></paramdef>
+	  <paramdef>int <parameter>nbytes</parameter></paramdef>
+	  <paramdef>KeySym *<parameter>keysym</parameter></paramdef>
+	  <paramdef>XComposeStatus *<parameter>status</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>event</parameter></term>
+	  <listitem><para>
+specifies the key event
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>buffer</parameter></term>
+	  <listitem><para>
+returns the translated characters
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>nbytes</parameter></term>
+	  <listitem><para>
+specifies the length of the buffer
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>keysym</parameter></term>
+	  <listitem><para>
+returns the computed KeySym, or None
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>status</parameter></term>
+	  <listitem><para>
+specifies or returns the compose state
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function is similar to
+<function>XLookupString</function>,
+except that it maps a key event to an APL string.
+    </para>
+
+  </sect1>
+
+  <sect1 id='Compound_Text_Functions'>
+<title>Compound Text Functions</title>
+
+    <para>
+The functions defined in this section are for parsing Compound Text strings,
+decomposing them into individual segments. Definitions needed to use these
+routines are in the include file
+&lt;<filename class='headerfile'>X11/Xmu/Xct.h</filename>&gt;
+<indexterm>
+<primary><filename class='headerfile'>X11/Xmu/Xct.h</filename></primary>
+</indexterm>
+and link against the libXmu library.
+    </para>
+
+    <warning><para>
+The functions in this section are <emphasis remap='B'>deprecated</emphasis> because they shift the
+burden for recently introduced locale encodings to the application. The
+use of the
+<symbol>UTF8_STRING</symbol>
+text encoding provides a better alternative.
+      </para></warning>
+
+    <para>
+A Compound Text string is represented as the following type:
+
+      <synopsis>
+	typedef unsigned char *XctString;
+      </synopsis>
+    </para>
+
+    <para id="XctCreate">
+      <indexterm zone="XctCreate">
+	<primary><function>XctCreate</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>XctData <function>XctCreate</function></funcdef>
+	  <paramdef>const XctString <parameter>string</parameter></paramdef>
+	  <paramdef>int <parameter>length</parameter></paramdef>
+	  <paramdef>XctFlags <parameter>flags</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>string</parameter></term>
+	  <listitem><para>
+the Compound Text string
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>length</parameter></term>
+	  <listitem><para>
+the number of bytes in string
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>flags</parameter></term>
+	  <listitem><para>
+parsing control flags
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function creates an
+<type>XctData</type>
+structure for parsing a Compound Text
+string.  The string need not be null terminated.  The following flags are
+defined to control parsing of the string:
+
+    <variablelist>
+      <varlistentry>
+	<term><symbol>XctSingleSetSegments</symbol></term>
+	<listitem><para>
+This means that returned segments should contain
+characters from only one set (C0, C1, GL, GR).  When this is requested,
+<symbol>XctSegment</symbol>
+is never returned by
+<function>XctNextItem</function>,
+instead
+<symbol>XctC0Segment</symbol>,
+<symbol>XctC1Segment</symbol>,
+<symbol>XctGlSegment</symbol>,
+and
+<symbol>XctGRSegment</symbol>
+are returned.  C0 and C1
+segments are always returned as singleton characters.
+	  </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+	<term><symbol>XctProvideExtensions</symbol></term>
+	<listitem><para>
+This means that if the Compound Text string is from a
+higher version than this code is implemented to, then syntactically correct
+but unknown control sequences should be returned as
+<symbol>XctExtension</symbol>
+items by
+<function>XctNextItem</function>.
+If this flag is not set, and the Compound Text string version
+indicates that extensions cannot be ignored, then each unknown control
+sequence will be reported as an
+<symbol>XctError</symbol>.
+	  </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+	<term><symbol>XctAcceptC0Extensions</symbol></term>
+	<listitem><para>
+This means that if the Compound Text string is from
+a higher version than this code is implemented to, then unknown C0
+characters should be treated as if they were legal, and returned as C0
+characters (regardless of how
+<symbol>XctProvideExtensions</symbol>
+is set) by
+<function>XctNextItem</function>.
+If this flag is not set, then all unknown C0 characters are treated
+according to
+<symbol>XctProvideExtensions</symbol>.
+	  </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+	<term><symbol>XctAcceptC1Extensions</symbol></term>
+	<listitem><para>
+This means that if the Compound Text string is from
+a higher version than this code is implemented to, then unknown C1
+characters should be treated as if they were legal, and returned as C1
+characters (regardless of how
+<symbol>XctProvideExtensions</symbol>
+is set) by
+<function>XctNextItem</function>.
+If this flag is not set, then all unknown C1 characters are treated
+according to
+<symbol>XctProvideExtensions</symbol>.
+	  </para></listitem>
+      </varlistentry>
+      <varlistentry>
+	<term><symbol>XctHideDirection</symbol></term>
+	<listitem><para>
+This means that horizontal direction changes should be
+reported as
+<symbol>XctHorizontal</symbol>
+items by
+<function>XctNextItem</function>. If this flag is not set,
+then direction changes are not returned as items, but the current direction
+is still maintained and reported for other items.  The current direction is
+given as an enumeration, with the values
+<symbol>XctUnspecified</symbol>,
+<symbol>XctLeftToRight</symbol>,
+and
+<symbol>XctRightToLeft</symbol>.
+	  </para></listitem>
+      </varlistentry>
+      <varlistentry>
+	<term><symbol>XctFreeString</symbol></term>
+	<listitem><para>
+This means that
+<function>XctFree</function>
+should free the Compound Text string that is passed to
+<function>XctCreate</function>.
+If this flag is not set, the string is not freed.
+	  </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+	<term><symbol>XctShiftMultiGRToGL</symbol></term>
+	<listitem><para>
+This means that
+<function>XctNextItem</function>
+should translate GR
+segments on-the-fly into GL segments for the GR sets: GB2312.1980-1,
+JISX0208.1983-1, and KSC5601.1987-1.
+	  </para></listitem>
+      </varlistentry>
+    </variablelist>
+  </para>
+
+    <para id="XctReset">
+      <indexterm zone="XctReset">
+	<primary><function>XctReset</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XctReset</function></funcdef>
+	    <paramdef>XctData <parameter>data</parameter></paramdef>
+	  </funcprototype>
+	</funcsynopsis>
+	<variablelist>
+	  <varlistentry>
+	    <term><parameter>data</parameter></term>
+	    <listitem><para>
+specifies the Compound Text structure
+	      </para></listitem>
+	  </varlistentry>
+	</variablelist>
+
+This function resets the
+<type>XctData</type>
+structure to reparse the Compound Text string from the beginning.
+      </para>
+
+      <para id="XctNextItem">
+      <indexterm zone="XctNextItem">
+	<primary><function>XctNextItem</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>XctResult <function>XctNextItem</function></funcdef>
+	    <paramdef>XctData <parameter>data</parameter></paramdef>
+	  </funcprototype>
+	</funcsynopsis>
+	<variablelist>
+	  <varlistentry>
+	    <term><parameter>data</parameter></term>
+	    <listitem><para>
+specifies the Compound Text structure
+	      </para></listitem>
+	  </varlistentry>
+	</variablelist>
+
+This function parses the next &ldquo;item&rdquo; from the Compound Text string.  The
+return value indicates what kind of item is returned.  The item itself, its
+length, and the current contextual state, are reported as components of the
+<type>XctData</type>
+structure.
+<type>XctResult</type>
+is an enumeration, with the following values:
+
+	<variablelist>
+	  <varlistentry>
+	    <term><symbol>XctSegment</symbol></term>
+	    <listitem><para>
+the item contains some mixture of C0, GL, GR, and C1 characters.
+	      </para></listitem>
+	  </varlistentry>
+
+	  <varlistentry>
+	    <term><symbol>XctC0Segment</symbol></term>
+	    <listitem><para>
+the item contains only C0 characters.
+	      </para></listitem>
+	  </varlistentry>
+
+	  <varlistentry>
+	    <term><symbol>XctGLSegment</symbol></term>
+	    <listitem><para>
+the item contains only GL characters.
+	      </para></listitem>
+	  </varlistentry>
+
+	  <varlistentry>
+	    <term><symbol>XctC1Segment</symbol></term>
+	    <listitem><para>
+the item contains only C1 characters.
+	      </para></listitem>
+	  </varlistentry>
+
+	  <varlistentry>
+	    <term><symbol>XctGRSegment</symbol></term>
+	    <listitem><para>
+the item contains only GR characters.
+	      </para></listitem>
+	  </varlistentry>
+
+	  <varlistentry>
+	    <term><symbol>XctExtendedSegment</symbol></term>
+	    <listitem><para>
+the item contains an extended segment.
+	      </para></listitem>
+	  </varlistentry>
+
+	  <varlistentry>
+	    <term><symbol>XctExtension</symbol></term>
+	    <listitem><para>
+the item is an unknown extension control sequence.
+	      </para></listitem>
+	  </varlistentry>
+
+	  <varlistentry>
+	    <term><symbol>XctHorizontal</symbol></term>
+	    <listitem><para>
+the item indicates a change in horizontal direction or
+depth.  The new direction and depth are recorded in the
+<type>XctData</type>
+structure.
+	      </para></listitem>
+	  </varlistentry>
+
+	  <varlistentry>
+	    <term><symbol>XctEndOfText</symbol></term>
+	    <listitem><para>
+The end of the Compound Text string has been reached.
+	      </para></listitem>
+	  </varlistentry>
+
+	  <varlistentry>
+	    <term><symbol>XctError</symbol></term>
+	    <listitem><para>
+the string contains a syntactic or semantic error; no further
+parsing should be performed.
+	      </para></listitem>
+	  </varlistentry>
+	</variablelist>
+    </para>
+
+    <para id="XctData">
+      <indexterm zone="XctData">
+	<primary><type>XctData</type></primary>
+      </indexterm>
+The following state values are stored in the
+<type>XctData</type>
+structure:
+	<synopsis>
+    XctString		item;		/* the action item */
+    unsigned		item_length;	/* length of item in bytes */
+    int			char_size;	/* the number of bytes per character in
+					 * item, with zero meaning variable */
+    char		*encoding;	/* the XLFD encoding name for item */
+    XctHDirection	horizontal;	/* the direction of item */
+    unsigned		horz_depth;	/* the current direction nesting depth */
+    char		*GL;		/* the "{I} F" string for the current GL */
+    char		*GL_encoding;	/* the XLFD encoding name for the current GL */
+    int			GL_set_size;	/* 94 or 96 */
+    int			GL_char_size;	/* the number of bytes per GL character */
+    char		*GR;		/* the "{I} F" string for the current GR */
+    char		*GR_encoding;	/* the XLFD encoding name for the current GR */
+    int			GR_set_size;	/* 94 or 96 */
+    int			GR_char_size;	/* number of bytes per GR character */
+    char		*GLGR_encoding;	/* the XLFD encoding name for the current
+					 *  GL+GR, if known */
+	</synopsis>
+      </para>
+      <para>
+	<funcsynopsis>
+	  <funcprototype>
+	    <funcdef>void <function>XctFree</function></funcdef>
+	    <paramdef>XctData <parameter>data</parameter></paramdef>
+	  </funcprototype>
+	</funcsynopsis>
+	<variablelist>
+	  <varlistentry>
+	    <term><parameter>data</parameter></term>
+	    <listitem><para>
+specifies the Compound Text structure
+	      </para></listitem>
+	  </varlistentry>
+	</variablelist>
+
+This function frees all data associated with the
+<type>XctData</type>
+structure.
+      </para>
+
+  </sect1>
+
+  <sect1 id='CloseDisplay_Hook_Functions'>
+<title>CloseDisplay Hook Functions</title>
+
+    <para>
+To use the functions defined in this section, you should include the header
+file
+&lt;<filename class='headerfile'>X11/Xmu/CloseHook.h</filename>&gt;
+<indexterm>
+<primary><filename class='headerfile'>X11/Xmu/CloseHook.h</filename></primary>
+</indexterm>
+and link against the libXmu library.
+    </para>
+
+    <para id="XmuAddCloseDisplayHook">
+      <indexterm zone="XmuAddCloseDisplayHook">
+	<primary><function>XmuAddCloseDisplayHook</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>CloseHook <function>XmuAddCloseDisplayHook</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>int <parameter>( *func )</parameter>
+	    <funcparams>Display *, XPointer</funcparams></paramdef>
+	  <paramdef>XPointer <parameter>arg</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the connection to the X server
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>func</parameter></term>
+	  <listitem><para>
+specifies the function to call at display close
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>arg</parameter></term>
+	  <listitem><para>
+specifies arbitrary data to pass to <parameter>func</parameter>
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function adds a callback for the given display.  When the display is
+closed, the given function will be called with the given display and
+argument as:
+
+      <programlisting>
+	(*func)(dpy, arg)
+      </programlisting>
+    </para>
+
+    <para>
+The function is declared to return an int even though the value is ignored,
+because some compilers used to have problems with functions returning void.
+    </para>
+
+    <para>
+This routine returns <symbol>NULL</symbol> if it was unable to add the
+callback, otherwise it
+returns an opaque handle that can be used to remove or lookup the callback.
+    </para>
+
+    <para id="XmuRemoveCloseDisplayHook">
+      <indexterm zone="XmuRemoveCloseDisplayHook">
+	<primary><function>XmuRemoveCloseDisplayHook</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>Bool <function>XmuRemoveCloseDisplayHook</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>CloseHook <parameter>handle</parameter></paramdef>
+	  <paramdef>int <parameter>( *func )</parameter>
+	    <funcparams>Display *, XPointer</funcparams></paramdef>
+	  <paramdef>XPointer <parameter>arg</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the connection to the X server
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>handle</parameter></term>
+	  <listitem><para>
+specifies the callback by id, or <symbol>NULL</symbol>
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><function>func</function></term>
+	  <listitem><para>
+specifies the callback by function
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>arg</parameter></term>
+		<listitem><para>
+specifies the function data to match
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function deletes a callback that has been added with
+<function>XmuAddCloseDisplayHook</function>.
+If handle is not <symbol>NULL</symbol>, it specifies the callback to
+remove, and the func and arg parameters are ignored.  If handle is <symbol>NULL</symbol>, the
+first callback found to match the specified func and arg will be removed.
+Returns
+<symbol>True</symbol>
+if a callback was removed, else returns
+<symbol>False</symbol>.
+    </para>
+
+    <para id="XmuLookupCloseDisplayHook">
+      <indexterm zone="XmuLookupCloseDisplayHook">
+	<primary><function>XmuLookupCloseDisplayHook</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>Bool <function>XmuLookupCloseDisplayHook</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>CloseHook <parameter>handle</parameter></paramdef>
+	  <paramdef>int <parameter>( *func )</parameter>
+	    <funcparams>Display *, XPointer</funcparams></paramdef>
+	  <paramdef>XPointer <parameter>arg</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the connection to the X server
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>handle</parameter></term>
+	  <listitem><para>
+specifies the callback by id, or <symbol>NULL</symbol>
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><function>func</function></term>
+	  <listitem><para>
+specifies the callback by function
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>arg</parameter></term>
+	  <listitem><para>
+specifies the function data to match
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function determines if a callback is installed.  If handle is not
+<symbol>NULL</symbol>,
+it specifies the callback to look for, and the func and arg parameters are
+ignored.  If handle is <symbol>NULL</symbol>, the function will look for
+any callback for the
+specified func and arg.  Returns
+<symbol>True</symbol>
+if a matching callback exists, else returns
+<symbol>False</symbol>.
+
+
+    </para>
+  </sect1>
+
+  <sect1 id='Display_Queue_Functions'>
+<title>Display Queue Functions</title>
+
+    <para>
+To use the functions and types defined in this section, you should include the
+header file
+&lt;<filename class='headerfile'>X11/Xmu/DisplayQue.h</filename>&gt;
+<indexterm>
+<primary><filename class='headerfile'>X11/Xmu/DisplayQue.h</filename></primary>
+</indexterm>
+and link against the libXmu library.
+<filename class='headerfile'>DisplayQue.h</filename> defines the following
+types:
+
+      <indexterm zone="XmuDisplayQueue">
+	<primary><type>XmuDisplayQueue</type></primary>
+      </indexterm>
+      <synopsis id="XmuDisplayQueue">
+typedef int (*XmuCloseDisplayQueueProc)(XmuDisplayQueue *queue,
+                                        XmuDisplayQueueEntry *entry);
+
+typedef int (*XmuFreeDisplayQueueProc)(XmuDisplayQueue *queue);
+
+typedef struct _XmuDisplayQueueEntry {
+	struct _XmuDisplayQueueEntry *prev, *next;
+	Display *display;
+	CloseHook closehook;
+	XPointer data;
+} XmuDisplayQueueEntry;
+
+typedef struct _XmuDisplayQueue {
+	int nentries;
+	XmuDisplayQueueEntry *head, *tail;
+	XmuCloseDisplayQueueProc closefunc;
+	XmuFreeDisplayQueueProc freefunc;
+	XPointer data;
+} XmuDisplayQueue;
+      </synopsis>
+    </para>
+
+    <para id="XmuDQCreate">
+      <indexterm zone="XmuDQCreate">
+	<primary><function>XmuDQCreate</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>XmuDisplayQueue *<function>XmuDQCreate</function></funcdef>
+	  <paramdef>XmuCloseDisplayQueueProc <parameter>closefunc</parameter></paramdef>
+	  <paramdef>XmuFreeDisplayQueueProc <parameter>freefunc</parameter></paramdef>
+	  <paramdef>XPointer <parameter>data</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>closefunc</parameter></term>
+	  <listitem><para>
+specifies the close function
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>freefunc</parameter></term>
+	  <listitem><para>
+specifies the free function
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>data</parameter></term>
+	  <listitem><para>
+specifies private data for the functions
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function creates and returns an empty
+<type>XmuDisplayQueue</type>
+(which is really just a set of displays, but is called a queue for
+historical reasons).  The queue is initially empty, but displays
+can be added using
+<function>XmuAddDisplay</function>.
+The data value is simply stored in the queue for use by the closefunc
+and freefunc callbacks.
+Whenever a display in the queue is closed using
+<function>XCloseDisplay</function>,
+the <parameter>closefunc</parameter> (if non-<symbol>NULL</symbol>) is called with the queue and the display's
+<function>XmuDisplayQueueEntry</function>
+as follows:
+      <programlisting>
+	(*closefunc)(queue, entry)
+      </programlisting>
+    </para>
+
+    <para>
+The <parameter>freefunc</parameter> (if non-<symbol>NULL</symbol>) is called whenever the last
+display in the
+queue is closed, as follows:
+
+      <programlisting>
+	(*freefunc)(queue)
+      </programlisting>
+    </para>
+
+    <para>
+The application is responsible for actually freeing the queue, by calling
+<function>XmuDQDestroy</function>.
+    </para>
+
+    <para id="XmuDQAddDisplay">
+      <indexterm zone="XmuDQAddDisplay">
+	<primary><function>XmuDQAddDisplay</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>XmuDisplayQueueEntry *<function>XmuDQAddDisplay</function></funcdef>
+	  <paramdef>XmuDisplayQueue *<parameter>q</parameter></paramdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>XPointer <parameter>data</parameter></paramdef>
+	</funcprototype>
+     </funcsynopsis>
+
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>q</parameter></term>
+	  <listitem><para>
+specifies the queue
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the display to add
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>data</parameter></term>
+	  <listitem><para>
+specifies private data for the free function
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function adds the specified display to the queue.  If successful,
+the queue entry is returned, otherwise <symbol>NULL</symbol> is returned.
+The data value is simply stored in the queue entry for use by the
+queue's freefunc callback.  This function does not attempt to prevent
+duplicate entries in the queue; the caller should use
+<function>XmuDQLookupDisplay</function>
+to determine if a display has already been added to a queue.
+    </para>
+
+    <para id="XmuDQLookupDisplay">
+      <indexterm zone="XmuDQLookupDisplay">
+	<primary><function>XmuDQLookupDisplay</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>XmuDisplayQueueEntry *<function>XmuDQLookupDisplay</function></funcdef>
+	  <paramdef>XmuDisplayQueue *<parameter>q</parameter></paramdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>q</parameter></term>
+	  <listitem><para>
+specifies the queue
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the display to lookup
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function returns the queue entry for the specified display, or
+<symbol>NULL</symbol> if
+the display is not in the queue.
+    </para>
+
+    <para id="XmuDQNDisplays">
+      <indexterm zone="XmuDQNDisplays">
+	<primary><function>XmuDQNDisplays</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef><function>XmuDQNDisplays</function></funcdef>
+	      <paramdef><parameter>q</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+This macro returns the number of displays in the specified queue.
+    </para>
+
+    <para id="XmuDQRemoveDisplay">
+      <indexterm zone="XmuDQRemoveDisplay">
+	<primary><function>XmuDQRemoveDisplay</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>Bool <function>XmuDQRemoveDisplay</function></funcdef>
+	  <paramdef>XmuDisplayQueue *<parameter>q</parameter></paramdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>q</parameter></term>
+	  <listitem><para>
+specifies the queue
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the display to remove
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function removes the specified display from the specified queue.
+No callbacks are performed.
+If the display is not found in the queue,
+<symbol>False</symbol>
+is returned, otherwise
+<symbol>True</symbol>
+is returned.
+    </para>
+
+    <para id="XmuDQDestroy">
+      <indexterm zone="XmuDQDestroy">
+	<primary><function>XmuDQDestroy</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>Bool <function>XmuDQDestroy</function></funcdef>
+	  <paramdef>XmuDisplayQueue *<parameter>q</parameter></paramdef>
+	  <paramdef>Bool <parameter>docallbacks</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>q</parameter></term>
+	  <listitem><para>
+specifies the queue to destroy
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>docallbacks</parameter></term>
+	  <listitem><para>
+specifies whether close functions should be called
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function releases all memory associated with the specified queue.
+If docallbacks is
+<symbol>True</symbol>,
+then the queue's closefunc callback (if non-<symbol>NULL</symbol>) is first called
+for each display in the queue, even though
+<function>XCloseDisplay</function>
+is not called on the display.
+    </para>
+
+  </sect1>
+
+  <sect1 id='Toolkit_Convenience_Functions'>
+<title>Toolkit Convenience Functions</title>
+
+    <para>
+To use the functions defined in this section, you should include the header
+file
+&lt;<filename class='headerfile'>X11/Xmu/Initer.h</filename>&gt;
+<indexterm>
+<primary><filename class='headerfile'>X11/Xmu/Initer.h</filename></primary>
+</indexterm>
+and link against the libXmu library.
+    </para>
+
+    <para id="XmuAddInitializer">
+      <indexterm zone="XmuAddInitializer">
+	<primary><function>XmuAddInitializer</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuAddInitializer</function></funcdef>
+	  <paramdef>void <parameter>( *func )</parameter>
+	    <funcparams>XtAppContext, XPointer</funcparams></paramdef>
+	  <paramdef>XPointer <parameter>data</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>func</parameter></term>
+	  <listitem><para>
+specifies the procedure to register
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>data</parameter></term>
+	  <listitem><para>
+specifies private data for the procedure
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function registers a procedure, to be invoked the first time
+<function>XmuCallInitializers</function>
+is called on a given application context.  The procedure
+is called with the application context and the specified data:
+
+      <programlisting>
+	(*func)(app_con, data)
+      </programlisting>
+    </para>
+
+    <para id="XmuCallInitializers">
+      <indexterm zone="XmuCallInitializers">
+	<primary><function>XmuCallInitializers</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuCallInitializers</function></funcdef>
+	  <paramdef>XtAppContext <parameter>app_con</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>app_con</parameter></term>
+	  <listitem><para>
+specifies the application context to initialize
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function calls each of the procedures that have been registered with
+<function>XmuAddInitializer</function>,
+if this is the first time the application context has been passed to
+<function>XmuCallInitializers</function>.
+Otherwise, this function does nothing.
+    </para>
+
+  </sect1>
+
+  <sect1 id='Standard_Colormap_Functions'>
+<title>Standard Colormap Functions</title>
+
+    <para>
+To use the functions defined in this section, you should include the header
+file
+&lt;<filename class='headerfile'>X11/Xmu/StdCmap.h</filename>&gt;
+<indexterm>
+<primary><filename class='headerfile'>X11/Xmu/StdCmap.h</filename></primary>
+</indexterm>
+and link against the libXmu library.
+    </para>
+
+    <para id="XmuAllStandardColormaps">
+      <indexterm zone="XmuAllStandardColormaps">
+	<primary><function>XmuAllStandardColormaps</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>Status <function>XmuAllStandardColormaps</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the connection to the X server
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+      <indexterm>
+	<primary>colormaps</primary><secondary>standard</secondary>
+      </indexterm>
+To create all of the appropriate standard colormaps for every visual of
+every screen on a given display, use
+<function>XmuAllStandardColormaps</function>.
+    </para>
+
+    <para>
+This function defines and retains as permanent resources all standard
+colormaps which are meaningful for the visuals of each screen of the
+display.  It returns 0 on failure, non-zero on success.  If the property of
+any standard colormap is already defined, this function will redefine it.
+    </para>
+
+    <para>
+This function is intended to be used by window managers or a special client
+at the start of a session.
+    </para>
+
+    <para>
+The standard colormaps of a screen are defined by properties associated with
+the screen's root window.  The property names of standard colormaps are
+predefined, and each property name except
+<property>RGB_DEFAULT_MAP</property> may describe at
+most one colormap.
+    </para>
+
+    <para>
+The standard colormaps are: <property>RGB_BEST_MAP</property>,
+<property>RGB_RED_MAP</property>, <property>RGB_GREEN_MAP</property>,
+<property>RGB_BLUE_MAP</property>, <property>RGB_DEFAULT_MAP</property>,
+ and <property>RGB_GRAY_MAP</property>.  Therefore a screen may
+have at most 6 standard colormap properties defined.
+    </para>
+
+    <para>
+A standard colormap is associated with a particular visual of the screen.  A
+screen may have multiple visuals defined, including visuals of the same
+class at different depths.  Note that a visual id might be repeated for more
+than one depth, so the visual id and the depth of a visual identify the
+visual.  The characteristics of the visual will determine which standard
+colormaps are meaningful under that visual, and will determine how the
+standard colormap is defined.  Because a standard colormap is associated
+with a specific visual, there must be a method of determining which visuals
+take precedence in defining standard colormaps.
+    </para>
+
+    <para>
+The method used here is: for the visual of greatest depth, define all
+standard colormaps meaningful to that visual class, according to this order
+of (descending) precedence:
+<symbol>DirectColor</symbol>;
+<symbol>PseudoColor</symbol>;
+<symbol>TrueColor</symbol>
+and
+<symbol>GrayScale</symbol>;
+and finally
+<symbol>StaticColor</symbol>
+and
+<symbol>StaticGray</symbol>.
+    </para>
+
+<para>This function allows success, on a per screen basis.  For example, if a map
+on screen 1 fails, the maps on screen 0, created earlier, will remain.
+However, none on screen 1 will remain.  If a map on screen 0 fails, none
+will remain.
+    </para>
+
+    <para>
+See
+<link linkend="XmuVisualStandardColormaps"><function>XmuVisualStandardColormaps</function></link>
+for which standard colormaps are meaningful under these classes of visuals.
+    </para>
+
+    <para id="XmuVisualStandardColormaps">
+      <indexterm zone="XmuVisualStandardColormaps">
+	<primary><function>XmuVisualStandardColormaps</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>Status <function>XmuVisualStandardColormaps</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>int <parameter>screen</parameter></paramdef>
+	  <paramdef>VisualID <parameter>visualid</parameter></paramdef>
+	  <paramdef>unsigned int <parameter>depth</parameter></paramdef>
+	  <paramdef>Bool <parameter>replace</parameter></paramdef>
+	  <paramdef>Bool <parameter>retain</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the connection to the X server
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>screen</parameter></term>
+	  <listitem><para>
+specifies the screen of the display
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>visualid</parameter></term>
+	  <listitem><para>
+specifies the visual type
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>depth</parameter></term>
+	  <listitem><para>
+specifies the visual depth
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>replace</parameter></term>
+	  <listitem><para>
+specifies whether or not to replace
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>retain</parameter></term>
+	  <listitem><para>
+specifies whether or not to retain
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+To create all of the appropriate standard colormaps for a given visual on a
+given screen, use
+<function>XmuVisualStandardColormaps</function>.
+    </para>
+
+    <para>
+This function defines all appropriate standard colormap properties for the
+given visual.  If replace is
+<symbol>True</symbol>,
+any previous definition will be removed.
+If retain is
+<symbol>True</symbol>,
+new properties will be retained for the duration of the
+server session.  This function returns 0 on failure, non-zero on success.
+On failure, no new properties will be defined, but old ones may have been
+removed if replace was <symbol>True</symbol>.
+    </para>
+
+    <para>
+Not all standard colormaps are meaningful to all visual classes.  This
+routine will check and define the following properties for the following
+classes, provided that the size of the colormap is not too small.  For
+<symbol>DirectColor</symbol>
+and
+<symbol>PseudoColor</symbol>:
+<property>RGB_DEFAULT_MAP</property>, <property>RGB_BEST_MAP</property>,
+<property>RGB_RED_MAP</property>, <property>RGB_GREEN_MAP</property>,
+<property>RGB_BLUE_MAP</property>, and <property>RGB_GRAY_MAP</property>.
+For
+<symbol>TrueColor</symbol>
+and
+<symbol>StaticColor</symbol>:
+<property>RGB_BEST_MAP</property>.  For
+<symbol>GrayScale</symbol>
+and
+<symbol>StaticGray</symbol>:
+<property>RGB_GRAY_MAP</property>.
+    </para>
+
+    <para id="XmuLookupStandardColormap">
+      <indexterm zone="XmuLookupStandardColormap">
+	<primary><function>XmuLookupStandardColormap</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>Status <function>XmuLookupStandardColormap</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>int <parameter>screen</parameter></paramdef>
+	  <paramdef>VisualID <parameter>visualid</parameter></paramdef>
+	  <paramdef>unsigned int <parameter>depth</parameter></paramdef>
+	  <paramdef>Atom <parameter>property</parameter></paramdef>
+	  <paramdef>Bool <parameter>replace</parameter></paramdef>
+	  <paramdef>Bool <parameter>retain</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the connection to the X server
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>screen</parameter></term>
+	  <listitem><para>
+specifies the screen of the display
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>visualid</parameter></term>
+	  <listitem><para>
+specifies the visual type
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>depth</parameter></term>
+	  <listitem><para>
+specifies the visual depth
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>property</parameter></term>
+	  <listitem><para>
+specifies the standard colormap property
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>replace</parameter></term>
+	  <listitem><para>
+specifies whether or not to replace
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>retain</parameter></term>
+	  <listitem><para>
+specifies whether or not to retain
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+To create a standard colormap if one does not currently exist, or replace
+the currently existing standard colormap, use
+<function>XmuLookupStandardColormap</function>.
+    </para>
+
+    <para>
+Given a screen, a visual, and a property, this function will determine the
+best allocation for the property under the specified visual, and determine
+the whether to create a new colormap or to use the default colormap of the
+screen.
+    </para>
+
+    <para>
+If replace is True, any previous definition of the property will be
+replaced.  If retain is True, the property and the colormap will be made
+permanent for the duration of the server session.  However, pre-existing
+property definitions which are not replaced cannot be made permanent by a
+call to this function; a request to retain resources pertains to newly
+created resources.
+    </para>
+
+    <para>
+This function returns 0 on failure, non-zero on success.  A request to
+create a standard colormap upon a visual which cannot support such a map is
+considered a failure.  An example of this would be requesting any standard
+colormap property on a monochrome visual, or, requesting an
+<property>RGB_BEST_MAP</property> on
+a display whose colormap size is 16.
+    </para>
+
+    <para id="XmuGetColormapAllocation">
+      <indexterm zone="XmuGetColormapAllocation">
+	<primary><function>XmuGetColormapAllocation</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>Status <function>XmuGetColormapAllocation</function></funcdef>
+	  <paramdef>XVisualInfo *<parameter>vinfo</parameter></paramdef>
+	  <paramdef>Atom <parameter>property</parameter></paramdef>
+	  <paramdef>unsigned long *<parameter>red_max</parameter></paramdef>
+	  <paramdef>unsigned long *<parameter>green_max</parameter></paramdef>
+	  <paramdef>unsigned long *<parameter>blue_max</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>vinfo</parameter></term>
+	  <listitem><para>
+specifies visual information for a chosen visual
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>property</parameter></term>
+	  <listitem><para>
+specifies one of the standard colormap property names
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>red_max</parameter></term>
+	  <listitem><para>
+returns maximum red value</para>
+	  </listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>green_max</parameter></term>
+	  <listitem><para>
+returns maximum green value
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>blue_max</parameter></term>
+	  <listitem><para>
+returns maximum blue value
+	  </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+To determine the best allocation of reds, greens, and blues in a standard
+colormap, use
+<function>XmuGetColormapAllocation</function>.
+    </para>
+
+    <para>
+<function>XmuGetColormapAllocation</function>
+returns 0 on failure, non-zero on success.  It is
+assumed that the visual is appropriate for the colormap property.
+    </para>
+
+    <para id="XmuStandardColormap">
+      <indexterm zone="XmuStandardColormap">
+	<primary><function>XmuStandardColormap</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>XStandardColormap *<function>XmuStandardColormap</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>int <parameter>screen</parameter></paramdef>
+	  <paramdef>VisualID <parameter>visualid</parameter></paramdef>
+	  <paramdef>unsigned int <parameter>depth</parameter></paramdef>
+	  <paramdef>Atom <parameter>property</parameter></paramdef>
+	  <paramdef>Colormap <parameter>cmap</parameter></paramdef>
+	  <paramdef>unsigned long <parameter>red_max</parameter></paramdef>
+	  <paramdef>unsigned long <parameter>green_max</parameter></paramdef>
+	  <paramdef>unsigned long <parameter>blue_max</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the connection to the X server
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>screen</parameter></term>
+	  <listitem><para>
+specifies the screen of the display
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>visualid</parameter></term>
+	  <listitem><para>
+specifies the visual type
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>depth</parameter></term>
+	  <listitem><para>
+specifies the visual depth
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>property</parameter></term>
+	  <listitem><para>
+specifies the standard colormap property
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>cmap</parameter></term>
+	  <listitem><para>
+specifies the colormap ID, or None
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>red_max</parameter></term>
+	  <listitem><para>
+specifies the red allocation
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>green_max</parameter></term>
+	  <listitem><para>
+specifies the green allocation
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>blue_max</parameter></term>
+	  <listitem><para>
+specifies the blue allocation
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+To create any one standard colormap, use
+<function>XmuStandardColormap</function>.
+    </para>
+
+    <para>
+This function creates a standard colormap for the given screen, visualid,
+and visual depth, with the given red, green, and blue maximum values, with
+the given standard property name.  Upon success, it returns a pointer to an
+<function>XStandardColormap</function>
+structure which describes the newly created colormap.
+Upon failure, it returns <symbol>NULL</symbol>.
+If cmap is the default colormap of the screen, the standard colormap
+will be defined on the default colormap; otherwise a new colormap is created.
+    </para>
+
+    <para>
+Resources created by this function are not made permanent; that is the
+caller's responsibility.
+    </para>
+
+    <para id="XmuCreateColormap">
+      <indexterm zone="XmuCreateColormap">
+	<primary><function>XmuCreateColormap</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>Status <function>XmuCreateColormap</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>XStandardColormap *<parameter>colormap</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the connection under which the map is created
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>colormap</parameter></term>
+	  <listitem><para>
+specifies the map to be created</para></listitem>
+	</varlistentry>
+      </variablelist>
+
+To create any one colormap which is described by an
+<structname>XStandardColormap</structname>
+structure, use
+<function>XmuCreateColormap</function>.
+    </para>
+
+    <para>
+This function returns 0 on failure, and non-zero on success.  The base_pixel
+of the colormap is set on success.  Resources created by this function are
+not made permanent.  No argument error checking is provided; use at your own
+risk.
+    </para>
+
+    <para>
+All colormaps are created with read-only allocations, with the exception of
+read-only allocations of colors which fail
+to return the expected pixel value, and these are individually defined as
+read/write allocations.  This is done so that all the cells defined in the
+colormap are contiguous, for use in image processing.  This typically
+happens with White and Black in the default map.
+    </para>
+
+    <para>
+Colormaps of static visuals are considered to be successfully created if the
+map of the static visual matches the definition given in the standard
+colormap structure.
+    </para>
+
+    <para id="XmuDeleteStandardColormap">
+      <indexterm zone="XmuDeleteStandardColormap">
+	<primary><function>XmuDeleteStandardColormap</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuDeleteStandardColormap</function></funcdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
+	  <paramdef>Screen *<parameter>screen</parameter></paramdef>
+	  <paramdef>Atom <parameter>property</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dpy</parameter></term>
+	  <listitem><para>
+specifies the connection to the X server
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>screen</parameter></term>
+	  <listitem><para>
+specifies the screen of the display
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>property</parameter></term>
+	  <listitem><para>
+specifies the standard colormap property
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+To remove any standard colormap property, use
+<function>XmuDeleteStandardColormap</function>.
+This function will remove the specified property from the specified screen,
+releasing any resources used by the colormap(s) of the property, if
+possible.
+    </para>
+
+  </sect1>
+
+  <sect1 id='Widget_Description_Functions'>
+<title>Widget Description Functions</title>
+
+    <para>
+The functions defined in this section are for building a description of
+the structure of and resources associated with a hierarchy of widget classes.
+This package is typically used by applications that wish to manipulate the
+widget set itself.
+    </para>
+
+    <para>
+The definitions needed to use these interfaces are in the header file
+&lt;<filename class='headerfile'>X11/Xmu/WidgetNode.h</filename>&gt;
+<indexterm>
+<primary><filename class='headerfile'>X11/Xmu/WidgetNode.h</filename></primary>
+</indexterm>.
+To call these functions, you need to link against the libXmu library.
+The following function must be called before any of the others described
+below:
+
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuWnInitializeNodes</function></funcdef>
+	  <paramdef>XmuWidgetNode *<parameter>node_array</parameter></paramdef>
+	  <paramdef>int <parameter>num_nodes</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>node_array</parameter></term>
+	  <listitem><para>
+specifies a list of widget classes, in alphabetical order
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>num_nodes</parameter></term>
+	  <listitem><para>
+specifies the number of widget classes in the node array
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+    </para>
+
+    <para>
+To determine the resources provided by a widget class or classes, use
+
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuWnFetchResources</function></funcdef>
+	  <paramdef>XmuWidgetNode *<parameter>node</parameter></paramdef>
+	  <paramdef>Widget <parameter>toplevel</parameter></paramdef>
+	  <paramdef>XmuWidgetNode *<parameter>top_node</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>node</parameter></term>
+	  <listitem><para>
+specifies the widget class for which resources should be obtained.
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>toplevel</parameter></term>
+	  <listitem><para>
+specifies the widget that should be used for creating an instance of
+<parameter>node</parameter>
+from which resources are extracted.  This is typically the value returned
+by <function>XtAppInitialize</function>.
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>top_node</parameter></term>
+	  <listitem><para>
+specifies the ancestor of <parameter>node</parameter> that should be
+treated as the root
+of the widget inheritance tree (used in determining which ancestor contributed
+which resources).
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+    </para>
+
+    <para>
+Each widget class inherits the resources of its parent.  To count the number
+of resources contributed by a particular widget class, use:
+
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>int <function>XmuWnCountOwnedResources</function></funcdef>
+	  <paramdef>XmuWidgetNode *<parameter>node</parameter></paramdef>
+	  <paramdef>XmuWidgetNode *<parameter>owner_node</parameter></paramdef>
+	  <paramdef>Bool <parameter>constraints</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>node</parameter></term>
+	  <listitem><para>
+specifies the widget class whose resources are being examined.
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>owner_node</parameter></term>
+	  <listitem><para>
+specifies the widget class of the ancestor of <parameter>node</parameter>
+whose contributions
+are being counted.
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>constraints</parameter></term>
+	  <listitem><para>
+specifies whether or not to count constraint resources or normal resources.
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This routine returns the number of resources contributed (or
+&ldquo;owned&rdquo;) by
+the specified widget class.
+	    </para>
+
+    <para id="XmuWnNameToNode">
+      <indexterm zone="XmuWnNameToNode">
+	<primary><function>XmuWnNameToNode</function></primary>
+      </indexterm>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>XmuWidgetNode *<function>XmuWnNameToNode</function></funcdef>
+	  <paramdef>XmuWidgetNode *<parameter>node_list</parameter></paramdef>
+	  <paramdef>int <parameter>num_nodes</parameter></paramdef>
+	  <paramdef>char *<parameter>name</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>node_list</parameter></term>
+	  <listitem><para>
+specifies a list of widget nodes
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>num_nodes</parameter></term>
+	  <listitem><para>
+specifies the number of nodes in the list
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>name</parameter></term>
+	  <listitem><para>
+specifies the name of the widget class in the node list to search for
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function returns the WidgetNode in the list that matches the given
+widget name or widget class name.  If no match is found, it returns
+<symbol>NULL</symbol>.
+    </para>
+
+  </sect1>
+
+  <sect1 id='Participation_in_the_Editres_Protocol'>
+<title>Participation in the Editres Protocol</title>
+
+    <para>
+      <indexterm>
+	<primary>editres</primary>
+      </indexterm>
+To participate in the editres protocol, applications which are not based
+on the Athena widget set should include the header file
+&lt;<filename class='headerfile'>X11/Xmu/Editres.h</filename>&gt;
+<indexterm>
+<primary><filename class='headerfile'>X11/Xmu/Editres.h</filename></primary>
+</indexterm>
+and link against the libXmu library.
+    </para>
+
+    <para>
+To participate in the editres protocol, Xt applications which do not rely
+on the Athena widget set should register the editres protocol handler on
+each shell widget in the application, specifying an event mask of 0,
+nonmaskable events, and client data as <symbol>NULL</symbol>:
+
+    <programlisting>
+XtAddEventHandler(shell, (EventMask) 0, True, _XEditResCheckMessages, NULL);
+    </programlisting>
+    </para>
+  </sect1>
+
+  <index />
+</article>
Index: lib/libXmu/create-1.1.4-docbook-patch/libXmu-1.1.4-new/doc
===================================================================
--- lib/libXmu/create-1.1.4-docbook-patch/libXmu-1.1.4-new/doc	(nonexistent)
+++ lib/libXmu/create-1.1.4-docbook-patch/libXmu-1.1.4-new/doc	(revision 5)

Property changes on: lib/libXmu/create-1.1.4-docbook-patch/libXmu-1.1.4-new/doc
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXmu/create-1.1.4-docbook-patch/libXmu-1.1.4-new
===================================================================
--- lib/libXmu/create-1.1.4-docbook-patch/libXmu-1.1.4-new	(nonexistent)
+++ lib/libXmu/create-1.1.4-docbook-patch/libXmu-1.1.4-new	(revision 5)

Property changes on: lib/libXmu/create-1.1.4-docbook-patch/libXmu-1.1.4-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXmu/create-1.1.4-docbook-patch
===================================================================
--- lib/libXmu/create-1.1.4-docbook-patch	(nonexistent)
+++ lib/libXmu/create-1.1.4-docbook-patch	(revision 5)

Property changes on: lib/libXmu/create-1.1.4-docbook-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXmu/patches/README
===================================================================
--- lib/libXmu/patches/README	(nonexistent)
+++ lib/libXmu/patches/README	(revision 5)
@@ -0,0 +1,6 @@
+
+/* begin *
+
+   TODO: Leave some comment here.
+
+ * end */
Index: lib/libXmu/patches
===================================================================
--- lib/libXmu/patches	(nonexistent)
+++ lib/libXmu/patches	(revision 5)

Property changes on: lib/libXmu/patches
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXmu
===================================================================
--- lib/libXmu	(nonexistent)
+++ lib/libXmu	(revision 5)

Property changes on: lib/libXmu
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXp/Makefile
===================================================================
--- lib/libXp/Makefile	(nonexistent)
+++ lib/libXp/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXp
+
+versions    = 1.0.4
+pkgname     = libXp
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXp
===================================================================
--- lib/libXp	(nonexistent)
+++ lib/libXp	(revision 5)

Property changes on: lib/libXp
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXpm/Makefile
===================================================================
--- lib/libXpm/Makefile	(nonexistent)
+++ lib/libXpm/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXpm
+
+versions    = 3.5.15
+pkgname     = libXpm
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXpm
===================================================================
--- lib/libXpm	(nonexistent)
+++ lib/libXpm	(revision 5)

Property changes on: lib/libXpm
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXpresent/Makefile
===================================================================
--- lib/libXpresent/Makefile	(nonexistent)
+++ lib/libXpresent/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXpresent
+
+versions    = 1.0.1
+pkgname     = libXpresent
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXpresent
===================================================================
--- lib/libXpresent	(nonexistent)
+++ lib/libXpresent	(revision 5)

Property changes on: lib/libXpresent
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXrandr/Makefile
===================================================================
--- lib/libXrandr/Makefile	(nonexistent)
+++ lib/libXrandr/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXrandr
+
+versions    = 1.5.3
+pkgname     = libXrandr
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXrandr
===================================================================
--- lib/libXrandr	(nonexistent)
+++ lib/libXrandr	(revision 5)

Property changes on: lib/libXrandr
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXrender/Makefile
===================================================================
--- lib/libXrender/Makefile	(nonexistent)
+++ lib/libXrender/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXrender
+
+versions    = 0.9.11
+pkgname     = libXrender
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXrender
===================================================================
--- lib/libXrender	(nonexistent)
+++ lib/libXrender	(revision 5)

Property changes on: lib/libXrender
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXres/Makefile
===================================================================
--- lib/libXres/Makefile	(nonexistent)
+++ lib/libXres/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXres
+
+versions    = 1.2.2
+pkgname     = libXres
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXres
===================================================================
--- lib/libXres	(nonexistent)
+++ lib/libXres	(revision 5)

Property changes on: lib/libXres
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXt/Makefile
===================================================================
--- lib/libXt/Makefile	(nonexistent)
+++ lib/libXt/Makefile	(revision 5)
@@ -0,0 +1,56 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXt
+
+versions    = 1.2.1
+pkgname     = libXt
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+patches     = $(CURDIR)/patches/libXt-1.2.1-docbook.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-1.2.1-docbook-patch ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s) $(patches)
Index: lib/libXt/create-1.2.1-docbook-patch/create.patch.sh
===================================================================
--- lib/libXt/create-1.2.1-docbook-patch/create.patch.sh	(nonexistent)
+++ lib/libXt/create-1.2.1-docbook-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=1.2.1
+
+tar --files-from=file.list -xjvf ../libXt-$VERSION.tar.bz2
+mv libXt-$VERSION libXt-$VERSION-orig
+
+cp -rf ./libXt-$VERSION-new ./libXt-$VERSION
+
+diff --unified -Nr  libXt-$VERSION-orig  libXt-$VERSION > libXt-$VERSION-docbook.patch
+
+mv libXt-$VERSION-docbook.patch ../patches
+
+rm -rf ./libXt-$VERSION
+rm -rf ./libXt-$VERSION-orig

Property changes on: lib/libXt/create-1.2.1-docbook-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: lib/libXt/create-1.2.1-docbook-patch/file.list
===================================================================
--- lib/libXt/create-1.2.1-docbook-patch/file.list	(nonexistent)
+++ lib/libXt/create-1.2.1-docbook-patch/file.list	(revision 5)
@@ -0,0 +1,7 @@
+libXt-1.2.1/specs/CH02.xml
+libXt-1.2.1/specs/CH04.xml
+libXt-1.2.1/specs/CH06.xml
+libXt-1.2.1/specs/CH07.xml
+libXt-1.2.1/specs/CH09.xml
+libXt-1.2.1/specs/CH10.xml
+libXt-1.2.1/specs/CH11.xml
Index: lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs/CH02.xml
===================================================================
--- lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs/CH02.xml	(nonexistent)
+++ lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs/CH02.xml	(revision 5)
@@ -0,0 +1,4540 @@
+<?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">
+
+<chapter id='Widget_Instantiation'>
+<title>Widget Instantiation</title>
+<para>
+A hierarchy of widget instances constitutes a widget tree.
+The shell widget returned by
+<xref linkend='XtAppCreateShell' xrefstyle='select: title'/>
+is the root of the widget tree instance.
+The widgets with one or more children are the intermediate nodes of that tree,
+and the widgets with no children of any kind are the leaves of the widget tree.
+With the exception of pop-up children (see <xref linkend='Pop_Up_Widgets' />),
+this widget tree instance defines the associated X Window tree.
+</para>
+
+<para>
+Widgets can be either composite or primitive.
+Both kinds of widgets can contain children,
+but the Intrinsics provide a set of management mechanisms for constructing
+and interfacing between composite widgets, their children, and
+other clients.
+</para>
+
+<para>
+Composite widgets, that is, members of the class
+<function>compositeWidgetClass</function>,
+are containers for an arbitrary,
+but widget implementation-defined, collection of children,
+which may be instantiated by the composite widget itself,
+by other clients, or by a combination of the two.
+Composite widgets also contain methods for managing the geometry (layout)
+of any child widget.
+Under unusual circumstances,
+a composite widget may have zero children,
+but it usually has at least one.
+By contrast,
+primitive widgets that contain children typically instantiate
+specific children of known classes themselves and do not expect external
+clients to do so.
+Primitive widgets also do not have general geometry management methods.
+</para>
+
+<para>
+In addition,
+the Intrinsics recursively perform many operations
+(for example, realization and destruction)
+on composite widgets and all their children.
+Primitive widgets that have children must be prepared
+to perform the recursive operations themselves on behalf of their children.
+</para>
+
+<para>
+A widget tree is manipulated by several Intrinsics functions.
+For example,
+<xref linkend='XtRealizeWidget' xrefstyle='select: title'/>
+traverses the tree downward and recursively realizes all
+pop-up widgets and children of composite widgets.
+<xref linkend='XtDestroyWidget' xrefstyle='select: title'/>
+traverses the tree downward and destroys all pop-up widgets
+and children of composite widgets.
+The functions that fetch and modify resources traverse the tree upward
+and determine the inheritance of resources from a widget's ancestors.
+<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>
+traverses the tree up one level and calls the geometry manager
+that is responsible for a widget child's geometry.
+</para>
+
+<para>
+To facilitate upward traversal of the widget tree,
+each widget has a pointer to its parent widget.
+The
+Shell
+widget that
+<xref linkend='XtAppCreateShell' xrefstyle='select: title'/>
+returns has a <emphasis remap='I'>parent</emphasis> pointer of NULL.
+</para>
+
+<para>
+To facilitate downward traversal of the widget tree,
+the <emphasis remap='I'>children</emphasis> field of
+each composite widget is a pointer to an array of child widgets,
+which includes all normal children created,
+not just the subset of children that are managed by the composite widget's
+geometry manager.
+Primitive widgets
+that instantiate children are entirely responsible for all operations
+that require downward traversal below themselves.
+In addition,
+every widget has a pointer to an array of pop-up children.
+</para>
+
+<sect1 id="Initializing_the_tk">
+<title>Initializing the X Toolkit</title>
+<para>
+Before an application can call any Intrinsics function
+other than
+<function>XtSetLanguageProc</function>
+and
+<xref linkend='XtToolkitThreadInitialize' xrefstyle='select: title'/>,
+it must initialize the Intrinsics by using
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+<xref linkend='XtToolkitInitialize' xrefstyle='select: title'/>,
+which initializes the Intrinsics internals
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XtCreateApplicationContext' xrefstyle='select: title'/>,
+which initializes the per-application state
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>
+or
+<xref linkend='XtOpenDisplay' xrefstyle='select: title'/>,
+which initializes the per-display state
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XtAppCreateShell' xrefstyle='select: title'/>,
+which creates the root of a widget tree
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+Or an application can call the convenience procedure
+<xref linkend='XtOpenApplication' xrefstyle='select: title'/>,
+which combines the functions of the preceding procedures.
+An application wishing to use the ANSI C locale mechanism should call
+<function>XtSetLanguageProc</function>
+prior to calling
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>,
+<xref linkend='XtOpenDisplay' xrefstyle='select: title'/>,
+<xref linkend='XtOpenApplication' xrefstyle='select: title'/>,
+or
+<xref linkend='XtAppInitialize' xrefstyle='select: title'/>.
+</para>
+
+<para>
+Multiple instances of X Toolkit applications may be implemented
+in a single address space.
+Each instance needs to be able to read
+input and dispatch events independently of any other instance.
+Further, an application instance may need multiple display connections
+to have widgets on multiple displays.
+From the application's point of view, multiple display connections
+usually are treated together as a single unit
+for purposes of event dispatching.
+To accommodate both requirements,
+the Intrinsics define application contexts,
+each of which provides the information needed to distinguish one application
+instance from another.
+The major component of an application context is a list of one or more X
+<function>Display</function>
+pointers for that application.
+The Intrinsics handle all display connections within a single application
+context simultaneously, handling input in a round-robin fashion.
+The application context type
+<function>XtAppContext</function>
+is opaque to clients.
+</para>
+
+<para>
+To initialize the Intrinsics internals, use
+<xref linkend='XtToolkitInitialize' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtToolkitInitialize'>
+<funcprototype>
+  <funcdef>void <function>XtToolkitInitialize</function></funcdef>
+  <paramdef><parameter>void</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+If
+<xref linkend='XtToolkitInitialize' xrefstyle='select: title'/>
+was previously called, it returns immediately.
+When
+<xref linkend='XtToolkitThreadInitialize' xrefstyle='select: title'/>
+is called before
+<xref linkend='XtToolkitInitialize' xrefstyle='select: title'/>,
+the latter is protected against
+simultaneous activation by multiple threads.
+</para>
+
+<para>
+To create an application context, use
+<xref linkend='XtCreateApplicationContext' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtCreateApplicationContext'>
+<funcprototype>
+  <funcdef>XtAppContext <function>XtCreateApplicationContext</function></funcdef>
+  <paramdef><parameter>void</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+
+<para>
+The
+<xref linkend='XtCreateApplicationContext' xrefstyle='select: title'/>
+function returns an application context,
+which is an opaque type.
+Every application must have at least one application context.
+</para>
+
+<para>
+To destroy an application context and close any
+remaining display connections in it, use
+<xref linkend='XtDestroyApplicationContext' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtDestroyApplicationContext'>
+<funcprototype>
+  <funcdef>void <function>XtDestroyApplicationContext</function></funcdef>
+  <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtDestroyApplicationContext' xrefstyle='select: title'/>
+function destroys the specified application context.
+If called from within an event dispatch (for example, in a callback procedure),
+<xref linkend='XtDestroyApplicationContext' xrefstyle='select: title'/>
+does not destroy the application context until the dispatch is complete.
+</para>
+
+<para>
+To get the application context in which a given widget was created, use
+<xref linkend='XtWidgetToApplicationContext' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtWidgetToApplicationContext'>
+<funcprototype>
+  <funcdef>XtAppContext <function>XtWidgetToApplicationContext</function></funcdef>
+  <paramdef>Widget <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget for which you want the application context.  Must be of class Object or any subclass thereof.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtWidgetToApplicationContext' xrefstyle='select: title'/>
+function returns the application context for the specified widget.
+</para>
+
+<para>
+To initialize a display and add it to an application context, use
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtDisplayInitialize'>
+<funcprototype>
+  <funcdef>void  <function>XtDisplayInitialize</function></funcdef>
+      <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+      <paramdef>Display * <parameter>display</parameter></paramdef>
+      <paramdef>const char * <parameter>application_name</parameter></paramdef>
+      <paramdef>const char * <parameter>application_class</parameter></paramdef>
+      <paramdef>XrmOptionDescRec * <parameter>options</parameter></paramdef>
+      <paramdef>Cardinal <parameter>num_options</parameter></paramdef>
+      <paramdef>int * <parameter>argc</parameter></paramdef>
+      <paramdef>char ** <parameter>argv</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a previously opened display connection.  Note that a single
+display connection can be in at most one application context.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>application_name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the name of the application instance.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>application_class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the class name of this application,
+which is usually the generic name for all instances of this application.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>options</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies how to parse the command line for any application-specific resources.
+The <emphasis remap='I'>options</emphasis> argument is passed as a parameter to
+<function>XrmParseCommand</function>.
+For further information,
+see Parsing Command Line Options in Xlib &mdash; C Language X Interface and <xref linkend='Parsing_the_Command_Line' /> of this specification.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_options</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the options list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>argc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to the number of command line parameters.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>argv</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the list of command line parameters.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>
+function retrieves the language string to be
+used for the specified display (see <xref linkend='Finding_File_Names' />),
+calls the language procedure (if set) with that language string,
+builds the resource database for the default screen, calls the Xlib
+<function>XrmParseCommand</function>
+function to parse the command line,
+and performs other per-display initialization.
+After
+<function>XrmParseCommand</function>
+has been called,
+<emphasis remap='I'>argc</emphasis> and <emphasis remap='I'>argv</emphasis> contain only those parameters that
+were not in the standard option table or in the table specified by the
+<emphasis remap='I'>options</emphasis> argument.
+If the modified <emphasis remap='I'>argc</emphasis> is not zero,
+most applications simply print out the modified <emphasis remap='I'>argv</emphasis> along with a message
+listing the allowable options.
+On POSIX-based systems,
+the application name is usually the final component of <emphasis remap='I'>argv</emphasis>[0].
+If the synchronous resource is
+<function>True</function>,
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>
+calls the Xlib
+<function>XSynchronize</function>
+function to put Xlib into synchronous mode for this display connection
+and any others currently open in the application context.
+See <xref linkend='Loading_the_Resource_Database' />
+and <xref linkend='Parsing_the_Command_Line' />
+for details on the <emphasis remap='I'>application_name</emphasis>,
+<emphasis remap='I'>application_class</emphasis>, <emphasis remap='I'>options</emphasis>, and <emphasis remap='I'>num_options</emphasis> arguments.
+</para>
+
+<para>
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>
+calls
+<function>XrmSetDatabase</function>
+to associate the resource database of the default screen with the
+display before returning.
+</para>
+
+<para>
+To open a display, initialize it, and then
+add it to an application context, use
+<xref linkend='XtOpenDisplay' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtOpenDisplay'>
+<funcprototype>
+  <funcdef>Display *<function>XtOpenDisplay</function></funcdef>
+       <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+       <paramdef>const char * <parameter>display_string</parameter></paramdef>
+       <paramdef>const char * <parameter>application_name</parameter></paramdef>
+       <paramdef>const char * <parameter>application_class</parameter></paramdef>
+       <paramdef>XrmOptionDescRec * <parameter>options</parameter></paramdef>
+       <paramdef>Cardinal <parameter>num_options</parameter></paramdef>
+       <paramdef>int * <parameter>argc</parameter></paramdef>
+       <paramdef>char ** <parameter>argv</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+
+
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display_string</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display string, or NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>application_name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the name of the application instance, or NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>application_class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the class name of this application,
+which is usually the generic name for all instances of this application.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>options</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies how to parse the command line for any application-specific resources.
+The options argument is passed as a parameter to
+<function>XrmParseCommand</function>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_options</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the options list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>argc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to the number of command line parameters.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>argv</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the list of command line parameters.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtOpenDisplay' xrefstyle='select: title'/>
+function calls
+<function>XOpenDisplay</function>
+with the specified <emphasis remap='I'>display_string</emphasis>.
+If <emphasis remap='I'>display_string</emphasis> is NULL,
+<xref linkend='XtOpenDisplay' xrefstyle='select: title'/>
+uses the current value of the -display option specified in <emphasis remap='I'>argv</emphasis>.
+If no display is specified in <emphasis remap='I'>argv</emphasis>,
+the user's default display is retrieved from the environment.
+On POSIX-based systems,
+this is the value of the
+<emphasis role='strong'>DISPLAY</emphasis>
+environment variable.
+</para>
+
+<para>
+If this succeeds,
+<xref linkend='XtOpenDisplay' xrefstyle='select: title'/>
+then calls
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>
+and passes it the opened display and
+the value of the -name option specified in <emphasis remap='I'>argv</emphasis> as the application name.
+If no -name option is specified
+and <emphasis remap='I'>application_name</emphasis> is
+non-NULL, <emphasis remap='I'>application_name</emphasis> is passed to
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>.
+If <emphasis remap='I'>application_name</emphasis> is NULL and if the environment variable
+<emphasis role='strong'>RESOURCE_NAME</emphasis>
+is set, the value of
+<emphasis role='strong'>RESOURCE_NAME</emphasis>
+is used.  Otherwise, the application
+name is the name used to invoke the program.  On implementations that
+conform to ANSI C Hosted Environment support, the application name will
+be <emphasis remap='I'>argv</emphasis>[0] less any directory and file type components, that is, the
+final component of <emphasis remap='I'>argv</emphasis>[0], if specified.  If <emphasis remap='I'>argv</emphasis>[0] does not exist or
+is the empty string, the application name is &ldquo;main&rdquo;.
+<xref linkend='XtOpenDisplay' xrefstyle='select: title'/>
+returns the newly opened display or NULL if it failed.
+</para>
+
+<para>
+See <xref linkend='Using_the_Intrinsics_in_a_Multi_Threaded_Environment' />
+for information regarding the use of
+<xref linkend='XtOpenDisplay' xrefstyle='select: title'/>
+in multiple threads.
+</para>
+
+<para>
+To close a display and remove it from an application context, use
+<xref linkend='XtCloseDisplay' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtCloseDisplay'>
+<funcprototype>
+  <funcdef>void <function>XtCloseDisplay</function></funcdef>
+       <paramdef>Display * <parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtCloseDisplay' xrefstyle='select: title'/>
+function calls
+<function>XCloseDisplay</function>
+with the specified <emphasis remap='I'>display</emphasis> as soon as it is safe to do so.
+If called from within an event dispatch (for example, a callback procedure),
+<xref linkend='XtCloseDisplay' xrefstyle='select: title'/>
+does not close the display until the dispatch is complete.
+Note that applications need only call
+<xref linkend='XtCloseDisplay' xrefstyle='select: title'/>
+if they are to continue executing after closing the display;
+otherwise, they should call
+<xref linkend='XtDestroyApplicationContext' xrefstyle='select: title'/>.
+</para>
+
+<para>
+See <xref linkend='Using_the_Intrinsics_in_a_Multi_Threaded_Environment' />
+for information regarding the use of
+<xref linkend='XtCloseDisplay' xrefstyle='select: title'/>
+in multiple threads.
+</para>
+</sect1>
+
+<sect1 id="Establishing_the_Locale">
+<title>Establishing the Locale</title>
+<para>
+Resource databases are specified to be created in the current process
+locale.  During display initialization prior to creating the
+per-screen resource database, the Intrinsics will call out to a specified
+application procedure to set the locale according to options found on
+the command line or in the per-display resource specifications.
+</para>
+
+<para>
+The callout procedure provided by the application is of type
+<function>XtLanguageProc</function>.
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>typedef String <function>(*XtLanguageProc)</function></funcdef>
+  <paramdef>Display <parameter>display</parameter></paramdef>
+  <paramdef>String <parameter>language</parameter></paramdef>
+  <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Passes the display.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>language</emphasis>
+    </term>
+    <listitem>
+      <para>
+Passes the initial language value obtained from the command line
+or server per-display resource specifications.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Passes the additional client data specified in the call to
+<function>XtSetLanguageProc</function>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+The language procedure allows an application to set the locale to
+the value of the language resource determined by
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>.
+The function returns a new language string that
+will be subsequently used by
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>
+to establish the path for loading resource files.  The returned
+string  will be copied by the Intrinsics into new memory.
+</para>
+
+<para>
+Initially, no language procedure is set by the Intrinsics.
+To set the language procedure for use by
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>,
+use
+<function>XtSetLanguageProc</function>.
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>XtLanguageProc <function>XtSetLanguageProc</function></funcdef>
+  <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+  <paramdef>XtLanguageProc <parameter>proc</parameter></paramdef>
+  <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context in which the language procedure is
+to be used, or NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the language procedure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies additional client data to be passed to the language
+procedure when it is called.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XtSetLanguageProc</function>
+sets the language procedure that will be called from
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>
+for all subsequent Displays initialized in the specified application
+context.   If <emphasis remap='I'>app_context</emphasis> is NULL, the specified language
+procedure is registered in all application contexts created by the
+calling process, including any future application contexts that may
+be created.   If <emphasis remap='I'>proc</emphasis> is NULL, a default language procedure is
+registered.
+<function>XtSetLanguageProc</function>
+returns the previously registered language procedure.
+If a language procedure has not yet been registered, the return value
+is unspecified, but if this return value is used in a subsequent call to
+<function>XtSetLanguageProc</function>,
+it will cause the default language procedure to be registered.
+</para>
+
+<para>
+The default language procedure does the following:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Sets the locale according to the environment.  On ANSI C-based
+systems this is done by calling
+<function>setlocale</function>(
+<function>LC_ALL</function>,
+<emphasis remap='I'>language</emphasis> ).
+If an error is encountered, a warning message is issued with
+<xref linkend='XtWarning' xrefstyle='select: title'/>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Calls
+<function>XSupportsLocale</function>
+to verify that the current locale is supported.
+If the locale is not supported, a warning message is issued with
+<xref linkend='XtWarning' xrefstyle='select: title'/>
+and the locale is set to &ldquo;C&rdquo;.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Calls
+<function>XSetLocaleModifiers</function>
+specifying the empty string.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Returns the value of the current locale.  On ANSI C-based systems this
+is the return value from a final call to
+<function>setlocale</function>(
+<function>LC_ALL</function>,
+NULL ).
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+A client wishing to use this mechanism to establish locale can do so
+by calling
+<function>XtSetLanguageProc</function>
+prior to
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>,
+as in the following example.
+</para>
+<programlisting>
+	Widget top;
+	XtSetLanguageProc(NULL, NULL, NULL);
+	top = XtOpenApplication(...);
+	...
+</programlisting>
+</sect1>
+
+<sect1 id="Loading_the_Resource_Database">
+<title>Loading the Resource Database</title>
+<para>
+The
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>
+function first determines the language
+string to be used for the specified display.  It then
+creates a resource database for the default screen of the display by
+combining the following sources in order, with the entries in the
+first named source having highest precedence:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Application command line (<emphasis remap='I'>argc</emphasis>, <emphasis remap='I'>argv</emphasis>).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Per-host user environment resource file on the local host.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Per-screen resource specifications from the server.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Per-display resource specifications from the server or from
+the user preference file on the local host.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Application-specific user resource file on the local host.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Application-specific class resource file on the local host.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+When the resource database for a particular screen on the display
+is needed (either internally, or when
+<xref linkend='XtScreenDatabase' xrefstyle='select: title'/>
+is called),
+it is created in the following manner using the sources listed
+above in the same order:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+A temporary database, the &ldquo;server resource database&rdquo;, is
+created from the string returned by
+<function>XResourceManagerString</function>
+or, if
+<function>XResourceManagerString</function>
+returns NULL, the contents of a resource file in the user's home
+directory.  On POSIX-based systems, the usual name for this user
+preference resource file is $HOME/<function>.Xdefaults</function>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If a language procedure has been set,
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>
+first searches the command line for the option &ldquo;-xnlLanguage&rdquo;, or
+for a -xrm option that specifies the xnlLanguage/XnlLanguage resource,
+as specified by Section 2.4.
+If such a resource is found, the value is assumed to be
+entirely in XPCS, the X Portable Character Set.  If neither option is
+specified on the command line,
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>
+queries the server resource database (which is assumed to be entirely
+in XPCS) for the resource
+<emphasis remap='I'>name</emphasis><function>.xnlLanguage</function>, class <emphasis remap='I'>Class</emphasis><function>.XnlLanguage</function>
+where <emphasis remap='I'>name</emphasis>
+and <emphasis remap='I'>Class</emphasis> are the <emphasis remap='I'>application_name</emphasis> and
+<emphasis remap='I'>application_class</emphasis> specified to
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>.
+The language procedure is then invoked with
+the resource value if found, else the empty string.  The
+string returned from the language procedure is saved for all future
+references in the Intrinsics that require the per-display language string.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The screen resource database is initialized by parsing the command
+line in the manner specified by Section 2.4.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If a language procedure has not been set,
+the initial database is then queried for the resource
+<emphasis remap='I'>name</emphasis><function>.xnlLanguage</function>, class <emphasis remap='I'>Class</emphasis><function>.XnlLanguage</function>
+as specified above.
+If this database query fails, the server resource database is
+queried; if this query also fails, the language is determined from
+the environment; on POSIX-based systems, this is done by retrieving the
+value of the
+<emphasis role='strong'>LANG</emphasis>
+environment variable.  If no language string is
+found, the empty string is used.
+This language string is saved for all future references in the Intrinsics
+that require the per-display language string.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+After determining the language string, the user's environment resource
+file is then merged into the initial resource database if the file exists.
+This file is user-, host-, and process-specific and is expected to
+contain user preferences that are to override those specifications in
+the per-display and per-screen resources.
+On POSIX-based systems, the user's environment resource file name is
+specified by the value of the
+<emphasis role='strong'>XENVIRONMENT</emphasis>
+environment variable.
+If this environment variable does not exist, the user's home directory
+is searched for a file named
+<function>.Xdefaults-</function><emphasis>host</emphasis>,
+where <emphasis remap='I'>host</emphasis> is the host name of the machine on which the
+application is running.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The per-screen resource specifications are then merged into the screen
+resource database, if they exist.  These specifications are the string
+returned by
+<function>XScreenResourceString</function>
+for the respective screen and are owned entirely by the user.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Next, the server resource database created earlier is merged into the
+screen resource database.  The server property, and corresponding user
+preference file, are owned and constructed entirely by the user.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The application-specific user resource file from the local host is
+then merged into the screen resource database.
+This file contains user customizations and is stored
+in a directory owned by the user.
+Either the user or the application or both can store resource specifications
+in the file.  Each should be prepared to find and respect entries made
+by the other.
+The file name is found by calling
+<function>XrmSetDatabase</function>
+with the current screen resource database, after preserving the
+original display-associated database, then calling
+<xref linkend='XtResolvePathname' xrefstyle='select: title'/>
+with the parameters
+(<emphasis remap='I'>display</emphasis>, NULL, NULL, NULL, <emphasis remap='I'>path</emphasis>, NULL, 0, NULL),
+where <emphasis remap='I'>path</emphasis> is defined in an operating-system-specific way.
+On POSIX-based systems, <emphasis remap='I'>path</emphasis> is defined to be the value
+of the environment variable
+<emphasis role='strong'>XUSERFILESEARCHPATH</emphasis>
+if this is defined.  If
+<emphasis role='strong'>XUSERFILESEARCHPATH</emphasis>
+is not defined, an implementation-dependent default value is used.
+This default value is constrained in the following manner:
+    </para>
+    <itemizedlist spacing='compact'>
+      <listitem>
+        <para>
+If the environment variable
+<emphasis role='strong'>XAPPLRESDIR</emphasis>
+is not defined, the default
+<emphasis role='strong'>XUSERFILESEARCHPATH</emphasis>
+must contain at least six entries.  These entries must contain
+$HOME as the directory prefix, plus the following substitutions:
+        </para>
+<programlisting>
+1.  %C, %N, %L     or      %C, %N, %l, %t, %c
+2.  %C, %N, %l
+3.  %C, %N
+4.  %N, %L         or      %N, %l, %t, %c
+5.  %N, %l
+6.  %N
+</programlisting>
+        <para>
+The order of these six entries within the path must be as given above.
+The order and use of substitutions within a given entry are
+implementation-dependent.
+        </para>
+      </listitem>
+      <listitem>
+        <para> If
+<emphasis role='strong'>XAPPLRESDIR</emphasis>
+is defined, the default
+<emphasis role='strong'>XUSERFILESEARCHPATH</emphasis>
+must contain at least seven entries.  These entries must contain the
+following directory prefixes and substitutions:
+        </para>
+<programlisting>
+1. $XAPPLRESDIR    with   %C, %N, %L   or   %C, %N, %l, %t, %c
+2. $XAPPLRESDIR    with   %C, %N, %l
+3. $XAPPLRESDIR    with   %C, %N
+4. $XAPPLRESDIR    with   %N, %L       or   %N, %l, %t, %c
+5. $XAPPLRESDIR    with   %N, %l
+6. $XAPPLRESDIR    with   %N
+7. $HOME           with   %N
+</programlisting>
+        <para>
+The order of these seven entries within the path must be as given above.
+The order and use of substitutions within a given entry are
+implementation-dependent.
+        </para>
+      </listitem>
+    </itemizedlist>
+  </listitem>
+  <listitem>
+    <para>
+Last, the application-specific class resource file from the local
+host is merged into the screen resource database.
+This file is owned by the application and is usually installed in
+a system directory when the application is installed.
+It may contain sitewide customizations specified by the system manager.
+The name of the application class resource file is found by calling
+<xref linkend='XtResolvePathname' xrefstyle='select: title'/>
+with the parameters
+(<emphasis remap='I'>display</emphasis>, &ldquo;app-defaults&rdquo;, NULL, NULL, NULL, NULL, 0, NULL).
+This file is expected to be provided by the developer of the application
+and may be required for the application to function properly.
+A simple application that wants to be assured of having a minimal
+set of resources in the absence of its class resource file can declare
+fallback resource specifications with
+<xref linkend='XtAppSetFallbackResources' xrefstyle='select: title'/>.
+Note that the customization substitution string is retrieved
+dynamically by
+<xref linkend='XtResolvePathname' xrefstyle='select: title'/>
+so that the resolved file name of the application class resource file
+can be affected by any of the earlier sources for the screen resource
+database, even though the contents of the class resource file have
+lowest precedence.  After calling
+<xref linkend='XtResolvePathname' xrefstyle='select: title'/>,
+the original display-associated database is restored.
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+To obtain the resource database for a particular screen, use
+<xref linkend='XtScreenDatabase' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtScreenDatabase'>
+<funcprototype>
+  <funcdef>XrmDatabase <function>XtScreenDatabase</function></funcdef>
+      <paramdef>Screen * <parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>screen</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the screen whose resource database is to be returned.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtScreenDatabase' xrefstyle='select: title'/>
+function returns the fully merged resource database as specified above,
+associated with the specified screen.  If the specified <emphasis remap='I'>screen</emphasis>
+does not belong to a
+<function>Display</function>
+initialized by
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>,
+the results are undefined.
+</para>
+
+<para>
+To obtain the default resource database associated with a particular display, use
+<xref linkend='XtDatabase' xrefstyle='select: title'/>.
+</para>
+
+
+<funcsynopsis id='XtDatabase'>
+<funcprototype>
+  <funcdef>XrmDatabase <function>XtDatabase</function></funcdef>
+      <paramdef>Display * <parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtDatabase' xrefstyle='select: title'/>
+function is equivalent to
+<function>XrmGetDatabase</function>.
+It returns the database associated with the specified display, or
+NULL if a database has not been set.
+</para>
+
+<para>
+To specify a default set of resource values that will be used to
+initialize the resource database if no application-specific class
+resource file is found (the last of the six sources listed above),
+use
+<xref linkend='XtAppSetFallbackResources' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppSetFallbackResources'>
+<funcprototype>
+  <funcdef>void <function>XtAppSetFallbackResources</function></funcdef>
+      <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+      <paramdef>String * <parameter>specification_list</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context in which
+the fallback specifications will be used.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>specification_list</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a NULL-terminated list of
+resource specifications to preload
+the database, or NULL.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+Each entry in <emphasis remap='I'>specification_list</emphasis> points to a string in the format of
+<function>XrmPutLineResource</function>.
+Following a call to
+<xref linkend='XtAppSetFallbackResources' xrefstyle='select: title'/>,
+when a resource database is being created for a particular screen and
+the Intrinsics are not able
+to find or read an application-specific class resource file according to the
+rules given above and if <emphasis remap='I'>specification_list</emphasis> is not NULL, the
+resource specifications in <emphasis remap='I'>specification_list</emphasis> will be merged
+into the screen resource database in place of the application-specific
+class resource file.
+<xref linkend='XtAppSetFallbackResources' xrefstyle='select: title'/>
+is not
+required to copy <emphasis remap='I'>specification_list</emphasis>; the caller must ensure that the
+contents of the list and of the strings addressed by the list remain
+valid until all displays are initialized or until
+<xref linkend='XtAppSetFallbackResources' xrefstyle='select: title'/>
+is called again.  The value NULL for
+<emphasis remap='I'>specification_list</emphasis> removes any previous fallback resource specification
+for the application context.  The intended use for fallback resources
+is to provide a minimal
+number of resources that will make the application usable (or at
+least terminate with helpful diagnostic messages) when some problem
+exists in finding and loading the application defaults file.
+</para>
+</sect1>
+
+<sect1 id="Parsing_the_Command_Line">
+<title>Parsing the Command Line</title>
+<para>
+The
+<xref linkend='XtOpenDisplay' xrefstyle='select: title'/>
+function first parses the command line for the following options:
+<variablelist>
+  <varlistentry>
+    <term>-display</term>
+    <listitem>
+      <para>
+Specifies the display name for
+<function>XOpenDisplay</function>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>-name</term>
+    <listitem>
+      <para>
+Sets the resource name prefix,
+which overrides the application name passed to
+<xref linkend='XtOpenDisplay' xrefstyle='select: title'/>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>-xnllanguage</term>
+    <listitem>
+      <para>
+Specifies the initial language string for establishing locale
+and for finding application class resource files.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+
+<para>
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>
+has a table of standard command line options that are passed to
+<function>XrmParseCommand</function>
+for adding resources to the resource database,
+and it takes as a parameter additional
+application-specific resource abbreviations.
+The format of this table is described in Section 15.9 in <emphasis remap='I'>Xlib &mdash; C Language X Interface</emphasis>.
+</para>
+<programlisting>
+typedef enum {
+     XrmoptionNoArg,     /* Value is specified in OptionDescRec.value */
+     XrmoptionIsArg,     /* Value is the option string itself */
+     XrmoptionStickyArg, /* Value is characters immediately following option */
+     XrmoptionSepArg,    /* Value is next argument in argv */
+     XrmoptionResArg,    /* Use the next argument as input to XrmPutLineResource*/
+     XrmoptionSkipArg,   /* Ignore this option and the next argument in argv */
+     XrmoptionSkipNArgs, /* Ignore this option and the next */
+                         /* OptionDescRec.value arguments in argv */
+     XrmoptionSkipLine   /* Ignore this option and the rest of argv */
+} XrmOptionKind;
+
+typedef struct {
+     char *option;       /* Option name in argv */
+     char *specifier;    /* Resource name (without application name) */
+     XrmOptionKind argKind; /* Location of the resource value */
+     XPointer value;     /* Value to provide if XrmoptionNoArg */
+} XrmOptionDescRec, *XrmOptionDescList;
+</programlisting>
+<para>The standard table contains the following entries:</para>
+
+<informaltable frame='topbot'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='4' align='left' colsep='0' rowsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <colspec colwidth='1.0*' colname='c3'/>
+  <colspec colwidth='1.0*' colname='c4'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Option String</entry>
+      <entry>Resource Name</entry>
+      <entry>Argument Kind</entry>
+      <entry>Resource Value</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>-background</entry>
+      <entry>*background</entry>
+      <entry>SepArg</entry>
+      <entry>next argument</entry>
+    </row>
+    <row>
+      <entry>-bd</entry>
+      <entry>*borderColor</entry>
+      <entry>SepArg</entry>
+      <entry>next argument</entry>
+    </row>
+    <row>
+      <entry>-bg</entry>
+      <entry>*background</entry>
+      <entry>SepArg</entry>
+      <entry>next argument</entry>
+    </row>
+    <row>
+      <entry>-borderwidth</entry>
+      <entry>.borderWidth</entry>
+      <entry>SepArg</entry>
+      <entry>next argument</entry>
+    </row>
+    <row>
+      <entry>-bordercolor</entry>
+      <entry>*borderColor</entry>
+      <entry>SepArg</entry>
+      <entry>next argument</entry>
+    </row>
+    <row>
+      <entry>-bw</entry>
+      <entry>.borderWidth</entry>
+      <entry>SepArg</entry>
+      <entry>next argument</entry>
+    </row>
+    <row>
+      <entry>-display</entry>
+      <entry>.display</entry>
+      <entry>SepArg</entry>
+      <entry>next argument</entry>
+    </row>
+    <row>
+      <entry>-fg</entry>
+      <entry>*foreground</entry>
+      <entry>SepArg</entry>
+      <entry>next argument</entry>
+    </row>
+    <row>
+      <entry>-fn</entry>
+      <entry>*font</entry>
+      <entry>SepArg</entry>
+      <entry>next argument</entry>
+    </row>
+    <row>
+      <entry>-font</entry>
+      <entry>*font</entry>
+      <entry>SepArg</entry>
+      <entry>next argument</entry>
+    </row>
+    <row>
+      <entry>-foreground</entry>
+      <entry>*foreground</entry>
+      <entry>SepArg</entry>
+      <entry>next argument</entry>
+    </row>
+    <row>
+      <entry>-geometry</entry>
+      <entry>.geometry</entry>
+      <entry>SepArg</entry>
+      <entry>next argument</entry>
+    </row>
+    <row>
+      <entry>-iconic</entry>
+      <entry>.iconic</entry>
+      <entry>NoArg</entry>
+      <entry>"true"</entry>
+    </row>
+    <row>
+      <entry>-name</entry>
+      <entry>.name</entry>
+      <entry>SepArg</entry>
+      <entry>next argument</entry>
+    </row>
+    <row>
+      <entry>-reverse</entry>
+      <entry>.reverseVideo</entry>
+      <entry>NoArg</entry>
+      <entry>"on"</entry>
+    </row>
+    <row>
+      <entry>-rv</entry>
+      <entry>.reverseVideo</entry>
+      <entry>NoArg</entry>
+      <entry>"on"</entry>
+    </row>
+    <row>
+      <entry>+rv</entry>
+      <entry>.reverseVideo</entry>
+      <entry>NoArg</entry>
+      <entry>"off"</entry>
+    </row>
+    <row>
+      <entry>-selectionTimeout</entry>
+      <entry>.selectionTimeout</entry>
+      <entry>SepArg</entry>
+      <entry>next argument</entry>
+    </row>
+    <row>
+      <entry>-synchronous</entry>
+      <entry>.synchronous</entry>
+      <entry>NoArg</entry>
+      <entry>"on"</entry>
+    </row>
+    <row>
+      <entry>+synchronous</entry>
+      <entry>.synchronous</entry>
+      <entry>NoArg</entry>
+      <entry>"off"</entry>
+    </row>
+    <row>
+      <entry>-title</entry>
+      <entry>.title</entry>
+      <entry>SepArg</entry>
+      <entry>next argument</entry>
+    </row>
+    <row>
+      <entry>-xnllanguage</entry>
+      <entry>.xnlLanguage</entry>
+      <entry>SepArg</entry>
+      <entry>next argument</entry>
+    </row>
+    <row>
+      <entry>-xrm</entry>
+      <entry>next argument</entry>
+      <entry>ResArg</entry>
+      <entry>next argument</entry>
+    </row>
+    <row>
+      <entry>-xtsessionID</entry>
+      <entry>.sessionID</entry>
+      <entry>SepArg</entry>
+      <entry>next argument</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+Note that any unique abbreviation for an option name in the standard table
+or in the application table is accepted.
+</para>
+
+<para>
+If reverseVideo is
+<function>True</function>,
+the values of
+<function>XtDefaultForeground</function>
+and
+<function>XtDefaultBackground</function>
+are exchanged for all screens on the Display.
+</para>
+
+<para>
+The value of the synchronous resource specifies whether or not
+Xlib is put into synchronous mode.  If a value is found in the resource
+database during display initialization,
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>
+makes a call to
+<function>XSynchronize</function>
+for all display
+connections currently open in the application context.  Therefore,
+when multiple displays are initialized in the same application
+context, the most recent value specified for the synchronous resource
+is used for all displays in the application context.
+</para>
+
+<para>
+The value of the selectionTimeout resource applies to all displays
+opened in the same application context.  When multiple displays are
+initialized in the same application context, the most recent value
+specified is used for all displays in the application context.
+</para>
+
+<para>
+The -xrm option provides a method of setting any resource in an application.
+The next argument should be a quoted string identical in format to a line in
+the user resource file.
+For example,
+to give a red background to all command buttons in an application named
+<function>xmh</function>,
+you can start it up as
+</para>
+<programlisting>
+xmh -xrm 'xmh*Command.background: red'
+</programlisting>
+<para>
+When it parses the command line,
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>
+merges the application option table with the standard option table
+before calling the Xlib
+<function>XrmParseCommand</function>
+function.
+An entry in the application table with the same name as an entry
+in the standard table overrides the standard table entry.
+If an option name is a prefix of another option name,
+both names are kept in the merged table.
+The Intrinsics reserve all option names
+beginning with the characters &ldquo;-xt&rdquo; for future standard uses.
+</para>
+</sect1>
+
+<sect1 id="Creating_Widgets">
+<title>Creating Widgets</title>
+<para>
+The creation of widget instances is a three-phase process:
+</para>
+
+<orderedlist>
+  <listitem>
+    <para>
+The widgets are allocated and initialized with resources
+and are optionally added to the managed subset of their parent.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+All composite widgets are notified of their managed children
+in a bottom-up traversal of the widget tree.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The widgets create X windows, which then are mapped.
+    </para>
+  </listitem>
+</orderedlist>
+<para>
+To start the first phase,
+the application calls
+<xref linkend='XtCreateWidget' xrefstyle='select: title'/>
+for all its widgets and adds some (usually, most or all) of its widgets
+to their respective parents' managed set by calling
+<xref linkend='XtManageChild' xrefstyle='select: title'/>.
+To avoid an O(n<superscript>2</superscript>) creation process where each composite widget
+lays itself out each time a widget is created and managed,
+parent widgets are not notified of changes in their managed set
+during this phase.
+</para>
+
+<para>
+After all widgets have been created,
+the application calls
+<xref linkend='XtRealizeWidget' xrefstyle='select: title'/>
+with the top-level widget to execute the second and third phases.
+<xref linkend='XtRealizeWidget' xrefstyle='select: title'/>
+first recursively traverses the widget tree in a postorder (bottom-up)
+traversal and then notifies each composite widget with one
+or more managed children by means of its change_managed procedure.
+</para>
+
+<para>
+Notifying a parent about its managed set involves geometry layout and
+possibly geometry negotiation.
+A parent deals with constraints on its size imposed from above
+(for example, when a user specifies the application window size)
+and suggestions made from below (for example,
+when a primitive child computes its preferred size).
+One difference between the two can cause geometry changes to ripple
+in both directions through the widget tree.
+The parent may force some of its children to change size and position
+and may issue geometry requests to its own parent in order to better
+accommodate all its children.
+You cannot predict where anything will go on the screen
+until this process finishes.
+</para>
+
+<para>
+Consequently, in the first and second phases,
+no X windows are actually created, because it is likely
+that they will get moved around after creation.
+This avoids unnecessary requests to the X server.
+</para>
+
+<para>
+Finally,
+<xref linkend='XtRealizeWidget' xrefstyle='select: title'/>
+starts the third phase by making a preorder (top-down) traversal
+of the widget tree, allocates an X window to each widget by means of
+its realize procedure, and finally maps the widgets that are managed.
+</para>
+
+<sect2 id="Creating_and_Merging_Argument_Lists">
+<title>Creating and Merging Argument Lists</title>
+<para>
+Many Intrinsics functions may be passed pairs of resource names and
+values.
+These are passed as an arglist, a pointer to an array of
+<function>Arg</function>
+structures, which contains
+</para>
+<programlisting>
+typedef struct {
+	String name;
+	XtArgVal value;
+} Arg, *ArgList;
+</programlisting>
+<para>
+where
+<function>XtArgVal</function>
+is as defined in Section 1.5.
+</para>
+
+<para>
+If the size of the resource is less than or equal to the size of an
+<function>XtArgVal</function>,
+the resource value is stored directly in <emphasis remap='I'>value</emphasis>;
+otherwise, a pointer to it is stored in <emphasis remap='I'>value</emphasis>.
+</para>
+
+<para>
+To set values in an
+<function>ArgList</function>,
+use
+<xref linkend='XtSetArg' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtSetArg'>
+<funcprototype>
+  <funcdef>void <function>XtSetArg</function></funcdef>
+  <paramdef>Arg <parameter>arg</parameter></paramdef>
+  <paramdef>String <parameter>name</parameter></paramdef>
+  <paramdef>XtArgVal <parameter>value</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>arg</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the <emphasis remap='I'>name/value</emphasis> pair to set.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the name of the resource.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>value</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the value of the resource if it will fit in an
+<function>XtArgVal</function>,
+else the address.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtSetArg' xrefstyle='select: title'/>
+function is usually used in a highly stylized manner to
+minimize the probability of making a mistake; for example:
+</para>
+<programlisting>
+Arg args[20];
+int n;
+n = 0;
+XtSetArg(args[n], XtNheight, 100);      n++;
+XtSetArg(args[n], XtNwidth, 200);       n++;
+XtSetValues(widget, args, n);
+</programlisting>
+<para>
+Alternatively, an application can statically declare the argument list
+and use
+<xref linkend='XtNumber' xrefstyle='select: title'/>:
+</para>
+<programlisting>
+static Args args[] = {
+	{XtNheight, (XtArgVal) 100},
+	{XtNwidth, (XtArgVal) 200},
+};
+XtSetValues(Widget, args, XtNumber(args));
+</programlisting>
+<para>
+Note that you should not use expressions with side effects such as
+auto-increment or auto-decrement
+within the first argument to
+<xref linkend='XtSetArg' xrefstyle='select: title'/>.
+<xref linkend='XtSetArg' xrefstyle='select: title'/>
+can be implemented as a macro that evaluates the first argument twice.
+</para>
+
+<para>
+To merge two
+arglist arrays, use
+<xref linkend='XtMergeArgLists' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtMergeArgLists'>
+<funcprototype>
+  <funcdef>ArgList <function>XtMergeArgLists</function></funcdef>
+     <paramdef>ArgList <parameter>args1</parameter></paramdef>
+     <paramdef>Cardinal <parameter>num_args1</parameter></paramdef>
+     <paramdef>ArgList <parameter>args2</parameter></paramdef>
+     <paramdef>Cardinal <parameter>num_args2</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args1</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the first argument list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args1</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the first argument list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args2</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the second argument list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args2</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the second argument list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtMergeArgLists' xrefstyle='select: title'/>
+function allocates enough storage to hold the combined
+arglist arrays and copies them into it.
+Note that it does not check for duplicate entries.
+The length of the returned list is the sum of the lengths of the
+specified lists.
+When it is no longer needed,
+free the returned storage by using
+<xref linkend='XtFree' xrefstyle='select: title'/>.
+</para>
+
+<para>
+All Intrinsics interfaces that require
+<function>ArgList</function>
+arguments have analogs
+conforming to the ANSI C variable argument list
+(traditionally called &ldquo;varargs&rdquo;)
+calling convention.  The name of the analog is formed by prefixing
+&ldquo;Va&rdquo; to the name of the corresponding
+<function>ArgList</function>
+procedure; e.g.,
+<xref linkend='XtVaCreateWidget' xrefstyle='select: title'/>.
+Each procedure named <function>XtVa</function><emphasis remap='I'>something</emphasis> takes as its
+last arguments, in place of the corresponding
+<function>ArgList</function>/
+<function>Cardinal</function>
+parameters, a variable parameter list of resource name and
+value pairs where each name is of type
+<function>String</function>
+and each value is of type
+<function>XtArgVal</function>.
+The end of the list is identified by a <emphasis remap='I'>name</emphasis> entry
+containing NULL.  Developers writing in the C language wishing to pass
+resource name and value pairs to any of these interfaces may use the
+<function>ArgList</function>
+and varargs forms interchangeably.
+</para>
+
+<para>
+Two special names are defined for use only in varargs lists:
+<function>XtVaTypedArg</function>
+and
+<function>XtVaNestedList</function>.
+</para>
+<programlisting>
+#define XtVaTypedArg "XtVaTypedArg"
+</programlisting>
+<para>
+If the name
+<function>XtVaTypedArg</function>
+is specified in place of a resource
+name, then the following four arguments are interpreted as a
+<emphasis remap='I'>name/type/value/size</emphasis> tuple <emphasis remap='I'>where</emphasis> name is of type
+<function>String</function>,
+<emphasis remap='I'>type</emphasis> is of type
+<function>String</function>,
+<emphasis remap='I'>value</emphasis> is of type
+<function>XtArgVal</function>,
+and <emphasis remap='I'>size</emphasis> is of type int.  When a varargs list containing
+<function>XtVaTypedArg</function>
+is processed, a resource type
+conversion (see <xref linkend='Resource_Conversions' />) is performed if necessary to convert the
+value into the format required by the associated resource.  If <emphasis remap='I'>type</emphasis> is
+XtRString, then <emphasis remap='I'>value</emphasis> contains a pointer to the string and <emphasis remap='I'>size</emphasis>
+contains the number of bytes allocated, including the trailing null
+byte.  If <emphasis remap='I'>type</emphasis> is not XtRString, then <emphasis remap='I'>if</emphasis> size is
+less than or equal to
+<function>sizeof</function>(<function>XtArgVal</function>), the value should be the data cast to the type
+<function>XtArgVal</function>,
+otherwise <emphasis remap='I'>value</emphasis> is a pointer to the data.  If the type
+conversion fails for any reason, a warning message is issued and the
+list entry is skipped.
+</para>
+<programlisting>
+#define XtVaNestedList  "XtVaNestedList"
+</programlisting>
+<para>
+If the name
+<function>XtVaNestedList</function>
+is specified in place of a resource name,
+then the following argument is interpreted as an
+<function>XtVarArgsList</function>
+value, which specifies another
+varargs list that is logically inserted into the original list at the
+point of declaration.  The end of the nested list is identified with a
+name entry containing NULL.  Varargs lists may nest to any depth.
+</para>
+
+<para>
+To dynamically allocate a varargs list for use with
+<function>XtVaNestedList</function>
+in multiple calls, use
+<xref linkend='XtVaCreateArgsList' xrefstyle='select: title'/>.
+</para>
+<programlisting>
+typedef XtPointer XtVarArgsList;
+</programlisting>
+
+<funcsynopsis id='XtVaCreateArgsList'>
+<funcprototype>
+  <funcdef>XtVarArgsList <function>XtVaCreateArgsList</function></funcdef>
+     <paramdef>XtPointer <parameter>unused</parameter></paramdef>
+     <paramdef> <parameter>...</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>unused</emphasis>
+    </term>
+    <listitem>
+      <para>
+This argument is not currently used and must be specified as NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      ...
+    </term>
+    <listitem>
+      <para>
+Specifies a variable parameter list of resource
+name and value pairs.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtVaCreateArgsList' xrefstyle='select: title'/>
+function allocates memory and copies its arguments into a
+single list pointer, which may be used with
+<function>XtVaNestedList</function>.
+The end of
+both lists is identified by a <emphasis remap='I'>name</emphasis> entry containing NULL.  Any entries
+of type
+<function>XtVaTypedArg</function>
+are copied as specified without applying
+conversions.  Data passed by reference (including Strings) are not
+copied, only the pointers themselves; the caller must ensure that the
+data remain valid for the lifetime of the created varargs list.  The
+list should be freed using
+<xref linkend='XtFree' xrefstyle='select: title'/>
+when no longer needed.
+</para>
+
+<para>
+Use of resource files and of the resource database is generally
+encouraged over lengthy arglist or varargs lists whenever possible in
+order to permit modification without recompilation.
+</para>
+</sect2>
+
+<sect2 id="Creating_a_Widget_Instance">
+<title>Creating a Widget Instance</title>
+<para>
+To create an instance of a widget, use
+<xref linkend='XtCreateWidget' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtCreateWidget'>
+<funcprototype>
+  <funcdef>Widget <function>XtCreateWidget</function></funcdef>
+      <paramdef>const char * <parameter>name</parameter></paramdef>
+      <paramdef>WidgetClass <parameter>object_class</parameter></paramdef>
+      <paramdef>Widget <parameter>parent</parameter></paramdef>
+      <paramdef>ArgList <parameter>args</parameter></paramdef>
+      <paramdef>Cardinal <parameter>num_args</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the resource instance name for the created widget,
+which is used for retrieving resources
+and, for that reason, should not be the same as any other widget
+that is a child of the same parent.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>object_class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget class pointer for the created object.  Must be <emphasis role='strong'>objectClass</emphasis> or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>parent</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the parent widget.  Must be of class Object or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the argument list to override any other resource specifications.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the argument list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtCreateWidget' xrefstyle='select: title'/>
+function performs all the boilerplate operations of widget
+creation, doing the following in order:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Checks to see if the class_initialize procedure has been called for this class
+and for all superclasses and, if not, calls those necessary in a
+superclass-to-subclass order.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the specified class is not
+<function>coreWidgetClass</function>
+or a subclass thereof,
+and the parent's class is a subclass of
+<function>compositeWidgetClass</function>
+and either no extension record in
+the parent's composite class part extension field exists with the
+<emphasis remap='I'>record_type</emphasis>
+<emphasis role='strong'>NULLQUARK</emphasis>
+or the <emphasis remap='I'>accepts_objects</emphasis> field in the extension
+record is
+<function>False</function>,
+<xref linkend='XtCreateWidget' xrefstyle='select: title'/>
+issues a fatal error; see <xref linkend='Addition_of_Children_to_a_Composite_Widget_The_insert_child_Procedure' /> and <xref linkend='Nonwidget_Objects' />.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the specified class contains an extension record in the object class
+part <emphasis remap='I'>extension</emphasis> field with <emphasis remap='I'>record_type</emphasis>
+<emphasis role='strong'>NULLQUARK</emphasis>
+and the <emphasis remap='I'>allocate</emphasis> field is not NULL,
+the procedure is invoked to allocate memory
+for the widget instance.  If the parent is a member of the class
+<function>constraintWidgetClass</function>,
+the procedure also allocates memory for the
+parent's constraints and stores the address of this memory into the
+<emphasis remap='I'>constraints</emphasis> field.  If no allocate procedure is found, the Intrinsics
+allocate memory for the widget and, when applicable, the constraints,
+and initializes the <emphasis remap='I'>constraints</emphasis> field.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Initializes the Core nonresource data fields
+<emphasis remap='I'>self</emphasis>, <emphasis remap='I'>parent</emphasis>, <emphasis remap='I'>widget_class</emphasis>, <emphasis remap='I'>being_destroyed</emphasis>,
+<emphasis remap='I'>name</emphasis>, <emphasis remap='I'>managed</emphasis>, <emphasis remap='I'>window</emphasis>, <emphasis remap='I'>visible</emphasis>,
+<emphasis remap='I'>popup_list</emphasis>, and <emphasis remap='I'>num_popups</emphasis>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Initializes the resource fields (for example, <emphasis remap='I'>background_pixel</emphasis>)
+by using the
+<function>CoreClassPart</function>
+resource lists specified for this class and all superclasses.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the parent is a member of the class
+<function>constraintWidgetClass</function>,
+initializes the resource fields of the constraints record
+by using the
+<function>ConstraintClassPart</function>
+resource lists specified for the parent's class
+and all superclasses up to
+<function>constraintWidgetClass</function>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Calls the initialize procedures for the widget starting at the
+Object
+initialize procedure on down to the widget's initialize procedure.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the parent is a member of the class
+<function>constraintWidgetClass</function>,
+calls the
+<function>ConstraintClassPart</function>
+initialize procedures,
+starting at
+<function>constraintWidgetClass</function>
+on down to the parent's
+<function>ConstraintClassPart</function>
+initialize procedure.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the parent is a member of the class
+<function>compositeWidgetClass</function>,
+puts the widget into its parent's children list by calling its parent's
+insert_child procedure.
+For further information,
+see <xref linkend='Addition_of_Children_to_a_Composite_Widget_The_insert_child_Procedure' />.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+To create an instance of a widget using varargs lists, use
+<xref linkend='XtVaCreateWidget' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtVaCreateWidget'>
+<funcprototype>
+  <funcdef>Widget <function>XtVaCreateWidget</function></funcdef>
+      <paramdef>const char * <parameter>name</parameter></paramdef>
+      <paramdef>WidgetClass <parameter>object_class</parameter></paramdef>
+      <paramdef>Widget <parameter>parent</parameter></paramdef>
+      <paramdef> <parameter>...</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the resource name for the created widget.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>object_class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget class pointer for the created object.  Must be <emphasis role='strong'>objectClass</emphasis> or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>parent</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the parent widget.  Must be of class Object or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      ...
+    </term>
+    <listitem>
+      <para>
+Specifies the variable argument list to override any other
+resource specifications.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtVaCreateWidget' xrefstyle='select: title'/>
+procedure is identical in function to
+<xref linkend='XtCreateWidget' xrefstyle='select: title'/>
+with the <emphasis remap='I'>args</emphasis> and <emphasis remap='I'>num_args</emphasis> parameters replaced by a varargs list,
+as described
+in Section 2.5.1.
+</para>
+</sect2>
+
+<sect2 id="Creating_an_Application_Shell_Instance">
+<title>Creating an Application Shell Instance</title>
+<para>
+An application can have multiple top-level widgets, each of which
+specifies a unique widget tree
+that can potentially be on different screens or displays.
+An application uses
+<xref linkend='XtAppCreateShell' xrefstyle='select: title'/>
+to create independent widget trees.
+</para>
+
+<funcsynopsis id='XtAppCreateShell'>
+<funcprototype>
+  <funcdef>Widget <function>XtAppCreateShell</function></funcdef>
+      <paramdef>const char * <parameter>name</parameter></paramdef>
+      <paramdef>const char * <parameter>application_class</parameter></paramdef>
+      <paramdef>WidgetClass <parameter>widget_class</parameter></paramdef>
+      <paramdef>Display * <parameter>display</parameter></paramdef>
+      <paramdef>ArgList <parameter>args</parameter></paramdef>
+      <paramdef>Cardinal <parameter>num_args</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the instance name of the shell widget.
+If <emphasis remap='I'>name</emphasis> is NULL,
+the application name passed to
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>
+is used.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>application_class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the resource class string to be used in
+place of the widget <emphasis remap='I'>class_name</emphasis> string when
+<emphasis remap='I'>widget_class</emphasis> is
+<function>applicationShellWidgetClass</function>
+or a subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget_class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget class for the top-level widget (e.g.,
+<function>applicationShellWidgetClass ).</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display for the default screen
+and for the resource database used to retrieve
+the shell widget resources.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the argument list to override any other resource specifications.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the argument list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtAppCreateShell' xrefstyle='select: title'/>
+function
+creates a new shell widget instance as the root of a widget tree.
+The screen resource for this widget is determined by first scanning
+<emphasis remap='I'>args</emphasis> for the XtNscreen argument.  If no XtNscreen argument is
+found, the resource database associated with the default screen of
+the specified display is queried for the resource <emphasis remap='I'>name</emphasis>.screen,
+class <emphasis remap='I'>Class</emphasis>.Screen where <emphasis remap='I'>Class</emphasis> is the specified
+<emphasis remap='I'>application_class</emphasis> if <emphasis remap='I'>widget_class</emphasis> is
+<function>applicationShellWidgetClass</function>
+or a subclass thereof.  If <emphasis remap='I'>widget_class</emphasis> is not
+<function>applicationShellWidgetClass</function>
+or a subclass, <emphasis remap='I'>Class</emphasis> is the <emphasis remap='I'>class_name</emphasis>
+field from the
+<function>CoreClassPart</function>
+of the specified <emphasis remap='I'>widget_class</emphasis>.
+If this query fails, the default
+screen of the specified display is used.  Once the screen is determined,
+the resource database associated with that screen is used to retrieve
+all remaining resources for the shell widget not specified in
+<emphasis remap='I'>args</emphasis>.  The widget name and <emphasis remap='I'>Class</emphasis> as determined above are
+used as the leftmost (i.e., root) components in all fully qualified
+resource names for objects within this widget tree.
+</para>
+
+<para>
+If the specified widget class is a subclass of WMShell, the name and
+<emphasis remap='I'>Class</emphasis> as determined above will be stored into the
+<emphasis role='strong'>WM_CLASS</emphasis>
+property on the widget's window when it becomes realized.
+If the specified <emphasis remap='I'>widget_class</emphasis> is
+<function>applicationShellWidgetClass</function>
+or a subclass thereof, the
+<emphasis role='strong'>WM_COMMAND</emphasis>
+property will also be set from the values of the XtNargv and
+XtNargc resources.
+</para>
+
+<para>
+To create multiple top-level shells within a single (logical)
+application,
+you can use one of two methods:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Designate one shell as the real top-level shell and
+create the others as pop-up children of it by using
+<xref linkend='XtCreatePopupShell' xrefstyle='select: title'/>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Have all shells as pop-up children of an unrealized top-level shell.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+The first method,
+which is best used when there is a clear choice for what is the main window,
+leads to resource specifications like the following:
+</para>
+<programlisting>
+xmail.geometry:...              (the main window)
+xmail.read.geometry:...         (the read window)
+xmail.compose.geometry:...      (the compose window)
+</programlisting>
+<para>
+The second method,
+which is best if there is no main window,
+leads to resource specifications like the following:
+</para>
+<programlisting>
+xmail.headers.geometry:...      (the headers window)
+xmail.read.geometry:...         (the read window)
+xmail.compose.geometry:...      (the compose window)
+</programlisting>
+<para>
+To create a top-level widget that is the root of a widget tree using
+varargs lists, use
+<xref linkend='XtVaAppCreateShell' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtVaAppCreateShell'>
+<funcprototype>
+  <funcdef>Widget <function>XtVaAppCreateShell</function></funcdef>
+      <paramdef>const char * <parameter>name</parameter></paramdef>
+      <paramdef>const char * <parameter>application_class</parameter></paramdef>
+      <paramdef>WidgetClass <parameter>widget_class</parameter></paramdef>
+      <paramdef>Display * <parameter>display</parameter></paramdef>
+      <paramdef>...</paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the instance name of the shell widget.
+If <emphasis remap='I'>name</emphasis> is NULL,
+the application name passed to
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>
+is used.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>application_class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the resource class string to be used in
+place of the widget <emphasis remap='I'>class_name</emphasis> string when
+<emphasis remap='I'>widget_class</emphasis> is
+<function>applicationShellWidgetClass</function>
+or a subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget_class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget class for the top-level widget.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display for the default screen
+and for the resource database used to retrieve
+the shell widget resources.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      ...
+    </term>
+    <listitem>
+      <para>
+Specifies the variable argument list to override any other
+resource specifications.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtVaAppCreateShell' xrefstyle='select: title'/>
+procedure is identical in function to
+<xref linkend='XtAppCreateShell' xrefstyle='select: title'/>
+with the <emphasis remap='I'>args</emphasis> and <emphasis remap='I'>num_args</emphasis> parameters replaced by a varargs list, as
+described in Section 2.5.1.
+</para>
+</sect2>
+
+<sect2 id="Convenience_Procedure_to_Initialize_an_Application">
+<title>Convenience Procedure to Initialize an Application</title>
+<para>
+To initialize the Intrinsics internals, create an application context,
+open and initialize a display, and create the initial root shell
+instance, an application may use
+<xref linkend='XtOpenApplication' xrefstyle='select: title'/>
+or
+<xref linkend='XtVaOpenApplication' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtOpenApplication'>
+<funcprototype>
+  <funcdef>Widget <function>XtOpenApplication</function></funcdef>
+      <paramdef>XtAppContext * <parameter>app_context_return</parameter></paramdef>
+      <paramdef>const char * <parameter>application_class</parameter></paramdef>
+      <paramdef>XrmOptionDescList <parameter>options</parameter></paramdef>
+      <paramdef>Cardinal <parameter>num_options</parameter></paramdef>
+      <paramdef>int * <parameter>argc_in_out</parameter></paramdef>
+      <paramdef>char ** <parameter>argv_in_out</parameter></paramdef>
+      <paramdef>String * <parameter>fallback_resources</parameter></paramdef>
+      <paramdef>WidgetClass <parameter>widget_class</parameter></paramdef>
+      <paramdef>ArgList <parameter>args</parameter></paramdef>
+      <paramdef>Cardinal <parameter>num_args</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the application context, if non-NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>application_class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the class name of the application.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>options</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the command line options table.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_options</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in <emphasis remap='I'>options</emphasis>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>argc_in_out</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to the number of command line arguments.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>argv_in_out</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to the command line arguments.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>fallback_resources</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies resource values to be used if the application class resource
+file cannot be opened or read, or NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget_class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the class of the widget to be created.  Must be shellWidgetClass
+or a subclass.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the argument list to override any
+other resource specifications for the created shell widget.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the argument list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtOpenApplication' xrefstyle='select: title'/>
+function calls
+<xref linkend='XtToolkitInitialize' xrefstyle='select: title'/>
+followed by
+<xref linkend='XtCreateApplicationContext' xrefstyle='select: title'/>,
+then calls
+<xref linkend='XtOpenDisplay' xrefstyle='select: title'/>
+with <emphasis remap='I'>display_string</emphasis> NULL and
+<emphasis remap='I'>application_name</emphasis> NULL, and finally calls
+<xref linkend='XtAppCreateShell' xrefstyle='select: title'/>
+with <emphasis remap='I'>name</emphasis> NULL, the specified <emphasis remap='I'>widget_class</emphasis>,
+an argument list and count,
+and returns the created shell.
+The recommended <emphasis remap='I'>widget_class</emphasis> is
+<function>sessionShellWidgetClass</function>.
+The argument list and count are created by merging
+the specified <emphasis remap='I'>args</emphasis> and <emphasis remap='I'>num_args</emphasis> with a list
+containing the specified <emphasis remap='I'>argc</emphasis> and <emphasis remap='I'>argv</emphasis>.
+The modified <emphasis remap='I'>argc</emphasis> and <emphasis remap='I'>argv</emphasis> returned by
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>
+are returned in <emphasis remap='I'>argc_in_out</emphasis> and <emphasis remap='I'>argv_in_out</emphasis>.  If
+<emphasis remap='I'>app_context_return</emphasis> is not NULL, the created application context is
+also returned.  If the display specified by the command line cannot be
+opened, an error message is issued and
+<xref linkend='XtOpenApplication' xrefstyle='select: title'/>
+terminates the application.  If <emphasis remap='I'>fallback_resources</emphasis> is non-NULL,
+<xref linkend='XtAppSetFallbackResources' xrefstyle='select: title'/>
+is called with the value prior to calling
+<xref linkend='XtOpenDisplay' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtVaOpenApplication'>
+<funcprototype>
+  <funcdef>Widget <function>XtVaOpenApplication</function></funcdef>
+      <paramdef>XtAppContext * <parameter>app_context_return</parameter></paramdef>
+      <paramdef>const char * <parameter>application_class</parameter></paramdef>
+      <paramdef>XrmOptionDescList <parameter>options</parameter></paramdef>
+      <paramdef>Cardinal <parameter>num_options</parameter></paramdef>
+      <paramdef>int * <parameter>argc_in_out</parameter></paramdef>
+      <paramdef>char ** <parameter>argv_in_out</parameter></paramdef>
+      <paramdef>String * <parameter>fallback_resources</parameter></paramdef>
+      <paramdef>WidgetClass <parameter>widget_class</parameter></paramdef>
+      <paramdef>...</paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the application context, if non-NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>application_class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the class name of the application.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>options</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the command line options table.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_options</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in <emphasis remap='I'>options</emphasis>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>argc_in_out</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to the number of command line arguments.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>argv_in_out</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the command line arguments array.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>fallback_resources</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies resource values to be used if the application class
+resource file cannot be opened, or NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget_class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the class of the widget to be created.  Must be shellWidgetClass
+or a subclass.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      ...
+    </term>
+    <listitem>
+      <para>
+Specifies the variable argument list to override any other
+resource specifications for the created shell.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtVaOpenApplication' xrefstyle='select: title'/>
+procedure is identical in function to
+<xref linkend='XtOpenApplication' xrefstyle='select: title'/>
+with the <emphasis remap='I'>args</emphasis> and <emphasis remap='I'>num_args</emphasis> parameters replaced by a varargs list,
+as described
+in Section 2.5.1.
+</para>
+</sect2>
+
+<sect2 id="Widget_Instance_Allocation_The_allocate_Procedure">
+<title>Widget Instance Allocation: The allocate Procedure</title>
+<para>
+A widget class may optionally provide an instance allocation procedure
+in the
+<function>ObjectClassExtension</function>
+record.
+</para>
+
+<para>
+When the call to create a widget includes a varargs list containing
+<function>XtVaTypedArg</function>,
+these arguments will be passed to the allocation procedure in an
+<function>XtTypedArgList</function>.
+</para>
+<programlisting>
+typedef struct {
+	String name;
+	String type;
+	XtArgVal value;
+	int size;
+} XtTypedArg, *XtTypedArgList;
+</programlisting>
+<para>
+The allocate procedure pointer in the
+<function>ObjectClassExtension</function>
+record is of type
+<xref linkend='XtAllocateProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAllocateProc'>
+<funcprototype>
+  <funcdef>typedef void <function>(*XtAllocateProc)</function></funcdef>
+      <paramdef>WidgetClass <parameter>widget_class</parameter></paramdef>
+      <paramdef>Cardinal* <parameter>constraint_size</parameter></paramdef>
+      <paramdef>Cardinal* <parameter>more_bytes</parameter></paramdef>
+      <paramdef>ArgList <parameter>args</parameter></paramdef>
+      <paramdef>Cardinal* <parameter>num_args</parameter></paramdef>
+      <paramdef>XtTypedArgList <parameter>typed_args</parameter></paramdef>
+      <paramdef>Cardinal* <parameter>num_typed_args</parameter></paramdef>
+      <paramdef>Widget* <parameter>new_return</parameter></paramdef>
+      <paramdef>XtPointer* <parameter>more_bytes_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget_class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget class of the instance to allocate.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>constraint_size</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the size of the constraint record to allocate, or 0.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>more_bytes</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of auxiliary bytes of memory to allocate.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the argument list as given in the call to create the widget.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of arguments.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>typed_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the list of typed arguments given in the call to create the widget.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_typed_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of typed arguments.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>new_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns a pointer to the newly allocated instance, or NULL in case of error.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>more_bytes_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the auxiliary memory if it was requested, or NULL
+if requested and an error occurred; otherwise, unchanged.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+At widget allocation time, if an extension record with <emphasis remap='I'>record_type</emphasis>
+equal to
+<emphasis role='strong'>NULLQUARK</emphasis>
+is located through the object class part <emphasis remap='I'>extension</emphasis> field
+and the <emphasis remap='I'>allocate</emphasis> field is not NULL, the
+<xref linkend='XtAllocateProc' xrefstyle='select: title'/>
+will be invoked to allocate memory for the widget.  If no ObjectClassPart
+extension record is declared with <emphasis remap='I'>record_type equal</emphasis> to
+<emphasis role='strong'>NULLQUARK</emphasis>,
+then
+<function>XtInheritAllocate</function>
+and
+<function>XtInheritDeallocate</function>
+are assumed.
+If no
+<xref linkend='XtAllocateProc' xrefstyle='select: title'/>
+is found, the Intrinsics will allocate memory for the widget.
+</para>
+
+<para>
+An
+<xref linkend='XtAllocateProc' xrefstyle='select: title'/>
+must perform the following:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Allocate memory for the widget instance and return it in <emphasis remap='I'>new_return</emphasis>.
+The memory must be at least <emphasis remap='I'>wc-&gt;core_class.widget_size</emphasis> bytes in length,
+double-word aligned.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Initialize the <emphasis remap='I'>core.constraints</emphasis> field in the instance record to NULL
+or to point to a constraint record.  If <emphasis remap='I'>constraint_size</emphasis>
+is not 0, the procedure must allocate memory for the constraint record.
+The memory must be double-word aligned.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If <emphasis remap='I'>more_bytes</emphasis> is not 0, then the address of a block of memory
+at least <emphasis remap='I'>more_bytes</emphasis> in size, double-word aligned, must be
+returned in the <emphasis remap='I'>more_bytes_return</emphasis> parameter,
+or NULL to indicate an error.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+A class allocation procedure that envelops the allocation procedure of a
+superclass must rely on the enveloped procedure to perform the instance
+and constraint allocation.
+Allocation procedures should refrain from initializing fields in the
+widget record except to store pointers to newly allocated additional memory.
+Under no circumstances should an allocation procedure that envelopes
+its superclass allocation procedure modify fields in the
+instance part of any superclass.
+</para>
+</sect2>
+
+<sect2 id="Widget_Instance_Initialization_The_initialize_Procedure">
+<title>Widget Instance Initialization: The initialize Procedure</title>
+<para>
+The initialize procedure pointer in a widget class is of type
+<xref linkend='XtInitProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtInitProc'>
+<funcprototype>
+  <funcdef>typedef void <function>(*XtInitProc)</function></funcdef>
+  <paramdef>Widget <parameter>request</parameter></paramdef>
+  <paramdef>Widget <parameter>new</parameter></paramdef>
+  <paramdef>ArgList <parameter>args</parameter></paramdef>
+  <paramdef>Cardinal * <parameter>num_args</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>request</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a copy of the widget with resource values as requested by the
+argument list, the resource database, and the widget defaults.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>new</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget with the new values, both resource and nonresource,
+that are actually allowed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the argument list passed by the client, for
+computing derived resource values.
+If the client created the widget using a varargs form, any resources
+specified via
+<function>XtVaTypedArg</function>
+are converted to the widget representation and the list is transformed
+into the
+<function>ArgList</function>
+format.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the argument list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+An initialization procedure performs the following:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Allocates space for and copies any resources referenced by address
+that the client is allowed to free or modify
+after the widget has been created.
+For example,
+if a widget has a field that is a
+<function>String</function>,
+it may choose not to
+depend on the characters at that address remaining constant
+but dynamically allocate space for the string and copy it to the new space.
+Widgets that do not copy one or more resources referenced
+by address should clearly so state in their user documentation.
+<note><para>
+It is not necessary to allocate space for or to copy callback lists.
+</para></note>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Computes values for unspecified resource fields.
+For example, if <emphasis remap='I'>width</emphasis> and <emphasis remap='I'>height</emphasis> are zero,
+the widget should compute an appropriate width and height
+based on its other resources.
+<note><para>
+A widget may directly assign only
+its own <emphasis remap='I'>width</emphasis> and <emphasis remap='I'>height</emphasis> within the initialize, initialize_hook,
+set_values, and
+set_values_hook procedures; see <xref linkend='Geometry_Management' />.
+</para></note>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Computes values for uninitialized nonresource fields that are derived from
+resource fields.
+For example, graphics contexts (GCs) that the widget uses are derived from
+resources like background, foreground, and font.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+An initialization procedure also can check certain fields for
+internal consistency.
+For example, it makes no sense to specify a colormap for a depth
+that does not support that colormap.
+</para>
+
+<para>
+Initialization procedures are called in superclass-to-subclass order
+after all fields specified in the resource lists have been
+initialized.  The initialize procedure does not need to examine
+<emphasis remap='I'>args</emphasis> and <emphasis remap='I'>num_args</emphasis>
+if all public resources are declared in the resource list.
+Most of the initialization code for a specific widget class deals with fields
+defined in that class and not with fields defined in its superclasses.
+</para>
+
+<para>
+If a subclass does not need an initialization procedure
+because it does not need to perform any of the above operations,
+it can specify NULL for the <emphasis remap='I'>initialize</emphasis> field in the class record.
+</para>
+
+<para>
+Sometimes a subclass may want to overwrite values filled in by its
+superclass.
+In particular, size calculations of a superclass often are
+incorrect for a subclass, and in this case,
+the subclass must modify or recalculate fields declared
+and computed by its superclass.
+</para>
+
+<para>
+As an example,
+a subclass can visually surround its superclass display.
+In this case, the width and height calculated by the superclass initialize
+procedure are too small and need to be incremented by the size of the surround.
+The subclass needs to know if its superclass's size was calculated by the
+superclass or was specified explicitly.
+All widgets must place themselves into whatever size is explicitly given,
+but they should compute a reasonable size if no size is requested.
+</para>
+
+<para>
+The <emphasis remap='I'>request</emphasis> and <emphasis remap='I'>new</emphasis> arguments provide the necessary information for
+a subclass to determine the difference between an explicitly specified field
+and a field computed by a superclass.
+The <emphasis remap='I'>request</emphasis> widget is a copy of the widget as initialized by the
+arglist and resource database.
+The <emphasis remap='I'>new</emphasis> widget starts with the values in the request,
+but it has been updated by all superclass initialization procedures called
+so far.
+A subclass initialize procedure can compare these two to resolve
+any potential conflicts.
+</para>
+
+<para>
+In the above example,
+the subclass with the visual surround can see
+if the <emphasis remap='I'>width</emphasis> and <emphasis remap='I'>height</emphasis> in the <emphasis remap='I'>request</emphasis> widget are zero.
+If so,
+it adds its surround size to the <emphasis remap='I'>width</emphasis> and <emphasis remap='I'>height</emphasis>
+fields in the <emphasis remap='I'>new</emphasis> widget.
+If not, it must make do with the size originally specified.
+</para>
+
+<para>
+The <emphasis remap='I'>new</emphasis> widget will become the actual widget instance record.
+Therefore,
+the initialization procedure should do all its work on the <emphasis remap='I'>new</emphasis> widget;
+the <emphasis remap='I'>request</emphasis> widget should never be modified.
+If the initialize procedure
+needs to call any routines that operate on a widget,
+it should specify <emphasis remap='I'>new</emphasis> as the widget instance.
+</para>
+</sect2>
+
+<sect2 id="Constraint_Instance_Initialization_The_ConstraintClassPart_initialize_Procedure">
+<title>Constraint Instance Initialization: The ConstraintClassPart initialize Procedure</title>
+<para>
+The constraint initialization procedure pointer, found in the
+<function>ConstraintClassPart</function>
+<emphasis remap='I'>initialize</emphasis> field of the widget class record, is of type
+<xref linkend='XtInitProc' xrefstyle='select: title'/>.
+The values passed to the parent constraint initialization procedures
+are the same as those passed to the child's class widget initialization
+procedures.
+</para>
+
+<para>
+The <emphasis remap='I'>constraints</emphasis> field of the <emphasis remap='I'>request</emphasis> widget points to a copy of the
+constraints record as initialized by the arglist and resource database.
+</para>
+
+<para>
+The constraint initialization procedure should compute any constraint fields
+derived from constraint resources.
+It can make further changes to the <emphasis remap='I'>new</emphasis> widget to make the widget
+and any other constraint fields
+conform to the specified constraints, for example,
+changing the widget's size or position.
+</para>
+
+<para>
+If a constraint class does not need a constraint initialization procedure,
+it can specify NULL for the <emphasis remap='I'>initialize</emphasis> field of the
+<function>ConstraintClassPart</function>
+in the class record.
+</para>
+</sect2>
+
+<sect2 id="Nonwidget_Data_Initialization_The_initialize_hook_Procedure">
+<title>Nonwidget Data Initialization: The initialize_hook Procedure</title>
+<note>
+<para>
+The initialize_hook procedure is obsolete, as the same information
+is now available to the initialize procedure.  The procedure has been
+retained for those widgets that used it in previous releases.
+</para>
+</note>
+
+<para>
+The initialize_hook procedure pointer is of type
+<xref linkend='XtArgsProc' xrefstyle='select: title'/>:
+</para>
+
+<funcsynopsis id='XtArgsProc'>
+<funcprototype>
+  <funcdef>typedef void <function>(*XtArgsProc)</function></funcdef>
+  <paramdef>Widget <parameter>w</parameter></paramdef>
+  <paramdef>ArgList <parameter>args</parameter></paramdef>
+  <paramdef>Cardinal * <parameter>num_args</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the argument list passed by the client.
+If the client created the widget using a varargs form, any resources
+specified via
+<function>XtVaTypedArg</function>
+are converted to the widget representation and the list is transformed
+into the
+<function>ArgList</function>
+format.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the argument list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If this procedure is not NULL,
+it is called immediately after the corresponding initialize
+procedure or in its place if the <emphasis remap='I'>initialize</emphasis> field is NULL.
+</para>
+
+<para>
+The initialize_hook procedure allows a widget instance to initialize
+nonresource data using information from the specified argument list
+as if it were a resource.
+</para>
+</sect2>
+</sect1>
+
+<sect1 id="Realizing_Widgets">
+<title>Realizing Widgets</title>
+<para>
+To realize a widget instance, use
+<xref linkend='XtRealizeWidget' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtRealizeWidget'>
+<funcprototype>
+  <funcdef>void <function>XtRealizeWidget</function></funcdef>
+  <paramdef>Widget <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.  Must be of class Core or any subclass thereof.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If the widget is already realized,
+<xref linkend='XtRealizeWidget' xrefstyle='select: title'/>
+simply returns.
+Otherwise it performs the following:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Binds all action names in the widget's
+translation table to procedures (see <xref linkend='Action_Names_to_Procedure_Translations' />).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Makes a postorder traversal of the widget tree rooted
+at the specified widget and calls each non-NULL change_managed procedure
+of all composite widgets that have one or more managed children.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Constructs an
+<function>XSetWindowAttributes</function>
+structure filled in with information derived from the
+Core
+widget fields and calls the realize procedure for the widget,
+which adds any widget-specific attributes and creates the X window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the widget is
+not a subclass of
+<function>compositeWidgetClass</function>,
+<xref linkend='XtRealizeWidget' xrefstyle='select: title'/>
+returns; otherwise it continues and performs the following:
+    </para>
+    <itemizedlist spacing='compact'>
+      <listitem>
+        <para>
+Descends recursively to each of the widget's
+managed children and calls the realize procedures.
+Primitive widgets that instantiate children are responsible for realizing
+those children themselves.
+        </para>
+      </listitem>
+      <listitem>
+        <para>
+Maps all of the managed children windows that have <emphasis remap='I'>mapped_when_managed</emphasis>
+<function>True</function>.
+If a widget is managed but <emphasis remap='I'>mapped_when_managed</emphasis> is
+<function>False</function>,
+the widget is allocated visual space but is not displayed.
+        </para>
+      </listitem>
+    </itemizedlist>
+  </listitem>
+</itemizedlist>
+<para>
+If the widget is a top-level shell widget (that is, it has no parent), and
+<emphasis remap='I'>mapped_when_managed</emphasis> is
+<function>True</function>,
+<xref linkend='XtRealizeWidget' xrefstyle='select: title'/>
+maps the widget window.
+</para>
+
+<para>
+<xref linkend='XtCreateWidget' xrefstyle='select: title'/>,
+<xref linkend='XtVaCreateWidget' xrefstyle='select: title'/>,
+<xref linkend='XtRealizeWidget' xrefstyle='select: title'/>,
+<xref linkend='XtManageChildren' xrefstyle='select: title'/>,
+<function>XtUnmanageChildren</function>,
+<xref linkend='XtUnrealizeWidget' xrefstyle='select: title'/>,
+<xref linkend='XtSetMappedWhenManaged' xrefstyle='select: title'/>,
+and
+<function>XtDestroyWidget</function>
+maintain the following invariants:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+If a composite widget is realized, then all its managed children are realized.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If a composite widget is realized, then all its managed children that have
+<emphasis remap='I'>mapped_when_managed</emphasis>
+<function>True</function>
+are mapped.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+All Intrinsics functions and all widget routines should accept
+either realized or unrealized widgets.
+When calling the realize or change_managed
+procedures for children of a composite
+widget,
+<xref linkend='XtRealizeWidget' xrefstyle='select: title'/>
+calls the procedures in reverse order of
+appearance in the
+<function>CompositePart</function>
+<emphasis remap='I'>children</emphasis> list.  By default, this
+ordering of the realize procedures will
+result in the stacking order of any newly created subwindows being
+top-to-bottom in the order of appearance on the list, and the most
+recently created child will be at the bottom.
+</para>
+
+<para>
+To check whether or not a widget has been realized, use
+<xref linkend='XtIsRealized' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtIsRealized'>
+<funcprototype>
+  <funcdef>Boolean <function>XtIsRealized</function></funcdef>
+  <paramdef>Widget <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.  Must be of class Object or any subclass thereof.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtIsRealized' xrefstyle='select: title'/>
+function returns
+<function>True</function>
+if the widget has been realized,
+that is, if the widget has a nonzero window ID.
+If the specified object is not a widget, the state of the nearest
+widget ancestor is returned.
+</para>
+
+<para>
+Some widget procedures (for example, set_values) might wish to
+operate differently
+after the widget has been realized.
+</para>
+<sect2 id="Widget_Instance_Window_Creation_The_realize_Procedure">
+<title>Widget Instance Window Creation: The realize Procedure</title>
+<para>
+The realize procedure pointer in a widget class is of type
+<xref linkend='XtRealizeProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtRealizeProc'>
+<funcprototype>
+  <funcdef>typedef void <function>(*XtRealizeProc)</function></funcdef>
+  <paramdef>Widget <parameter>w</parameter></paramdef>
+  <paramdef>XtValueMask <parameter>value_mask</parameter></paramdef>
+  <paramdef>XSetWindowAttributes <parameter>attributes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>value_mask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies which fields in the <emphasis remap='I'>attributes</emphasis> structure are used.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>attributes</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window attributes to use in the
+<function>XCreateWindow</function>
+call.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The realize procedure must create the widget's window.
+</para>
+
+<para>
+Before calling the class realize procedure, the generic
+<xref linkend='XtRealizeWidget' xrefstyle='select: title'/>
+function fills in a mask and a corresponding
+<function>XSetWindowAttributes</function>
+structure.
+It sets the following fields in <emphasis remap='I'>attributes</emphasis> and
+corresponding bits in <emphasis remap='I'>value_mask</emphasis>
+based on information in the widget
+core
+structure:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+The <emphasis remap='I'>background_pixmap</emphasis> (or <emphasis remap='I'>background_pixel</emphasis> if <emphasis remap='I'>background_pixmap</emphasis> is
+<function>XtUnspecifiedPixmap</function>)
+is filled in from the corresponding field.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The <emphasis remap='I'>border_pixmap</emphasis> (or <emphasis remap='I'>border_pixel</emphasis> if <emphasis remap='I'>border_pixmap</emphasis> is
+<function>XtUnspecifiedPixmap</function>)
+is filled in from the corresponding field.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The <emphasis remap='I'>colormap</emphasis> is filled in from the corresponding field.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The <emphasis remap='I'>event_mask</emphasis> is filled in based on the event handlers registered,
+the event translations specified, whether the <emphasis remap='I'>expose</emphasis> field is non-NULL,
+and whether <emphasis remap='I'>visible_interest</emphasis> is
+<function>True</function>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The <emphasis remap='I'>bit_gravity</emphasis> is set to
+<function>NorthWestGravity</function>
+if the <emphasis remap='I'>expose</emphasis> field is NULL.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+These or any other fields in attributes and the corresponding bits in
+<emphasis remap='I'>value_mask</emphasis> can be set by the realize procedure.
+</para>
+
+<para>
+Note that because realize is not a chained operation,
+the widget class realize procedure must update the
+<function>XSetWindowAttributes</function>
+structure with all the appropriate fields from
+non-Core
+superclasses.
+</para>
+
+<para>
+A widget class can inherit its realize procedure from its superclass
+during class initialization.
+The realize procedure defined for
+<function>coreWidgetClass</function>
+calls
+<xref linkend='XtCreateWindow' xrefstyle='select: title'/>
+with the passed <emphasis remap='I'>value_mask</emphasis> and <emphasis remap='I'>attributes</emphasis>
+and with <emphasis remap='I'>window_class</emphasis> and <emphasis remap='I'>visual</emphasis> set to
+<function>CopyFromParent</function>.
+Both
+<function>compositeWidgetClass</function>
+and
+<function>constraintWidgetClass</function>
+inherit this realize procedure, and most new widget subclasses
+can do the same (see <xref linkend='Inheritance_of_Superclass_Operations' />).
+</para>
+
+<para>
+The most common noninherited realize procedures set <emphasis remap='I'>bit_gravity</emphasis> in the mask
+and attributes to the appropriate value and then create the window.
+For example, depending on its justification, Label might set <emphasis remap='I'>bit_gravity</emphasis> to
+<function>WestGravity</function>,
+<function>CenterGravity</function>,
+or
+<function>EastGravity</function>.
+Consequently, shrinking it would just move the bits appropriately,
+and no
+exposure
+event is needed for repainting.
+</para>
+
+<para>
+If a composite widget's children should be realized in an order other
+than that specified
+(to control the stacking order, for example),
+it should call
+<xref linkend='XtRealizeWidget' xrefstyle='select: title'/>
+on its children itself in the appropriate order from within its own
+realize procedure.
+</para>
+
+<para>
+Widgets that have children and whose class is not a subclass of
+<function>compositeWidgetClass</function>
+are responsible for calling
+<xref linkend='XtRealizeWidget' xrefstyle='select: title'/>
+on their children, usually from within the realize procedure.
+</para>
+
+<para>
+Realize procedures cannot manage or unmanage their descendants.
+</para>
+</sect2>
+
+<sect2 id="Window_Creation_Convenience_Routine">
+<title>Window Creation Convenience Routine</title>
+<para>
+Rather than call the Xlib
+<function>XCreateWindow</function>
+function explicitly, a realize procedure should normally call the Intrinsics analog
+<xref linkend='XtCreateWindow' xrefstyle='select: title'/>,
+which simplifies the creation of windows for widgets.
+</para>
+
+<funcsynopsis id='XtCreateWindow'>
+<funcprototype>
+  <funcdef>void <function>XtCreateWindow</function></funcdef>
+  <paramdef>Widget <parameter>w</parameter></paramdef>
+  <paramdef>unsigned int <parameter>window_class</parameter></paramdef>
+  <paramdef>Visual * <parameter>visual</parameter></paramdef>
+  <paramdef>XtValueMask <parameter>value_mask</parameter></paramdef>
+  <paramdef>XSetWindowAttributes * <parameter>attributes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget that defines the additional window attributed.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>window_class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the Xlib window class (for example,
+<function>InputOutput</function>,
+<function>InputOnly</function>,
+or
+<function>CopyFromParent ).</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>visual</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the visual type (usually
+<function>CopyFromParent ).</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>value_mask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies which fields in the <emphasis remap='I'>attributes</emphasis> structure are used.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>attributes</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the window attributes to use in the
+<function>XCreateWindow</function>
+call.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtCreateWindow' xrefstyle='select: title'/>
+function calls the Xlib
+<function>XCreateWindow</function>
+function with values from the widget structure and the passed parameters.
+Then, it assigns the created window to the widget's <emphasis remap='I'>window</emphasis> field.
+</para>
+
+<para>
+<xref linkend='XtCreateWindow' xrefstyle='select: title'/>
+evaluates the following fields of the widget core
+structure: <emphasis remap='I'>depth</emphasis>, <emphasis remap='I'>screen</emphasis>, <emphasis remap='I'>parent-&gt;core.window</emphasis>, <emphasis remap='I'>x</emphasis>,
+<emphasis remap='I'>y</emphasis>, <emphasis remap='I'>width</emphasis>, <emphasis remap='I'>height</emphasis>, and
+<emphasis remap='I'>border_width</emphasis>.
+</para>
+</sect2>
+</sect1>
+
+<sect1 id="Obtaining_Window_Information_from_a_Widget">
+<title>Obtaining Window Information from a Widget</title>
+<para>
+The
+Core
+widget class definition contains the screen and window ids.
+The <emphasis remap='I'>window</emphasis> field may be NULL for a while
+(see <xref linkend='Creating_Widgets' /> and <xref linkend='Realizing_Widgets' />).
+</para>
+
+<para>
+The display pointer, the parent widget, screen pointer,
+and window of a widget are available to the widget writer by means of macros
+and to the application writer by means of functions.
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Display * <function>XtDisplay</function></funcdef>
+  <paramdef>Widget <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.  Must be of class Core or any subclass thereof.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XtDisplay</function>
+returns the display pointer for the specified widget.
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Widget <function>XtParent</function></funcdef>
+  <paramdef>Widget <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.  Must be of class Object or any subclass thereof.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<function>XtParent</function>
+returns the parent object for the specified widget. The returned object
+will be of class Object or a subclass.
+</para>
+
+<funcsynopsis id='XtScreen'>
+<funcprototype>
+  <funcdef>Screen *<function>XtScreen</function></funcdef>
+  <paramdef>Widget <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.  Must be of class Core or any subclass thereof.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtScreen' xrefstyle='select: title'/>
+returns the screen pointer for the specified widget.
+</para>
+
+<funcsynopsis id='XtWindow'>
+<funcprototype>
+  <funcdef>Window <function>XtWindow</function></funcdef>
+  <paramdef>Widget <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.  Must be of class Core or any subclass thereof.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtWindow' xrefstyle='select: title'/>
+returns the window of the specified widget.
+</para>
+
+<para>
+The display pointer, screen pointer, and window of a widget or
+of the closest widget ancestor of a nonwidget object are available
+by means of
+<xref linkend='XtDisplayOfObject' xrefstyle='select: title'/>,
+<xref linkend='XtScreenOfObject' xrefstyle='select: title'/>,
+and
+<xref linkend='XtWindowOfObject' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtDisplayOfObject'>
+<funcprototype>
+  <funcdef>Display *<function>XtDisplayOfObject</function></funcdef>
+  <paramdef>Widget <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>object</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the object.  Must be of class Object or any subclass thereof.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtDisplayOfObject' xrefstyle='select: title'/>
+is identical in function to
+<function>XtDisplay</function>
+if the object is a widget; otherwise
+<xref linkend='XtDisplayOfObject' xrefstyle='select: title'/>
+returns the display
+pointer for the nearest ancestor of <emphasis remap='I'>object</emphasis> that is of class
+Widget or a subclass thereof.
+</para>
+
+<funcsynopsis id='XtScreenOfObject'>
+<funcprototype>
+  <funcdef>Screen *<function>XtScreenOfObject</function></funcdef>
+  <paramdef>Widget <parameter>object</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>object</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the object.  Must be of class Object or any subclass thereof.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtScreenOfObject' xrefstyle='select: title'/>
+is identical in function to
+<xref linkend='XtScreen' xrefstyle='select: title'/>
+if the object is a widget; otherwise
+<xref linkend='XtScreenOfObject' xrefstyle='select: title'/>
+returns the screen pointer
+for the nearest ancestor of <emphasis remap='I'>object</emphasis> that is of class
+Widget or a subclass thereof.
+</para>
+
+<funcsynopsis id='XtWindowOfObject'>
+<funcprototype>
+  <funcdef>Window <function>XtWindowOfObject</function></funcdef>
+  <paramdef>Widget <parameter>object</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>object</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the object.  Must be of class Object or any subclass thereof.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtWindowOfObject' xrefstyle='select: title'/>
+is identical in function to
+<xref linkend='XtWindow' xrefstyle='select: title'/>
+if the object is a widget; otherwise
+<xref linkend='XtWindowOfObject' xrefstyle='select: title'/>
+returns the window for the nearest ancestor of <emphasis remap='I'>object</emphasis> that is of class
+Widget or a subclass thereof.
+</para>
+
+<para>
+To retrieve the instance name of an object, use
+<xref linkend='XtName' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtName'>
+<funcprototype>
+  <funcdef>String <function>XtName</function></funcdef>
+  <paramdef>Widget <parameter>object</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>object</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the object whose name is desired.  Must be of class Object or any subclass thereof.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtName' xrefstyle='select: title'/>
+returns a pointer to the instance name of the specified object.
+The storage is owned by the Intrinsics and must not be modified.  The
+name is not qualified by the names of any of the object's ancestors.
+</para>
+
+<para>
+Several window attributes are locally cached in the widget instance.
+Thus, they can be set by the resource manager and
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+as well as used by routines that derive structures from these values
+(for example, <emphasis remap='I'>depth</emphasis> for deriving pixmaps,
+<emphasis remap='I'>background_pixel</emphasis> for deriving GCs, and so on) or in the
+<xref linkend='XtCreateWindow' xrefstyle='select: title'/>
+call.
+</para>
+
+<para>
+The <emphasis remap='I'>x</emphasis>, <emphasis remap='I'>y</emphasis>, <emphasis remap='I'>width</emphasis>, <emphasis remap='I'>height</emphasis>, and <emphasis remap='I'>border_width</emphasis>
+window attributes are available to
+geometry managers.
+These fields are maintained synchronously inside the Intrinsics.
+When an
+<function>XConfigureWindow</function>
+is issued by the Intrinsics on the widget's window (on request of its parent),
+these values are updated immediately rather than some time later
+when the server generates a
+<function>ConfigureNotify</function>
+event.
+(In fact, most widgets do not select
+<function>SubstructureNotify</function>
+events.)
+This ensures that all geometry calculations are based on the internally
+consistent toolkit world rather than on either
+an inconsistent world updated by asynchronous
+<function>ConfigureNotify</function>
+events or a consistent, but slow, world in which geometry managers
+ask the server
+for window sizes whenever they need to lay out their managed children
+(see <xref linkend='Geometry_Management' />).
+</para>
+<sect2 id="Unrealizing_Widgets">
+<title>Unrealizing Widgets</title>
+<para>
+To destroy the windows associated with a widget and its
+non-pop-up descendants, use
+<xref linkend='XtUnrealizeWidget' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtUnrealizeWidget'>
+<funcprototype>
+  <funcdef>void <function>XtUnrealizeWidget</function></funcdef>
+  <paramdef>Widget <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.  Must be of class Core or any subclass thereof.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If the widget is currently unrealized,
+<xref linkend='XtUnrealizeWidget' xrefstyle='select: title'/>
+simply returns.  Otherwise it performs the following:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Unmanages the widget if the widget is managed.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Makes a postorder (child-to-parent) traversal of the widget tree
+rooted at the specified widget and, for each widget that has
+declared a callback list resource named &ldquo;unrealizeCallback&rdquo;, executes the
+procedures on the
+XtNunrealizeCallback
+list.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Destroys the widget's window and any subwindows by calling
+<function>XDestroyWindow</function>
+with the specified widget's <emphasis remap='I'>window</emphasis> field.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+Any events in the queue or which arrive following a call to
+<xref linkend='XtUnrealizeWidget' xrefstyle='select: title'/>
+will be dispatched as if the window(s) of the
+unrealized widget(s) had never existed.
+</para>
+</sect2>
+</sect1>
+
+<sect1 id="Destroying_Widgets">
+<title>Destroying Widgets</title>
+<para>
+The Intrinsics provide support
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+To destroy all the pop-up children of the widget being destroyed
+and destroy all children of composite widgets.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+To remove (and unmap) the widget from its parent.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+To call the callback procedures that have been registered to trigger
+when the widget is destroyed.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+To minimize the number of things a widget has to deallocate when destroyed.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+To minimize the number of
+<function>XDestroyWindow</function>
+calls when destroying a widget tree.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+To destroy a widget instance, use
+<xref linkend='XtDestroyWidget' xrefstyle='select: title'/>.
+</para>
+
+
+<funcsynopsis id='XtDestroyWidget'>
+<funcprototype>
+  <funcdef>void <function>XtDestroyWidget</function></funcdef>
+  <paramdef>Widget <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.  Must be of class Object or any subclass thereof.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtDestroyWidget' xrefstyle='select: title'/>
+function provides the only method of destroying a widget,
+including widgets that need to destroy themselves.
+It can be called at any time,
+including from an application callback routine of the widget being destroyed.
+This requires a two-phase destroy process in order to avoid dangling
+references to destroyed widgets.
+</para>
+
+<para>
+In phase 1,
+<xref linkend='XtDestroyWidget' xrefstyle='select: title'/>
+performs the following:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+If the <emphasis remap='I'>being_destroyed</emphasis> field of the widget is
+<function>True</function>,
+it returns immediately.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Recursively descends the widget tree and
+sets the <emphasis remap='I'>being_destroyed</emphasis> field to
+<function>True</function>
+for the widget and all normal and pop-up children.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Adds the widget to a list of widgets (the destroy list) that should be
+destroyed when it is safe to do so.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+Entries on the destroy list satisfy the invariant that
+if w2 occurs after w1 on the destroy list, then w2 is not a descendent,
+either normal or pop-up, of w1.
+</para>
+
+<para>
+Phase 2 occurs when all procedures that should execute as a result of
+the current event have been called, including all procedures registered with
+the event and translation managers,
+that is, when the current invocation of
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>
+is about to return, or immediately if not in
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>.
+</para>
+
+<para>
+In phase 2,
+<xref linkend='XtDestroyWidget' xrefstyle='select: title'/>
+performs the following on each entry in the destroy list in the order
+specified:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+If the widget is not a pop-up child and the widget's parent is a subclass of
+<function>compositeWidgetClass</function>,
+and if the parent is not being destroyed,
+it calls
+<xref linkend='XtUnmanageChild' xrefstyle='select: title'/>
+on the widget and then calls the widget's parent's delete_child procedure
+(see <xref linkend='Deletion_of_Children_The_delete_child_Procedure' />).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Calls the destroy callback procedures registered on the widget
+and all normal and pop-up descendants in postorder (it calls child
+callbacks before parent callbacks).
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+The
+<xref linkend='XtDestroyWidget' xrefstyle='select: title'/>
+function then makes second traversal of the widget and all normal
+and pop-up descendants to perform the following three items on each
+widget in postorder:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+If the widget is not a pop-up child and the widget's parent is a subclass of
+<function>constraintWidgetClass</function>,
+it calls the
+<function>ConstraintClassPart</function>
+destroy procedure for the parent,
+then for the parent's superclass,
+until finally it calls the
+<function>ConstraintClassPart</function>
+destroy procedure for
+<function>constraintWidgetClass</function>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Calls the
+<function>CoreClassPart</function>
+destroy procedure declared in the widget class,
+then the destroy procedure declared in its superclass,
+until finally it calls the destroy procedure declared in the Object
+class record.  Callback lists are deallocated.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the widget class object class part contains an
+<function>ObjectClassExtension</function>
+record with the record_type
+<emphasis role='strong'>NULLQUARK</emphasis>
+and the <emphasis remap='I'>deallocate</emphasis> field is not NULL,
+calls the deallocate procedure to deallocate the instance and if one
+exists, the constraint record.  Otherwise, the Intrinsics will deallocate
+the widget instance record and if one exists, the constraint record.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Calls
+<function>XDestroyWindow</function>
+if the specified widget is realized (that is, has an X window).
+The server recursively destroys all normal descendant windows.
+(Windows of realized pop-up Shell children, and their
+descendants, are destroyed by a shell class destroy procedure.)
+    </para>
+  </listitem>
+</itemizedlist>
+<sect2 id="Adding_and_Removing_Destroy_Callbacks">
+<title>Adding and Removing Destroy Callbacks</title>
+<para>
+When an application needs to perform additional processing during the
+destruction of a widget,
+it should register a destroy callback procedure for the widget.
+The destroy callback procedures use the mechanism described in
+<xref linkend='Callbacks' />.
+The destroy callback list is identified by the resource name
+XtNdestroyCallback.
+</para>
+
+<para>
+For example, the following adds an application-supplied destroy callback
+procedure <emphasis remap='I'>ClientDestroy</emphasis> with client data to a widget by calling
+<xref linkend='XtAddCallback' xrefstyle='select: title'/>.
+</para>
+
+<programlisting>
+XtAddCallback(<emphasis remap='I'>w</emphasis>, XtNdestroyCallback, <emphasis remap='I'>ClientDestroy</emphasis>, <emphasis remap='I'>client_data</emphasis>)
+</programlisting>
+
+<para>
+Similarly, the following removes the application-supplied destroy callback
+procedure <emphasis remap='I'>ClientDestroy</emphasis> by calling
+<xref linkend='XtRemoveCallback' xrefstyle='select: title'/>.
+</para>
+
+<programlisting>
+XtRemoveCallback(<emphasis remap='I'>w</emphasis>, XtNdestroyCallback, <emphasis remap='I'>ClientDestroy</emphasis>, <emphasis remap='I'>client_data</emphasis>)
+</programlisting>
+<para>
+The <emphasis remap='I'>ClientDestroy</emphasis> argument is of type
+<xref linkend='XtCallbackProc' xrefstyle='select: title'/>;
+see <xref linkend='Using_Callback_Procedure_and_Callback_List_Definitions' />.
+</para>
+</sect2>
+
+<sect2 id="Dynamic_Data_Deallocation_The_destroy_Procedure">
+<title>Dynamic Data Deallocation: The destroy Procedure</title>
+<para>
+The destroy procedure pointers in the
+<function>ObjectClassPart</function>,
+<function>RectObjClassPart</function>,
+and
+<function>CoreClassPart</function>
+structures are of type
+<xref linkend='XtWidgetProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtWidgetProc'>
+<funcprototype>
+  <funcdef>typedef void <function>XtWidgetProc</function></funcdef>
+  <paramdef>Widget <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget being destroyed.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The destroy procedures are called in subclass-to-superclass order.
+Therefore, a widget's destroy procedure should deallocate only storage
+that is specific to the subclass and should ignore the storage
+allocated by any of its superclasses.
+The destroy procedure should deallocate only resources that have been
+explicitly created by the subclass.
+Any resource that was obtained from the resource database
+or passed in an argument list was not created by the widget
+and therefore should not be destroyed by it.
+If a widget does not need to deallocate any storage,
+the destroy procedure entry in its class record can be NULL.
+</para>
+
+<para>
+Deallocating storage includes, but is not limited to,
+the following steps:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Calling
+<xref linkend='XtFree' xrefstyle='select: title'/>
+on dynamic storage allocated with
+<xref linkend='XtMalloc' xrefstyle='select: title'/>,
+<xref linkend='XtCalloc' xrefstyle='select: title'/>,
+and so on.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Calling
+<function>XFreePixmap</function>
+on pixmaps created with direct X calls.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Calling
+<xref linkend='XtReleaseGC' xrefstyle='select: title'/>
+on GCs allocated with
+<xref linkend='XtGetGC' xrefstyle='select: title'/>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Calling
+<function>XFreeGC</function>
+on GCs allocated with direct X calls.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Calling
+<xref linkend='XtRemoveEventHandler' xrefstyle='select: title'/>
+on event handlers added to other widgets.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Calling
+<xref linkend='XtRemoveTimeOut' xrefstyle='select: title'/>
+on timers created with
+<xref linkend='XtAppAddTimeOut' xrefstyle='select: title'/>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Calling
+<xref linkend='XtDestroyWidget' xrefstyle='select: title'/>
+for each child if the widget has children
+and is not a subclass of
+<function>compositeWidgetClass</function>.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+During destroy phase 2 for each widget, the Intrinsics remove the widget
+from the modal cascade, unregister all event handlers, remove all key,
+keyboard, button, and pointer grabs and remove all callback procedures
+registered on the widget.  Any outstanding selection transfers will time out.
+</para>
+</sect2>
+
+<sect2 id="Dynamic_Constraint_Data_Deallocation_The_ConstraintClassPart_destroy_Procedure">
+<title>Dynamic Constraint Data Deallocation: The ConstraintClassPart destroy Procedure</title>
+<para>
+The constraint destroy procedure identified in the
+<function>ConstraintClassPart</function>
+<function>constraintWidgetClass</function>.
+This constraint destroy procedure pointer is of type
+<xref linkend='XtWidgetProc' xrefstyle='select: title'/>.
+The constraint destroy procedures are called in subclass-to-superclass order,
+starting at the class of the widget's parent and ending at
+<function>constraintWidgetClass</function>.
+Therefore, a parent's constraint destroy procedure should deallocate only
+storage that is specific to the constraint subclass
+and not storage allocated by any of its superclasses.
+</para>
+
+<para>
+If a parent does not need to deallocate any constraint storage,
+the constraint destroy procedure entry
+in its class record can be NULL.
+</para>
+</sect2>
+
+<sect2 id="Widget_Instance_Deallocation_The_deallocate_Procedure">
+<title>Widget Instance Deallocation: The deallocate Procedure</title>
+<para>
+The deallocate procedure pointer in the
+<function>ObjectClassExtension</function>
+record is of type
+<function>XtDeallocateProc</function>.
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>typedef void <function>(*XtDeallocateProc)</function></funcdef>
+  <paramdef>Widget <parameter>widget</parameter></paramdef>
+  <paramdef>XtPointer <parameter>more_bytes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget being destroyed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>more_bytes</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the auxiliary memory received from the corresponding allocator
+along with the widget, or NULL.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+When a widget is destroyed, if an
+<function>ObjectClassExtension</function>
+record exists in the object class part <emphasis remap='I'>extension</emphasis> field
+with <emphasis remap='I'>record_type</emphasis>
+<emphasis role='strong'>NULLQUARK</emphasis>
+and the <emphasis remap='I'>deallocate</emphasis> field is not NULL, the
+<function>XtDeallocateProc</function>
+will be called.
+If no ObjectClassPart extension record is declared with <emphasis remap='I'>record_type</emphasis>
+equal to
+<emphasis role='strong'>NULLQUARK</emphasis>,
+then
+<function>XtInheritAllocate</function>
+and
+<function>XtInheritDeallocate</function>
+are assumed.
+The responsibilities of the deallocate procedure are to deallocate the
+memory specified by <emphasis remap='I'>more_bytes</emphasis> if it is not NULL,
+to deallocate the constraints record as specified by the
+widget's <emphasis remap='I'>core.constraints</emphasis> field if it is
+not NULL, and to deallocate the widget instance itself.
+</para>
+
+<para>
+If no
+<function>XtDeallocateProc</function>
+is found, it is assumed that the Intrinsics
+originally allocated the memory and is responsible for freeing it.
+</para>
+</sect2>
+</sect1>
+
+<sect1 id="Exiting_from_an_Application">
+<title>Exiting from an Application</title>
+<para>
+All X Toolkit applications should terminate
+by calling
+<xref linkend='XtDestroyApplicationContext' xrefstyle='select: title'/>
+and then exiting
+using the
+standard method for their operating system (typically, by calling
+<function>exit</function>
+for POSIX-based systems).
+The quickest way to make the windows disappear while exiting is to call
+<xref linkend='XtUnmapWidget' xrefstyle='select: title'/>
+on each top-level shell widget.
+The Intrinsics have no resources beyond those in the program image,
+and the X server will free its resources when its connection
+to the application is broken.
+</para>
+
+<para>
+Depending upon the widget set in use, it may be necessary to explicitly
+destroy individual widgets or widget trees with
+<xref linkend='XtDestroyWidget' xrefstyle='select: title'/>
+before calling
+<xref linkend='XtDestroyApplicationContext' xrefstyle='select: title'/>
+in order to ensure that any
+required widget cleanup is properly executed.  The application developer
+must refer to the widget documentation to learn if a widget needs to
+perform cleanup beyond that performed automatically by the
+operating system.  If the client is a session participant
+(see <xref linkend='Session_Participation' />), then the client may wish to resign from the session
+before exiting.  See <xref linkend='Resigning_from_a_Session' /> for details.
+</para>
+</sect1>
+</chapter>
Index: lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs/CH04.xml
===================================================================
--- lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs/CH04.xml	(nonexistent)
+++ lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs/CH04.xml	(revision 5)
@@ -0,0 +1,2498 @@
+<?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">
+
+<chapter id='Shell_Widgets'>
+<title>Shell Widgets</title>
+
+<para>
+Shell widgets hold an application's top-level widgets to allow them to
+communicate with the window manager and session manager.
+Shells have been designed to be as nearly invisible as possible.
+Clients have to create them,
+but they should never have to worry about their sizes.
+</para>
+
+<para>
+If a shell widget is resized from the outside (typically by a window manager),
+the shell widget also resizes its managed child widget automatically.
+Similarly, if the shell's child widget needs to change size,
+it can make a geometry request to the shell,
+and the shell negotiates the size change with the outer environment.
+Clients should never attempt to change the size of their shells directly.
+</para>
+
+<para>The five types of public shells are:</para>
+<variablelist>
+  <varlistentry>
+    <term>OverrideShell</term>
+    <listitem>
+      <para>
+      Used for shell windows that completely bypass the window manager
+      (for example, pop-up menu shells).
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>TransientShell</term>
+      <listitem>
+        <para>Used for shell windows that have the
+      <emphasis role='strong'>WM_TRANSIENT_FOR</emphasis>
+      property set. The effect of this property is dependent upon the
+      window manager being used.
+        </para>
+      </listitem>
+  </varlistentry>
+  <varlistentry>
+      <term>TopLevelShell</term>
+      <listitem>
+        <para>Used for normal top-level windows
+      (for example, any additional top-level widgets an application needs).
+        </para>
+      </listitem>
+  </varlistentry>
+  <varlistentry>
+      <term>ApplicationShell</term>
+      <listitem>
+        <para>Formerly used for the single main top-level window that
+      the window manager identifies as an application instance and
+      made obsolete by SessionShell.
+        </para>
+      </listitem>
+  </varlistentry>
+  <varlistentry>
+      <term>SessionShell</term>
+      <listitem>
+        <para>
+      Used for the single main top-level window that
+      the window manager identifies as an application instance and
+      that interacts with the session manager.
+        </para>
+      </listitem>
+  </varlistentry>
+</variablelist>
+
+<sect1 id="Shell_Widget_Definitions">
+<title>Shell Widget Definitions</title>
+<para>
+Widgets negotiate their size and position with their parent widget,
+that is, the widget that directly contains them.
+Widgets at the top of the hierarchy do not have parent widgets.
+Instead, they must deal with the outside world.
+To provide for this,
+each top-level widget is encapsulated in a special widget, called a
+shell widget.
+</para>
+
+<para>
+Shell
+widgets, whose class is a subclass of the
+Composite class,
+encapsulate other widgets and can allow a widget to avoid the
+geometry clipping imposed by the parent-child window relationship.
+They also can provide a layer of communication with the window manager.
+</para>
+
+<para>The eight different types of shells are:</para>
+<variablelist>
+  <varlistentry>
+    <term>Shell</term>
+    <listitem>
+      <para>The base class for shell widgets; provides the
+      fields needed for all types of shells.  Shell
+      is a direct subclass of
+      <emphasis role='strong'>compositeWidgetClass</emphasis>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>OverrideShell</term>
+    <listitem>
+      <para>A subclass of Shell; used for shell windows that completely
+      bypass the window manager.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>WMShell</term>
+    <listitem>
+      <para>A subclass of Shell; contains fields needed by the
+      common window manager protocol.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>VendorShell</term>
+    <listitem>
+      <para>A subclass of WMShell; contains fields used by
+      vendor-specific window managers.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>TransientShell</term>
+    <listitem>
+      <para>A subclass of VendorShell; used for shell windows that
+      desire the <emphasis role='strong'>WM_TRANSIENT_FOR</emphasis>
+      property.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>TopLevelShell</term>
+    <listitem>
+      <para>A subclass of VendorShell; used for normal top-level windows.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>ApplicationShell</term>
+      <listitem>
+      <para>A subclass of TopLevelShell; may be used for an application's additional
+      root windows.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>SessionShell</term>
+    <listitem>
+      <para>A subclass of ApplicationShell; used for an application's
+      main root window.</para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+Note that the classes
+Shell,
+WMShell,
+and
+VendorShell
+are internal and should not be instantiated or subclassed.
+Only
+OverrrideShell,
+TransientShell,
+TopLevelShell,
+ApplicationShell,
+and
+SessionShell
+are intended for public use.
+</para>
+
+<sect2 id="ShellClassPart_Definitions">
+<title>ShellClassPart Definitions</title>
+<para>
+Only the Shell
+class has additional class fields, which are all contained in the
+<function>ShellClassExtensionRec</function>.
+None of the other Shell classes have any additional class fields:
+</para>
+
+<programlisting>
+typedef struct {
+        XtPointer extension;
+} ShellClassPart, OverrideShellClassPart,
+WMShellClassPart, VendorShellClassPart, TransientShellClassPart,
+TopLevelShellClassPart, ApplicationShellClassPart, SessionShellClassPart;
+</programlisting>
+
+<para>The full Shell class record definitions are:</para>
+
+<programlisting>
+typedef struct _ShellClassRec {
+        CoreClassPart           core_class;
+        CompositeClassPart      composite_class;
+        ShellClassPart          shell_class;
+} ShellClassRec;
+</programlisting>
+
+<programlisting>
+typedef struct {    <lineannotation>See <xref linkend='Class_Extension_Records' /></lineannotation>
+        XtPointer               next_extension;
+        XrmQuark                record_type;
+        long                    version;
+        Cardinal                record_size;
+        XtGeometryHandler root_geometry_manager; See below
+} ShellClassExtensionRec, *ShellClassExtension;
+</programlisting>
+
+<programlisting>
+typedef struct _OverrideShellClassRec {
+        CoreClassPart           core_class;
+        CompositeClassPart      composite_class;
+        ShellClassPart          shell_class;
+        OverrideShellClassPart  override_shell_class;
+} OverrideShellClassRec;
+</programlisting>
+
+<programlisting>
+typedef struct _WMShellClassRec {
+        CoreClassPart           core_class;
+        CompositeClassPart      composite_class;
+        ShellClassPart          shell_class;
+        WMShellClassPart        wm_shell_class;
+} WMShellClassRec;
+</programlisting>
+
+<programlisting>
+typedef struct _VendorShellClassRec {
+        CoreClassPart           core_class;
+        CompositeClassPart      composite_class;
+        ShellClassPart          shell_class;
+        WMShellClassPart        wm_shell_class;
+        VendorShellClassPart    vendor_shell_class;
+} VendorShellClassRec;
+</programlisting>
+
+<programlisting>
+typedef struct _TransientShellClassRec {
+        CoreClassPart           core_class;
+        CompositeClassPart      composite_class;
+        ShellClassPart          shell_class;
+        WMShellClassPart        wm_shell_class;
+        VendorShellClassPart    vendor_shell_class;
+        TransientShellClassPart transient_shell_class;
+} TransientShellClassRec;
+</programlisting>
+
+<programlisting>
+typedef struct _TopLevelShellClassRec {
+        CoreClassPart           core_class;
+        CompositeClassPart      composite_class;
+        ShellClassPart          shell_class;
+        WMShellClassPart        wm_shell_class;
+        VendorShellClassPart    vendor_shell_class;
+        TopLevelShellClassPart  top_level_shell_class;
+} TopLevelShellClassRec;
+</programlisting>
+
+<programlisting>
+typedef struct _ApplicationShellClassRec {
+        CoreClassPart           core_class;
+        CompositeClassPart      composite_class;
+        ShellClassPart          shell_class;
+        WMShellClassPart        wm_shell_class;
+        VendorShellClassPart    vendor_shell_class;
+        TopLevelShellClassPart  top_level_shell_class;
+        ApplicationShellClassPart application_shell_class;
+} ApplicationShellClassRec;
+</programlisting>
+
+<programlisting>
+typedef struct _SessionShellClassRec {
+        CoreClassPart           core_class;
+        CompositeClassPart      composite_class;
+        ShellClassPart          shell_class;
+        WMShellClassPart        wm_shell_class;
+        VendorShellClassPart    vendor_shell_class;
+        TopLevelShellClassPart  top_level_shell_class;
+        ApplicationShellClassPart application_shell_class;
+        SessionShellClassPart   session_shell_class;
+} SessionShellClassRec;
+</programlisting>
+
+<para>
+The single occurrences of the class records and pointers for creating
+instances of shells are:
+</para>
+
+<programlisting>
+extern ShellClassRec            shellClassRec;
+extern OverrideShellClassRec    overrideShellClassRec;
+extern WMShellClassRec          wmShellClassRec;
+extern VendorShellClassRec      vendorShellClassRec;
+extern TransientShellClassRec   transientShellClassRec;
+extern TopLevelShellClassRec    topLevelShellClassRec;
+extern ApplicationShellClassRec applicationShellClassRec;
+extern SessionShellClassRec     sessionShellClassRec;
+extern WidgetClass              shellWidgetClass;
+extern WidgetClass              overrideShellWidgetClass;
+extern WidgetClass              wmShellWidgetClass;
+extern WidgetClass              vendorShellWidgetClass;
+extern WidgetClass              transientShellWidgetClass;
+extern WidgetClass              topLevelShellWidgetClass;
+extern WidgetClass              applicationShellWidgetClass;
+extern WidgetClass              sessionShellWidgetClass;
+</programlisting>
+
+<para>
+The following opaque types and opaque variables are defined
+for generic operations on widgets whose class is a subclass of
+Shell.
+</para>
+
+<informaltable frame='topbot'>
+  <?dbfo keep-together="auto" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Types</entry>
+      <entry>Variables</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry><emphasis role='strong'>ShellWidget</emphasis></entry>
+      <entry><emphasis role='strong'>shellWidgetClass</emphasis></entry>
+    </row>
+    <row>
+      <entry><emphasis role='strong'>OverrideShellWidget</emphasis></entry>
+      <entry><emphasis role='strong'>overrideShellWidgetClass</emphasis></entry>
+    </row>
+    <row>
+      <entry><emphasis role='strong'>WMShellWidget</emphasis></entry>
+      <entry><emphasis role='strong'>wmShellWidgetClass</emphasis></entry>
+    </row>
+    <row>
+      <entry><emphasis role='strong'>VendorShellWidget</emphasis></entry>
+      <entry><emphasis role='strong'>vendorShellWidgetClass</emphasis></entry>
+    </row>
+    <row>
+      <entry><emphasis role='strong'>TransientShellWidget</emphasis></entry>
+      <entry><emphasis role='strong'>transientShellWidgetClass</emphasis></entry>
+    </row>
+    <row>
+      <entry><emphasis role='strong'>TopLevelShellWidget</emphasis></entry>
+      <entry><emphasis role='strong'>topLevelShellWidgetClass</emphasis></entry>
+    </row>
+    <row>
+      <entry><emphasis role='strong'>ApplicationShellWidget</emphasis></entry>
+      <entry><emphasis role='strong'>applicationShellWidgetClass</emphasis></entry>
+    </row>
+    <row>
+      <entry><emphasis role='strong'>SessionShellWidget</emphasis></entry>
+      <entry><emphasis role='strong'>sessionShellWidgetClass</emphasis></entry>
+    </row>
+    <row>
+      <entry><emphasis role='strong'>ShellWidgetClass</emphasis></entry>
+      <entry></entry>
+    </row>
+    <row>
+      <entry><emphasis role='strong'>OverrideShellWidgetClass</emphasis></entry>
+      <entry></entry>
+    </row>
+    <row>
+      <entry><emphasis role='strong'>WMShellWidgetClass</emphasis></entry>
+      <entry></entry>
+    </row>
+    <row>
+      <entry><emphasis role='strong'>VendorShellWidgetClass</emphasis></entry>
+      <entry></entry>
+    </row>
+    <row>
+      <entry><emphasis role='strong'>TransientShellWidgetClass</emphasis></entry>
+      <entry></entry>
+    </row>
+    <row>
+      <entry><emphasis role='strong'>TopLevelShellWidgetClass</emphasis></entry>
+      <entry></entry>
+    </row>
+    <row>
+      <entry><emphasis role='strong'>ApplicationShellWidgetClass</emphasis></entry>
+      <entry></entry>
+    </row>
+    <row>
+      <entry><emphasis role='strong'>SessionShellWidgetClass</emphasis></entry>
+      <entry></entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The declarations for all Intrinsics-defined shells except
+VendorShell appear in
+<filename class="headerfile">Shell.h</filename>
+and
+<filename class="headerfile">ShellP.h</filename>.
+VendorShell has separate public and private .h files which are included by
+<filename class="headerfile">Shell.h</filename>
+and
+<filename class="headerfile">ShellP.h</filename>.
+</para>
+
+<para>
+<filename class="headerfile">Shell.h</filename>
+uses incomplete structure definitions to ensure that the
+compiler catches attempts to access private data in any of the Shell
+instance or class data structures.
+</para>
+
+<para>
+The symbolic constant for the
+<function>ShellClassExtension</function>
+version identifier is
+<function>XtShellExtensionVersion</function>
+(see <xref linkend='Class_Extension_Records' />).
+</para>
+
+<para>
+The root_geometry_manager procedure acts as
+the parent geometry manager for geometry requests made by shell
+widgets.  When a shell widget calls either
+<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>
+or
+<xref linkend='XtMakeResizeRequest' xrefstyle='select: title'/>,
+the root_geometry_manager procedure is invoked to
+negotiate the new geometry with the window manager.  If the window
+manager permits the new geometry, the root_geometry_manager
+procedure should
+return
+<function>XtGeometryYes</function>;
+if the window manager denies the geometry
+request or does not change the window geometry within some timeout
+interval (equal to <emphasis remap='I'>wm_timeout</emphasis> in the case of WMShells), the
+root_geometry_manager procedure should return
+<function>XtGeometryNo</function>.
+If the window manager makes some alternative geometry change, the
+root_geometry_manager procedure may return either
+<function>XtGeometryNo</function>
+and handle the new geometry as a resize or
+<function>XtGeometryAlmost</function>
+in anticipation that the shell will accept the compromise.  If the
+compromise is not accepted, the new size must then be handled as a
+resize.  Subclasses of
+Shell
+that wish to provide their own
+root_geometry_manager procedures are strongly encouraged to use enveloping to
+invoke their superclass's root_geometry_manager procedure under most
+situations, as the window manager interaction may be very complex.
+</para>
+
+<para>
+If no
+<function>ShellClassPart</function>
+extension record is declared with <emphasis remap='I'>record_type</emphasis>
+equal to
+<emphasis role='strong'>NULLQUARK</emphasis>,
+then
+<function>XtInheritRootGeometryManager</function>
+is assumed.
+</para>
+</sect2>
+
+<sect2 id="ShellPart_Definition">
+<title>ShellPart Definition</title>
+<para>
+The various shell widgets have the following additional instance
+fields defined in
+their widget records:
+</para>
+
+<programlisting>
+typedef struct {
+        String                  geometry;
+        XtCreatePopupChildProc  create_popup_child_proc;
+        XtGrabKind              grab_kind;
+        Boolean                 spring_loaded;
+        Boolean                 popped_up;
+        Boolean                 allow_shell_resize;
+        Boolean                 client_specified;
+        Boolean                 save_under;
+        Boolean                 override_redirect;
+        XtCallbackList          popup_callback;
+        XtCallbackList          popdown_callback;
+        Visual *                visual;
+} ShellPart;
+</programlisting>
+
+<programlisting>
+typedef struct {
+        int     empty;
+} OverrideShellPart;
+</programlisting>
+
+<programlisting>
+typedef struct {
+        String                  title;
+        int                     wm_timeout;
+        Boolean                 wait_for_wm;
+        Boolean                 transient;
+        Boolean                 urgency;
+        Widget                  client_leader;
+        String                  window_role;
+        struct _OldXSizeHints {
+                long            flags;
+                int             x, y;
+                int             width, height;
+                int             min_width, min_height;
+                int             max_width, max_height;
+                int             width_inc, height_inc;
+                struct {
+                        int     x;
+                        int     y;
+                } min_aspect, max_aspect;
+        } size_hints;
+        XWMHints                wm_hints;
+        int                     base_width, base_height, win_gravity;
+        Atom                    title_encoding;
+} WMShellPart;
+</programlisting>
+
+<programlisting>
+typedef struct {
+        int     vendor_specific;
+} VendorShellPart;
+</programlisting>
+
+<programlisting>
+typedef struct {
+        Widget  transient_for;
+} TransientShellPart;
+typedef struct {
+        String  icon_name;
+        Boolean iconic;
+        Atom    icon_name_encoding;
+} TopLevelShellPart;
+</programlisting>
+
+<programlisting>
+typedef struct {
+        char *  class;
+        XrmClass        xrm_class;
+        int     argc;
+        char ** argv;
+} ApplicationShellPart;
+</programlisting>
+
+<programlisting>
+typedef struct {
+        SmcConn         connection;
+        String          session_id;
+        String *        restart_command;
+        String *        clone_command;
+        String *        discard_command;
+        String *        resign_command;
+        String *        shutdown_command;
+        String *        environment;
+        String          current_dir;
+        String          program_path;
+        unsigned char   restart_style;
+        Boolean         join_session;
+        XtCallbackList  save_callbacks;
+        XtCallbackList  interact_callbacks;
+        XtCallbackList  cancel_callbacks;
+        XtCallbackList  save_complete_callbacks;
+        XtCallbackList  die_callbacks;
+        XtCallbackList  error_callbacks;
+} SessionShellPart;
+</programlisting>
+
+<para>
+The full shell widget instance record definitions are:
+</para>
+
+<programlisting>
+typedef struct {
+        CorePart        core;
+        CompositePart   composite;
+        ShellPart       shell;
+} ShellRec, *ShellWidget;
+</programlisting>
+
+<programlisting>
+typedef struct {
+        CorePart        core;
+        CompositePart   composite;
+        ShellPart       shell;
+        OverrideShellPart override;
+} OverrideShellRec, *OverrideShellWidget;
+</programlisting>
+
+<programlisting>
+typedef struct {
+        CorePart        core;
+        CompositePart   composite;
+        ShellPart       shell;
+        WMShellPart     wm;
+} WMShellRec, *WMShellWidget;
+</programlisting>
+
+<programlisting>
+typedef struct {
+        CorePart        core;
+        CompositePart   composite;
+        ShellPart       shell;
+        WMShellPart     wm;
+        VendorShellPart vendor;
+} VendorShellRec, *VendorShellWidget;
+</programlisting>
+
+<programlisting>
+typedef struct {
+        CorePart        core;
+        CompositePart   composite;
+        ShellPart       shell;
+        WMShellPart     wm;
+        VendorShellPart vendor;
+        TransientShellPart transient;
+} TransientShellRec, *TransientShellWidget;
+</programlisting>
+
+<programlisting>
+typedef struct {
+        CorePart                core;
+        CompositePart           composite;
+        ShellPart               shell;
+        WMShellPart             wm;
+        VendorShellPart         vendor;
+        TopLevelShellPart       topLevel;
+} TopLevelShellRec, *TopLevelShellWidget;
+</programlisting>
+
+<programlisting>
+typedef  struct {
+        CorePart                core;
+        CompositePart           composite;
+        ShellPart               shell;
+        WMShellPart             wm;
+        VendorShellPart         vendor;
+        TopLevelShellPart       topLevel;
+        ApplicationShellPart    application;
+} ApplicationShellRec, *ApplicationShellWidget;
+</programlisting>
+
+<programlisting>
+typedef  struct {
+        CorePart                core;
+        CompositePart           composite;
+        ShellPart               shell;
+        WMShellPart             wm;
+        VendorShellPart         vendor;
+        TopLevelShellPart       topLevel;
+        ApplicationShellPart    application;
+        SessionShellPart        session;
+} SessionShellRec, *SessionShellWidget;
+</programlisting>
+
+</sect2>
+
+<sect2 id="Shell_Resources">
+<title>Shell Resources</title>
+<para>
+The resource names, classes, and representation types specified in
+the
+<function>shellClassRec</function>
+resource list are:
+</para>
+
+<informaltable frame='topbot'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='3' align='left' rowsep='0' colsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <colspec colwidth='1.0*' colname='c3'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Name</entry>
+      <entry>Class</entry>
+      <entry>Representation</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>XtNallowShellResize</entry>
+      <entry>XtCAllowShellResize</entry>
+      <entry>XtRBoolean</entry>
+    </row>
+    <row>
+      <entry>XtNcreatePopupChildProc</entry>
+      <entry>XtCCreatePopupChildProc</entry>
+      <entry>XtRFunction</entry>
+    </row>
+    <row>
+      <entry>XtNgeometry</entry>
+      <entry>XtCGeometry</entry>
+      <entry>XtRString</entry>
+    </row>
+    <row>
+      <entry>XtNoverrideRedirect</entry>
+      <entry>XtCOverrideRedirect</entry>
+      <entry>XtRBoolean</entry>
+    </row>
+    <row>
+      <entry>XtNpopdownCallback</entry>
+      <entry>XtCCallback</entry>
+      <entry>XtRCallback</entry>
+    </row>
+    <row>
+      <entry>XtNpopupCallback</entry>
+      <entry>XtCCallback</entry>
+      <entry>XtRCallback</entry>
+    </row>
+    <row>
+      <entry>XtNsaveUnder</entry>
+      <entry>XtCSaveUnder</entry>
+      <entry>XtRBoolean</entry>
+    </row>
+    <row>
+      <entry>XtNvisual</entry>
+      <entry>XtCVisual</entry>
+      <entry>XtRVisual</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+OverrideShell
+declares no additional resources beyond those defined by
+Shell.
+</para>
+
+<para>
+The resource names, classes, and representation types specified in
+the
+<function>wmShellClassRec</function>
+resource list are:
+</para>
+
+<informaltable frame='topbot'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='3' align='left' rowsep='0' colsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <colspec colwidth='1.0*' colname='c3'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Name</entry>
+      <entry>Class</entry>
+      <entry>Representation</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>XtNbaseHeight</entry>
+      <entry>XtCBaseHeight</entry>
+      <entry>XtRInt</entry>
+    </row>
+    <row>
+      <entry>XtNbaseWidth</entry>
+      <entry>XtCBaseWidth</entry>
+      <entry>XtRInt</entry>
+    </row>
+    <row>
+      <entry>XtNclientLeader</entry>
+      <entry>XtCClientLeader</entry>
+      <entry>XtRWidget</entry>
+    </row>
+    <row>
+      <entry>XtNheightInc</entry>
+      <entry>XtCHeightInc</entry>
+      <entry>XtRInt</entry>
+    </row>
+    <row>
+      <entry>XtNiconMask</entry>
+      <entry>XtCIconMask</entry>
+      <entry>XtRBitmap</entry>
+    </row>
+    <row>
+      <entry>XtNiconPixmap</entry>
+      <entry>XtCIconPixmap</entry>
+      <entry>XtRBitmap</entry>
+    </row>
+    <row>
+      <entry>XtNiconWindow</entry>
+      <entry>XtCIconWindow</entry>
+      <entry>XtRWindow</entry>
+    </row>
+    <row>
+      <entry>XtNiconX</entry>
+      <entry>XtCIconX</entry>
+      <entry>XtRInt</entry>
+    </row>
+    <row>
+      <entry>XtNiconY</entry>
+      <entry>XtCIconY</entry>
+      <entry>XtRInt</entry>
+    </row>
+    <row>
+      <entry>XtNinitialState</entry>
+      <entry>XtCInitialState</entry>
+      <entry>XtRInitialState</entry>
+    </row>
+    <row>
+      <entry>XtNinput</entry>
+      <entry>XtCInput</entry>
+      <entry>XtRBool</entry>
+    </row>
+    <row>
+      <entry>XtNmaxAspectX</entry>
+      <entry>XtCMaxAspectX</entry>
+      <entry>XtRInt</entry>
+    </row>
+    <row>
+      <entry>XtNmaxAspectY</entry>
+      <entry>XtCMaxAspectY</entry>
+      <entry>XtRInt</entry>
+    </row>
+    <row>
+      <entry>XtNmaxHeight</entry>
+      <entry>XtCMaxHeight</entry>
+      <entry>XtRInt</entry>
+    </row>
+    <row>
+      <entry>XtNmaxWidth</entry>
+      <entry>XtCMaxWidth</entry>
+      <entry>XtRInt</entry>
+    </row>
+    <row>
+      <entry>XtNminAspectX</entry>
+      <entry>XtCMinAspectX</entry>
+      <entry>XtRInt</entry>
+    </row>
+    <row>
+      <entry>XtNminAspectY</entry>
+      <entry>XtCMinAspectY</entry>
+      <entry>XtRInt</entry>
+    </row>
+    <row>
+      <entry>XtNminHeight</entry>
+      <entry>XtCMinHeight</entry>
+      <entry>XtRInt</entry>
+    </row>
+    <row>
+      <entry>XtNminWidth</entry>
+      <entry>XtCMinWidth</entry>
+      <entry>XtRInt</entry>
+    </row>
+    <row>
+      <entry>XtNtitle</entry>
+      <entry>XtCTitle</entry>
+      <entry>XtRString</entry>
+    </row>
+    <row>
+      <entry>XtNtitleEncoding</entry>
+      <entry>XtCTitleEncoding</entry>
+      <entry>XtRAtom</entry>
+    </row>
+    <row>
+      <entry>XtNtransient</entry>
+      <entry>XtCTransient</entry>
+      <entry>XtRBoolean</entry>
+    </row>
+    <row>
+      <entry>XtNwaitforwm, XtNwaitForWm</entry>
+      <entry>XtCWaitforwm, XtCWaitForWm</entry>
+      <entry>XtRBoolean</entry>
+    </row>
+    <row>
+      <entry>XtNwidthInc</entry>
+      <entry>XtCWidthInc</entry>
+      <entry>XtRInt</entry>
+    </row>
+    <row>
+      <entry>XtNwindowRole</entry>
+      <entry>XtCWindowRole</entry>
+      <entry>XtRString</entry>
+    </row>
+    <row>
+      <entry>XtNwinGravity</entry>
+      <entry>XtCWinGravity</entry>
+      <entry>XtRGravity</entry>
+    </row>
+    <row>
+      <entry>XtNwindowGroup</entry>
+      <entry>XtCWindowGroup</entry>
+      <entry>XtRWindow</entry>
+    </row>
+    <row>
+      <entry>XtNwmTimeout</entry>
+      <entry>XtCWmTimeout</entry>
+      <entry>XtRInt</entry>
+    </row>
+    <row>
+      <entry>XtNurgency</entry>
+      <entry>XtCUrgency</entry>
+      <entry>XtRBoolean</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The class resource list for
+VendorShell
+is implementation-defined.
+</para>
+
+<para>
+The resource names, classes, and representation types that are specified in the
+<function>transientShellClassRec</function>
+resource list are:
+</para>
+
+<informaltable frame='topbot'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <colspec colwidth='1.0*' colname='c3'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Name</entry>
+      <entry>Class</entry>
+      <entry>Representation</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>XtNtransientFor</entry>
+      <entry>XtCTransientFor</entry>
+      <entry>XtRWidget</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The resource names, classes, and representation types that are specified in the
+<function>topLevelShellClassRec</function>
+resource list are:
+</para>
+
+<informaltable frame='topbot'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <colspec colwidth='1.0*' colname='c3'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Name</entry>
+      <entry>Class</entry>
+      <entry>Representation</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>XtNiconName</entry>
+      <entry>XtCIconName</entry>
+      <entry>XtRString</entry>
+    </row>
+    <row>
+      <entry>XtNiconNameEncoding</entry>
+      <entry>XtCIconNameEncoding</entry>
+      <entry>XtRAtom</entry>
+    </row>
+    <row>
+      <entry>XtNiconic</entry>
+      <entry>XtCIconic</entry>
+      <entry>XtRBoolean</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The resource names, classes, and representation types that are specified in the
+<function>applicationShellClassRec</function>
+resource list are:
+</para>
+
+<informaltable frame='topbot'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <colspec colwidth='1.0*' colname='c3'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Name</entry>
+      <entry>Class</entry>
+      <entry>Representation</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>XtNargc</entry>
+      <entry>XtCArgc</entry>
+      <entry>XtRInt</entry>
+    </row>
+    <row>
+      <entry>XtNargv</entry>
+      <entry>XtCArgv</entry>
+      <entry>XtRStringArray</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The resource names, classes, and representation types that are specified
+in the
+<function>sessionShellClassRec</function>
+resource list are:
+</para>
+
+<informaltable frame='topbot'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <colspec colwidth='1.0*' colname='c3'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Name</entry>
+      <entry>Class</entry>
+      <entry>Representation</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>XtNcancelCallback</entry>
+      <entry>XtCCallback</entry>
+      <entry>XtRCallback</entry>
+    </row>
+    <row>
+      <entry>XtNcloneCommand</entry>
+      <entry>XtCCloneCommand</entry>
+      <entry>XtRCommandArgArray</entry>
+    </row>
+    <row>
+      <entry>XtNconnection</entry>
+      <entry>XtCConnection</entry>
+      <entry>XtRSmcConn</entry>
+    </row>
+    <row>
+      <entry>XtNcurrentDirectory</entry>
+      <entry>XtCCurrentDirectory</entry>
+      <entry>XtRDirectoryString</entry>
+    </row>
+    <row>
+      <entry>XtNdieCallback</entry>
+      <entry>XtCCallback</entry>
+      <entry>XtRCallback</entry>
+    </row>
+    <row>
+      <entry>XtNdiscardCommand</entry>
+      <entry>XtCDiscardCommand</entry>
+      <entry>XtRCommandArgArray</entry>
+    </row>
+    <row>
+      <entry>XtNenvironment</entry>
+      <entry>XtCEnvironment</entry>
+      <entry>XtREnvironmentArray</entry>
+    </row>
+    <row>
+      <entry>XtNerrorCallback</entry>
+      <entry>XtCCallback</entry>
+      <entry>XtRCallback</entry>
+    </row>
+    <row>
+      <entry>XtNinteractCallback</entry>
+      <entry>XtCCallback</entry>
+      <entry>XtRCallback</entry>
+    </row>
+    <row>
+      <entry>XtNjoinSession</entry>
+      <entry>XtCJoinSession</entry>
+      <entry>XtRBoolean</entry>
+    </row>
+    <row>
+      <entry>XtNprogramPath</entry>
+      <entry>XtCProgramPath</entry>
+      <entry>XtRString</entry>
+    </row>
+    <row>
+      <entry>XtNresignCommand</entry>
+      <entry>XtCResignCommand</entry>
+      <entry>XtRCommandArgArray</entry>
+    </row>
+    <row>
+      <entry>XtNrestartCommand</entry>
+      <entry>XtCRestartCommand</entry>
+      <entry>XtRCommandArgArray</entry>
+    </row>
+    <row>
+      <entry>XtNrestartStyle</entry>
+      <entry>XtCRestartStyle</entry>
+      <entry>XtRRestartStyle</entry>
+    </row>
+    <row>
+      <entry>XtNsaveCallback</entry>
+      <entry>XtCCallback</entry>
+      <entry>XtRCallback</entry>
+    </row>
+    <row>
+      <entry>XtNsaveCompleteCallback</entry>
+      <entry>XtCCallback</entry>
+      <entry>XtRCallback</entry>
+    </row>
+    <row>
+      <entry>XtNsessionID</entry>
+      <entry>XtCSessionID</entry>
+      <entry>XtRString</entry>
+    </row>
+    <row>
+      <entry>XtNshutdownCommand</entry>
+      <entry>XtCShutdownCommand</entry>
+      <entry>XtRCommandArgArray</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+</sect2>
+
+<sect2 id="ShellPart_Default_Values">
+<title>ShellPart Default Values</title>
+<para>
+The default values for fields common to all classes of public shells
+(filled in by the
+Shell
+resource lists and the
+Shell
+initialize procedures) are:
+</para>
+
+<informaltable frame='topbot'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Field</entry>
+      <entry>Default Value</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>geometry</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>create_popup_child_proc</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>grab_kind</entry>
+      <entry>(none)</entry>
+    </row>
+    <row>
+      <entry>spring_loaded</entry>
+      <entry>(none)</entry>
+    </row>
+    <row>
+      <entry>popped_up</entry>
+      <entry><function>False</function></entry>
+    </row>
+    <row>
+      <entry>allow_shell_resize</entry>
+      <entry><function>False</function></entry>
+    </row>
+    <row>
+      <entry>client_specified</entry>
+      <entry>(internal)</entry>
+    </row>
+    <row>
+      <entry>save_under</entry>
+      <entry><function>True</function>
+      for OverrideShell and TransientShell,
+      <emphasis role='strong'>False</emphasis>
+      otherwise</entry>
+    </row>
+    <row>
+      <entry>override_redirect</entry>
+      <entry><function>True</function>
+      for OverrideShell,
+      <function>False</function>
+      otherwise</entry>
+    </row>
+    <row>
+      <entry>popup_callback</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>popdown_callback</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>visual</entry>
+      <entry><function>CopyFromParent</function></entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The <emphasis remap='I'>geometry</emphasis> field specifies the size and position
+and is usually given only on a command line or in a defaults file.
+If the <emphasis remap='I'>geometry</emphasis> field is non-NULL when
+a widget of class WMShell
+is realized, the geometry specification is parsed using
+<function>XWMGeometry</function>
+with a default geometry
+string constructed from the values of <emphasis remap='I'>x</emphasis>, <emphasis remap='I'>y</emphasis>, <emphasis remap='I'>width</emphasis>,
+<emphasis remap='I'>height</emphasis>, <emphasis remap='I'>width_inc</emphasis>,
+and <emphasis remap='I'>height_inc</emphasis> and the size and position flags in the window manager
+size hints are set.  If the geometry specifies an x or y position,
+then
+<function>USPosition</function>
+is set.  If the geometry specifies a width or height, then
+<function>USSize</function>
+is set.  Any fields in the geometry specification
+override the corresponding values in the
+Core <emphasis remap='I'>x</emphasis>, <emphasis remap='I'>y</emphasis>, <emphasis remap='I'>width</emphasis>, and <emphasis remap='I'>height</emphasis> fields.
+If <emphasis remap='I'>geometry</emphasis> is NULL or contains only a partial specification, then the
+Core <emphasis remap='I'>x</emphasis>, <emphasis remap='I'>y</emphasis>, <emphasis remap='I'>width</emphasis>, and <emphasis remap='I'>height</emphasis> fields are used and
+<function>PPosition</function>
+and
+<function>PSize</function>
+are set as appropriate.
+The geometry string is not copied by any of the Intrinsics
+Shell classes; a client specifying the string in an arglist
+or varargs list must ensure
+that the value remains valid until the shell widget is realized.
+For further information on the geometry string, see
+Parsing the Window Geometry
+in Xlib &mdash; C Language X Interface.
+</para>
+
+<para>
+The <emphasis remap='I'>create_popup_child_proc</emphasis> procedure is called by the
+<xref linkend='XtPopup' xrefstyle='select: title'/>
+procedure and may remain NULL.
+The <emphasis remap='I'>grab_kind</emphasis>, <emphasis remap='I'>spring_loaded</emphasis>,
+and <emphasis remap='I'>popped_up</emphasis> fields maintain widget
+state information as described under
+<xref linkend='XtPopup' xrefstyle='select: title'/>,
+<xref linkend='XtMenuPopup' xrefstyle='select: title'/>,
+<xref linkend='XtPopdown' xrefstyle='select: title'/>,
+and
+<xref linkend='XtMenuPopdown' xrefstyle='select: title'/>.
+The <emphasis remap='I'>allow_shell_resize</emphasis> field controls whether the widget contained
+by the shell is allowed to try to resize itself.
+If allow_shell_resize is
+<function>False</function>,
+any geometry requests made by the child will always return
+<function>XtGeometryNo</function>
+without interacting with the window manager.
+Setting <emphasis remap='I'>save_under</emphasis>
+<function>True</function>
+instructs the server to attempt
+to save the contents of windows obscured by the shell when it is mapped
+and to restore those contents automatically when the shell is unmapped.
+It is useful for pop-up menus.
+Setting <emphasis remap='I'>override_redirect</emphasis>
+<function>True</function>
+determines
+whether the window manager can intercede when the shell window
+is mapped.
+For further information on override_redirect,
+see Window Attributes in
+Xlib &mdash; C Language X Interface
+and
+Pop-up Windows and
+Redirection of Operations in the
+Inter-Client Communication Conventions Manual.
+The pop-up and pop-down callbacks are called during
+<xref linkend='XtPopup' xrefstyle='select: title'/>
+and
+<xref linkend='XtPopdown' xrefstyle='select: title'/>.
+The default value of the <emphasis remap='I'>visual</emphasis> resource is the symbolic value
+<function>CopyFromParent</function>.
+The Intrinsics do not need to query the parent's visual type when the
+default value is used; if a client using
+<xref linkend='XtGetValues' xrefstyle='select: title'/>
+to examine the visual type receives the value
+<function>CopyFromParent</function>,
+it must then use
+<function>XGetWindowAttributes</function>
+if it needs the actual visual type.
+</para>
+
+<para>
+The default values for Shell fields in
+WMShell
+and its subclasses are:
+</para>
+
+<informaltable frame='topbot'>
+  <?dbfo keep-together="auto" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Field</entry>
+      <entry>Default Value</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>title</entry>
+      <entry>Icon name, if specified, otherwise the application's name</entry>
+    </row>
+    <row>
+      <entry>wm_timeout</entry>
+      <entry>Five seconds, in units of milliseconds</entry>
+    </row>
+    <row>
+      <entry>wait_for_wm</entry>
+      <entry><function>True</function></entry>
+    </row>
+    <row>
+      <entry>transient</entry>
+      <entry><function>True</function>
+      for TransientShell,
+      <function>False</function>
+      otherwise</entry>
+    </row>
+    <row>
+      <entry>urgency</entry>
+      <entry><function>False</function></entry>
+    </row>
+    <row>
+      <entry>client_leader</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>window_role</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>min_width</entry>
+      <entry><function>XtUnspecifiedShellInt</function></entry>
+    </row>
+    <row>
+      <entry>min_height</entry>
+      <entry><function>XtUnspecifiedShellInt</function></entry>
+    </row>
+    <row>
+      <entry>max_width</entry>
+      <entry><function>XtUnspecifiedShellInt</function></entry>
+    </row>
+    <row>
+      <entry>max_height</entry>
+      <entry><function>XtUnspecifiedShellInt</function></entry>
+    </row>
+    <row>
+      <entry>width_inc</entry>
+      <entry><function>XtUnspecifiedShellInt</function></entry>
+    </row>
+    <row>
+      <entry>height_inc</entry>
+      <entry><function>XtUnspecifiedShellInt</function></entry>
+    </row>
+    <row>
+      <entry>min_aspect_x</entry>
+      <entry><function>XtUnspecifiedShellInt</function></entry>
+    </row>
+    <row>
+      <entry>min_aspect_y</entry>
+      <entry><function>XtUnspecifiedShellInt</function></entry>
+    </row>
+    <row>
+      <entry>max_aspect_x</entry>
+      <entry><function>XtUnspecifiedShellInt</function></entry>
+    </row>
+    <row>
+      <entry>max_aspect_y</entry>
+      <entry><function>XtUnspecifiedShellInt</function></entry>
+    </row>
+    <row>
+      <entry>input</entry>
+      <entry><function>False</function></entry>
+    </row>
+    <row>
+      <entry>initial_state</entry>
+      <entry>Normal</entry>
+    </row>
+    <row>
+      <entry>icon_pixmap</entry>
+      <entry>None</entry>
+    </row>
+    <row>
+      <entry>icon_window</entry>
+      <entry>None</entry>
+    </row>
+    <row>
+      <entry>icon_x</entry>
+      <entry><function>XtUnspecifiedShellInt</function></entry>
+    </row>
+    <row>
+      <entry>icon_y</entry>
+      <entry><function>XtUnspecifiedShellInt</function></entry>
+    </row>
+    <row>
+      <entry>icon_mask</entry>
+      <entry>None</entry>
+    </row>
+    <row>
+      <entry>window_group</entry>
+      <entry><function>XtUnspecifiedWindow</function></entry>
+    </row>
+    <row>
+      <entry>base_width</entry>
+      <entry><function>XtUnspecifiedShellInt</function></entry>
+    </row>
+    <row>
+      <entry>base_height</entry>
+      <entry><function>XtUnspecifiedShellInt</function></entry>
+    </row>
+    <row>
+      <entry>win_gravity</entry>
+      <entry><function>XtUnspecifiedShellInt</function></entry>
+    </row>
+    <row>
+      <entry>title_encoding</entry>
+      <entry>See text</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The <emphasis remap='I'>title</emphasis> and
+<emphasis remap='I'>title_encoding</emphasis> fields are stored in the
+<emphasis role='strong'>WM_NAME</emphasis>
+property on the shell's window by the WMShell realize procedure.
+If the <emphasis remap='I'>title_encoding</emphasis> field is
+<function>None</function>,
+the <emphasis remap='I'>title</emphasis> string is assumed to be in the encoding of the current
+locale and the encoding of the
+<emphasis role='strong'>WM_NAME</emphasis>
+property is set to
+<function>XStdICCTextStyle</function>.
+If a language procedure has not been set
+the default value of <emphasis remap='I'>title_encoding</emphasis> is
+<emphasis role='strong'>XA_STRING</emphasis>, otherwise the default value is
+<function>None</function>.
+The <emphasis remap='I'>wm_timeout</emphasis> field specifies, in milliseconds,
+the amount of time a shell is to wait for
+confirmation of a geometry request to the window manager.
+If none comes back within that time,
+the shell assumes the window manager is not functioning properly
+and sets <emphasis remap='I'>wait_for_wm</emphasis> to
+<function>False</function>
+(later events may reset this value).
+When <emphasis remap='I'>wait_for_wm</emphasis> is
+<function>False</function>,
+the shell does not wait for a response, but relies on asynchronous
+notification.
+If <emphasis remap='I'>transient</emphasis> is
+<function>True</function>,
+the
+<emphasis role='strong'>WM_TRANSIENT_FOR</emphasis>
+property
+will be stored on the shell window with a value as specified below.
+The interpretation of this property is specific to the window manager
+under which the application is run; see the
+Inter-Client Communication Conventions Manual
+for more details.
+</para>
+
+<para>
+The realize and set_values procedures of WMShell store the
+<emphasis role='strong'>WM_CLIENT_LEADER</emphasis>
+property on the shell window.
+When <emphasis remap='I'>client_leader</emphasis> is not NULL and the client leader widget is
+realized, the property will be created with the value of the window of the
+client leader widget.
+When <emphasis remap='I'>client_leader</emphasis> is NULL and the shell widget has a NULL parent,
+the widget's window is used as the value of the
+property.
+When <emphasis remap='I'>client_leader</emphasis> is NULL and the shell widget has a non-NULL parent,
+a search is made for the closest shell ancestor
+with a non-NULL <emphasis remap='I'>client_leader</emphasis>,
+and if none is found the shell ancestor with a NULL parent is the result.
+If the resulting widget is realized, the property is created
+with the value of the widget's window.
+</para>
+
+<para>
+When the value of <emphasis remap='I'>window_role</emphasis> is not NULL, the
+realize and set_values procedures store the
+<emphasis role='strong'>WM_WINDOW_ROLE</emphasis>
+property on the shell's window with the value of the resource.
+</para>
+
+<para>
+All other resources specify fields in the window manager hints
+and the window manager size hints.
+The realize and set_values procedures of
+WMShell
+set the corresponding flag bits in the
+hints if any of the fields contain nondefault values.  In addition, if
+a flag bit is set that refers to a field with the value
+<function>XtUnspecifiedShellInt</function>,
+the value of the field is modified as follows:
+</para>
+
+<informaltable frame='topbot'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Field</entry>
+      <entry>Replacement</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>base_width, base_height</entry>
+      <entry>0</entry>
+    </row>
+    <row>
+      <entry>width_inc, height_inc</entry>
+      <entry>1</entry>
+    </row>
+    <row>
+      <entry>max_width, max_height</entry>
+      <entry>32767</entry>
+    </row>
+    <row>
+      <entry>min_width, min_height</entry>
+      <entry>1</entry>
+    </row>
+    <row>
+      <entry>min_aspect_x, min_aspect_y</entry>
+      <entry>-1</entry>
+    </row>
+    <row>
+      <entry>max_aspect_x, max_aspect_y</entry>
+      <entry>-1</entry>
+    </row>
+    <row>
+      <entry>icon_x, icon_y</entry>
+      <entry>-1</entry>
+    </row>
+    <row>
+      <entry>win_gravity</entry>
+      <entry>Value returned by
+      <function>XWMGeometry</function>
+      if called,
+      else <function>NorthWestGravity</function></entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+If the shell widget has a non-NULL parent, then the
+realize and set_values procedures replace the value
+<function>XtUnspecifiedWindow</function>
+in the <emphasis remap='I'>window_group</emphasis> field with the window id of the root widget
+of the widget tree if the
+root widget is realized. The symbolic constant
+<function>XtUnspecifiedWindowGroup</function>
+may be used to indicate that the <emphasis remap='I'>window_group</emphasis> hint flag bit is not
+to be set.  If <emphasis remap='I'>transient</emphasis> is
+<function>True</function>,
+the shell's class is not a subclass of
+TransientShell,
+and <emphasis remap='I'>window_group</emphasis> is not
+<function>XtUnspecifiedWindowGroup</function>,
+the WMShell realize and set_values procedures then store the
+<emphasis role='strong'>WM_TRANSIENT_FOR</emphasis>
+property with the value of <emphasis remap='I'>window_group</emphasis>.
+</para>
+
+<para>
+Transient
+shells have the following additional resource:
+</para>
+
+<informaltable frame='topbot'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Field</entry>
+      <entry>Replacement</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>transient_for</entry>
+      <entry>NULL</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The realize and set_values procedures of
+TransientShell
+store the
+<emphasis role='strong'>WM_TRANSIENT_FOR</emphasis>
+property on the shell window if <emphasis remap='I'>transient</emphasis> is
+<function>True</function>.
+If <emphasis remap='I'>transient_for</emphasis> is non-NULL and the widget specified by
+<emphasis remap='I'>transient_for</emphasis> is realized, then its window is used as the value of the
+<emphasis role='strong'>WM_TRANSIENT_FOR</emphasis>
+property; otherwise, the value of <emphasis remap='I'>window_group</emphasis> is used.
+</para>
+
+<para>
+<function>TopLevel</function>
+shells have the the following additional resources:
+</para>
+
+
+<informaltable frame='topbot'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Field</entry>
+      <entry>Default Value</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>icon_name</entry>
+      <entry>Shell widget's name</entry>
+    </row>
+    <row>
+      <entry>iconic</entry>
+      <entry><emphasis role='strong'>False</emphasis></entry>
+    </row>
+    <row>
+      <entry>icon_name_encoding</entry>
+      <entry>See text</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The <emphasis remap='I'>icon_name</emphasis>
+and <emphasis remap='I'>icon_name_encoding</emphasis> fields are stored in the
+<emphasis role='strong'>WM_ICON_NAME</emphasis>
+property on the shell's window by the TopLevelShell realize
+procedure.
+If the <emphasis remap='I'>icon_name_encoding</emphasis> field is
+<function>None</function>,
+the <emphasis remap='I'>icon_name</emphasis> string is assumed to be in the encoding of the
+current locale and the encoding of the
+<emphasis role='strong'>WM_ICON_NAME</emphasis>
+property is set to
+<function>XStdICCTextStyle</function>.
+If a language procedure has not been set,
+the default value of <emphasis remap='I'>icon_name_encoding</emphasis> is
+<emphasis role='strong'>XA_STRING</emphasis>, otherwise the default value is
+<function>None</function>.
+The <emphasis remap='I'>iconic</emphasis> field may be used by a client to request
+that the window manager iconify or deiconify the shell; the
+TopLevelShell
+set_values procedure will send the appropriate
+<emphasis role='strong'>WM_CHANGE_STATE</emphasis>
+message (as specified by the <emphasis remap='I'>Inter-Client Communication Conventions Manual</emphasis>)
+if this resource is changed from
+<function>False</function>
+to
+<function>True</function>
+and will call
+<xref linkend='XtPopup' xrefstyle='select: title'/>
+specifying <emphasis remap='I'>grab_kind</emphasis> as
+<function>XtGrabNone</function>
+if <emphasis remap='I'>iconic</emphasis> is changed from
+<function>True</function>
+to
+<function>False</function>.
+The XtNiconic resource is also an alternative way to set
+the XtNinitialState resource
+to indicate that a shell should be initially displayed as an icon; the
+TopLevelShell
+initialize procedure will set <emphasis remap='I'>initial_state</emphasis> to
+<function>IconicState</function>
+if <emphasis remap='I'>iconic</emphasis> is
+<function>True</function>.
+</para>
+
+<para>
+Application
+shells have the following additional resources:
+</para>
+
+<informaltable frame='topbot'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Field</entry>
+      <entry>Default Value</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>argc</entry>
+      <entry>0</entry>
+    </row>
+    <row>
+      <entry>argv</entry>
+      <entry>NULL</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The <emphasis remap='I'>argc</emphasis> and <emphasis remap='I'>argv</emphasis> fields are used to initialize
+the standard property
+<emphasis role='strong'>WM_COMMAND</emphasis>.  See the
+Inter-Client Communication Conventions Manual
+for more information.
+</para>
+
+<para>
+The default values for the SessionShell instance fields,
+which are filled in from the resource lists and by the
+initialize procedure, are
+</para>
+
+<informaltable frame='topbot'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Field</entry>
+      <entry>Default Value</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>cancel_callbacks</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>clone_command</entry>
+      <entry>See text</entry>
+    </row>
+    <row>
+      <entry>connection</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>current_dir</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>die_callbacks</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>discard_command</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>environment</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>error_callbacks</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>interact_callbacks</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>join_session</entry>
+      <entry><emphasis role='strong'>True</emphasis></entry>
+    </row>
+    <row>
+      <entry>program_path</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>resign_command</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>restart_command</entry>
+      <entry>See text</entry>
+    </row>
+    <row>
+      <entry>restart_style</entry>
+      <entry><emphasis role='strong'>SmRestartIfRunning</emphasis></entry>
+    </row>
+    <row>
+      <entry>save_callbacks</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>save_complete_callbacks</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>session_id</entry>
+      <entry>NULL</entry>
+    </row>
+    <row>
+      <entry>shutdown_command</entry>
+      <entry>NULL</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The <emphasis remap='I'>connection</emphasis> field contains the session connection object or NULL
+if a session connection is not being managed by this widget.
+</para>
+
+<para>
+The <emphasis remap='I'>session_id</emphasis> is an identification assigned to the session
+participant by the session manager.
+The <emphasis remap='I'>session_id</emphasis> will be passed to the session
+manager as the client identifier of the previous session.
+When a connection is established with the session manager,
+the client id assigned by the session manager is stored
+in the <emphasis remap='I'>session_id</emphasis> field.
+When not NULL, the <emphasis remap='I'>session_id</emphasis> of the Session shell widget that
+is at the root of the widget tree of the client leader widget will be
+used to create the
+<emphasis role='strong'>SM_CLIENT_ID</emphasis>
+property on the client leader's window.
+</para>
+
+<para>
+If <emphasis remap='I'>join_session</emphasis> is
+<function>False</function>,
+the widget will not attempt to establish a
+connection to the session manager at shell creation time.
+See <xref linkend='Joining_a_Session' /> and
+<xref linkend='Resigning_from_a_Session' />
+for more information on the functionality of this resource.
+</para>
+
+<para>
+The <emphasis remap='I'>restart_command</emphasis>, <emphasis remap='I'>clone_command</emphasis>, <emphasis remap='I'>discard_command</emphasis>,
+<emphasis remap='I'>resign_command</emphasis>, <emphasis remap='I'>shutdown_command</emphasis>, <emphasis remap='I'>environment</emphasis>,
+<emphasis remap='I'>current_dir</emphasis>, <emphasis remap='I'>program_path</emphasis>, and
+<emphasis remap='I'>restart_style</emphasis> fields contain standard session properties.
+</para>
+
+<para>
+When a session connection is established or newly managed by the shell,
+the shell initialize and set_values methods check the values of the
+<emphasis remap='I'>restart_command</emphasis>,
+<emphasis remap='I'>clone_command</emphasis>,
+and <emphasis remap='I'>program_path</emphasis>
+resources.  At that time, if <emphasis remap='I'>restart_command</emphasis> is NULL, the value
+of the <emphasis remap='I'>argv</emphasis> resource will be copied to <emphasis remap='I'>restart_command</emphasis>.
+Whether or not <emphasis remap='I'>restart_command</emphasis> was NULL,
+if &ldquo;<emphasis>-xtsessionID</emphasis>&rdquo; &ldquo;<emphasis>&lt;session id&gt;</emphasis>&rdquo; does not
+already appear in the <emphasis remap='I'>restart_command</emphasis>, it will be added by the
+initialize and set_values methods at the beginning of the command arguments;
+if the &ldquo;<emphasis>-xtsessionID</emphasis>&rdquo; argument already appears with an incorrect
+<emphasis>session id</emphasis> in the following argument, that argument
+will be replaced with the current <emphasis>session id</emphasis>.
+</para>
+
+<para>
+After this, the shell initialize and set_values procedures check the
+<emphasis remap='I'>clone_command</emphasis>.  If <emphasis remap='I'>clone_command</emphasis> is NULL,
+<emphasis remap='I'>restart_command</emphasis> will be copied to <emphasis remap='I'>clone_command</emphasis>,
+except the &ldquo;<emphasis>-xtsessionID</emphasis>&rdquo; and following argument will not be copied.
+</para>
+
+<para>
+Finally, the shell initialize and set_values procedures check the
+<emphasis remap='I'>program_path</emphasis>.  If <emphasis remap='I'>program_path</emphasis> is NULL, the
+first element of <emphasis remap='I'>restart_command</emphasis> is copied to <emphasis remap='I'>program_path</emphasis>.
+</para>
+
+<para>
+The possible values of <emphasis remap='I'>restart_style</emphasis> are
+<function>SmRestartIfRunning</function>,
+<function>SmRestartAnyway</function>,
+<function>SmRestartImmediately</function>,
+and
+<function>SmRestartNever</function>.
+A resource converter is registered for this resource;
+for the strings that it recognizes,
+see <xref linkend='Predefined_Resource_Converters' />.
+</para>
+
+<para>
+The resource type EnvironmentArray is a NULL-terminated array of
+pointers to strings;
+each string has the format &ldquo;name=value&rdquo;.
+The `=' character may not appear in the name,
+and the string is terminated by a null character.
+</para>
+</sect2>
+</sect1>
+
+<sect1 id="Session_Participation">
+<title>Session Participation</title>
+<para>
+Applications can participate in a user's session, exchanging messages
+with the session manager as described in the
+<emphasis>X Session Management Protocol</emphasis> and the
+<emphasis remap='I'>X Session Management Library</emphasis>.
+</para>
+
+<para>
+When a widget of
+<function>sessionShellWidgetClass</function>
+or a subclass is created, the widget provides support for the application
+as a session participant and continues to provide support until the
+widget is destroyed.
+</para>
+
+<sect2 id="Joining_a_Session">
+<title>Joining a Session</title>
+<para>
+When a Session shell is created,
+if <emphasis remap='I'>connection</emphasis> is NULL,
+and if <emphasis remap='I'>join_session</emphasis> is
+<function>True</function>,
+and if <emphasis remap='I'>argv</emphasis> or <emphasis remap='I'>restart_command</emphasis> is not NULL,
+and if in POSIX environments the
+<emphasis role='strong'>SESSION_MANAGER</emphasis>
+environment variable is defined,
+the shell will attempt to establish a new connection with the session manager.
+</para>
+
+<para>
+To transfer management of an existing session connection from an
+application to the shell at widget creation time, pass the existing
+session connection ID as the <emphasis remap='I'>connection</emphasis> resource value
+when creating the Session shell,
+and if the other creation-time conditions on session participation are met,
+the widget will maintain the connection with the session manager.
+The application must ensure that only one
+Session shell manages the connection.
+</para>
+
+<para>
+In the Session shell set_values procedure,
+if <emphasis remap='I'>join_session</emphasis> changes from
+<function>False</function>
+to
+<function>True</function>
+and <emphasis remap='I'>connection</emphasis> is NULL and when in POSIX environments the
+<emphasis role='strong'>SESSION_MANAGER</emphasis>
+environment variable is defined,
+the shell will attempt to open a connection to the session manager.
+If <emphasis remap='I'>connection</emphasis> changes from NULL to non-NULL, the
+Session shell
+will take over management of that session connection and will set
+<emphasis remap='I'>join_session</emphasis> to
+<function>True</function>.
+If <emphasis remap='I'>join_session</emphasis> changes from
+<function>False</function>
+to
+<function>True</function>
+and <emphasis remap='I'>connection</emphasis> is not NULL, the
+Session shell will take over management of the session connection.
+</para>
+
+<para>
+When a successful connection has been established, <emphasis remap='I'>connection</emphasis>
+contains the session connection ID for the session participant.
+When the shell begins to manage the connection, it will call
+<xref linkend='XtAppAddInput' xrefstyle='select: title'/>
+to register the handler which watches for protocol messages
+from the session manager.
+When the attempt to connect fails, a warning message is issued
+and <emphasis remap='I'>connection</emphasis> is set to NULL.
+</para>
+
+<para>
+While the connection is being managed, if a
+<function>SaveYourself</function>,
+<function>SaveYourselfPhase2</function>,
+<function>Interact</function>,
+<function>ShutdownCancelled</function>,
+<function>SaveComplete</function>,
+or
+<function>Die</function>
+message is received from the session manager, the Session shell will
+call out to application callback procedures registered
+on the respective callback list of the Session shell and will
+send
+<function>SaveYourselfPhase2Request</function>,
+<function>InteractRequest</function>,
+<function>InteractDone</function>,
+<function>SaveYourselfDone</function>,
+and
+<function>ConnectionClosed</function>
+messages as appropriate.
+Initially, all of the client's session properties are undefined.
+When any of the session property resource values are defined or change,
+the Session shell initialize and set_values procedures
+will update the client's session property value by a
+<function>SetProperties</function>
+or a
+<function>DeleteProperties</function>
+message, as appropriate.
+The session ProcessID and UserID properties are always set by the shell
+when it is possible to determine the value of these properties.
+</para>
+</sect2>
+
+<sect2 id="Saving_Application_State">
+<title>Saving Application State</title>
+<para>
+The session manager instigates an application checkpoint by sending a
+<function>SaveYourself</function>
+request.
+Applications are responsible for saving their state in response to the
+request.
+</para>
+
+<para>
+When the
+<function>SaveYourself</function>
+request arrives, the procedures registered on the
+Session shell's save callback list are called.
+If the application does not register any save callback procedures on
+the save callback list, the shell will report to the session manager
+that the application failed to save its state.
+Each procedure on the save callback list receives a token
+in the <emphasis remap='I'>call_data</emphasis> parameter.
+</para>
+
+<para>
+The checkpoint token in the <emphasis remap='I'>call_data</emphasis> parameter is of type
+<function>XtCheckpointToken</function>.
+</para>
+
+<programlisting>
+typedef struct {
+        int     save_type;
+        int     interact_style;
+        Boolean shutdown;
+        Boolean fast;
+        Boolean cancel_shutdown
+        int     phase;
+        int     interact_dialog_type;   /* return */
+        Boolean request_cancel;         /* return */
+        Boolean request_next_phase;     /* return */
+        Boolean save_success;           /* return */
+} XtCheckpointTokenRec, *XtCheckpointToken;
+</programlisting>
+
+<para>
+The <emphasis remap='I'>save_type</emphasis>, <emphasis remap='I'>interact_style</emphasis>, <emphasis remap='I'>shutdown</emphasis>, and <emphasis remap='I'>fast</emphasis>
+fields of the token contain the parameters of the
+<function>SaveYourself</function>
+message.
+The possible values of <emphasis remap='I'>save_type</emphasis> are
+<function>SmSaveLocal</function>,
+<function>SmSaveGlobal</function>,
+and
+<function>SmSaveBoth</function>;
+these indicate the type of information to be saved.
+The possible values of <emphasis remap='I'>interact_style</emphasis> are
+<function>SmInteractStyleNone</function>,
+<function>SmInteractStyleErrors</function>,
+and
+<function>SmInteractStyleAny</function>;
+these indicate whether user interaction would be permitted
+and, if so, what kind of interaction.
+If <emphasis remap='I'>shutdown</emphasis> is
+<function>True</function>,
+the checkpoint is being performed in preparation for the end of the session.
+If <emphasis remap='I'>fast</emphasis> is
+<function>True</function>,
+the client should perform the checkpoint as quickly as possible.
+If <emphasis remap='I'>cancel_shutdown</emphasis> is
+<function>True</function>,
+a
+<function>ShutdownCancelled</function>
+message has been received for the current save operation.
+(See <xref linkend='Resigning_from_a_Session' />.)
+The <emphasis remap='I'>phase</emphasis> is used by manager clients, such as a window manager,
+to distinguish between the first and second phase of a save operation.
+The <emphasis remap='I'>phase</emphasis> will be either 1 or 2.
+The remaining fields in the checkpoint token structure are provided for
+the application to communicate with the shell.
+</para>
+
+<para>
+Upon entry to the first application save callback procedure, the return
+fields in the token have the following initial values:
+<emphasis remap='I'>interact_dialog_type</emphasis> is
+<function>SmDialogNormal</function>;
+<emphasis remap='I'>request_cancel</emphasis> is
+<function>False</function>;
+<emphasis remap='I'>request_next_phase</emphasis> is
+<function>False</function>;
+and <emphasis remap='I'>save_success</emphasis> is
+<function>True</function>.
+When a token is returned with any of the four return fields containing
+a noninitial value, and when the field is applicable, subsequent tokens
+passed to the application during the current save operation
+will always contain the noninitial value.
+</para>
+
+<para>
+The purpose of the token's <emphasis remap='I'>save_success</emphasis> field is to
+indicate the outcome of the entire operation to the
+session manager and ultimately, to the user.
+Returning
+<function>False</function>
+indicates some portion of the application state
+could not be successfully saved.  If any token is returned
+to the shell with <emphasis remap='I'>save_success</emphasis>
+<function>False</function>,
+tokens subsequently received
+by the application for the current save operation will show
+<emphasis remap='I'>save_success</emphasis> as
+<function>False</function>.
+When the shell sends the final status of the checkpoint to the
+session manager, it will indicate failure to save application state
+if any token was returned with <emphasis remap='I'>save_success</emphasis>
+<function>False</function>.
+</para>
+
+<para>
+Session participants that manage and save the state of other clients
+should structure their save or interact callbacks to
+set <emphasis remap='I'>request_next_phase</emphasis> to
+<function>True</function>
+when phase is 1, which will cause the shell to send the
+<function>SaveYourselfPhase2Request</function>
+when the first phase is complete.  When the
+<function>SaveYourselfPhase2</function>
+message is received, the shell will invoke the save callbacks a
+second time with <emphasis remap='I'>phase</emphasis> equal to 2.
+Manager clients should save the state of other clients
+when the callbacks are invoked the second time and <emphasis remap='I'>phase</emphasis> equal to 2.
+</para>
+
+<para>
+The application may request additional tokens while a checkpoint is under way,
+and these additional tokens must be returned by an explicit call.
+</para>
+
+<para>
+To request an additional token for a save callback response that has a
+deferred outcome, use
+<xref linkend='XtSessionGetToken' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtSessionGetToken'>
+<funcprototype>
+<funcdef>XtCheckpointToken <function>XtSessionGetToken</function></funcdef>
+   <paramdef>Widget <parameter>widget</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the Session shell widget which manages session participation.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+The
+<xref linkend='XtSessionGetToken' xrefstyle='select: title'/>
+function will return NULL if no checkpoint operation is currently under way.
+</para>
+
+<para>
+To indicate the completion of checkpoint processing including user
+interaction, the application must signal the Session shell
+by returning all tokens.
+(See <xref linkend='Interacting_with_the_User_during_a_Checkpoint' /> and
+<xref linkend='Completing_a_Save' />).
+To return a token, use
+<xref linkend='XtSessionReturnToken' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtSessionReturnToken'>
+<funcprototype>
+<funcdef>void <function>XtSessionReturnToken</function></funcdef>
+   <paramdef>XtCheckpointToken <parameter>token</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>token</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a token that was received as the <emphasis remap='I'>call_data</emphasis> by a procedure
+on the interact callback list or a token that was received by a call to
+<xref linkend='XtSessionGetToken' xrefstyle='select: title'/>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+Tokens passed as <emphasis remap='I'>call_data</emphasis> to save callbacks are implicitly
+returned when the save callback procedure returns.
+A save callback procedure should not call
+<xref linkend='XtSessionReturnToken' xrefstyle='select: title'/>
+on the token passed in its <emphasis remap='I'>call_data</emphasis>.
+</para>
+
+<sect3 id="Requesting_Interaction">
+<title>Requesting Interaction</title>
+<para>
+When the token <emphasis remap='I'>interact_style</emphasis> allows user interaction,
+the application may
+interact with the user during the checkpoint, but must wait for permission
+to interact.
+Applications request permission to interact with the user during the
+checkpointing operation by registering a procedure on the Session
+shell's interact callback list.  When all save callback procedures have
+returned, and each time a token that was granted by a call to
+<xref linkend='XtSessionGetToken' xrefstyle='select: title'/>
+is returned, the Session shell examines the interact callback list.
+If interaction is permitted and the interact callback list is not empty,
+the shell will send an
+<function>InteractRequest</function>
+to the session manager when an interact request is not already outstanding
+for the application.
+</para>
+
+<para>
+The type of interaction dialog that will be requested is specified by
+the <emphasis remap='I'>interact_dialog_type</emphasis> field in the checkpoint token.
+The possible values for <emphasis remap='I'>interact_dialog_type</emphasis> are
+<function>SmDialogError</function>
+and
+<function>SmDialogNormal</function>.
+If a token is returned with <emphasis remap='I'>interact_dialog_type</emphasis> containing
+<function>SmDialogError</function>,
+the interact request and any subsequent interact requests will be for
+an error dialog; otherwise, the request will be for a normal dialog with
+the user.
+</para>
+
+<para>
+When a token is returned with <emphasis remap='I'>save_success</emphasis>
+<function>False</function>
+or <emphasis remap='I'>interact_dialog_type</emphasis>
+<function>SmDialogError</function>,
+tokens subsequently passed to callbacks during the same active
+<function>SaveYourself</function>
+response will reflect these changed values, indicating that
+an error condition has occurred during the checkpoint.
+</para>
+
+<para>
+The <emphasis remap='I'>request_cancel</emphasis> field is a return value for interact callbacks only.
+Upon return from a procedure on the save callback list, the value
+of the token's <emphasis remap='I'>request_cancel</emphasis> field is not examined by the shell.
+This is also true of tokens received through a call to
+<xref linkend='XtSessionGetToken' xrefstyle='select: title'/>.
+</para>
+</sect3>
+
+<sect3 id="Interacting_with_the_User_during_a_Checkpoint">
+<title>Interacting with the User during a Checkpoint</title>
+<para>
+When the session manager grants the application's request for user interaction,
+the Session shell receives an
+<function>Interact</function>
+message.
+The procedures registered on the interact callback list are executed,
+but not as if executing a typical callback list.
+These procedures are individually executed in
+sequence, with a checkpoint token functioning as the sequencing mechanism.
+Each step in the sequence begins by removing a procedure
+from the interact callback list
+and executing it with a token passed in the <emphasis remap='I'>call_data</emphasis>.
+The interact callback will typically pop up a dialog box and return.
+When the user interaction and associated application checkpointing has
+completed, the application must return the token by calling
+<xref linkend='XtSessionReturnToken' xrefstyle='select: title'/>.
+Returning the token completes the current step and triggers the next step
+in the sequence.
+</para>
+
+<para>
+During interaction the client may request cancellation of a shutdown.
+When a token passed as <emphasis remap='I'>call_data</emphasis> to an interact procedure is returned,
+if <emphasis remap='I'>shutdown</emphasis> is
+<function>True</function>
+and <emphasis remap='I'>cancel_shutdown</emphasis> is
+<function>False</function>,
+<emphasis remap='I'>request_cancel</emphasis> indicates whether the
+application requests that the pending shutdown be cancelled.
+If <emphasis remap='I'>request_cancel</emphasis> is
+<function>True</function>,
+the field will also be
+<function>True</function>
+in any tokens subsequently granted during the checkpoint operation.
+When a token is returned requesting cancellation of
+the session shutdown, pending interact procedures will still be
+called by the Session shell.
+When all interact procedures have been removed from the interact callback
+list, executed, and the final interact token returned to the shell, an
+<function>InteractDone</function>
+message is sent to the session manager, indicating whether
+a pending session shutdown is requested to be cancelled.
+</para>
+</sect3>
+
+<sect3 id="Responding_to_a_Shutdown_Cancellation">
+<title>Responding to a Shutdown Cancellation</title>
+<para>
+Callbacks registered on the cancel callback list are invoked when the
+Session shell processes a
+<function>ShutdownCancelled</function>
+message from the session manager.  This may occur during the
+processing of save callbacks, while waiting for interact permission,
+during user interaction, or after the save operation is complete and
+the application is expecting a
+<function>SaveComplete</function>
+or a
+<function>Die</function>
+message.
+The <emphasis remap='I'>call_data</emphasis> for these callbacks is NULL.
+</para>
+
+<para>
+When the shell notices that a pending shutdown has been cancelled,
+the token <emphasis remap='I'>cancel_shutdown</emphasis> field will be
+<function>True</function>
+in tokens subsequently given to the application.
+</para>
+
+<para>
+Receiving notice of a shutdown cancellation does not cancel the
+pending execution of save callbacks or interact callbacks.
+After the cancel callbacks execute, if <emphasis remap='I'>interact_style</emphasis> is not
+<function>SmInteractStyleNone</function>
+and the interact list is not empty,
+the procedures on the interact callback list will be executed
+and passed a token with <emphasis remap='I'>interact_style</emphasis>
+<function>SmInteractStyleNone</function>.
+The application should not interact with the user, and the Session shell
+will not send an
+<function>InteractDone</function>
+message.
+</para>
+</sect3>
+
+<sect3 id="Completing_a_Save">
+<title>Completing a Save</title>
+<para>
+When there is no user interaction, the shell regards the application
+as having finished saving state when all callback procedures
+on the save callback list have returned, and any additional tokens
+passed out by
+<xref linkend='XtSessionGetToken' xrefstyle='select: title'/>
+have been returned by corresponding calls to
+<xref linkend='XtSessionReturnToken' xrefstyle='select: title'/>.
+If the save operation involved user interaction,
+the above completion conditions apply, and in addition, all requests for
+interaction have been granted or cancelled,
+and all tokens passed to interact callbacks have been returned
+through calls to
+<xref linkend='XtSessionReturnToken' xrefstyle='select: title'/>.
+If the save operation involved a manager client that requested the
+second phase, the above conditions apply to both the first and second
+phase of the save operation.
+</para>
+
+<para>
+When the application has finished saving state,
+the Session shell will report the result to the session manager by
+sending the
+<function>SaveYourselfDone</function>
+message.
+If the session is continuing, the shell will receive the
+<function>SaveComplete</function>
+message when all applications have completed saving state.
+This message indicates that applications may again allow changes
+to their state.  The shell will execute the save_complete callbacks.
+The <emphasis remap='I'>call_data</emphasis> for these callbacks is NULL.
+</para>
+</sect3>
+</sect2>
+
+<sect2 id="Responding_to_a_Shutdown">
+<title>Responding to a Shutdown</title>
+<para>
+Callbacks registered on the die callback list are invoked when the
+session manager sends a
+<function>Die</function>
+message.
+The callbacks on this list should do whatever is appropriate to quit
+the application.
+Before executing procedures on the die callback list,
+the Session shell will close the connection to the session manager
+and will remove the handler that watches for protocol messages.
+The <emphasis remap='I'>call_data</emphasis> for these callbacks is NULL.
+</para>
+</sect2>
+
+<sect2 id="Resigning_from_a_Session">
+<title>Resigning from a Session</title>
+<para>
+When the Session shell widget is destroyed, the destroy method will
+close the connection to the session manager by sending a
+<function>ConnectionClosed</function>
+protocol message and will remove the input callback
+that was watching for session protocol messages.
+</para>
+
+<para>
+When
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+is used to set <emphasis remap='I'>join_session</emphasis> to
+<function>False</function>,
+the set_values method of the Session shell will close the
+connection to the session manager if one exists by sending a
+<function>ConnectionClosed</function>
+message, and <emphasis remap='I'>connection</emphasis> will be set to NULL.
+</para>
+
+<para>
+Applications that exit in response to user actions and that do not
+wait for phase 2 destroy to complete on
+the Session shell should set <emphasis remap='I'>join_session</emphasis> to
+<function>False</function>
+before exiting.
+</para>
+
+<para>
+When
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+is used to set <emphasis remap='I'>connection</emphasis> to NULL,
+the Session shell will stop managing the connection, if one exists.
+However, that session connection will not be closed.
+</para>
+
+<para>
+Applications that wish to ensure continuation of a session connection
+beyond the destruction of the shell should first retrieve the
+<emphasis remap='I'>connection</emphasis> resource value,
+then set the <emphasis remap='I'>connection</emphasis> resource to NULL,
+and then they may safely destroy the widget without losing control
+of the session connection.
+</para>
+
+<para>
+The error callback list will be called if an unrecoverable
+communications error occurs while the shell is managing the connection.
+The shell will close the connection, set <emphasis remap='I'>connection</emphasis> to NULL,
+remove the input callback, and
+call the procedures registered on the error callback list.
+The <emphasis remap='I'>call_data</emphasis> for these callbacks is NULL.
+</para>
+</sect2>
+</sect1>
+</chapter>
Index: lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs/CH06.xml
===================================================================
--- lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs/CH06.xml	(nonexistent)
+++ lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs/CH06.xml	(revision 5)
@@ -0,0 +1,1372 @@
+<?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">
+
+<chapter id='Geometry_Management'>
+<title>Geometry Management</title>
+
+<para>
+A widget does not directly control its size and location;
+rather, its parent is responsible for controlling them.
+Although the position of children is usually left up to their parent,
+the widgets themselves often have the best idea of their optimal sizes
+and, possibly, preferred locations.
+</para>
+
+<para>
+To resolve physical layout conflicts between sibling widgets and between
+a widget and its parent, the Intrinsics provide the geometry management mechanism.
+Almost all
+composite
+widgets have a geometry manager specified in the <emphasis remap='I'>geometry_manager</emphasis> field
+in the widget class record that is responsible for the size, position, and
+stacking order of the widget's children.
+The only exception is fixed boxes,
+which create their children themselves and can ensure that
+their children will never make a geometry request.
+</para>
+
+<sect1 id="Initiating_Geometry_Changes">
+<title>Initiating Geometry Changes</title>
+
+<para>
+Parents, children, and clients each initiate geometry changes differently.
+Because a parent has absolute control of its children's geometry,
+it changes the geometry directly by calling
+<function>XtMoveWidget</function>,
+<xref linkend='XtResizeWidget' xrefstyle='select: title'/>,
+or
+<xref linkend='XtConfigureWidget' xrefstyle='select: title'/>.
+A child must ask its parent for a geometry change by calling
+<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>
+or
+<xref linkend='XtMakeResizeRequest' xrefstyle='select: title'/>.
+An application or other client code initiates a geometry change by calling
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+on the appropriate geometry fields,
+thereby giving the widget the opportunity to modify or reject the client
+request before it gets propagated to the parent and the opportunity
+to respond appropriately to the parent's reply.
+</para>
+
+<para>
+When a widget that needs to change its size, position, border width,
+or stacking depth asks its parent's geometry manager to make the desired
+changes,
+the geometry manager can allow the request, disallow the request, or
+suggest a compromise.
+</para>
+
+<para>
+When the geometry manager is asked to change the geometry of a child,
+the geometry manager may also rearrange and resize any or all
+of the other children that it controls.
+The geometry manager can move children around freely using
+<xref linkend='XtMoveWidget' xrefstyle='select: title'/>.
+When it resizes a child (that is, changes the width, height, or
+border width) other than the one making the request,
+it should do so by calling
+<xref linkend='XtResizeWidget' xrefstyle='select: title'/>.
+The requesting child may be given special treatment; see
+<xref linkend='Child_Geometry_Management_The_geometry_manager_Procedure' />.
+It can simultaneously move and resize a child with a single call to
+<xref linkend='XtConfigureWidget' xrefstyle='select: title'/>.
+</para>
+
+<para>
+Often, geometry managers find that they can satisfy a request only if
+they can reconfigure a widget that they are not in control of; in particular,
+the
+composite
+widget may want to change its own size.
+In this case,
+the geometry manager makes a request to its parent's geometry manager.
+Geometry requests can cascade this way to arbitrary depth.
+</para>
+
+<para>
+Because such cascaded arbitration of widget geometry can involve extended
+negotiation,
+windows are not actually allocated to widgets at application
+startup until all widgets are satisfied with their geometry;
+see <xref linkend='Creating_Widgets' /> and
+<xref linkend='Realizing_Widgets' />.
+</para>
+
+<note>
+<orderedlist>
+  <listitem>
+    <para>
+The Intrinsics treatment of stacking requests is deficient in several areas.
+Stacking requests for unrealized widgets are granted but will have no effect.
+In addition, there is no way to do an
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+that will generate a stacking geometry request.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+After a successful geometry request (one that returned
+<function>XtGeometryYes</function>),
+a widget does not know whether its resize procedure has been called.
+Widgets should have resize procedures that can be called more than once
+without ill effects.
+    </para>
+  </listitem>
+</orderedlist>
+</note>
+</sect1>
+
+<sect1 id="General_Geometry_Manager_Requests">
+<title>General Geometry Manager Requests</title>
+<para>
+When making a geometry request, the child specifies an
+<function>XtWidgetGeometry</function>
+structure.
+</para>
+
+<programlisting>
+typedef unsigned long XtGeometryMask;
+typedef struct {
+        XtGeometryMask  request_mode;
+        Position        x, y;
+        Dimension       width, height;
+        Dimension       border_width;
+        Widget          sibling;
+        int             stack_mode;
+} XtWidgetGeometry;
+</programlisting>
+
+<para>
+To make a general geometry manager request from a widget, use
+<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtMakeGeometryRequest'>
+<funcprototype>
+<funcdef>XtGeometryResult <function>XtMakeGeometryRequest</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>XtWidgetGeometry *<parameter>request</parameter></paramdef>
+   <paramdef>XtWidgetGeometry *<parameter>reply_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget making the request.  Must be of class RectObj or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>request</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired widget geometry (size, position, border width,
+and stacking order).
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>reply_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the allowed widget size, or may be NULL
+if the requesting widget is not interested in handling
+<function>XtGeometryAlmost</function>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+Depending on the condition,
+<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>
+performs the following:
+</para>
+
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+If the widget is unmanaged or the widget's parent is not realized,
+it makes the changes and returns
+<function>XtGeometryYes</function>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the parent's class is not a subclass of
+<function>compositeWidgetClass</function>
+or the parent's <emphasis remap='I'>geometry_manager</emphasis> field is NULL,
+it issues an error.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the widget's <emphasis remap='I'>being_destroyed</emphasis> field is
+<function>True</function>,
+it returns
+<function>XtGeometryNo</function>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the widget <emphasis remap='I'>x</emphasis>, <emphasis remap='I'>y</emphasis>, <emphasis remap='I'>width</emphasis>, <emphasis remap='I'>height</emphasis>, and
+<emphasis remap='I'>border_width</emphasis> fields are
+all equal to the requested values,
+it returns
+<function>XtGeometryYes</function>;
+otherwise, it calls the parent's geometry_manager procedure
+with the given parameters.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the parent's geometry manager returns
+<function>XtGeometryYes</function>
+and if
+<function>XtCWQueryOnly</function>
+is not set in <emphasis remap='I'>request-&gt;request_mode</emphasis>
+and if the widget is realized,
+<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>
+calls the
+<function>XConfigureWindow</function>
+Xlib function to reconfigure the widget's window (set its size, location,
+and stacking order as appropriate).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the geometry manager returns
+<function>XtGeometryDone</function>,
+the change has been approved and actually has been done.
+In this case,
+<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>
+does no configuring and returns
+<function>XtGeometryYes</function>.
+<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>
+never returns
+<function>XtGeometryDone</function>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Otherwise,
+<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>
+just returns the resulting value from the parent's geometry manager.
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+Children of primitive widgets are always unmanaged; therefore,
+<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>
+always returns
+<function>XtGeometryYes</function>
+when called by a child of a primitive widget.
+</para>
+
+<para>
+The return codes from geometry managers are
+</para>
+
+<programlisting>
+typedef enum {
+        XtGeometryYes,
+        XtGeometryNo,
+        XtGeometryAlmost,
+        XtGeometryDone
+} XtGeometryResult;
+</programlisting>
+
+<para>
+The <emphasis remap='I'>request_mode</emphasis> definitions are from
+<filename class="headerfile">&lt;X11/X.h&gt;</filename>.
+</para>
+
+<informaltable frame='none'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <colspec colwidth='1.0*' colname='c3'/>
+  <tbody>
+    <row>
+      <entry>#define</entry>
+      <entry><function>CWX</function></entry>
+      <entry>(1&lt;&lt;0)</entry>
+    </row>
+    <row>
+      <entry>#define</entry>
+      <entry><function>CWY</function></entry>
+      <entry>(1&lt;&lt;1)</entry>
+    </row>
+    <row>
+      <entry>#define</entry>
+      <entry><function>CWWidth</function></entry>
+      <entry>(1&lt;&lt;2)</entry>
+    </row>
+    <row>
+      <entry>#define</entry>
+      <entry><function>CWHeight</function></entry>
+      <entry>(1&lt;&lt;3)</entry>
+    </row>
+    <row>
+      <entry>#define</entry>
+      <entry><function>CWBorderWidth</function></entry>
+      <entry>(1&lt;&lt;4)</entry>
+    </row>
+    <row>
+      <entry>#define</entry>
+      <entry><function>CWSibling</function></entry>
+      <entry>(1&lt;&lt;5)</entry>
+    </row>
+    <row>
+      <entry>#define</entry>
+      <entry><function>CWStackMode</function></entry>
+      <entry>(1&lt;&lt;6)</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The Intrinsics also support the following value.
+</para>
+
+<informaltable frame='none'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <colspec colwidth='1.0*' colname='c3'/>
+  <tbody>
+    <row>
+      <entry>#define</entry>
+      <entry><function>XtCWQueryOnly</function></entry>
+      <entry>(1&lt;&lt;7)</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+<function>XtCWQueryOnly</function>
+indicates that the corresponding geometry request is only a query
+as to what would happen if this geometry request were made
+and that no widgets should actually be changed.
+</para>
+
+<para>
+<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>,
+like the
+<function>XConfigureWindow</function>
+Xlib function, uses <emphasis remap='I'>request_mode</emphasis> to determine which fields in the
+<function>XtWidgetGeometry</function>
+structure the caller wants to specify.
+</para>
+
+<para>
+The <emphasis remap='I'>stack_mode</emphasis> definitions are from
+<filename class="headerfile">&lt;X11/X.h&gt;</filename>:
+</para>
+
+<informaltable frame='none'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <colspec colwidth='1.0*' colname='c3'/>
+  <tbody>
+    <row>
+      <entry>#define</entry>
+      <entry><function>Above</function></entry>
+      <entry>0</entry>
+    </row>
+    <row>
+      <entry>#define</entry>
+      <entry><function>Below</function></entry>
+      <entry>1</entry>
+    </row>
+    <row>
+      <entry>#define</entry>
+      <entry><function>TopIf</function></entry>
+      <entry>2</entry>
+    </row>
+    <row>
+      <entry>#define</entry>
+      <entry><function>BottomIf</function></entry>
+      <entry>3</entry>
+    </row>
+    <row>
+      <entry>#define</entry>
+      <entry><function>Opposite</function></entry>
+      <entry>4</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The Intrinsics also support the following value.
+</para>
+
+<informaltable frame='none'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <colspec colwidth='1.0*' colname='c3'/>
+  <tbody>
+    <row>
+      <entry>#define</entry>
+      <entry><function>XtSMDontChange</function></entry>
+      <entry>5</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+For definition and behavior of
+<function>Above</function>,
+<function>Below</function>,
+<function>TopIf</function>,
+<function>BottomIf</function>,
+and
+<function>Opposite</function>,
+BLAH
+in Xlib &mdash; C Language X Interface.
+<function>XtSMDontChange</function>
+indicates that the widget wants its current stacking order preserved.
+</para>
+</sect1>
+
+<sect1 id="Resize_Requests">
+<title>Resize Requests</title>
+<para>
+To make a simple resize request from a widget, you can use
+<xref linkend='XtMakeResizeRequest' xrefstyle='select: title'/>
+as an alternative to
+<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtMakeResizeRequest'>
+<funcprototype>
+<funcdef>typedef XtGeometryResult <function>XtMakeResizeRequest</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Dimension <parameter>width</parameter></paramdef>
+   <paramdef>Dimension *<parameter>width_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget making the request.  Must be of class RectObj or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the desired widget width and height.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height</emphasis>
+    </term>
+    <listitem>
+      <para></para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Return the allowed widget width and height.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height_return</emphasis>
+    </term>
+    <listitem>
+     <para></para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+The
+<xref linkend='XtMakeResizeRequest' xrefstyle='select: title'/>
+function, a simple interface to
+<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>,
+creates an
+<function>XtWidgetGeometry</function>
+structure and specifies that width and height should change
+by setting <emphasis remap='I'>request_mode</emphasis> to
+<function>CWWidth</function>
+<function>|</function>
+<function>CWHeight</function>.
+The geometry manager is free to modify any of the other window attributes
+(position or stacking order) to satisfy the resize request.
+If the return value is
+<function>XtGeometryAlmost</function>,
+<emphasis remap='I'>width_return</emphasis> and <emphasis remap='I'>height_return</emphasis> contain a compromise width and height.
+If these are acceptable,
+the widget should immediately call
+<xref linkend='XtMakeResizeRequest' xrefstyle='select: title'/>
+again and request that the compromise width and height be applied.
+If the widget is not interested in
+<function>XtGeometryAlmost</function>
+replies,
+it can pass NULL for <emphasis remap='I'>width_return</emphasis> and <emphasis remap='I'>height_return</emphasis>.
+</para>
+</sect1>
+
+<sect1 id="Potential_Geometry_Changes">
+<title>Potential Geometry Changes</title>
+<para>
+Sometimes a geometry manager cannot respond to
+a geometry request from a child without first making a geometry request
+to the widget's own parent (the original requestor's grandparent).
+If the request to the grandparent would allow the parent to satisfy the
+original request,
+the geometry manager can make the intermediate geometry request
+as if it were the originator.
+On the other hand,
+if the geometry manager already has determined that the original request
+cannot be completely satisfied (for example, if it always denies
+position changes),
+it needs to tell the grandparent to respond to the intermediate request
+without actually changing the geometry
+because it does not know if the child will accept the compromise.
+To accomplish this, the geometry manager uses
+<function>XtCWQueryOnly</function>
+in the intermediate request.
+</para>
+
+<para>
+When
+<function>XtCWQueryOnly</function>
+is used, the geometry manager needs to cache
+enough information to exactly reconstruct the intermediate request.
+If the grandparent's response to the intermediate query was
+<function>XtGeometryAlmost</function>,
+the geometry manager needs to cache the entire
+reply geometry in the event the child accepts the parent's compromise.
+</para>
+
+<para>
+If the grandparent's response was
+<function>XtGeometryAlmost</function>,
+it may also be necessary to cache the entire reply geometry from
+the grandparent when
+<function>XtCWQueryOnly</function>
+is not used.
+If the geometry manager is still able to satisfy the original request,
+it may immediately accept the grandparent's compromise
+and then act on the child's request.
+If the grandparent's compromise geometry is insufficient to allow
+the child's request and if the geometry manager is willing to offer
+a different compromise to the child,
+the grandparent's compromise should not be accepted until the child
+has accepted the new compromise.
+</para>
+
+<para>
+Note that a compromise geometry returned with
+<function>XtGeometryAlmost</function>
+is guaranteed only for the next call to the same widget;
+therefore, a cache of size 1 is sufficient.
+</para>
+</sect1>
+
+<sect1 id="Child_Geometry_Management_The_geometry_manager_Procedure">
+<title>Child Geometry Management: The geometry_manager Procedure</title>
+<para>
+The geometry_manager procedure pointer in a composite widget class is of type
+<xref linkend='XtGeometryHandler' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtGeometryHandler'>
+<funcprototype>
+<funcdef>typedef XtGeometryResult *<function>XtGeometryHandler</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>XtWidgetGeometry *<parameter>request</parameter></paramdef>
+   <paramdef>XtWidgetGeometry *<parameter>geometry_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Passes the widget making the request.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>request</emphasis>
+    </term>
+    <listitem>
+      <para>
+Passes the new geometry the child desires.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>geometry_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Passes a geometry structure in which the geometry manager may store a
+compromise.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+A class can inherit its superclass's geometry manager during class
+initialization.
+</para>
+
+<para>
+A bit set to zero in the request's <emphasis remap='I'>request_mode</emphasis>
+field means that the child widget
+does not care about the value of the corresponding field,
+so the geometry manager can change this field as it wishes.
+A bit set to 1 means that the child wants that geometry element set
+to the value in the corresponding field.
+</para>
+
+<para>
+If the geometry manager can satisfy all changes requested
+and if
+<function>XtCWQueryOnly</function>
+is not specified,
+it updates the widget's <emphasis remap='I'>x</emphasis>, <emphasis remap='I'>y</emphasis>, <emphasis remap='I'>width</emphasis>, <emphasis remap='I'>height</emphasis>,
+and <emphasis remap='I'>border_width</emphasis> fields
+appropriately.
+Then, it returns
+<function>XtGeometryYes</function>,
+and the values pointed to by the <emphasis remap='I'>geometry_return</emphasis> argument are undefined.
+The widget's window is moved and resized automatically by
+<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>.
+</para>
+
+<para>
+Homogeneous composite widgets often find it convenient to treat the widget
+making the request the same as any other widget, including reconfiguring
+it using
+<xref linkend='XtConfigureWidget' xrefstyle='select: title'/>
+or
+<xref linkend='XtResizeWidget' xrefstyle='select: title'/>
+as part of its layout process, unless
+<function>XtCWQueryOnly</function>
+is specified.
+If it does this,
+it should return
+<function>XtGeometryDone</function>
+to inform
+<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>
+that it does not need to do the configuration itself.
+</para>
+
+<note>
+<para>
+To remain
+compatible with layout techniques used in older widgets (before
+<function>XtGeometryDone</function>
+was added to the Intrinsics), a geometry manager should avoid using
+<xref linkend='XtResizeWidget' xrefstyle='select: title'/>
+or
+<xref linkend='XtConfigureWidget' xrefstyle='select: title'/>
+on the child making
+the request because the layout process of the child may be in an
+intermediate state in which it is not prepared to handle a call to its
+resize procedure.  A self-contained widget set may choose this
+alternative geometry management scheme, however, provided that it
+clearly warns widget developers of the compatibility consequences.
+</para>
+</note>
+
+<para>
+Although
+<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>
+resizes the widget's window
+(if the geometry
+manager returns
+<function>XtGeometryYes</function>),
+it does not call the widget class's resize procedure.
+The requesting widget must perform whatever
+resizing calculations are needed explicitly.
+</para>
+
+<para>
+If the geometry manager disallows the request,
+the widget cannot change its geometry.
+The values pointed to by <emphasis remap='I'>geometry_return</emphasis> are undefined,
+and the geometry manager returns
+<function>XtGeometryNo</function>.
+</para>
+
+<para>
+Sometimes the geometry manager cannot satisfy the request exactly
+but may be able to satisfy a similar request.
+That is,
+it could satisfy only a subset of the requests (for example,
+size but not position) or a lesser request
+(for example, it cannot make the child as big as the
+request but it can make the child bigger than its current size).
+In such cases,
+the geometry manager fills in the structure pointed to by
+<emphasis remap='I'>geometry_return</emphasis> with the actual changes
+it is willing to make, including an appropriate <emphasis remap='I'>request_mode</emphasis> mask, and returns
+<function>XtGeometryAlmost</function>.
+If a bit in <emphasis remap='I'>geometry_return-&gt;request_mode</emphasis> is zero,
+the geometry manager agrees not to change the corresponding value
+if <emphasis remap='I'>geometry_return</emphasis> is used immediately
+in a new request.
+If a bit is 1,
+the geometry manager does change that element to the corresponding
+value in <emphasis remap='I'>geometry_return</emphasis>.
+More bits may be set in <emphasis remap='I'>geometry_return-&gt;request_mode</emphasis>
+than in the original request if
+the geometry manager intends to change other fields should the
+child accept the compromise.
+</para>
+
+<para>
+When
+<function>XtGeometryAlmost</function>
+is returned,
+the widget must decide if the compromise suggested in <emphasis remap='I'>geometry_return</emphasis>
+is acceptable.
+If it is, the widget must not change its geometry directly;
+rather, it must make another call to
+<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>.
+</para>
+
+<para>
+If the next geometry request from this child uses the
+<emphasis remap='I'>geometry_return</emphasis> values filled in by the geometry manager with an
+<function>XtGeometryAlmost</function>
+return and if there have been no intervening geometry requests on
+either its parent or any of its other children,
+the geometry manager must grant the request, if possible.
+That is, if the child asks immediately with the returned geometry,
+it should get an answer of
+<function>XtGeometryYes</function>.
+However,
+dynamic behavior in
+the user's window manager may affect the final outcome.
+</para>
+
+<para>
+To return
+<function>XtGeometryYes</function>,
+the geometry manager frequently rearranges the position of other managed
+children by calling
+<xref linkend='XtMoveWidget' xrefstyle='select: title'/>.
+However, a few geometry managers may sometimes change the
+size of other managed children by calling
+<xref linkend='XtResizeWidget' xrefstyle='select: title'/>
+or
+<xref linkend='XtConfigureWidget' xrefstyle='select: title'/>.
+If
+<function>XtCWQueryOnly</function>
+is specified,
+the geometry manager must return data describing
+how it would react to this geometry
+request without actually moving or resizing any widgets.
+</para>
+
+<para>
+Geometry managers must not assume that the <emphasis remap='I'>request</emphasis>
+and <emphasis remap='I'>geometry_return</emphasis> arguments point to independent storage.
+The caller is permitted to use the same field for both,
+and the geometry manager must allocate its own temporary storage,
+if necessary.
+</para>
+</sect1>
+
+<sect1 id="Widget_Placement_and_Sizing">
+<title>Widget Placement and Sizing</title>
+<para>
+To move a sibling widget of the child making the geometry request,
+the parent uses
+<xref linkend='XtMoveWidget' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtMoveWidget'>
+<funcprototype>
+<funcdef>void <function>XtMoveWidget</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Position <parameter>x</parameter></paramdef>
+   <paramdef>Position <parameter>y</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.  Must be of class RectObj or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+     <para></para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the new widget x and y coordinates.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtMoveWidget' xrefstyle='select: title'/>
+function returns immediately if the specified geometry fields
+are the same as the old values.
+Otherwise,
+<xref linkend='XtMoveWidget' xrefstyle='select: title'/>
+writes the new <emphasis remap='I'>x</emphasis> and <emphasis remap='I'>y</emphasis> values into the object
+and, if the object is a widget and is realized, issues an Xlib
+<function>XMoveWindow</function>
+call on the widget's window.
+</para>
+
+<para>
+To resize a sibling widget of the child making the geometry request,
+the parent uses
+<xref linkend='XtResizeWidget' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtResizeWidget'>
+<funcprototype>
+<funcdef>void <function>XtResizeWidget</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Dimension <parameter>width</parameter></paramdef>
+   <paramdef>Dimension <parameter>height</parameter></paramdef>
+   <paramdef>Dimension <parameter>border_width</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.  Must be of class RectObj or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width</emphasis>
+    </term>
+    <listitem>
+     <para></para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height</emphasis>
+    </term>
+    <listitem>
+     <para></para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>border_width</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the new widget size.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtResizeWidget' xrefstyle='select: title'/>
+function returns immediately if the specified geometry fields
+are the same as the old values.
+Otherwise,
+<xref linkend='XtResizeWidget' xrefstyle='select: title'/>
+writes the new <emphasis remap='I'>width</emphasis>, <emphasis remap='I'>height</emphasis>, and <emphasis remap='I'>border_width</emphasis> values into
+the object and, if the object is a widget and is realized, issues an
+<function>XConfigureWindow</function>
+call on the widget's window.
+</para>
+
+<para>
+If the new width or height is different from the old values,
+<xref linkend='XtResizeWidget' xrefstyle='select: title'/>
+calls the object's resize procedure to notify it of the size change.
+</para>
+
+<para>
+To move and resize the sibling widget of the child making the geometry request,
+the parent uses
+<xref linkend='XtConfigureWidget' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtConfigureWidget'>
+<funcprototype>
+<funcdef>void <function>XtConfigureWidget</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Position <parameter>x</parameter></paramdef>
+   <paramdef>Position <parameter>y</parameter></paramdef>
+   <paramdef>Dimension <parameter>width</parameter></paramdef>
+   <paramdef>Dimension <parameter>height</parameter></paramdef>
+   <paramdef>Dimension <parameter>border_width</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.  Must be of class RectObj or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+     <para></para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the new widget x and y coordinates.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>width</emphasis>
+    </term>
+    <listitem>
+     <para></para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>height</emphasis>
+    </term>
+    <listitem>
+     <para></para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>border_width</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the new widget size.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtConfigureWidget' xrefstyle='select: title'/>
+function returns immediately if the specified new geometry fields
+are all equal to the current values.
+Otherwise,
+<xref linkend='XtConfigureWidget' xrefstyle='select: title'/>
+writes the new <emphasis remap='I'>x</emphasis>, <emphasis remap='I'>y</emphasis>, <emphasis remap='I'>width</emphasis>, <emphasis remap='I'>height</emphasis>,
+and <emphasis remap='I'>border_width</emphasis> values
+into the object and, if the object is a widget and is realized, makes an Xlib
+<function>XConfigureWindow</function>
+call on the widget's window.
+</para>
+
+<para>
+If the new width or height is different from its old value,
+<xref linkend='XtConfigureWidget' xrefstyle='select: title'/>
+calls the object's resize procedure to notify it of the size change;
+otherwise, it simply returns.
+</para>
+
+<para>
+To resize a child widget that already has the new values of its width,
+height, and border width, the parent uses
+<xref linkend='XtResizeWindow' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtResizeWindow'>
+<funcprototype>
+<funcdef>void <function>XtResizeWindow</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.  Must be of class Core or any subclass thereof.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtResizeWindow' xrefstyle='select: title'/>
+function calls the
+<function>XConfigureWindow</function>
+Xlib function to make the window of the specified widget match its width,
+height, and border width.
+This request is done unconditionally because there is no
+inexpensive way to tell if these
+values match the current values.
+Note that the widget's resize procedure is not called.
+</para>
+
+<para>
+There are very few times to use
+<xref linkend='XtResizeWindow' xrefstyle='select: title'/>;
+instead, the parent should use
+<xref linkend='XtResizeWidget' xrefstyle='select: title'/>.
+</para>
+</sect1>
+
+<sect1 id="Preferred_Geometry">
+<title>Preferred Geometry</title>
+<para>
+Some parents may be willing to adjust their layouts to accommodate the
+preferred geometries of their children.
+They can use
+<xref linkend='XtQueryGeometry' xrefstyle='select: title'/>
+to obtain the preferred geometry
+and, as they see fit, can use or ignore any portion of the response.
+</para>
+
+<para>
+To query a child widget's preferred geometry, use
+<xref linkend='XtQueryGeometry' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtQueryGeometry'>
+<funcprototype>
+<funcdef>XtGeometryResult <function>XtQueryGeometry</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>XtWidgetGeometry *<parameter>intended</parameter></paramdef>
+   <paramdef>XtWidgetGeometry *<parameter>preferred_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.  Must be of class RectObj or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>intended</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the new geometry the parent plans to give to the child, or
+NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>preferred_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the child widget's preferred geometry.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+To discover a child's preferred geometry,
+the child's parent stores the new
+geometry in the corresponding fields of
+the intended structure, sets the corresponding bits in <emphasis remap='I'>intended.request_mode</emphasis>,
+and calls
+<xref linkend='XtQueryGeometry' xrefstyle='select: title'/>.
+The parent should set only those fields that are important to it so
+that the child can determine whether it may be able to attempt changes to
+other fields.
+</para>
+
+<para>
+<xref linkend='XtQueryGeometry' xrefstyle='select: title'/>
+clears all bits in the <emphasis remap='I'>preferred_return-&gt;request_mode</emphasis>
+field and checks the
+<emphasis remap='I'>query_geometry</emphasis> field of the specified widget's class record.
+If <emphasis remap='I'>query_geometry</emphasis> is not NULL,
+<xref linkend='XtQueryGeometry' xrefstyle='select: title'/>
+calls the query_geometry procedure and passes as arguments the
+specified widget, <emphasis remap='I'>intended</emphasis>, and <emphasis remap='I'>preferred_return</emphasis> structures.
+If the <emphasis remap='I'>intended</emphasis> argument is NULL,
+<xref linkend='XtQueryGeometry' xrefstyle='select: title'/>
+replaces it with a pointer to an
+<function>XtWidgetGeometry</function>
+structure with <emphasis remap='I'>request_mode</emphasis> equal to zero before calling the
+query_geometry procedure.
+</para>
+
+<note>
+<para>
+If
+<xref linkend='XtQueryGeometry' xrefstyle='select: title'/>
+is called from within a geometry_manager
+procedure for the widget that issued
+<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>
+or
+<xref linkend='XtMakeResizeRequest' xrefstyle='select: title'/>,
+the results
+are not guaranteed to be consistent with the requested changes.  The
+change request passed to the geometry manager takes precedence over
+the preferred geometry.
+</para>
+</note>
+
+<para>
+The query_geometry procedure pointer is of type
+<xref linkend='XtGeometryHandler' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='_XtGeometryHandler'>
+<funcprototype>
+<funcdef>typedef XtGeometryResult <function>(*XtGeometryHandler)</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>XtWidgetGeometry *<parameter>request</parameter></paramdef>
+   <paramdef>XtWidgetGeometry *<parameter>preferred_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Passes the child widget whose preferred geometry is required.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>request</emphasis>
+    </term>
+    <listitem>
+      <para>
+Passes the geometry changes that the parent plans to make.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>preferred_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Passes a structure in which the child returns its preferred geometry.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The query_geometry procedure is expected to examine the bits set in
+<emphasis remap='I'>request-&gt;request_mode</emphasis>, evaluate the preferred geometry of the widget,
+and store the result in <emphasis remap='I'>preferred_return</emphasis>
+(setting the bits in <emphasis remap='I'>preferred_return-&gt;request_mode</emphasis> corresponding
+to those geometry fields that it cares about).
+If the proposed geometry change is acceptable without modification,
+the query_geometry procedure should return
+<function>XtGeometryYes</function>.
+If at least one field in <emphasis remap='I'>preferred_return</emphasis>
+with a bit set in <emphasis remap='I'>preferred_return-&gt;request_mode</emphasis>
+is different
+from the corresponding field in <emphasis remap='I'>request</emphasis>
+or if a bit was set in <emphasis remap='I'>preferred_return-&gt;request_mode</emphasis>
+that was not set in the request,
+the query_geometry procedure should return
+<function>XtGeometryAlmost</function>.
+If the preferred geometry is identical to the current geometry,
+the query_geometry procedure should return
+<function>XtGeometryNo</function>.
+</para>
+
+<note><para>
+The query_geometry procedure may assume
+that no
+<xref linkend='XtMakeResizeRequest' xrefstyle='select: title'/>
+or
+<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>
+is in progress
+for the specified widget; that is, it is not required to construct
+a reply consistent with the requested geometry if such a request
+were actually outstanding.
+</para></note>
+
+<para>
+After calling the query_geometry procedure
+or if the <emphasis remap='I'>query_geometry</emphasis> field is NULL,
+<xref linkend='XtQueryGeometry' xrefstyle='select: title'/>
+examines all the unset bits in <emphasis remap='I'>preferred_return-&gt;request_mode</emphasis>
+and sets the corresponding fields in <emphasis remap='I'>preferred_return</emphasis>
+to the current values from the widget instance.
+If
+<function>CWStackMode</function>
+is not set,
+the <emphasis remap='I'>stack_mode</emphasis> field is set to
+<function>XtSMDontChange</function>.
+<xref linkend='XtQueryGeometry' xrefstyle='select: title'/>
+returns the value returned by the query_geometry procedure or
+<function>XtGeometryYes</function>
+if the <emphasis remap='I'>query_geometry</emphasis> field is NULL.
+</para>
+
+<para>
+Therefore, the caller can interpret a return of
+<function>XtGeometryYes</function>
+as not needing to evaluate the contents of the reply and, more important,
+not needing to modify its layout plans.
+A return of
+<function>XtGeometryAlmost</function>
+means either that both the parent and the child expressed interest
+in at least one common field and the child's preference does not match
+the parent's intentions or that the child expressed interest in a field that
+the parent might need to consider.
+A return value of
+<function>XtGeometryNo</function>
+means that both the parent and the child expressed interest in a field and
+that the child suggests that the field's current value in the widget instance
+is its preferred value.
+In addition, whether or not the caller ignores the return value or the
+reply mask, it is guaranteed that the <emphasis remap='I'>preferred_return</emphasis> structure contains complete
+geometry information for the child.
+</para>
+
+<para>
+Parents are expected to call
+<xref linkend='XtQueryGeometry' xrefstyle='select: title'/>
+in their layout routine and wherever else the information is significant
+after change_managed has been called.
+The first time it is invoked,
+the changed_managed procedure may assume that the child's current geometry
+is its preferred geometry.
+Thus, the child is still responsible for storing values
+into its own geometry during its initialize procedure.
+</para>
+</sect1>
+
+<sect1 id="Size_Change_Management_The_resize_Procedure">
+<title>Size Change Management: The resize Procedure</title>
+<para>
+A child can be resized by its parent at any time.
+Widgets usually need to know when they have changed size
+so that they can lay out their displayed data again to match the new size.
+When a parent resizes a child, it calls
+<xref linkend='XtResizeWidget' xrefstyle='select: title'/>,
+which updates the geometry fields in the widget,
+configures the window if the widget is realized,
+and calls the child's resize procedure to notify the child.
+The resize procedure pointer is of type
+<xref linkend='XtWidgetProc' xrefstyle='select: title'/>.
+</para>
+
+<para>
+If a class need not recalculate anything when a widget is resized,
+it can specify NULL for the <emphasis remap='I'>resize</emphasis> field in its class record.
+This is an unusual case and should occur only for widgets
+with very trivial display semantics.
+The resize procedure takes a widget as its only argument.
+The <emphasis remap='I'>x</emphasis>, <emphasis remap='I'>y</emphasis>, <emphasis remap='I'>width</emphasis>, <emphasis remap='I'>height</emphasis>,
+and <emphasis remap='I'>border_width</emphasis> fields of the widget contain the new values.
+The resize procedure should recalculate the layout of internal data
+as needed.
+(For example, a centered Label in a window that changes size
+should recalculate the starting position of the text.)
+The widget must obey resize as a command and must not treat it as a request.
+A widget must not issue an
+<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>
+or
+<xref linkend='XtMakeResizeRequest' xrefstyle='select: title'/>
+call from its resize procedure.
+</para>
+</sect1>
+</chapter>
Index: lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs/CH07.xml
===================================================================
--- lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs/CH07.xml	(nonexistent)
+++ lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs/CH07.xml	(revision 5)
@@ -0,0 +1,5001 @@
+<?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">
+
+<chapter id='Event_Management'>
+<title>Event Management</title>
+<para>
+While Xlib allows the reading and processing of events anywhere in an application,
+widgets in the X Toolkit neither directly read events
+nor grab the server or pointer.
+Widgets register procedures that are to be called
+when an event or class of events occurs in that widget.
+</para>
+
+<para>
+A typical application consists of startup code followed by an event loop
+that reads events and dispatches them by calling
+the procedures that widgets have registered.
+The default event loop provided by the Intrinsics is
+<xref linkend='XtAppMainLoop' xrefstyle='select: title'/>.
+</para>
+
+<para>
+The event manager is a collection of functions to perform the following tasks:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Add or remove event sources other than X server events (in particular,
+timer interrupts, file input, or POSIX signals).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Query the status of event sources.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Add or remove procedures to be called when an event occurs for a particular
+widget.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Enable and
+disable the dispatching of user-initiated events (keyboard and pointer events)
+for a particular widget.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Constrain the dispatching of events to a cascade of pop-up widgets.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Register procedures to be called when specific events arrive.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Register procedures to be called when the Intrinsics will block.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Enable safe operation in a multi-threaded environment.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+Most widgets do not need to call any of the event handler functions explicitly.
+The normal interface to X events is through the higher-level
+translation manager,
+which maps sequences of X events, with modifiers, into procedure calls.
+Applications rarely use any of the event manager routines besides
+<xref linkend='XtAppMainLoop' xrefstyle='select: title'/>.
+</para>
+<sect1 id="Adding_and_Deleting_Additional_Event_Sources">
+<title>Adding and Deleting Additional Event Sources</title>
+<para>
+While most applications are driven only by X events,
+some applications need to incorporate other sources of input
+into the Intrinsics event-handling mechanism.
+The event manager provides routines to integrate notification of timer events
+and file data pending into this mechanism.
+</para>
+
+<para>
+The next section describes functions that provide input gathering from files.
+The application registers the files with the Intrinsics read routine.
+When input is pending on one of the files,
+the registered callback procedures are invoked.
+</para>
+<sect2 id="Adding_and_Removing_Input_Sources">
+<title>Adding and Removing Input Sources</title>
+<para>
+To register a new file as an input source for a given application context, use
+<xref linkend='XtAppAddInput' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppAddInput'>
+<funcprototype>
+<funcdef>XtInputId <function>XtAppAddInput</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+   <paramdef>int <parameter>source</parameter></paramdef>
+   <paramdef>XtPointer <parameter>condition</parameter></paramdef>
+   <paramdef>XtInputCallbackProc <parameter>proc</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context that identifies the application.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>source</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the source file descriptor on a POSIX-based system
+or other operating-system-dependent device specification.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>condition</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the mask that indicates a read, write, or exception condition
+or some other operating-system-dependent condition.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to be called when the condition is found.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an argument passed to the specified procedure
+when it is called.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtAppAddInput' xrefstyle='select: title'/>
+function registers with the Intrinsics read routine a new source of events,
+which is usually file input but can also be file output.
+Note that <emphasis remap='I'>file</emphasis> should be loosely interpreted to mean any sink
+or source of data.
+<xref linkend='XtAppAddInput' xrefstyle='select: title'/>
+also specifies the conditions under which the source can generate events.
+When an event is pending on this source,
+the callback procedure is called.
+</para>
+
+<para>
+The legal values for the <emphasis remap='I'>condition</emphasis> argument are operating-system-dependent.
+On a POSIX-based system,
+<emphasis remap='I'>source</emphasis> is a file number and the condition is some union of the following:
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis role='strong'>XtInputReadMask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies that <emphasis remap='I'>proc</emphasis> is to be called when <emphasis remap='I'>source</emphasis> has data to be read.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis role='strong'>XtInputWriteMask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies that <emphasis remap='I'>proc</emphasis> is to be called when <emphasis remap='I'>source</emphasis> is ready
+for writing.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis role='strong'>XtInputExceptMask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies that <emphasis remap='I'>proc</emphasis> is to be called when <emphasis remap='I'>source</emphasis> has
+exception data.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+
+<para>
+Callback procedure pointers used to handle file events are of
+type
+<xref linkend='XtInputCallbackProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtInputCallbackProc'>
+<funcprototype>
+<funcdef>typedef void <function>(*XtInputCallbackProc)</function></funcdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+   <paramdef>int *<parameter>source</parameter></paramdef>
+   <paramdef>XtInputId *<parameter>id</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Passes the client data argument that was registered for this procedure in
+<function>XtAppAddInput</function>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>source</emphasis>
+    </term>
+    <listitem>
+      <para>
+Passes the source file descriptor generating the event.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>id</emphasis>
+    </term>
+    <listitem>
+      <para>
+Passes the id returned from the corresponding
+<xref linkend='XtAppAddInput' xrefstyle='select: title'/>
+call.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+See <xref linkend='Using_the_Intrinsics_in_a_Multi_Threaded_Environment' />
+for information regarding the use of
+<xref linkend='XtAppAddInput' xrefstyle='select: title'/>
+in multiple threads.
+</para>
+
+<para>
+To discontinue a source of input, use
+<xref linkend='XtRemoveInput' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtRemoveInput'>
+<funcprototype>
+<funcdef>void <function>XtRemoveInput</function></funcdef>
+   <paramdef>XtInputId <parameter>id</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>id</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the id returned from the corresponding
+<xref linkend='XtAppAddInput' xrefstyle='select: title'/>
+call.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtRemoveInput' xrefstyle='select: title'/>
+function causes the Intrinsics read routine to stop watching for events
+from the file source specified by <emphasis remap='I'>id</emphasis>.
+</para>
+
+<para>
+See <xref linkend='Using_the_Intrinsics_in_a_Multi_Threaded_Environment' />
+for information regarding the use of
+<xref linkend='XtRemoveInput' xrefstyle='select: title'/>
+in multiple threads.
+</para>
+</sect2>
+
+<sect2 id="Adding_and_Removing_Blocking_Notifications">
+<title>Adding and Removing Blocking Notifications</title>
+<para>
+Occasionally it is desirable for an application to receive notification
+when the Intrinsics event manager detects no pending input from file sources
+and no pending input from X server event sources and is about to block
+in an operating system call.
+</para>
+
+<para>
+To register a hook that is called immediately prior to event blocking, use
+<xref linkend='XtAppAddBlockHook' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppAddBlockHook'>
+<funcprototype>
+<funcdef>XtBlockHookId <function>XtAppAddBlockHook</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+   <paramdef>XtBlockHookProc <parameter>proc</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context that identifies the application.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to be called before blocking.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an argument passed to the specified procedure when it is called.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtAppAddBlockHook' xrefstyle='select: title'/>
+function registers the specified procedure and returns an identifier for it.
+The hook procedure <emphasis remap='I'>proc</emphasis> is called at any time in the future when
+the Intrinsics are about to block pending some input.
+</para>
+
+<para>
+The procedure pointers used to provide notification of event blocking
+are of type
+<xref linkend='XtBlockHookProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtBlockHookProc'>
+<funcprototype>
+<funcdef>typedef void *<function>XtBlockHookProc</function></funcdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Passes the client data argument that was registered for this procedure in
+<function>XtAppAddBlockHook</function>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+To discontinue the use of a procedure for blocking notification, use
+<xref linkend='XtRemoveBlockHook' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtRemoveBlockHook'>
+<funcprototype>
+<funcdef>void <function>XtRemoveBlockHook</function></funcdef>
+   <paramdef>XtBlockHookId <parameter>id</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>id</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the identifier returned from the corresponding call to
+<xref linkend='XtAppAddBlockHook' xrefstyle='select: title'/>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtRemoveBlockHook' xrefstyle='select: title'/>
+function removes the specified procedure from the list of procedures
+that are called by the Intrinsics read routine before blocking on event sources.
+</para>
+</sect2>
+
+<sect2 id="Adding_and_Removing_Timeouts">
+<title>Adding and Removing Timeouts</title>
+<para>
+The timeout facility notifies the application or the widget
+through a callback procedure that a specified time interval has elapsed.
+Timeout values are uniquely identified by an interval id.
+</para>
+
+<para>
+To register a timeout callback, use
+<xref linkend='XtAppAddTimeOut' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppAddTimeOut'>
+<funcprototype>
+<funcdef>XtIntervalId <function>XtAppAddTimeOut</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+   <paramdef>unsigned long <parameter>interval</parameter></paramdef>
+   <paramdef>XtTimerCallbackProc <parameter>proc</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context for which the timer is to be set.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>interval</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the time interval in milliseconds.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to be called when the time expires.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an argument passed to the specified procedure
+when it is called.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtAppAddTimeOut' xrefstyle='select: title'/>
+function creates a timeout and returns an identifier for it.
+The timeout value is set to <emphasis remap='I'>interval</emphasis>.
+The callback procedure <emphasis remap='I'>proc</emphasis> is called when
+<xref linkend='XtAppNextEvent' xrefstyle='select: title'/>
+or
+<xref linkend='XtAppProcessEvent' xrefstyle='select: title'/>
+is next called after the time interval elapses,
+and then the timeout is removed.
+</para>
+
+<para>
+Callback procedure pointers used with timeouts are of
+type
+<xref linkend='XtTimerCallbackProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtTimerCallbackProc'>
+<funcprototype>
+<funcdef>typedef void *<function>XtTimerCallbackProc</function></funcdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+   <paramdef>XtIntervalId *<parameter>timer</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Passes the client data argument that was registered for this procedure in
+<function>XtAppAddTimeOut</function>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>timer</emphasis>
+    </term>
+    <listitem>
+      <para>
+Passes the id returned from the corresponding
+<xref linkend='XtAppAddTimeOut' xrefstyle='select: title'/>
+call.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+See <xref linkend='Using_the_Intrinsics_in_a_Multi_Threaded_Environment' />
+for information regarding the use of
+<xref linkend='XtAppAddTimeOut' xrefstyle='select: title'/>
+in multiple threads.
+</para>
+
+<para>
+To clear a timeout value, use
+<xref linkend='XtRemoveTimeOut' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtRemoveTimeOut'>
+<funcprototype>
+<funcdef>void <function>XtRemoveTimeOut</function></funcdef>
+   <paramdef>XtIntervalId <parameter>timer</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>timer</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the id for the timeout request to be cleared.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtRemoveTimeOut' xrefstyle='select: title'/>
+function removes the pending timeout.
+Note that timeouts are automatically removed once they trigger.
+</para>
+
+<para>
+Please refer to Section 7.12 for information regarding the use of
+<xref linkend='XtRemoveTimeOut' xrefstyle='select: title'/>
+in multiple threads.
+</para>
+</sect2>
+
+<sect2 id="Adding_and_Removing_Signal_Callbacks">
+<title>Adding and Removing Signal Callbacks</title>
+<para>
+The signal facility notifies the application or the widget through a
+callback procedure that a signal or other external asynchronous event
+has occurred.  The registered callback procedures are uniquely identified
+by a signal id.
+</para>
+
+<para>
+Prior to establishing a signal handler, the application or widget should
+call
+<xref linkend='XtAppAddSignal' xrefstyle='select: title'/>
+and store the resulting identifier in a place accessible to the signal
+handler.  When a signal arrives, the signal handler should call
+<xref linkend='XtNoticeSignal' xrefstyle='select: title'/>
+to notify the Intrinsics that a signal has occurred.  To register a signal
+callback use
+<xref linkend='XtAppAddSignal' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppAddSignal'>
+<funcprototype>
+<funcdef>XtSignalId <function>XtAppAddSignal</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+   <paramdef>XtSignalCallbackProc <parameter>proc</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context that identifies the application.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to be called when the signal is noticed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an argument passed to the specified procedure when it is called.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The callback procedure pointers used to handle signal events are of type
+<xref linkend='XtSignalCallbackProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtSignalCallbackProc'>
+<funcprototype>
+<funcdef>typedef void <function>(*XtSignalCallbackProc)</function></funcdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+   <paramdef>XtSignalId *<parameter>id</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Passes the client data argument that was registered for this procedure in
+<xref linkend='XtAppAddSignal' xrefstyle='select: title'/>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>id</emphasis>
+    </term>
+    <listitem>
+      <para>
+Passes the id returned from the corresponding
+<xref linkend='XtAppAddSignal' xrefstyle='select: title'/>
+call.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+To notify the Intrinsics that a signal has occurred, use
+<xref linkend='XtNoticeSignal' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtNoticeSignal'>
+<funcprototype>
+<funcdef>void <function>XtNoticeSignal</function></funcdef>
+   <paramdef>XtSignalId <parameter>id</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>id</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the id returned from the corresponding
+<xref linkend='XtAppAddSignal' xrefstyle='select: title'/>
+call.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+On a POSIX-based system,
+<xref linkend='XtNoticeSignal' xrefstyle='select: title'/>
+is the only Intrinsics function that can safely be called from a signal handler.
+If
+<xref linkend='XtNoticeSignal' xrefstyle='select: title'/>
+is invoked multiple times before the Intrinsics are able to invoke the
+registered callback, the callback is only called once.
+Logically, the Intrinsics maintain &ldquo;pending&rdquo; flag for each registered callback.
+This flag is initially
+<function>False</function>
+and is set to
+<function>True</function>
+by
+<xref linkend='XtNoticeSignal' xrefstyle='select: title'/>.
+When
+<xref linkend='XtAppNextEvent' xrefstyle='select: title'/>
+or
+<xref linkend='XtAppProcessEvent' xrefstyle='select: title'/>
+(with a mask including
+<function>XtIMSignal</function>)
+is called, all registered callbacks with &ldquo;pending&rdquo;
+<function>True</function>
+are invoked and the flags are reset to
+<function>False</function>.
+</para>
+
+<para>
+If the signal handler wants to track how many times the signal has been
+raised, it can keep its own private counter.  Typically the handler would
+not do any other work; the callback does the actual processing for the
+signal. The Intrinsics never block signals from being raised, so if a given
+signal can be raised multiple times before the Intrinsics can invoke the
+callback for that signal, the callback must be designed to deal with
+this.  In another case, a signal might be raised just after the Intrinsics
+sets the pending flag to
+<function>False</function>
+but before the callback can get control, in which case the pending flag
+will still be
+<function>True</function>
+after the callback returns, and the Intrinsics will invoke the callback
+again, even though all of the signal raises have been handled.  The
+callback must also be prepared to handle this case.
+</para>
+
+<para>
+To remove a registered signal callback, call
+<xref linkend='XtRemoveSignal' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtRemoveSignal'>
+<funcprototype>
+<funcdef>void <function>XtRemoveSignal</function></funcdef>
+   <paramdef>XtSignalId <parameter>id</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>id</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the id returned by the corresponding call to
+<xref linkend='XtAppAddSignal' xrefstyle='select: title'/>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The client should typically disable the source of the signal before calling
+<xref linkend='XtRemoveSignal' xrefstyle='select: title'/>.
+If the signal could have been raised again before the source was disabled
+and the client wants to process it, then after disabling the source but
+before calling
+<xref linkend='XtRemoveSignal' xrefstyle='select: title'/>
+the client can test for signals with
+<xref linkend='XtAppPending' xrefstyle='select: title'/>
+and process them by calling
+<xref linkend='XtAppProcessEvent' xrefstyle='select: title'/>
+with the mask
+<function>XtIMSignal</function>.
+</para>
+</sect2>
+</sect1>
+
+<sect1 id="Constraining_Events_to_a_Cascade_of_Widgets">
+<title>Constraining Events to a Cascade of Widgets</title>
+<para>
+Modal widgets are widgets that, except for the input directed to them,
+lock out user input to the application.
+</para>
+
+<para>
+When a modal menu or modal dialog box is popped up using
+<xref linkend='XtPopup' xrefstyle='select: title'/>,
+user events (keyboard and pointer events) that occur outside the modal
+widget should be delivered to the modal widget or ignored.
+In no case will user events be delivered to a widget outside
+the modal widget.
+</para>
+
+<para>
+Menus can pop up submenus, and dialog boxes can pop up further dialog
+boxes to create a pop-up cascade.
+In this case,
+user events may be delivered to one of several modal widgets in the cascade.
+</para>
+
+<para>
+Display-related events should be delivered outside the modal cascade so that
+exposure events and the like keep the application's display up-to-date.
+Any event that occurs within the cascade is delivered as usual.
+The user events delivered to the most recent spring-loaded shell
+in the cascade when they occur outside the cascade are called remap events
+and are
+<function>KeyPress</function>,
+<function>KeyRelease</function>,
+<function>ButtonPress</function>,
+and
+<function>ButtonRelease</function>.
+The user events ignored when they occur outside the cascade are
+<function>MotionNotify</function>
+and
+<function>EnterNotify</function>.
+All other events are delivered normally.
+In particular, note that this is one
+way in which widgets can receive
+<function>LeaveNotify</function>
+events without first receiving
+<function>EnterNotify</function>
+events; they should be prepared to deal with
+this, typically by ignoring any unmatched
+<function>LeaveNotify</function>
+events.
+</para>
+
+<para>
+<xref linkend='XtPopup' xrefstyle='select: title'/>
+uses the
+<xref linkend='XtAddGrab' xrefstyle='select: title'/>
+and
+<xref linkend='XtRemoveGrab' xrefstyle='select: title'/>
+functions to constrain user events to a modal cascade
+and subsequently to remove a grab when the modal widget is popped down.
+</para>
+
+<para>
+To constrain or redirect user input to a modal widget, use
+<xref linkend='XtAddGrab' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAddGrab'>
+<funcprototype>
+<funcdef>void <function>XtAddGrab</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Boolean <parameter>exclusive</parameter></paramdef>
+   <paramdef>Boolean <parameter>spring_loaded</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget to add to the modal cascade. Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>exclusive</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies whether user events should be dispatched exclusively to this widget
+or also to previous widgets in the cascade.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>spring_loaded</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies whether this widget was popped up because the user pressed
+a pointer button.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtAddGrab' xrefstyle='select: title'/>
+function appends the widget to the modal cascade
+and checks that <emphasis remap='I'>exclusive</emphasis> is
+<function>True</function>
+if <emphasis remap='I'>spring_loaded</emphasis> is
+<function>True</function>.
+If this condition is not met,
+<xref linkend='XtAddGrab' xrefstyle='select: title'/>
+generates a warning message.
+</para>
+
+<para>
+The modal cascade is used by
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>
+when it tries to dispatch a user event.
+When at least one modal widget is in the widget cascade,
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>
+first determines if the event should be delivered.
+It starts at the most recent cascade entry and follows the cascade up to and
+including the most recent cascade entry added with the <emphasis remap='I'>exclusive</emphasis> parameter
+<function>True</function>.
+</para>
+
+<para>
+This subset of the modal cascade along with all descendants of these widgets
+comprise the active subset.
+User events that occur outside the widgets in this subset are ignored
+or remapped.
+Modal menus with submenus generally add a submenu widget to the cascade
+with <emphasis remap='I'>exclusive</emphasis>
+<function>False</function>.
+Modal dialog boxes that need to restrict user input to the most deeply nested
+dialog box add a subdialog widget to the cascade with <emphasis remap='I'>exclusive</emphasis>
+<function>True</function>.
+User events that occur within the active subset are delivered to the
+appropriate widget, which is usually a child or further descendant of the modal
+widget.
+</para>
+
+<para>
+Regardless of where in the application they occur,
+remap events are always delivered to the most recent widget in the active
+subset of the cascade registered with <emphasis remap='I'>spring_loaded</emphasis>
+<function>True</function>,
+if any such widget exists.
+If the event
+occurred in the active subset of the cascade but outside the
+spring-loaded widget, it is delivered normally before being
+delivered also to the spring-loaded widget.
+Regardless of where it is dispatched, the Intrinsics do not modify
+the contents of the event.
+</para>
+
+<para>
+To remove the redirection of user input to a modal widget, use
+<xref linkend='XtRemoveGrab' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtRemoveGrab'>
+<funcprototype>
+<funcdef>void <function>XtRemoveGrab</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget to remove from the modal cascade.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtRemoveGrab' xrefstyle='select: title'/>
+function removes widgets from the modal cascade starting
+at the most recent widget up to and including the specified widget.
+It issues a warning if the specified widget is not on the modal cascade.
+</para>
+<sect2 id="Requesting_Key_and_Button_Grabs">
+<title>Requesting Key and Button Grabs</title>
+<para>
+The Intrinsics provide a set of key and button grab interfaces that
+are parallel to those provided by Xlib and that allow the Intrinsics
+to modify event dispatching when necessary.  X Toolkit applications and
+widgets that need to passively grab keys or buttons or actively grab
+the keyboard or pointer should use the
+following Intrinsics routines rather than the corresponding Xlib
+routines.
+</para>
+
+<para>
+To passively grab a single key of the keyboard, use
+<xref linkend='XtGrabKey' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtGrabKey'>
+<funcprototype>
+<funcdef>void <function>XtGrabKey</function></funcdef>
+   <paramdef>Widget <parameter>widget</parameter></paramdef>
+   <paramdef>KeyCode <parameter>keycode</parameter></paramdef>
+   <paramdef>Modifiers <parameter>modifiers</parameter></paramdef>
+   <paramdef>Boolean <parameter>owner_events</parameter></paramdef>
+   <paramdef>int <parameter>pointer_mode</parameter></paramdef>
+   <paramdef>int <parameter>keyboard_mode</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget in whose window the key is to be grabbed.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keycode</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>modifiers</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>owner_events</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>pointer_mode</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>keyboard_mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify arguments to
+<function>XGrabKey</function>;
+see Section 12.2
+in Xlib &mdash; C Language X Interface.
+
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtGrabKey' xrefstyle='select: title'/>
+calls
+<function>XGrabKey</function>
+specifying the widget's window as the grab
+window if the widget is realized.  The remaining arguments are exactly
+as for
+<function>XGrabKey</function>.
+If the widget is not realized, or is later unrealized, the call to
+<function>XGrabKey</function>
+is performed (again) when
+the widget is realized and its window becomes mapped.  In the future,
+if
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>
+is called with a
+<function>KeyPress</function>
+event matching the specified keycode and modifiers (which may be
+<function>AnyKey</function>
+or
+<function>AnyModifier</function>,
+respectively) for the
+widget's window, the Intrinsics will call
+<xref linkend='XtUngrabKeyboard' xrefstyle='select: title'/>
+with the timestamp from the
+<function>KeyPress</function>
+event if either of the following conditions is true:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+There is a modal cascade and the widget is not in
+the active subset of the cascade and the keyboard was not previously
+grabbed, or
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>XFilterEvent</function>
+returns
+<function>True</function>.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+To cancel a passive key grab, use
+<xref linkend='XtUngrabKey' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtUngrabKey'>
+<funcprototype>
+<funcdef>void <function>XtUngrabKey</function></funcdef>
+   <paramdef>Widget <parameter>widget</parameter></paramdef>
+   <paramdef>KeyCode <parameter>keycode</parameter></paramdef>
+   <paramdef>Modifiers <parameter>modifiers</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget in whose window the key was grabbed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keycode</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>modifiers</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify arguments to
+<function>XUngrabKey</function>;
+see Section 12.2
+in Xlib &mdash; C Language X Interface.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtUngrabKey' xrefstyle='select: title'/>
+procedure calls
+<function>XUngrabKey</function>
+specifying the widget's
+window as the ungrab window if the widget is realized.  The remaining
+arguments are exactly as for
+<function>XUngrabKey</function>.
+If the widget is not realized,
+<xref linkend='XtUngrabKey' xrefstyle='select: title'/>
+removes a deferred
+<xref linkend='XtGrabKey' xrefstyle='select: title'/>
+request, if any, for the specified widget, keycode, and modifiers.
+</para>
+
+<para>
+To actively grab the keyboard, use
+<xref linkend='XtGrabKeyboard' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtGrabKeyboard'>
+<funcprototype>
+<funcdef>int <function>XtGrabKeyboard</function></funcdef>
+   <paramdef>Widget <parameter>widget</parameter></paramdef>
+   <paramdef>Boolean <parameter>owner_events</parameter></paramdef>
+   <paramdef>int <parameter>pointer_mode</parameter></paramdef>
+   <paramdef>int <parameter>keyboard_mode</parameter></paramdef>
+   <paramdef>Time <parameter>time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget for whose window the keyboard is to be grabbed.
+Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>owner_events</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>pointer_mode</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>keyboard_mode</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify arguments to
+<function>XGrabKeyboard</function>;
+see Section 12.2
+in Xlib &mdash; C Language X Interface.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If the specified widget is realized,
+<xref linkend='XtGrabKeyboard' xrefstyle='select: title'/>
+calls
+<function>XGrabKeyboard</function>
+specifying the widget's window as the grab window.  The remaining
+arguments and return value are exactly as for
+<function>XGrabKeyboard</function>.
+If the widget is not realized,
+<xref linkend='XtGrabKeyboard' xrefstyle='select: title'/>
+immediately returns
+<function>GrabNotViewable</function>.
+No future automatic ungrab is implied by
+<xref linkend='XtGrabKeyboard' xrefstyle='select: title'/>.
+</para>
+
+<para>
+To cancel an active keyboard grab, use
+<xref linkend='XtUngrabKeyboard' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtUngrabKeyboard'>
+<funcprototype>
+<funcdef>void <function>XtUngrabKeyboard</function></funcdef>
+   <paramdef>Widget <parameter>widget</parameter></paramdef>
+   <paramdef>Time <parameter>time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget that has the active keyboard grab.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the additional argument to
+<function>XUngrabKeyboard</function>;
+see Section 12.2
+in Xlib &mdash; C Language X Interface.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtUngrabKeyboard' xrefstyle='select: title'/>
+calls
+<function>XUngrabKeyboard</function>
+with the specified time.
+</para>
+
+<para>
+To passively grab a single pointer button, use
+<xref linkend='XtGrabButton' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtGrabButton'>
+<funcprototype>
+<funcdef>void <function>XtGrabButton</function></funcdef>
+   <paramdef>Widget <parameter>widget</parameter></paramdef>
+   <paramdef>int <parameter>button</parameter></paramdef>
+   <paramdef>Modifiers <parameter>modifiers</parameter></paramdef>
+   <paramdef>Boolean <parameter>owner_events</parameter></paramdef>
+   <paramdef>unsigned int <parameter>event_mask</parameter></paramdef>
+   <paramdef>int <parameter>pointer_mode</parameter></paramdef>
+   <paramdef>int <parameter>keyboard_mode</parameter></paramdef>
+   <paramdef>Window <parameter>confine_to</parameter></paramdef>
+   <paramdef>Cursor <parameter>cursor</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget in whose window the button is to be grabbed.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>button</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>modifiers</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>owner_events</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>event_mask</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>pointer_mode</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>keyboard_mode</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>confine_to</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>cursor</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify arguments to
+<function>XGrabButton</function>;
+see Section 12.1
+in Xlib &mdash; C Language X Interface.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtGrabButton' xrefstyle='select: title'/>
+calls
+<function>XGrabButton</function>
+specifying the widget's window as the
+grab window if the widget is realized.  The remaining arguments are
+exactly as for
+<function>XGrabButton</function>.
+If the widget is not realized, or is later unrealized, the call to
+<function>XGrabButton</function>
+is performed (again)
+when the widget is realized and its window becomes mapped.  In the
+future, if
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>
+is called with a
+<function>ButtonPress</function>
+event matching the specified button and modifiers (which may be
+<function>AnyButton</function>
+or
+<function>AnyModifier</function>,
+respectively)
+for the widget's window, the Intrinsics will call
+<xref linkend='XtUngrabPointer' xrefstyle='select: title'/>
+with the timestamp from the
+<function>ButtonPress</function>
+event if either of the following conditions is true:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+There is a modal cascade and the
+widget is not in the active subset of the cascade and the pointer was
+not previously grabbed, or
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>XFilterEvent</function>
+returns
+<function>True</function>.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+To cancel a passive button grab, use
+<xref linkend='XtUngrabButton' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtUngrabButton'>
+<funcprototype>
+<funcdef>void <function>XtUngrabButton</function></funcdef>
+   <paramdef>Widget <parameter>widget</parameter></paramdef>
+   <paramdef>unsigned int <parameter>button</parameter></paramdef>
+   <paramdef>Modifiers <parameter>modifiers</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget in whose window the button was grabbed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>button</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>modifiers</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify arguments to
+<function>XUngrabButton</function>;
+see Section 12.1
+in Xlib &mdash; C Language X Interface.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtUngrabButton' xrefstyle='select: title'/>
+procedure calls
+<function>XUngrabButton</function>
+specifying the
+widget's window as the ungrab window if the widget is realized.  The
+remaining arguments are exactly as for
+<function>XUngrabButton</function>.
+If the widget is not realized,
+<xref linkend='XtUngrabButton' xrefstyle='select: title'/>
+removes a deferred
+<xref linkend='XtGrabButton' xrefstyle='select: title'/>
+request, if any, for the specified widget, button, and modifiers.
+</para>
+
+<para>
+To actively grab the pointer, use
+<xref linkend='XtGrabPointer' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtGrabPointer'>
+<funcprototype>
+<funcdef>int <function>XtGrabPointer</function></funcdef>
+   <paramdef>Widget <parameter>widget</parameter></paramdef>
+   <paramdef>Boolean <parameter>owner_events</parameter></paramdef>
+   <paramdef>unsigned int <parameter>event_mask</parameter></paramdef>
+   <paramdef>int <parameter>pointer_mode</parameter></paramdef>
+   <paramdef>int <parameter>keyboard_mode</parameter></paramdef>
+   <paramdef>Window <parameter>confine_to</parameter></paramdef>
+   <paramdef>Cursor <parameter>cursor</parameter></paramdef>
+   <paramdef>Time <parameter>time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget for whose window the pointer is to be grabbed.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>owner_events</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>event_mask</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>pointer_mode</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>keyboard_mode</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>confine_to</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>cursor</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify arguments to
+<function>XGrabPointer</function>;
+see Section 12.1
+in Xlib &mdash; C Language X Interface.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If the specified widget is realized,
+<xref linkend='XtGrabPointer' xrefstyle='select: title'/>
+calls
+<function>XGrabPointer</function>,
+specifying the widget's window as the grab window.  The remaining
+arguments and return value are exactly as for
+<function>XGrabPointer</function>.
+If the widget is not realized,
+<xref linkend='XtGrabPointer' xrefstyle='select: title'/>
+immediately returns
+<function>GrabNotViewable</function>.
+No future automatic ungrab is implied by
+<xref linkend='XtGrabPointer' xrefstyle='select: title'/>.
+</para>
+
+<para>
+To cancel an active pointer grab, use
+<xref linkend='XtUngrabPointer' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtUngrabPointer'>
+<funcprototype>
+<funcdef>void <function>XtUngrabPointer</function></funcdef>
+   <paramdef>Widget <parameter>widget</parameter></paramdef>
+   <paramdef>Time <parameter>time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget that has the active pointer grab.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the time argument to
+<function>XUngrabPointer</function>;
+see Section 12.1
+in Xlib &mdash; C Language X Interface.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtUngrabPointer' xrefstyle='select: title'/>
+calls
+<function>XUngrabPointer</function>
+with the specified time.
+</para>
+</sect2>
+</sect1>
+
+<sect1 id="Focusing_Events_on_a_Child">
+<title>Focusing Events on a Child</title>
+<para>
+To redirect keyboard input to a normal descendant of a
+widget without calling
+<function>XSetInputFocus</function>,
+use
+<xref linkend='XtSetKeyboardFocus' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtSetKeyboardFocus'>
+<funcprototype>
+<funcdef>void <function>XtSetKeyboardFocus</function></funcdef>
+   <paramdef>Widget <parameter>subtree</parameter></paramdef>
+   <paramdef>Widget <parameter>descendent</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>subtree</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the subtree of the hierarchy for which the keyboard focus is
+to be set.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>descendant</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies either the normal (non-pop-up) descendant of <emphasis remap='I'>subtree</emphasis> to which
+keyboard events are logically directed, or
+<function>None</function>.
+It is not an error to specify
+<function>None</function>
+when no input focus was previously set.  Must be of class Object or any subclass thereof.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtSetKeyboardFocus' xrefstyle='select: title'/>
+causes
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>
+to remap keyboard events occurring within the specified subtree
+and dispatch them to the specified descendant widget or to an ancestor.
+If the descendant's class is not a subclass of Core, the descendant is
+replaced by its closest windowed ancestor.
+</para>
+
+<para>
+When there is no modal cascade, keyboard events can be dispatched
+to a widget in one of five ways.  Assume the server delivered the
+event to the window for widget E (because of X input focus, key or
+keyboard grabs, or pointer position).
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+If neither E nor any of E's ancestors have redirected the keyboard
+focus, or if the event activated a grab for E as specified by a call
+to
+<xref linkend='XtGrabKey' xrefstyle='select: title'/>
+with any value of <emphasis remap='I'>owner_events</emphasis>, or
+if the keyboard is actively grabbed by E with <emphasis remap='I'>owner_events</emphasis>
+<function>False</function>
+via
+<xref linkend='XtGrabKeyboard' xrefstyle='select: title'/>
+or
+<xref linkend='XtGrabKey' xrefstyle='select: title'/>
+on a previous key press, the event is dispatched to E.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Beginning with the ancestor of E closest to the root that has
+redirected the keyboard focus or E if no such ancestor exists, if
+the target of that focus redirection has in turn redirected the
+keyboard focus, recursively follow this focus chain to find a widget
+F that has not redirected focus.
+    </para>
+  </listitem>
+  <listitem>
+    <itemizedlist spacing='compact'>
+      <listitem>
+        <para>
+If E is the final focus target widget F or a descendant of F, the
+event is dispatched to E.
+        </para>
+      </listitem>
+      <listitem>
+        <para>
+If E is not F, an ancestor of F, or a descendant of F, and the event
+activated a grab for E as specified by a call to
+<xref linkend='XtGrabKey' xrefstyle='select: title'/>
+for E,
+<xref linkend='XtUngrabKeyboard' xrefstyle='select: title'/>
+is called.
+        </para>
+      </listitem>
+      <listitem>
+        <para>
+If E is an ancestor of F, and the event is a key press, and either
+        </para>
+        <itemizedlist spacing='compact'>
+          <listitem>
+            <para>
+E has grabbed the key with
+<xref linkend='XtGrabKey' xrefstyle='select: title'/>
+and <emphasis remap='I'>owner_events</emphasis>
+<function>False</function>,
+or
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+E has grabbed the key with
+<xref linkend='XtGrabKey' xrefstyle='select: title'/>
+and <emphasis remap='I'>owner_events</emphasis>
+<function>True</function>,
+and the coordinates of the event are outside the rectangle specified
+by E's geometry,
+then the event is dispatched to E.
+            </para>
+          </listitem>
+        </itemizedlist>
+      </listitem>
+      <listitem>
+        <para>
+Otherwise, define A as the closest common ancestor of E and F:
+        </para>
+        <itemizedlist spacing='compact'>
+          <listitem>
+            <para>
+If there is an active keyboard grab for any widget via either
+<xref linkend='XtGrabKeyboard' xrefstyle='select: title'/>
+or
+<xref linkend='XtGrabKey' xrefstyle='select: title'/>
+on a previous key press, or
+if no widget between F and A (noninclusive) has grabbed
+the key and modifier combination with
+<xref linkend='XtGrabKey' xrefstyle='select: title'/>
+and any value of <emphasis remap='I'>owner_events</emphasis>, the event is dispatched to F.
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+Else, the event is dispatched to the ancestor of F closest to A
+that has grabbed the key and modifier combination with
+<xref linkend='XtGrabKey' xrefstyle='select: title'/>.
+            </para>
+          </listitem>
+        </itemizedlist>
+      </listitem>
+    </itemizedlist>
+  </listitem>
+</itemizedlist>
+<para>
+When there is a modal cascade, if the final destination widget as
+identified above is in the active subset of the cascade, the event is
+dispatched; otherwise the event is remapped to a spring-loaded shell
+or discarded.
+Regardless of where it is dispatched, the Intrinsics do not modify
+the contents of the event.
+</para>
+
+<para>
+When <emphasis remap='I'>subtree</emphasis> or one of its descendants acquires the X input focus
+or the pointer moves into the subtree such that keyboard events would
+now be delivered to the subtree, a
+<function>FocusIn</function>
+event is generated for the descendant if
+<function>FocusChange</function>
+events have been selected by the descendant.
+Similarly, when <emphasis remap='I'>subtree</emphasis> loses the X input focus
+or the keyboard focus for one of its ancestors, a
+<function>FocusOut</function>
+event is generated for descendant if
+<function>FocusChange</function>
+events have been selected by the descendant.
+</para>
+
+<para>
+A widget tree may also actively manage the X server input focus.  To
+do so, a widget class specifies an accept_focus procedure.
+</para>
+
+<para>
+The accept_focus procedure pointer is of type
+<xref linkend='XtAcceptFocusProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAcceptFocusProc'>
+<funcprototype>
+<funcdef>typedef Boolean *<function>XtAcceptFocusProc</function></funcdef>
+
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Time *<parameter>time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the X time of the event causing the accept focus.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+Widgets that need the input focus can call
+<function>XSetInputFocus</function>
+explicitly, pursuant to the restrictions of the <emphasis remap='I'>Inter-Client Communication Conventions Manual</emphasis>.
+To allow outside agents, such as the parent,
+to cause a widget to take the input focus,
+every widget exports an accept_focus procedure.
+The widget returns a value indicating
+whether it actually took the focus or not,
+so that the parent can give the focus to another widget.
+Widgets that need to know when they lose the input focus must use
+the Xlib focus notification mechanism explicitly
+(typically by specifying translations for
+<function>FocusIn</function>
+and
+<function>FocusOut</function>
+events).
+Widgets classes that never want the input focus should set the
+<emphasis remap='I'>accept_focus</emphasis> field to NULL.
+</para>
+
+<para>
+To call a widget's accept_focus procedure, use
+<xref linkend='XtCallAcceptFocus' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtCallAcceptFocus'>
+<funcprototype>
+<funcdef>Boolean <function>XtCallAcceptFocus</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Time *<parameter>time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the X time of the event that is causing the focus change.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtCallAcceptFocus' xrefstyle='select: title'/>
+function calls the specified widget's accept_focus procedure,
+passing it the specified widget and time, and returns what the accept_focus
+procedure returns.
+If <emphasis remap='I'>accept_focus</emphasis> is NULL,
+<xref linkend='XtCallAcceptFocus' xrefstyle='select: title'/>
+returns
+<function>False</function>.
+</para>
+<sect2 id="Events_for_Drawables_That_Are_Not_a_Widget_s_Window">
+<title>Events for Drawables That Are Not a Widget's Window</title>
+<para>
+Sometimes an application must handle events for drawables that are not
+associated with widgets in its widget tree.  Examples include handling
+<function>GraphicsExpose</function>
+and
+<function>NoExpose</function>
+events on Pixmaps, and handling
+<function>PropertyNotify</function>
+events on the root window.
+</para>
+
+<para>
+To register a drawable with the Intrinsics event dispatching, use
+<xref linkend='XtRegisterDrawable' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtRegisterDrawable'>
+<funcprototype>
+<funcdef>void <function>XtRegisterDrawable</function></funcdef>
+   <paramdef>Display *<parameter>display</parameter></paramdef>
+   <paramdef>Drawable <parameter>drawable</parameter></paramdef>
+   <paramdef>Widget <parameter>widget</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable's display.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>drawable</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable to register.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget to register the drawable for.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtRegisterDrawable' xrefstyle='select: title'/>
+associates the specified drawable with the specified widget
+so that future calls to
+<xref linkend='XtWindowToWidget' xrefstyle='select: title'/>
+with the drawable will return the widget.
+The default event dispatcher will dispatch future events that
+arrive for the drawable to the widget in the same manner as
+events that contain the widget's window.
+</para>
+
+<para>
+If the drawable is already registered with another widget, or if the
+drawable is the window of a widget in the client's widget tree, the
+results of calling
+<xref linkend='XtRegisterDrawable' xrefstyle='select: title'/>
+are undefined.
+</para>
+
+<para>
+To unregister a drawable with the Intrinsics event dispatching, use
+<xref linkend='XtUnregisterDrawable' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtUnregisterDrawable'>
+<funcprototype>
+<funcdef>void <function>XtUnregisterDrawable</function></funcdef>
+   <paramdef>Display *<parameter>display</parameter></paramdef>
+   <paramdef>Drawable <parameter>drawable</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable's display.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>drawable</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable to unregister.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtUnregisterDrawable' xrefstyle='select: title'/>
+removes an association created with
+<xref linkend='XtRegisterDrawable' xrefstyle='select: title'/>.
+If the drawable is the window of a widget in the client's widget tree
+the results of calling
+<xref linkend='XtUnregisterDrawable' xrefstyle='select: title'/>
+are undefined.
+</para>
+</sect2>
+</sect1>
+
+<sect1 id="Querying_Event_Sources">
+<title>Querying Event Sources</title>
+<para>
+The event manager provides several functions to examine and read events
+(including file and timer events) that are in the queue.
+The next three functions are Intrinsics equivalents of the
+<function>XPending</function>,
+<function>XPeekEvent</function>,
+and
+<function>XNextEvent</function>
+Xlib calls.
+</para>
+
+<para>
+To determine if there are any events on the input queue for a given application,
+use
+<xref linkend='XtAppPending' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppPending'>
+<funcprototype>
+<funcdef>XtInputMask <function>XtAppPending</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context that identifies the application to check.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtAppPending' xrefstyle='select: title'/>
+function returns a nonzero value if there are
+events pending from the X server, timer pending, other input sources
+pending, or signal sources pending.  The
+value returned is a bit mask that is the OR of
+<function>XtIMXEvent</function>,
+<function>XtIMTimer</function>,
+<function>XtIMAlternateInput</function>,
+and
+<function>XtIMSignal</function>
+(see
+<function>XtAppProcessEvent ).</function>
+If there are no events pending,
+<xref linkend='XtAppPending' xrefstyle='select: title'/>
+flushes the output buffers of each Display in the application context
+and returns zero.
+</para>
+
+<para>
+To return the event from the head of a given application's input queue
+without removing input from the queue, use
+<xref linkend='XtAppPeekEvent' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppPeekEvent'>
+<funcprototype>
+<funcdef>Boolean <function>XtAppPeekEvent</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+   <paramdef>XEvent *<parameter>event_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context that identifies the application.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the event information to the specified event structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If there is an X event in the queue,
+<xref linkend='XtAppPeekEvent' xrefstyle='select: title'/>
+copies it into <emphasis remap='I'>event_return</emphasis> and returns
+<function>True</function>.
+If no X input is on the queue,
+<xref linkend='XtAppPeekEvent' xrefstyle='select: title'/>
+flushes the output buffers of each Display in the application context
+and blocks until some input is available
+(possibly calling some timeout callbacks in the interim).
+If the next available input is an X event,
+<xref linkend='XtAppPeekEvent' xrefstyle='select: title'/>
+fills in <emphasis remap='I'>event_return</emphasis> and returns
+<function>True</function>.
+Otherwise, the input is for an input source
+registered with
+<xref linkend='XtAppAddInput' xrefstyle='select: title'/>,
+and
+<xref linkend='XtAppPeekEvent' xrefstyle='select: title'/>
+returns
+<function>False</function>.
+The sample implementations provides XtAppPeekEvent as described.  Timeout callbacks
+are called while blocking for input.  If some input for an input source is
+available,
+<xref linkend='XtAppPeekEvent' xrefstyle='select: title'/>
+will return
+<function>True</function>
+without returning an event.
+</para>
+
+<para>
+To remove and return the event
+from the head of a given application's X event queue,
+use
+<xref linkend='XtAppNextEvent' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppNextEvent'>
+<funcprototype>
+<funcdef>void <function>XtAppNextEvent</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+   <paramdef>XEvent *<parameter>event_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context that identifies the application.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the event information to the specified event structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If the X event queue is empty,
+<xref linkend='XtAppNextEvent' xrefstyle='select: title'/>
+flushes the X output buffers of each Display in the application context
+and waits for an X event while looking at the other input sources
+and timeout values and calling any callback procedures triggered by them.
+This wait time can be used for background processing;
+see <xref linkend='Adding_Background_Work_Procedures' />.
+</para>
+</sect1>
+
+<sect1 id="Dispatching_Events">
+<title>Dispatching Events</title>
+<para>
+The Intrinsics provide functions that dispatch events
+to widgets or other application code.
+Every client interested in X events on a widget uses
+<xref linkend='XtAddEventHandler' xrefstyle='select: title'/>
+to register which events it is
+interested in and a procedure (event handler) to be called
+when the event happens in that window.
+The translation manager automatically registers event handlers for widgets
+that use translation tables; see <xref linkend='Translation_Management' />.
+</para>
+
+<para>
+Applications that need direct control of the processing of different types
+of input should use
+<xref linkend='XtAppProcessEvent' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppProcessEvent'>
+<funcprototype>
+<funcdef>void <function>XtAppProcessEvent</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+   <paramdef>XtInputMask <parameter>mask</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context that identifies the
+application for which to process input.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>mask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies what types of events to process.
+The mask is the bitwise inclusive OR of any combination of
+<function>XtIMXEvent</function>,
+<function>XtIMTimer</function>,
+<function>XtIMAlternateInput</function>,
+and
+<function>XtIMSignal</function>.
+As a convenience,
+<filename class="headerfile">Intrinsic.h</filename>
+defines the symbolic name
+<function>XtIMAll</function>
+to be the bitwise inclusive OR of these four event types.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtAppProcessEvent' xrefstyle='select: title'/>
+function processes one timer, input source, signal source, or X event.
+If there is no event or input of the appropriate type to process, then
+<xref linkend='XtAppProcessEvent' xrefstyle='select: title'/>
+blocks until there is.
+If there is more than one type of input available to process,
+it is undefined which will get processed.
+Usually, this procedure is not called by client applications; see
+<xref linkend='XtAppMainLoop' xrefstyle='select: title'/>.
+<xref linkend='XtAppProcessEvent' xrefstyle='select: title'/>
+processes timer events by calling any appropriate timer callbacks,
+input sources by calling any appropriate input callbacks,
+signal source by calling any appropriate signal callbacks,
+and X events by
+calling
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>.
+</para>
+
+<para>
+When an X event is received,
+it is passed to
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>,
+which calls the appropriate event handlers
+and passes them the widget, the event, and client-specific data
+registered with each procedure.
+If no handlers for that event are registered,
+the event is ignored and the dispatcher simply returns.
+</para>
+
+<para>
+To dispatch an event returned by
+<xref linkend='XtAppNextEvent' xrefstyle='select: title'/>,
+retrieved directly from the Xlib queue, or synthetically constructed,
+to any registered event filters or event handlers, call
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtDispatchEvent'>
+<funcprototype>
+<funcdef>Boolean <function>XtDispatchEvent</function></funcdef>
+   <paramdef>XEvent *<parameter>event</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to the event structure to be dispatched
+to the appropriate event handlers.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>
+function first calls
+<function>XFilterEvent</function>
+with the <emphasis remap='I'>event</emphasis> and the window of the widget to which the
+Intrinsics intend to dispatch the event, or the event window if
+the Intrinsics would not dispatch the event to any handlers.
+If
+<function>XFilterEvent</function>
+returns
+<function>True</function>
+and the event activated a server grab as identified
+by a previous call to
+<xref linkend='XtGrabKey' xrefstyle='select: title'/>
+or
+<xref linkend='XtGrabButton' xrefstyle='select: title'/>,
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>
+calls
+<xref linkend='XtUngrabKeyboard' xrefstyle='select: title'/>
+or
+<xref linkend='XtUngrabPointer' xrefstyle='select: title'/>
+with the timestamp from the event and immediately returns
+<function>True</function>.
+If
+<function>XFilterEvent</function>
+returns
+<function>True</function>
+and a grab was not activated,
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>
+just immediately returns
+<function>True</function>.
+Otherwise,
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>
+sends the event to the event handler functions that
+have been previously registered with the dispatch routine.
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>
+returns
+<function>True</function>
+if
+<function>XFilterEvent</function>
+returned
+<function>True</function>,
+or if the event was dispatched to some handler, and
+<function>False</function>
+if it found no handler to which to dispatch the event.
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>
+records the last timestamp in any event that
+contains a timestamp (see
+<function>XtLastTimestampProcessed</function>),
+regardless of whether it was filtered or dispatched.
+If a modal cascade is active with <emphasis remap='I'>spring_loaded</emphasis>
+<function>True</function>,
+and if the event is a remap event as defined by
+<xref linkend='XtAddGrab' xrefstyle='select: title'/>,
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>
+may dispatch the event a second time.  If it does so,
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>
+will call
+<function>XFilterEvent</function>
+again with the window of the spring-loaded widget prior to the second
+dispatch, and if
+<function>XFilterEvent</function>
+returns
+<function>True</function>,
+the second dispatch will not be performed.
+</para>
+</sect1>
+
+<sect1 id="The_Application_Input_Loop">
+<title>The Application Input Loop</title>
+<para>
+To process all input from a given application in a continuous loop,
+use the convenience procedure
+<xref linkend='XtAppMainLoop' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppMainLoop'>
+<funcprototype>
+<funcdef>void <function>XtAppMainLoop</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context that identifies the application.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The <xref linkend='XtAppMainLoop' xrefstyle='select: title'/>
+function processes events using
+<xref linkend='XtAppProcessEvent' xrefstyle='select: title'/>,
+varying the <emphasis remap='I'>mask parameter</emphasis>
+and using <xref linkend='XtAppPending' xrefstyle='select: title'/>
+to ensure that it has a chance to handle events of all types,
+i.e., X events, timer events, input events and signal sources.
+This constitutes the main loop of X Toolkit applications.
+There is nothing special about
+<xref linkend='XtAppMainLoop' xrefstyle='select: title'/>;
+it simply processes events in a conditional loop.
+At the bottom of the loop, it checks to see if the specified
+application context's destroy flag is set.
+If the flag is set, the loop breaks.
+The whole loop is enclosed between a matching
+<xref linkend='XtAppLock' xrefstyle='select: title'/>
+and
+<xref linkend='XtAppUnlock' xrefstyle='select: title'/>.
+</para>
+
+<para>
+Applications can provide their own version of this loop,
+which tests some global termination flag or tests that the number
+of top-level widgets is larger than zero before
+circling back for the next event.
+</para>
+
+<para>
+The design of 
+<xref linkend='XtAppMainLoop' xrefstyle='select: title'/>
+has changed since Release 6.
+Originally it looped over calls to
+<xref linkend='XtAppNextEvent' xrefstyle='select: title'/>,
+and
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>,
+but because the latter returns only after an X event
+(not for timers, signals, inputs),
+it was modified to allow any type of event to break out of the loop.
+</para>
+</sect1>
+
+<sect1 id="Setting_and_Checking_the_Sensitivity_State_of_a_Widget">
+<title>Setting and Checking the Sensitivity State of a Widget</title>
+<para>
+Many widgets have a mode in which they assume a different appearance
+(for example, are grayed out or stippled), do not respond to user events,
+and become dormant.
+</para>
+
+<para>
+When dormant,
+a widget is considered to be insensitive.
+If a widget is insensitive,
+the event manager does not dispatch any events to the widget
+with an event type of
+<function>KeyPress</function>,
+<function>KeyRelease</function>,
+<function>ButtonPress</function>,
+<function>ButtonRelease</function>,
+<function>MotionNotify</function>,
+<function>EnterNotify</function>,
+<function>LeaveNotify</function>,
+<function>FocusIn</function>,
+or
+<function>FocusOut</function>.
+</para>
+
+<para>
+A widget can be insensitive because its <emphasis remap='I'>sensitive</emphasis> field is
+<function>False</function>
+or because one of its ancestors is insensitive and thus the widget's
+<emphasis remap='I'>ancestor_sensitive</emphasis> field also is
+<function>False</function>.
+A widget can but does not need to distinguish these two cases visually.
+</para>
+
+<note>
+<para>
+Pop-up shells will have
+<emphasis remap='I'>ancestor_sensitive</emphasis>
+<function>False</function>
+if the parent was insensitive when the shell
+was created.  Since
+<xref linkend='XtSetSensitive' xrefstyle='select: title'/>
+on the parent will not
+modify the resource of the pop-up child, clients are advised to include
+a resource specification of the form
+&ldquo;*TransientShell.ancestorSensitive: True&rdquo;
+in the application defaults resource file or to
+otherwise ensure that the parent is
+sensitive when creating pop-up shells.
+</para>
+</note>
+
+<para>
+To set the sensitivity state of a widget, use
+<xref linkend='XtSetSensitive' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtSetSensitive'>
+<funcprototype>
+<funcdef>void <function>XtSetSensitive</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Boolean <parameter>sensitive</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.  Must be of class RectObj or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>sensitive</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies whether the widget should receive
+keyboard, pointer, and focus events.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtSetSensitive' xrefstyle='select: title'/>
+function first calls
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+on the current widget with an argument list specifying the
+XtNsensitive resource and the new value.
+If <emphasis remap='I'>sensitive</emphasis> is
+<function>False</function>
+and the widget's class is a subclass of
+Composite,
+<xref linkend='XtSetSensitive' xrefstyle='select: title'/>
+recursively propagates the new value
+down the child tree by calling
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+on each child to set <emphasis remap='I'>ancestor_sensitive</emphasis> to
+<function>False</function>.
+If <emphasis remap='I'>sensitive</emphasis> is
+<function>True</function>
+and the widget's class is a subclass of
+Composite
+and the widget's <emphasis remap='I'>ancestor_sensitive</emphasis> field is
+<function>True</function>,
+<xref linkend='XtSetSensitive' xrefstyle='select: title'/>
+sets the <emphasis remap='I'>ancestor_sensitive</emphasis> of each child to
+<function>True</function>
+and then recursively calls
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+on each normal descendant that is now sensitive to set
+<emphasis remap='I'>ancestor_sensitive</emphasis> to
+<function>True</function>.
+</para>
+
+<para>
+<xref linkend='XtSetSensitive' xrefstyle='select: title'/>
+calls
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+to change the <emphasis remap='I'>sensitive</emphasis> and <emphasis remap='I'>ancestor_sensitive</emphasis> fields
+of each affected widget.
+Therefore, when one of these changes,
+the widget's set_values procedure should
+take whatever display actions are needed
+(for example, graying out or stippling the widget).
+</para>
+
+<para>
+<xref linkend='XtSetSensitive' xrefstyle='select: title'/>
+maintains the invariant that, if the parent has either <emphasis remap='I'>sensitive</emphasis>
+or <emphasis remap='I'>ancestor_sensitive</emphasis>
+<function>False</function>,
+then all children have <emphasis remap='I'>ancestor_sensitive</emphasis>
+<function>False</function>.
+</para>
+
+<para>
+To check the current sensitivity state of a widget,
+use
+<xref linkend='XtIsSensitive' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtIsSensitive'>
+<funcprototype>
+<funcdef>Boolean <function>XtIsSensitive</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the object.  Must be of class Object or any subclass thereof.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtIsSensitive' xrefstyle='select: title'/>
+function returns
+<function>True</function>
+or
+<function>False</function>
+to indicate whether user input events are being dispatched.
+If object's class is a subclass of RectObj and
+both <emphasis remap='I'>sensitive</emphasis> and <emphasis remap='I'>ancestor_sensitive</emphasis> are
+<function>True</function>,
+<xref linkend='XtIsSensitive' xrefstyle='select: title'/>
+returns
+<function>True</function>;
+otherwise, it returns
+<function>False</function>.
+</para>
+</sect1>
+
+<sect1 id="Adding_Background_Work_Procedures">
+<title>Adding Background Work Procedures</title>
+<para>
+The Intrinsics have some limited support for background processing.
+Because most applications spend most of their time waiting for input,
+you can register an idle-time work procedure
+that is called when the toolkit would otherwise block in
+<xref linkend='XtAppNextEvent' xrefstyle='select: title'/>
+or
+<xref linkend='XtAppProcessEvent' xrefstyle='select: title'/>.
+Work procedure pointers are of type
+<xref linkend='XtWorkProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtWorkProc'>
+<funcprototype>
+<funcdef>typedef Boolean <function>(*XtWorkProc)</function></funcdef>
+
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Passes the client data specified when the work procedure was registered.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+This procedure should return
+<function>True</function>
+when it is done to indicate that it
+should be removed.
+If the procedure returns
+<function>False</function>,
+it will remain registered and called again when the
+application is next idle.
+Work procedures should be very judicious about how much they do.
+If they run for more than a small part of a second,
+interactive feel is likely to suffer.
+</para>
+
+<para>
+To register a work procedure for a given application, use
+<xref linkend='XtAppAddWorkProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppAddWorkProc'>
+<funcprototype>
+<funcdef>XtWorkProcId <function>XtAppAddWorkProc</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+   <paramdef>XtWorkProc <parameter>proc</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context that identifies the application.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to be called when the application is idle.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the argument passed to the specified procedure
+when it is called.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtAppAddWorkProc' xrefstyle='select: title'/>
+function adds the specified work procedure for the application identified
+by <emphasis remap='I'>app_context</emphasis>
+and returns an opaque unique identifier for this work procedure.
+Multiple work procedures can be registered,
+and the most recently added one is always the one that is called.
+However, if a work procedure adds another work procedure,
+the newly added one has lower priority than the current one.
+</para>
+
+<para>
+To remove a work procedure, either return
+<function>True</function>
+from the procedure when it is called or use
+<xref linkend='XtRemoveWorkProc' xrefstyle='select: title'/>
+outside of the procedure.
+</para>
+
+<funcsynopsis id='XtRemoveWorkProc'>
+<funcprototype>
+<funcdef>void <function>XtRemoveWorkProc</function></funcdef>
+   <paramdef>XtWorkProcId <parameter>id</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>id</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies which work procedure to remove.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtRemoveWorkProc' xrefstyle='select: title'/>
+function explicitly removes the specified background work procedure.
+</para>
+</sect1>
+
+<sect1 id="X_Event_Filters">
+<title>X Event Filters</title>
+<para>
+The event manager provides filters that can be applied to
+specific X events.
+The filters, which screen out events that are redundant or are temporarily
+unwanted, handle
+pointer motion compression,
+enter/leave compression, and
+exposure compression.
+</para>
+<sect2 id="Pointer_Motion_Compression">
+<title>Pointer Motion Compression</title>
+<para>
+Widgets can have a hard time keeping up with a rapid stream of
+pointer motion events.  Furthermore,
+they usually do not care about every motion event.  To throw out
+redundant motion events, the widget class field <emphasis remap='I'>compress_motion</emphasis> should be
+<function>True</function>.
+When a request for an event would return a motion event,
+the Intrinsics check if there are any other motion events
+for the same widget immediately
+following the current one and, if so, skip all but the last of them.
+</para>
+</sect2>
+
+<sect2 id="Enter_Leave_Compression">
+<title>Enter/Leave Compression</title>
+<para>
+To throw out pairs of enter and leave events that have no intervening events,
+as can happen when the user moves the pointer across a widget
+without stopping in it,
+the widget class field <emphasis remap='I'>compress_enterleave</emphasis> should be
+<function>True</function>.
+These enter and leave events are not delivered to the client
+if they are found together in the input queue.
+</para>
+</sect2>
+
+<sect2 id="Exposure_Compression">
+<title>Exposure Compression</title>
+<para>
+Many widgets prefer to process a series of exposure events as a
+single expose region rather than as individual rectangles.  Widgets
+with complex displays might use the expose region as a clip list
+in a graphics context, and widgets with simple displays might
+ignore the region entirely and redisplay their whole window or
+might get the bounding box from the region and redisplay only that
+rectangle.
+</para>
+
+<para>
+In either case, these widgets do not care about getting partial exposure events.
+The <emphasis remap='I'>compress_exposure</emphasis> field in the widget class
+structure specifies the type and number of exposure events that are
+dispatched to the widget's expose procedure.  This field must be
+initialized to one of the following values:
+</para>
+
+<programlisting>
+#define XtExposeNoCompress              ((XtEnum)False)
+#define XtExposeCompressSeries          ((XtEnum)True)
+#define XtExposeCompressMultiple        &lt;implementation-defined&gt;
+#define XtExposeCompressMaximal         &lt;implementation-defined&gt;
+</programlisting>
+
+<para>
+optionally ORed with any combination of the following flags (all with
+implementation-defined values):
+<function>XtExposeGraphicsExpose</function>,
+<function>XtExposeGraphicsExposeMerged</function>,
+<function>XtExposeNoExpose</function>,
+and
+<function>XtExposeNoRegion</function>.
+</para>
+
+<para>
+If the <emphasis remap='I'>compress_exposure</emphasis> field in the widget class structure does not
+specify
+<function>XtExposeNoCompress</function>,
+the event manager calls the widget's expose procedure only
+once for a series of exposure events.
+In this case, all
+<function>Expose</function>
+or
+<function>GraphicsExpose</function>
+events are accumulated into a region.
+When the final event is received,
+the event manager replaces the rectangle in the event with the
+bounding box for the region
+and calls the widget's expose procedure,
+passing the modified exposure event and (unless
+<function>XtExposeNoRegion</function>
+is specified) the region.
+For more information on regions, see
+Section 16.5 in
+Xlib &mdash; C Language X Interface.
+</para>
+
+<para>
+The values have the following interpretation:
+</para>
+
+<para>
+<function>XtExposeNoCompress</function>
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+No exposure compression is performed; every selected event is
+individually dispatched to the expose procedure with a <emphasis remap='I'>region</emphasis>
+argument of NULL.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<function>XtExposeCompressSeries</function>
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Each series of exposure events is coalesced into a single event,
+which is dispatched
+when an exposure event with count equal to zero is reached.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<function>XtExposeCompressMultiple</function>
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Consecutive series of exposure events are coalesced into a single
+event, which is dispatched
+when an exposure event with count equal to zero is reached and either
+the event queue is empty or the next event is not an exposure event
+for the same widget.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<function>XtExposeCompressMaximal</function>
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+All expose series currently in the queue for the widget
+are coalesced into a single
+event without regard to intervening nonexposure events.  If a
+partial series is in the end of the queue, the Intrinsics will
+block until the end of the series is received.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+The additional flags have the following meaning:
+</para>
+
+<para>
+<function>XtExposeGraphicsExpose</function>
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Specifies that
+<function>GraphicsExpose</function>
+events are also to be dispatched to
+the expose procedure.
+<function>GraphicsExpose</function>
+events are compressed, if specified, in the same manner as
+<function>Expose</function>
+events.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<function>XtExposeGraphicsExposeMerged</function>
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Specifies in the case of
+<function>XtExposeCompressMultiple</function>
+and
+<function>XtExposeCompressMaximal</function>
+that series of
+<function>GraphicsExpose</function>
+and
+<function>Expose</function>
+events are to be compressed together, with the final event type
+determining the type of the event passed to the expose procedure.
+If this flag is not set, then only series of the same event type
+as the event at the head of the queue are coalesced.  This flag
+also implies
+<function>XtExposeGraphicsExpose</function>.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<function>XtExposeNoExpose</function>
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Specifies that
+<function>NoExpose</function>
+events are also to be dispatched to the expose procedure.
+<function>NoExpose</function>
+events are never coalesced with
+other exposure events or with each other.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<function>XtExposeNoRegion</function>
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Specifies that the final region argument passed to the expose
+procedure is NULL.  The rectangle in the event will still
+contain bounding box information for the entire series of
+compressed exposure events.  This option saves processing time when the
+region is not needed by the widget.
+    </para>
+  </listitem>
+</itemizedlist>
+</sect2>
+</sect1>
+
+<sect1 id="Widget_Exposure_and_Visibility">
+<title>Widget Exposure and Visibility</title>
+<para>
+Every primitive widget and some composite widgets display data on the screen
+by means of direct Xlib calls.
+Widgets cannot simply write to the screen and forget what they have done.
+They must keep enough state to redisplay the window or parts
+of it if a portion is obscured and then reexposed.
+</para>
+
+<sect2 id="Redisplay_of_a_Widget_The_expose_Procedure">
+<title>Redisplay of a Widget: The expose Procedure</title>
+<para>
+The expose procedure pointer in a widget class is of type
+<xref linkend='XtExposeProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtExposeProc'>
+<funcprototype>
+<funcdef>typedef void <function>(*XtExposeProc)</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>XEvent *<parameter>event</parameter></paramdef>
+   <paramdef>Region <parameter>region</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget instance requiring redisplay.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the exposure event giving the rectangle requiring redisplay.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>region</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the union of all rectangles in this exposure sequence.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The redisplay of a widget upon exposure is the responsibility of the
+expose procedure in the widget's class record.
+If a widget has no display semantics,
+it can specify NULL for the <emphasis remap='I'>expose</emphasis> field.
+Many composite widgets serve only as containers for their children
+and have no expose procedure.
+</para>
+
+<note>
+<para>
+If the <emphasis remap='I'>expose</emphasis> procedure is NULL,
+<xref linkend='XtRealizeWidget' xrefstyle='select: title'/>
+fills in a default bit gravity of
+<function>NorthWestGravity</function>
+before it calls the widget's realize procedure.
+</para>
+</note>
+
+<para>
+If the widget's <emphasis remap='I'>compress_exposure</emphasis> class field specifies
+<function>XtExposeNoCompress</function>
+or
+<function>XtExposeNoRegion</function>,
+or if the event type is
+<function>NoExpose</function>
+(see <xref linkend='Exposure_Compression' />),
+<emphasis remap='I'>region</emphasis> is NULL.  If
+<function>XtExposeNoCompress</function>
+is not specified and the event type is not
+<function>NoExpose</function>,
+the event is the final event in the compressed series
+but <emphasis remap='I'>x</emphasis>, <emphasis remap='I'>y</emphasis>, <emphasis remap='I'>width</emphasis>, and <emphasis remap='I'>height</emphasis> contain
+the bounding box for all the compressed events.
+The region is created and destroyed by the Intrinsics, but
+the widget is permitted to modify the region contents.
+</para>
+
+<para>
+A small simple widget (for example, Label) can ignore the bounding box
+information in the event and redisplay the entire window.
+A more complicated widget (for example, Text) can use the bounding box
+information to minimize the amount of calculation and redisplay it does.
+A very complex widget uses the region as a clip list in a GC and
+ignores the event information.
+The expose procedure is not chained and is therefore
+responsible for exposure of all superclass data
+as well as its own.
+</para>
+
+<para>
+However,
+it often is possible to anticipate the display needs of several levels
+of subclassing.
+For example, rather than implement separate display procedures for
+the widgets Label, Pushbutton, and Toggle,
+you could write a single display routine in Label that uses display state
+fields like
+</para>
+<programlisting>
+Boolean         invert;
+Boolean         highlight;
+Dimension       highlight_width;
+</programlisting>
+<para>
+Label would have <emphasis remap='I'>invert</emphasis> and <emphasis remap='I'>highlight</emphasis> always
+<function>False</function>
+and <emphasis remap='I'>highlight_width</emphasis> zero.
+Pushbutton would dynamically set <emphasis remap='I'>highlight</emphasis> and <emphasis remap='I'>highlight_width</emphasis>,
+but it would leave <emphasis remap='I'>invert</emphasis> always
+<function>False</function>.
+Finally, Toggle would dynamically set all three.
+In this case,
+the expose procedures for Pushbutton and Toggle inherit
+their superclass's expose procedure;
+see <xref linkend='Inheritance_of_Superclass_Operations' />.
+</para>
+</sect2>
+
+<sect2 id="Widget_Visibility">
+<title>Widget Visibility</title>
+<para>
+Some widgets may use substantial computing resources to produce the
+data they will display.
+However, this effort is wasted if the widget is not actually visible
+on the screen, that is, if the widget is obscured by another application
+or is iconified.
+</para>
+
+<para>
+The <emphasis remap='I'>visible</emphasis> field in the
+core
+widget structure provides a hint to the widget that it need not compute
+display data.
+This field is guaranteed to be
+<function>True</function>
+by the time an
+exposure
+event is processed if any part of the widget is visible,
+but is
+<function>False</function>
+if the widget is fully obscured.
+</para>
+
+<para>
+Widgets can use or ignore the <emphasis remap='I'>visible</emphasis> hint.
+If they ignore it,
+they should have <emphasis remap='I'>visible_interest</emphasis> in their widget class record set
+<function>False</function>.
+In such cases,
+the <emphasis remap='I'>visible</emphasis> field is initialized
+<function>True</function>
+and never changes.
+If <emphasis remap='I'>visible_interest</emphasis> is
+<function>True</function>,
+the event manager asks for
+<function>VisibilityNotify</function>
+events for the widget and sets <emphasis remap='I'>visible</emphasis> to
+<function>True</function>
+on
+<function>VisibilityUnobscured</function>
+or
+<function>VisibilityPartiallyObscured</function>
+events and
+<function>False</function>
+on
+<function>VisibilityFullyObscured</function>
+events.
+</para>
+</sect2>
+</sect1>
+
+<sect1 id="X_Event_Handlers">
+<title>X Event Handlers</title>
+<para>
+Event handlers are procedures called when specified events
+occur in a widget.
+Most widgets need not use event handlers explicitly.
+Instead, they use the Intrinsics translation manager.
+Event handler procedure pointers are of the type
+<xref linkend='XtEventHandler' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtEventHandler'>
+<funcprototype>
+<funcdef>typedef void <function>(*XtEventHandler)</function></funcdef>
+
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+   <paramdef>XEvent *<parameter>event</parameter></paramdef>
+   <paramdef>Boolean *<parameter>continue_to_dispatch</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget for which the event arrived.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies any client-specific information registered with the event handler.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the triggering event.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>continue_to_dispatch</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies whether the remaining event
+handlers registered for the current event
+should be called.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+After receiving an event and before calling any event handlers, the
+Boolean pointed to by <emphasis remap='I'>continue_to_dispatch</emphasis> is initialized to
+<function>True</function>.
+When an event handler is called, it may decide that further processing
+of the event is not desirable and may store
+<function>False</function>
+in this Boolean, in
+which case any handlers remaining to be called for the event are
+ignored.
+</para>
+
+<para>
+The circumstances under which the Intrinsics may add event handlers
+to a widget are currently implementation-dependent.  Clients must
+therefore be aware that storing
+<function>False</function>
+into the <emphasis remap='I'>continue_to_dispatch</emphasis> argument can lead to portability problems.
+</para>
+<sect2 id="Event_Handlers_That_Select_Events">
+<title>Event Handlers That Select Events</title>
+<para>
+To register an event handler procedure with the dispatch mechanism, use
+<xref linkend='XtAddEventHandler' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAddEventHandler'>
+<funcprototype>
+<funcdef>void <function>XtAddEventHandler</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>EventMask <parameter>event_mask</parameter></paramdef>
+   <paramdef>Boolean <parameter>nonmaskable</parameter></paramdef>
+   <paramdef>XtEventHandler <parameter>proc</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget for which this event handler is being registered.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_mask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the event mask for which to call this procedure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nonmaskable</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies whether this procedure should be
+called on the nonmaskable events
+<function>( GraphicsExpose</function>,
+<function>NoExpose</function>,
+<function>SelectionClear</function>,
+<function>SelectionRequest</function>,
+<function>SelectionNotify</function>,
+<function>ClientMessage</function>,
+and
+<function>MappingNotify ).</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to be called.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies additional data to be passed to the event handler.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtAddEventHandler' xrefstyle='select: title'/>
+function registers a procedure with the dispatch mechanism that is
+to be called when an event that matches the mask occurs on the specified
+widget.
+Each widget has a single registered event handler list, which will
+contain any procedure/client_data pair exactly once regardless of
+the manner in which it is registered.
+If the procedure is already registered with the same <emphasis remap='I'>client_data</emphasis>
+value,
+the specified mask augments the existing mask.
+If the widget is realized,
+<xref linkend='XtAddEventHandler' xrefstyle='select: title'/>
+calls
+<function>XSelectInput</function>,
+if necessary.
+The order in which this procedure is called relative to other handlers
+registered for the same event is not defined.
+</para>
+
+<para>
+To remove a previously registered event handler, use
+<xref linkend='XtRemoveEventHandler' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtRemoveEventHandler'>
+<funcprototype>
+<funcdef>void <function>XtRemoveEventHandler</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>EventMask <parameter>event_mask</parameter></paramdef>
+   <paramdef>Boolean <parameter>nonmaskable</parameter></paramdef>
+   <paramdef>XtEventHandler <parameter>proc</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget for which this procedure is registered.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_mask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the event mask for which to unregister this procedure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nonmaskable</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies whether this procedure should be
+removed on the nonmaskable events
+<function>( GraphicsExpose</function>,
+<function>NoExpose</function>,
+<function>SelectionClear</function>,
+<function>SelectionRequest</function>,
+<function>SelectionNotify</function>,
+<function>ClientMessage</function>,
+and
+<function>MappingNotify ).</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to be removed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the registered client data.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtRemoveEventHandler' xrefstyle='select: title'/>
+function unregisters an event handler registered with
+<xref linkend='XtAddEventHandler' xrefstyle='select: title'/>
+or
+<xref linkend='XtInsertEventHandler' xrefstyle='select: title'/>
+for the specified events.
+The request is ignored if <emphasis remap='I'>client_data</emphasis> does not match the value given
+when the handler was registered.
+If the widget is realized and no other event handler requires the event,
+<xref linkend='XtRemoveEventHandler' xrefstyle='select: title'/>
+calls
+<function>XSelectInput</function>.
+If the specified procedure has not been registered
+or if it has been registered with a different value of <emphasis remap='I'>client_data</emphasis>,
+<xref linkend='XtRemoveEventHandler' xrefstyle='select: title'/>
+returns without reporting an error.
+</para>
+
+<para>
+To stop a procedure registered with
+<xref linkend='XtAddEventHandler' xrefstyle='select: title'/>
+or
+<xref linkend='XtInsertEventHandler' xrefstyle='select: title'/>
+from receiving all selected events, call
+<xref linkend='XtRemoveEventHandler' xrefstyle='select: title'/>
+with an <emphasis remap='I'>event_mask</emphasis> of
+<function>XtAllEvents</function>
+and <emphasis remap='I'>nonmaskable</emphasis>
+<function>True</function>.
+The procedure will continue to receive any events
+that have been specified in calls to
+<xref linkend='XtAddRawEventHandler' xrefstyle='select: title'/>
+or
+<xref linkend='XtInsertRawEventHandler' xrefstyle='select: title'/>.
+</para>
+
+<para>
+To register an event handler procedure that receives events before or
+after all previously registered event handlers, use
+<xref linkend='XtInsertEventHandler' xrefstyle='select: title'/>.
+</para>
+<programlisting>
+typedef enum {XtListHead, XtListTail} XtListPosition;
+</programlisting>
+
+<funcsynopsis id='XtInsertEventHandler'>
+<funcprototype>
+<funcdef>void <function>XtInsertEventHandler</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>EventMask <parameter>event_mask</parameter></paramdef>
+   <paramdef>Boolean <parameter>nonmaskable</parameter></paramdef>
+   <paramdef>XtEventHandler <parameter>proc</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+   <paramdef>XtListPosition <parameter>position</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget for which this event handler is being registered. Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_mask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the event mask for which to call this procedure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nonmaskable</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies whether this procedure should be
+called on the nonmaskable events
+<function>( GraphicsExpose</function>,
+<function>NoExpose</function>,
+<function>SelectionClear</function>,
+<function>SelectionRequest</function>,
+<function>SelectionNotify</function>,
+<function>ClientMessage</function>,
+and
+<function>MappingNotify ).</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to be called.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies additional data to be passed to the client's event handler.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>position</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies when the event handler is to be called
+relative to other previously registered handlers.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtInsertEventHandler' xrefstyle='select: title'/>
+is identical to
+<xref linkend='XtAddEventHandler' xrefstyle='select: title'/>
+with the additional <emphasis remap='I'>position</emphasis> argument.  If <emphasis remap='I'>position</emphasis> is
+<function>XtListHead</function>,
+the event
+handler is registered so that it is called before any event
+handlers that were previously registered for the same widget.  If
+<emphasis remap='I'>position</emphasis> is
+<function>XtListTail</function>,
+the event handler is registered to be called
+after any previously registered event handlers.  If the procedure is
+already registered with the same <emphasis remap='I'>client_data</emphasis> value, the specified mask
+augments the existing mask and the procedure is repositioned in
+the list.
+</para>
+</sect2>
+
+<sect2 id="Event_Handlers_That_Do_Not_Select_Events">
+<title>Event Handlers That Do Not Select Events</title>
+<para>
+On occasion,
+clients need to register an event handler procedure with the
+dispatch mechanism without explicitly
+causing the X server to select for that event.
+To do this, use
+<xref linkend='XtAddRawEventHandler' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAddRawEventHandler'>
+<funcprototype>
+<funcdef>void <function>XtAddRawEventHandler</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>EventMask <parameter>event_mask</parameter></paramdef>
+   <paramdef>Boolean <parameter>nonmaskable</parameter></paramdef>
+   <paramdef>XtEventHandler <parameter>proc</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget for which this event handler is being registered. Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_mask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the event mask for which to call this procedure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nonmaskable</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies whether this procedure should be
+called on the nonmaskable events
+<function>( GraphicsExpose</function>,
+<function>NoExpose</function>,
+<function>SelectionClear</function>,
+<function>SelectionRequest</function>,
+<function>SelectionNotify</function>,
+<function>ClientMessage</function>,
+and
+<function>MappingNotify ).</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to be called.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies additional data to be passed to the client's event handler.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtAddRawEventHandler' xrefstyle='select: title'/>
+function is similar to
+<xref linkend='XtAddEventHandler' xrefstyle='select: title'/>
+except that it does not affect the widget's event mask and never causes an
+<function>XSelectInput</function>
+for its events.
+Note that the widget might already have those mask bits set
+because of other nonraw event handlers registered on it.
+If the procedure is already registered with the same <emphasis remap='I'>client_data</emphasis>,
+the specified mask augments the existing mask.
+The order in which this procedure is called relative to other handlers
+registered for the same event is not defined.
+</para>
+
+<para>
+To remove a previously registered raw event handler, use
+<xref linkend='XtRemoveRawEventHandler' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtRemoveRawEventHandler'>
+<funcprototype>
+<funcdef>void <function>XtRemoveRawEventHandler</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>EventMask <parameter>event_mask</parameter></paramdef>
+   <paramdef>Boolean <parameter>nonmaskable</parameter></paramdef>
+   <paramdef>XtEventHandler <parameter>proc</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget for which this procedure is registered.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_mask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the event mask for which to unregister this procedure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nonmaskable</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies whether this procedure should be
+removed on the nonmaskable events
+<function>( GraphicsExpose</function>,
+<function>NoExpose</function>,
+<function>SelectionClear</function>,
+<function>SelectionRequest</function>,
+<function>SelectionNotify</function>,
+<function>ClientMessage</function>,
+and
+<function>MappingNotify ).</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to be registered.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the registered client data.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtRemoveRawEventHandler' xrefstyle='select: title'/>
+function unregisters an event handler registered with
+<xref linkend='XtAddRawEventHandler' xrefstyle='select: title'/>
+or
+<xref linkend='XtInsertRawEventHandler' xrefstyle='select: title'/>
+for the specified events without changing
+the window event mask.
+The request is ignored if <emphasis remap='I'>client_data</emphasis> does not match the value given
+when the handler was registered.
+If the specified procedure has not been registered
+or if it has been registered with a different value of <emphasis remap='I'>client_data</emphasis>,
+<xref linkend='XtRemoveRawEventHandler' xrefstyle='select: title'/>
+returns without reporting an error.
+</para>
+
+<para>
+To stop a procedure
+registered with
+<xref linkend='XtAddRawEventHandler' xrefstyle='select: title'/>
+or
+<xref linkend='XtInsertRawEventHandler' xrefstyle='select: title'/>
+from receiving all nonselected events, call
+<xref linkend='XtRemoveRawEventHandler' xrefstyle='select: title'/>
+with an <emphasis remap='I'>event_mask</emphasis> of
+<function>XtAllEvents</function>
+and <emphasis remap='I'>nonmaskable</emphasis>
+<function>True</function>.
+The procedure
+will continue to receive any events that have been specified in calls to
+<xref linkend='XtAddEventHandler' xrefstyle='select: title'/>
+or
+<xref linkend='XtInsertEventHandler' xrefstyle='select: title'/>.
+</para>
+
+<para>
+To register an event handler procedure that receives events before or
+after all previously registered event handlers without selecting for
+the events, use
+<xref linkend='XtInsertRawEventHandler' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtInsertRawEventHandler'>
+<funcprototype>
+<funcdef>void <function>XtInsertRawEventHandler</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>EventMask <parameter>event_mask</parameter></paramdef>
+   <paramdef>Boolean <parameter>nonmaskable</parameter></paramdef>
+   <paramdef>XtEventHandler <parameter>proc</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+   <paramdef>XtListPosition <parameter>position</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget for which this event handler is being registered. Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_mask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the event mask for which to call this procedure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nonmaskable</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies whether this procedure should be
+called on the nonmaskable events
+<function>( GraphicsExpose</function>,
+<function>NoExpose</function>,
+<function>SelectionClear</function>,
+<function>SelectionRequest</function>,
+<function>SelectionNotify</function>,
+<function>ClientMessage</function>,
+and
+<function>MappingNotify ).</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to be registered.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies additional data to be passed to the client's event handler.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>position</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies when the event handler is to be called
+relative to other previously registered handlers.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtInsertRawEventHandler' xrefstyle='select: title'/>
+function is similar to
+<xref linkend='XtInsertEventHandler' xrefstyle='select: title'/>
+except that it does not modify the widget's event
+mask and never causes an
+<function>XSelectInput</function>
+for the specified events.  If
+the procedure is already registered with the same <emphasis remap='I'>client_data</emphasis>
+value, the
+specified mask augments the existing mask and the procedure is
+repositioned in the list.
+</para>
+</sect2>
+
+<sect2 id="Current_Event_Mask">
+<title>Current Event Mask</title>
+<para>
+To retrieve the event mask for a given widget, use
+<xref linkend='XtBuildEventMask' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtBuildEventMask'>
+<funcprototype>
+<funcdef>EventMask <function>XtBuildEventMask</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.  Must be of class Core or any subclass thereof.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtBuildEventMask' xrefstyle='select: title'/>
+function returns the event mask representing the logical OR
+of all event masks for event handlers registered on the widget with
+<xref linkend='XtAddEventHandler' xrefstyle='select: title'/>
+and
+<xref linkend='XtInsertEventHandler' xrefstyle='select: title'/>
+and all event translations, including accelerators,
+installed on the widget.
+This is the same event mask stored into the
+<function>XSetWindowAttributes</function>
+structure by
+<xref linkend='XtRealizeWidget' xrefstyle='select: title'/>
+and sent to the server when event handlers and translations are installed or
+removed on the realized widget.
+</para>
+</sect2>
+
+<sect2 id="Event_Handlers_for_X_Protocol_Extensions">
+<title>Event Handlers for X11 Protocol Extensions</title>
+<para>
+To register an event handler procedure with the Intrinsics dispatch
+mechanism according to an event type, use
+<xref linkend='XtInsertEventTypeHandler' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtInsertEventTypeHandler'>
+<funcprototype>
+<funcdef>void <function>XtInsertEventTypeHandler</function></funcdef>
+   <paramdef>Widget <parameter>widget</parameter></paramdef>
+   <paramdef>int <parameter>event_type</parameter></paramdef>
+   <paramdef>XtPointer <parameter>select_data</parameter></paramdef>
+   <paramdef>XtEventHandler <parameter>proc</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+   <paramdef>XtListPosition <parameter>position</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget for which this event handler is being registered.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the event type for which to call this event handler.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>select_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies data used to request events of the specified type from the server,
+or NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the event handler to be called.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies additional data to be passed to the event handler.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>position</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies when the event handler is to be called relative to other
+previously registered handlers.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtInsertEventTypeHandler' xrefstyle='select: title'/>
+registers a procedure with the
+dispatch mechanism that is to be called when an event that matches the
+specified <emphasis remap='I'>event_type</emphasis> is dispatched to the specified <emphasis remap='I'>widget</emphasis>.
+</para>
+
+<para>
+If <emphasis remap='I'>event_type</emphasis> specifies one of the core X protocol events, then
+<emphasis remap='I'>select_data</emphasis> must be a pointer to a value of type
+<function>EventMask</function>,
+indicating
+the event mask to be used to select for the desired event.  This event
+mask is included in the value returned by
+<xref linkend='XtBuildEventMask' xrefstyle='select: title'/>.
+If the widget is realized,
+<xref linkend='XtInsertEventTypeHandler' xrefstyle='select: title'/>
+calls
+<function>XSelectInput</function>
+if necessary.  Specifying NULL for <emphasis remap='I'>select_data</emphasis> is equivalent to
+specifying a pointer to an event mask containing 0.  This is similar
+to the
+<xref linkend='XtInsertRawEventHandler' xrefstyle='select: title'/>
+function.
+</para>
+
+<para>
+If <emphasis remap='I'>event_type</emphasis> specifies an extension event type, then the semantics of
+the data pointed to by <emphasis remap='I'>select_data</emphasis> are defined by the extension
+selector registered for the specified event type.
+</para>
+
+<para>
+In either case the Intrinsics are not required to copy the data
+pointed to by <emphasis remap='I'>select_data</emphasis>, so the caller must ensure that it remains
+valid as long as the event handler remains registered with this value
+of <emphasis remap='I'>select_data</emphasis>.
+</para>
+
+<para>
+The <emphasis remap='I'>position</emphasis> argument allows the client to control the order of
+invocation of event handlers registered for the same event type.  If
+the client does not care about the order, it should normally specify
+<function>XtListTail</function>,
+which registers this event handler after any previously
+registered handlers for this event type.
+</para>
+
+<para>
+Each widget has a single registered event handler list, which will
+contain any procedure/client_data pair exactly once if it is
+registered with
+<xref linkend='XtInsertEventTypeHandler' xrefstyle='select: title'/>,
+regardless of the manner
+in which it is registered and regardless of the value(s)
+of <emphasis remap='I'>select_data</emphasis>.  If the procedure is already registered with the
+same <emphasis remap='I'>client_data</emphasis> value, the specified mask augments the existing
+mask and the procedure is repositioned in the list.
+</para>
+
+<para>
+To remove an event handler registered with
+<xref linkend='XtInsertEventTypeHandler' xrefstyle='select: title'/>,
+use
+<xref linkend='XtRemoveEventTypeHandler' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtRemoveEventTypeHandler'>
+<funcprototype>
+<funcdef>void <function>XtRemoveEventTypeHandler</function></funcdef>
+   <paramdef>Widget <parameter>widget</parameter></paramdef>
+   <paramdef>int <parameter>event_type</parameter></paramdef>
+   <paramdef>XtPointer <parameter>select_data</parameter></paramdef>
+   <paramdef>XtEventHandler <parameter>proc</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget for which the event handler was registered.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the event type for which the handler was registered.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>select_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies data used to deselect events of the specified type
+from the server, or NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the event handler to be removed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the additional client data with which the procedure was registered.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtRemoveEventTypeHandler' xrefstyle='select: title'/>
+function unregisters an event handler
+registered with
+<xref linkend='XtInsertEventTypeHandler' xrefstyle='select: title'/>
+for the specified event type.
+The request is ignored if <emphasis remap='I'>client_data</emphasis> does not match the value given
+when the handler was registered.
+</para>
+
+<para>
+If <emphasis remap='I'>event_type</emphasis> specifies one of the core X protocol events,
+<emphasis remap='I'>select_data</emphasis> must be a pointer to a value of type
+<function>EventMask, indicating the event</function>
+mask to be used to deselect for the appropriate event.  If the widget
+is realized,
+<xref linkend='XtRemoveEventTypeHandler' xrefstyle='select: title'/>
+calls
+<function>XSelectInput</function>
+if necessary.
+Specifying NULL for <emphasis remap='I'>select_data</emphasis> is equivalent to specifying a pointer
+to an event mask containing 0.  This is similar to the
+<xref linkend='XtRemoveRawEventHandler' xrefstyle='select: title'/>
+function.
+</para>
+
+<para>
+If <emphasis remap='I'>event_type</emphasis> specifies an extension event type, then the semantics of
+the data pointed to by <emphasis remap='I'>select_data</emphasis> are defined by the extension
+selector registered for the specified event type.
+</para>
+
+<para>
+To register a procedure to select extension events for a widget, use
+<xref linkend='XtRegisterExtensionSelector' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtRegisterExtensionSelector'>
+<funcprototype>
+<funcdef>void <function>XtRegisterExtensionSelector</function></funcdef>
+   <paramdef>Display *<parameter>display</parameter></paramdef>
+   <paramdef>int <parameter>min_event_type</parameter></paramdef>
+   <paramdef>int <parameter>max_event_type</parameter></paramdef>
+   <paramdef>XtExtensionSelectProc <parameter>proc</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display for which the extension selector is to be registered.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>min_event_type</emphasis>
+    </term>
+    <listitem>
+      <para></para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>max_event_type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the range of event types for the extension.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the extension selector procedure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies additional data to be passed to the extension selector.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtRegisterExtensionSelector' xrefstyle='select: title'/>
+function registers a procedure to arrange
+for the delivery of extension events to widgets.
+</para>
+
+<para>
+If <emphasis remap='I'>min_event_type</emphasis> and <emphasis remap='I'>max_event_type</emphasis> match the parameters
+to a previous call to
+<xref linkend='XtRegisterExtensionSelector' xrefstyle='select: title'/>
+for the same <emphasis remap='I'>display</emphasis>, then <emphasis remap='I'>proc</emphasis> and <emphasis remap='I'>client_data</emphasis>
+replace the previously
+registered values.  If the range specified by <emphasis remap='I'>min_event_type</emphasis>
+and <emphasis remap='I'>max_event_type</emphasis> overlaps the range of the parameters to a
+previous call for the same display in any other way, an error results.
+</para>
+
+<para>
+When a widget is realized,
+after the <emphasis remap='I'>core.realize</emphasis> method is called,
+the Intrinsics check to see if any event
+handler specifies an event type within the range of a registered
+extension selector.  If so, the Intrinsics call each such selector.
+If an event type handler is added or removed, the Intrinsics check to
+see if the event type falls within the range of a registered extension
+selector, and if it does, calls the selector.  In either case the Intrinsics
+pass a list of all the widget's event types that are within the
+selector's range.  The corresponding select data are also passed.  The
+selector is responsible for enabling the delivery of extension events
+required by the widget.
+</para>
+
+<para>
+An extension selector is of type
+<xref linkend='XtExtensionSelectProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtExtensionSelectProc'>
+<funcprototype>
+<funcdef>typedef void <function>(*XtExtensionSelectProc)</function></funcdef>
+
+   <paramdef>Widget <parameter>widget</parameter></paramdef>
+   <paramdef>int *<parameter>event_types</parameter></paramdef>
+   <paramdef>XtPointer *<parameter>select_data</parameter></paramdef>
+   <paramdef>int <parameter>count</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget that is being realized or is having
+an event handler added or removed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_types</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a list of event types that the widget has
+registered event handlers for.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>select_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a list of the select_data parameters specified in
+<xref linkend='XtInsertEventTypeHandler' xrefstyle='select: title'/>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the <emphasis remap='I'>event_types</emphasis> and <emphasis remap='I'>select_data</emphasis>
+lists.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the additional client data with which the procedure was registered.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The <emphasis remap='I'>event_types</emphasis> and <emphasis remap='I'>select_data</emphasis> lists will always have the
+same number of elements, specified by <emphasis remap='I'>count</emphasis>.
+Each event type/select data pair represents one call to
+<xref linkend='XtInsertEventTypeHandler' xrefstyle='select: title'/>.
+</para>
+
+<para>
+To register a procedure to dispatch events of a specific type within
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>,
+use
+<xref linkend='XtSetEventDispatcher' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtSetEventDispatcher'>
+<funcprototype>
+<funcdef>XtEventDispatchProc <function>XtSetEventDispatcher</function></funcdef>
+   <paramdef>Display *<parameter>display</parameter></paramdef>
+   <paramdef>int <parameter>event_type</parameter></paramdef>
+   <paramdef>XtEventDispatchProc <parameter>proc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display for which the event dispatcher is to be registered.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the event type for which the dispatcher should be invoked.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the event dispatcher procedure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtSetEventDispatcher' xrefstyle='select: title'/>
+function registers the event dispatcher procedure specified by <emphasis remap='I'>proc</emphasis>
+for events with the type <emphasis remap='I'>event_type</emphasis>.  The previously registered
+dispatcher (or the default dispatcher if there was no previously registered
+dispatcher) is returned.  If <emphasis remap='I'>proc</emphasis> is NULL, the default procedure is
+restored for the specified type.
+</para>
+
+<para>
+In the future, when
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>
+is called with an event type of <emphasis remap='I'>event_type</emphasis>, the specified <emphasis remap='I'>proc</emphasis>
+(or the default dispatcher) is invoked to determine a widget
+to which to dispatch the event.
+</para>
+
+<para>
+The default dispatcher handles the Intrinsics modal cascade and keyboard
+focus mechanisms, handles the semantics of <emphasis remap='I'>compress_enterleave</emphasis>
+and <emphasis remap='I'>compress_motion</emphasis>, and discards all extension events.
+</para>
+
+<para>
+An event dispatcher procedure pointer is of type
+<xref linkend='XtEventDispatchProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtEventDispatchProc'>
+<funcprototype>
+<funcdef>typedef Boolean <function>(*XtEventDispatchProc)</function></funcdef>
+   <paramdef>XEvent *<parameter>event</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event</emphasis>
+    </term>
+    <listitem>
+      <para>
+Passes the event to be dispatched.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The event dispatcher procedure should determine whether this event is of
+a type that should be dispatched to a widget.
+</para>
+
+<para>
+If the event should be dispatched to a widget, the event dispatcher
+procedure should determine the appropriate widget to receive the
+event, call
+<function>XFilterEvent</function>
+with the window of this widget, or
+<function>None</function>
+if the event is to be discarded, and if
+<function>XFilterEvent</function>
+returns
+<function>False</function>,
+dispatch the event to the widget using
+<xref linkend='XtDispatchEventToWidget' xrefstyle='select: title'/>.
+The procedure should return
+<function>True</function>
+if either
+<function>XFilterEvent</function>
+or
+<xref linkend='XtDispatchEventToWidget' xrefstyle='select: title'/>
+returned
+<function>True</function>
+and
+<function>False</function>
+otherwise.
+</para>
+
+<para>
+If the event should not be dispatched to a widget, the event
+dispatcher procedure should attempt to dispatch the event elsewhere as
+appropriate and return
+<function>True</function>
+if it successfully dispatched the event and
+<function>False</function>
+otherwise.
+</para>
+
+<para>
+Some dispatchers for extension events may wish to forward events
+according to the Intrinsics' keyboard focus mechanism.  To determine
+which widget is the end result of keyboard event forwarding, use
+<xref linkend='XtGetKeyboardFocusWidget' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtGetKeyboardFocusWidget'>
+<funcprototype>
+<funcdef>Widget <function>XtGetKeyboardFocusWidget</function></funcdef>
+   <paramdef>Widget <parameter>widget</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget to get forwarding information for.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtGetKeyboardFocusWidget' xrefstyle='select: title'/>
+function returns the widget that would be the end result of keyboard
+event forwarding for a keyboard event for the specified widget.
+</para>
+
+<para>
+To dispatch an event to a specified widget, use
+<xref linkend='XtDispatchEventToWidget' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtDispatchEventToWidget'>
+<funcprototype>
+<funcdef>Boolean <function>XtDispatchEventToWidget</function></funcdef>
+   <paramdef>Widget <parameter>widget</parameter></paramdef>
+   <paramdef>XEvent *<parameter>event</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget to which to dispatch the event.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to the event to be dispatched.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtDispatchEventToWidget' xrefstyle='select: title'/>
+function scans the list of registered event handlers for the
+specified widget and calls each handler that has been registered
+for the specified event type, subject to the <emphasis remap='I'>continue_to_dispatch</emphasis>
+value returned by each handler.
+The Intrinsics behave as if event handlers were registered at the head
+of the list for
+<function>Expose</function>,
+<function>NoExpose</function>,
+<function>GraphicsExpose</function>,
+and
+<function>VisibilityNotify</function>
+events to invoke the widget's expose procedure according to the exposure
+compression rules and to update the widget's <emphasis remap='I'>visible</emphasis> field
+if <emphasis remap='I'>visible_interest</emphasis> is
+<function>True</function>.
+These internal event handlers never set <emphasis remap='I'>continue_to_dispatch</emphasis> to
+<function>False</function>.
+</para>
+
+<para>
+<xref linkend='XtDispatchEventToWidget' xrefstyle='select: title'/>
+returns
+<function>True</function>
+if any event handler was called and
+<function>False</function>
+otherwise.
+</para>
+</sect2>
+</sect1>
+
+<sect1 id="Using_the_Intrinsics_in_a_Multi_Threaded_Environment">
+<title>Using the Intrinsics in a Multi-Threaded Environment</title>
+<para>
+The Intrinsics may be used in environments that offer multiple threads
+of execution within the context of a single process.  A multi-threaded
+application using the Intrinsics must explicitly initialize the toolkit
+for mutually exclusive access by calling
+<xref linkend='XtToolkitThreadInitialize' xrefstyle='select: title'/>.
+</para>
+<sect2 id="Initializing_a_Multi_Threaded_Intrinsics_Application">
+<title>Initializing a Multi-Threaded Intrinsics Application</title>
+<para>
+To test and initialize Intrinsics support for mutually exclusive thread
+access, call
+<xref linkend='XtToolkitThreadInitialize' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtToolkitThreadInitialize'>
+<funcprototype>
+<funcdef>Boolean <function>XtToolkitThreadInitialize</function></funcdef>
+   <paramdef><parameter>void</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+<xref linkend='XtToolkitThreadInitialize' xrefstyle='select: title'/>
+returns <function>True</function> if the Intrinsics support mutually exclusive thread
+access, otherwise it returns <function>False</function>. <xref linkend='XtToolkitThreadInitialize' xrefstyle='select: title'/>
+must be called before
+<xref linkend='XtCreateApplicationContext' xrefstyle='select: title'/>,
+<xref linkend='XtAppInitialize' xrefstyle='select: title'/>,
+<xref linkend='XtOpenApplication' xrefstyle='select: title'/>,
+or
+<function>XtSetLanguageProc</function>
+is called. <xref linkend='XtToolkitThreadInitialize' xrefstyle='select: title'/> may be called more than once;
+however, the application writer must ensure that it is not called
+simultaneously by two or more threads.
+</para>
+</sect2>
+
+<sect2 id="Locking_tk_Data_Structures">
+<title>Locking X Toolkit Data Structures</title>
+<para>
+The Intrinsics employs two levels of locking: application context and
+process.  Locking an application context ensures mutually exclusive
+access by a thread to the state associated with the application context,
+including all displays and widgets associated with it.  Locking a
+process ensures mutually exclusive access by a thread to Intrinsics process
+global data.
+</para>
+
+<para>
+A client may acquire a lock multiple times and the effect is cumulative.
+The client must ensure that the lock is released an equal number of times in
+order for the lock to be acquired by another thread.
+</para>
+
+<para>
+Most application writers will have little need to use locking as the
+Intrinsics performs the necessary locking internally.
+Resource converters are an exception.
+They require the application context or process to be locked
+before the application can safely call them directly, for example:
+</para>
+<programlisting>
+        ...
+        XtAppLock(app_context);
+        XtCvtStringToPixel(dpy, args, num_args, fromVal, toVal, closure_ret);
+        XtAppUnlock(app_context);
+        ...
+</programlisting>
+<para>
+When the application relies upon
+<xref linkend='XtConvertAndStore' xrefstyle='select: title'/>
+or a converter to provide the storage for the results of a
+conversion, the application should acquire the process lock before
+calling out and hold the lock until the results have been copied.
+</para>
+
+<para>
+Application writers who write their own
+utility functions, such as one which retrieves the being_destroyed field from
+a widget instance, must lock the application context before accessing
+widget internal data.  For example:
+</para>
+<programlisting>
+#include &lt;X11/CoreP.h&gt;
+Boolean BeingDestroyed (Widget widget)
+{
+        Boolean ret;
+        XtAppLock(XtWidgetToApplicationContext(widget));
+        ret = widget-&gt;core.being_destroyed;
+        XtAppUnlock(XtWidgetToApplicationContext(widget));
+        return ret;
+}
+</programlisting>
+<para>
+A client that wishes to atomically call two or more Intrinsics functions
+must lock the application context.  For example:
+</para>
+<programlisting>
+        ...
+        XtAppLock(XtWidgetToApplicationContext(widget));
+        XtUnmanageChild (widget1);
+        XtManageChild (widget2);
+        XtAppUnlock(XtWidgetToApplicationContext(widget));
+        ...
+</programlisting>
+<sect3 id="Locking_the_Application_Context">
+<title>Locking the Application Context</title>
+<para>
+To ensure mutual exclusion of application context, display, or
+widget internal state, use
+<function>XtAppLock.</function>
+</para>
+
+<funcsynopsis id='XtAppLock'>
+<funcprototype>
+<funcdef>void <function>XtAppLock</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context to lock.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtAppLock' xrefstyle='select: title'/> blocks until it is able to acquire the lock.  Locking the
+application context also ensures that only the thread holding the lock
+makes Xlib calls from within Xt.  An application that makes its own
+direct Xlib calls must either lock the application context around every
+call or enable thread locking in Xlib.
+</para>
+
+<para>
+To unlock a locked application context, use
+<function>XtAppUnlock.</function>
+</para>
+
+<funcsynopsis id='XtAppUnlock'>
+<funcprototype>
+<funcdef>void <function>XtAppUnlock</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context that was previously locked.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+
+</sect3>
+<sect3 id="Locking_the_Process">
+<title>Locking the Process</title>
+<para>
+To ensure mutual exclusion of X Toolkit process global data, a
+widget writer must use
+<function>XtProcessLock.</function>
+</para>
+
+<funcsynopsis id='XtProcessLock'>
+<funcprototype>
+<funcdef>void <function>XtProcessLock</function></funcdef>
+   <paramdef><parameter>void</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+<xref linkend='XtProcessLock' xrefstyle='select: title'/> blocks until it is able to acquire the lock.
+Widget writers may use XtProcessLock to guarantee mutually exclusive
+access to widget static data.
+</para>
+
+<para>
+To unlock a locked process, use
+<xref linkend='XtProcessUnlock' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtProcessUnlock'>
+<funcprototype>
+<funcdef>void <function>XtProcessUnlock</function></funcdef>
+   <paramdef><parameter>void</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+To lock both an application context and the process at the same
+time, call
+<xref linkend='XtAppLock' xrefstyle='select: title'/>
+first and then
+<xref linkend='XtProcessLock' xrefstyle='select: title'/>.
+To release both locks, call
+<xref linkend='XtProcessUnlock' xrefstyle='select: title'/>
+first and then
+<xref linkend='XtAppUnlock' xrefstyle='select: title'/>.
+The order is important to avoid deadlock.
+</para>
+</sect3>
+</sect2>
+
+<sect2 id="Event_Management_in_a_Multi_Threaded_Environment">
+<title>Event Management in a Multi-Threaded Environment</title>
+<para>
+In a nonthreaded environment an application writer could reasonably
+assume that it is safe to exit the application from a quit callback.
+This assumption may no longer hold true in a multi-threaded environment;
+therefore it is desirable to provide a mechanism to terminate an
+event-processing loop without necessarily terminating its thread.
+</para>
+
+<para>
+To indicate that the event loop should terminate after the current
+event dispatch has completed, use
+<xref linkend='XtAppSetExitFlag' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppSetExitFlag'>
+<funcprototype>
+<funcdef>void <function>XtAppSetExitFlag</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtAppMainLoop' xrefstyle='select: title'/>
+tests the value of the flag and will return if the flag is <function>True</function>.
+</para>
+
+<para>
+Application writers who implement their own main loop may test the
+value of the exit flag with
+<xref linkend='XtAppGetExitFlag' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppGetExitFlag'>
+<funcprototype>
+<funcdef>Boolean <function>XtAppGetExitFlag</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtAppGetExitFlag' xrefstyle='select: title'/>
+will normally return <function>False</function>, indicating that event processing
+may continue.  When
+<xref linkend='XtAppGetExitFlag' xrefstyle='select: title'/>
+returns <function>True</function>, the loop must terminate and return to the caller,
+which might then destroy the application context.
+</para>
+
+<para>
+Application writers should be aware that, if a thread is blocked in
+<xref linkend='XtAppNextEvent' xrefstyle='select: title'/>,
+<xref linkend='XtAppPeekEvent' xrefstyle='select: title'/>,
+or
+<xref linkend='XtAppProcessEvent' xrefstyle='select: title'/>
+and another thread in the same application context opens a new display,
+adds an alternate input, or a timeout, any new source(s) will not
+normally be &ldquo;noticed&rdquo; by the blocked thread.  Any new sources are
+&ldquo;noticed&rdquo; the next time one of these functions is called.
+</para>
+
+<para>
+The Intrinsics manage access to events on a last-in, first-out basis.  If
+multiple threads in the same application context block in
+<xref linkend='XtAppNextEvent' xrefstyle='select: title'/>,
+<xref linkend='XtAppPeekEvent' xrefstyle='select: title'/>,
+or
+<xref linkend='XtAppProcessEvent' xrefstyle='select: title'/>,
+the last thread to call one of these functions is the first
+thread to return.
+</para>
+</sect2>
+</sect1>
+</chapter>
Index: lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs/CH09.xml
===================================================================
--- lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs/CH09.xml	(nonexistent)
+++ lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs/CH09.xml	(revision 5)
@@ -0,0 +1,4391 @@
+<?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">
+
+<chapter id='Resource_Management'>
+<title>Resource Management</title>
+<para>
+A resource is a field in the widget record with a corresponding
+resource entry in the <emphasis remap='I'>resources</emphasis> list of the widget or any of its
+superclasses.
+This means that the field is
+settable by
+<xref linkend='XtCreateWidget' xrefstyle='select: title'/>
+(by naming the field in the argument list), by an
+entry in a resource file (by using either the name or class), and by
+<xref linkend='XtSetValues' xrefstyle='select: title'/>.
+In addition, it is readable by
+<xref linkend='XtGetValues' xrefstyle='select: title'/>.
+Not all fields in a widget record are resources.
+Some are for bookkeeping use by the
+generic routines (like <emphasis remap='I'>managed</emphasis> and <emphasis remap='I'>being_destroyed</emphasis>).
+Others can be for local bookkeeping,
+and still others are derived from resources
+(many graphics contexts and pixmaps).
+</para>
+
+<para>
+Widgets typically need to obtain a large set of resources at widget
+creation time.
+Some of the resources come from the argument list supplied in the call to
+<xref linkend='XtCreateWidget' xrefstyle='select: title'/>,
+some from the resource database,
+and some from the internal defaults specified by the widget.
+Resources are obtained first from the argument list,
+then from the resource database for all resources not specified
+in the argument list,
+and last, from the internal default, if needed.
+</para>
+<sect1 id="Resource_Lists">
+<title>Resource Lists</title>
+<para>
+A resource entry specifies a field in the widget,
+the textual name and class of the field that argument lists
+and external resource files use to refer to the field,
+and a default value that the field should get if no value is specified.
+The declaration for the
+<function>XtResource</function>
+structure is
+</para>
+<programlisting>
+typedef struct {
+        String          resource_name;
+        String          resource_class;
+        String          resource_type;
+        Cardinal        resource_size;
+        Cardinal        resource_offset;
+        String          default_type;
+        XtPointer       default_addr;
+} XtResource, *XtResourceList;
+</programlisting>
+<para>
+When the resource list is specified as the
+<function>CoreClassPart</function>,
+<function>ObjectClassPart</function>,
+<function>RectObjClassPart</function>,
+or
+<function>ConstraintClassPart</function>
+<emphasis remap='I'>resources</emphasis> field, the strings pointed to by <emphasis remap='I'>resource_name</emphasis>,
+<emphasis remap='I'>resource_class</emphasis>, <emphasis remap='I'>resource_type</emphasis>, and <emphasis remap='I'>default_type</emphasis> must
+be permanently allocated prior to or during the execution of the class
+initialization procedure and must not be subsequently deallocated.
+</para>
+
+<para>
+The <emphasis remap='I'>resource_name</emphasis> field contains the name used by clients to access the field
+in the widget.
+By convention, it starts with a lowercase letter
+and is spelled exactly like the field name,
+except all underscores (_) are deleted and the next letter is replaced by its
+uppercase counterpart.
+For example, the resource name for background_pixel becomes backgroundPixel.
+Resource names beginning with the two-character
+sequence &ldquo;xt&rdquo;, and resource classes beginning with the two-character
+sequence &ldquo;Xt&rdquo; are reserved to the Intrinsics for future standard and
+implementation-dependent uses.
+Widget header files typically contain a symbolic name for each resource name.
+All resource names, classes, and types used by the Intrinsics are named in
+<filename class="headerfile">&lt;X11/StringDefs.h&gt;</filename>.
+The Intrinsics's symbolic resource names begin with
+&ldquo;XtN&rdquo;
+and are followed by the string name (for example, XtNbackgroundPixel
+for backgroundPixel).
+</para>
+
+<para>
+The <emphasis remap='I'>resource_class</emphasis> field contains the class string used in resource
+specification files to identify the field.
+A resource class provides two functions:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+It isolates an application from different representations that widgets
+can use for a similar resource.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It lets you specify values for several actual resources with a single name.
+A resource class should be chosen to span a group of closely related fields.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+For example,
+a widget can have several pixel resources: background, foreground,
+border, block cursor, pointer cursor, and so on.
+Typically, the background defaults to white
+and everything else to black.
+The resource class for each of these resources in the resource list
+should be chosen so that it takes the minimal number of entries
+in the resource database to make the background ivory
+and everything else darkblue.
+</para>
+
+<para>
+In this case, the background pixel should have a resource class of
+&ldquo;Background&rdquo;
+and all the other pixel entries a resource class of
+&ldquo;Foreground&rdquo;.
+Then, the resource file needs only two lines to
+change all pixels to ivory or darkblue:
+</para>
+<programlisting>
+*Background:    ivory
+*Foreground:    darkblue
+</programlisting>
+<para>
+Similarly, a widget may have several font resources (such as normal and bold),
+but all fonts should have the class Font.
+Thus, changing all fonts simply requires only a single line in the
+default resource file:
+</para>
+<programlisting>
+*Font:  6x13
+</programlisting>
+<para>
+By convention,
+resource classes are always spelled starting with a capital letter
+to distinguish them from resource names.
+Their symbolic names are preceded with
+&ldquo;XtC&rdquo;
+(for example, XtCBackground).
+</para>
+
+<para>
+The <emphasis remap='I'>resource_type</emphasis> field gives the physical representation type of the resource
+and also encodes information about the specific usage of the field.
+By convention, it starts with an uppercase letter and is
+spelled identically to the type name of the field.
+The resource type is used when resources are fetched to
+convert from the resource database format (usually
+<function>String</function>)
+or the format of the resource default value
+(almost anything, but often
+<function>String</function>)
+to the desired
+physical representation (see <xref linkend='Resource_Conversions' />).
+The Intrinsics define the following resource types:
+</para>
+
+<informaltable frame='topbot'>
+  <?dbfo keep-together="auto" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Resource Type</entry>
+      <entry>Structure or Field Type</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry><function>XtRAcceleratorTable</function></entry>
+      <entry>XtAccelerators</entry>
+    </row>
+    <row>
+      <entry><function>XtRAtom</function></entry>
+      <entry>Atom</entry>
+    </row>
+    <row>
+      <entry><function>XtRBitmap</function></entry>
+      <entry>Pixmap, depth=1</entry>
+    </row>
+    <row>
+      <entry><function>XtRBoolean</function></entry>
+      <entry>Boolean</entry>
+    </row>
+    <row>
+      <entry><function>XtRBool</function></entry>
+      <entry>Bool</entry>
+    </row>
+    <row>
+      <entry><function>XtRCallback</function></entry>
+      <entry>XtCallbackList</entry>
+    </row>
+    <row>
+      <entry><function>XtRCardinal</function></entry>
+      <entry>Cardinal</entry>
+    </row>
+    <row>
+      <entry><function>XtRColor</function></entry>
+      <entry>XColor</entry>
+    </row>
+    <row>
+      <entry><function>XtRColormap</function></entry>
+      <entry>Colormap</entry>
+    </row>
+    <row>
+      <entry><function>XtRCommandArgArray</function></entry>
+      <entry>String*</entry>
+    </row>
+    <row>
+      <entry><function>XtRCursor</function></entry>
+      <entry>Cursor</entry>
+    </row>
+    <row>
+      <entry><function>XtRDimension</function></entry>
+      <entry>Dimension</entry>
+    </row>
+    <row>
+      <entry><function>XtRDirectoryString</function></entry>
+      <entry>String</entry>
+    </row>
+    <row>
+      <entry><function>XtRDisplay</function></entry>
+      <entry>Display*</entry>
+    </row>
+    <row>
+      <entry><function>XtREnum</function></entry>
+      <entry>XtEnum</entry>
+    </row>
+    <row>
+      <entry><function>XtREnvironmentArray</function></entry>
+      <entry>String*</entry>
+    </row>
+    <row>
+      <entry><function>XtRFile</function></entry>
+      <entry>FILE*</entry>
+    </row>
+    <row>
+      <entry><function>XtRFloat</function></entry>
+      <entry>float</entry>
+    </row>
+    <row>
+      <entry><function>XtRFont</function></entry>
+      <entry>Font</entry>
+    </row>
+    <row>
+      <entry><function>XtRFontSet</function></entry>
+      <entry>XFontSet</entry>
+    </row>
+    <row>
+      <entry><function>XtRFontStruct</function></entry>
+      <entry>XFontStruct*</entry>
+    </row>
+    <row>
+      <entry><function>XtRFunction</function></entry>
+      <entry>(*)(Widget)</entry>
+    </row>
+    <row>
+      <entry><function>XtRGeometry</function></entry>
+      <entry>char*, format as defined by
+      <function>XParseGeometry</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRGravity</function></entry>
+      <entry>int</entry>
+    </row>
+    <row>
+      <entry><function>XtRInitialState</function></entry>
+      <entry>int</entry>
+    </row>
+    <row>
+      <entry><function>XtRInt</function></entry>
+      <entry>int</entry>
+    </row>
+    <row>
+      <entry><function>XtRLongBoolean</function></entry>
+      <entry>long</entry>
+    </row>
+    <row>
+      <entry><function>XtRObject</function></entry>
+      <entry>Object</entry>
+    </row>
+    <row>
+      <entry><function>XtRPixel</function></entry>
+      <entry>Pixel</entry>
+    </row>
+    <row>
+      <entry><function>XtRPixmap</function></entry>
+      <entry>Pixmap</entry>
+    </row>
+    <row>
+      <entry><function>XtRPointer</function></entry>
+      <entry>XtPointer</entry>
+    </row>
+    <row>
+      <entry><function>XtRPosition</function></entry>
+      <entry>Position</entry>
+    </row>
+    <row>
+      <entry><function>XtRRestartStyle</function></entry>
+      <entry>unsigned char</entry>
+    </row>
+    <row>
+      <entry><function>XtRScreen</function></entry>
+      <entry>Screen*</entry>
+    </row>
+    <row>
+      <entry><function>XtRShort</function></entry>
+      <entry>short</entry>
+    </row>
+    <row>
+      <entry><function>XtRSmcConn</function></entry>
+      <entry>XtPointer</entry>
+    </row>
+    <row>
+      <entry><function>XtRString</function></entry>
+      <entry>String</entry>
+    </row>
+    <row>
+      <entry><function>XtRStringArray</function></entry>
+      <entry>String*</entry>
+    </row>
+    <row>
+      <entry><function>XtRStringTable</function></entry>
+      <entry>String*</entry>
+    </row>
+    <row>
+      <entry><function>XtRTranslationTable</function></entry>
+      <entry>XtTranslations</entry>
+    </row>
+    <row>
+      <entry><function>XtRUnsignedChar</function></entry>
+      <entry>unsigned char</entry>
+    </row>
+    <row>
+      <entry><function>XtRVisual</function></entry>
+      <entry>Visual*</entry>
+    </row>
+    <row>
+      <entry><function>XtRWidget</function></entry>
+      <entry>Widget</entry>
+    </row>
+    <row>
+      <entry><function>XtRWidgetClass</function></entry>
+      <entry>WidgetClass</entry>
+    </row>
+    <row>
+      <entry><function>XtRWidgetList</function></entry>
+      <entry>WidgetList</entry>
+    </row>
+    <row>
+      <entry><function>XtRWindow</function></entry>
+      <entry>Window</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+<filename class="headerfile">&lt;X11/StringDefs.h&gt;</filename>
+also defines the following resource types as a
+convenience for widgets, although they do not have any corresponding
+data type assigned:
+<function>XtREditMode</function>,
+<function>XtRJustify</function>,
+and
+<function>XtROrientation</function>.
+</para>
+
+<para>
+The <emphasis remap='I'>resource_size</emphasis> field is the size of the physical representation in bytes;
+you should specify it as
+<function>sizeof</function>(type) so that the
+compiler fills in the value.
+The <emphasis remap='I'>resource_offset</emphasis> field is the offset in bytes of the field
+within the widget.
+You should use the
+<xref linkend='XtOffsetOf' xrefstyle='select: title'/>
+macro to retrieve this value.
+The <emphasis remap='I'>default_type</emphasis> field is the representation type of the default
+resource value.
+If <emphasis remap='I'>default_type</emphasis> is different from <emphasis remap='I'>resource_type</emphasis> and the default value
+is needed,
+the resource manager invokes a conversion procedure from <emphasis remap='I'>default_type</emphasis>
+to <emphasis remap='I'>resource_type</emphasis>.
+Whenever possible,
+the default type should be identical to the resource type in order
+to minimize widget creation time.
+However, there are sometimes no values of the type that the program
+can easily specify.
+In this case,
+it should be a value for which the converter is guaranteed to work (for example,
+<function>XtDefaultForeground</function>
+for a pixel resource).
+The <emphasis remap='I'>default_addr</emphasis> field specifies the address of the default resource value.
+As a special case, if <emphasis remap='I'>default_type</emphasis> is
+<function>XtRString</function>,
+then the value in the <emphasis remap='I'>default_addr</emphasis> field is the pointer to
+the string rather than a pointer to the pointer.
+The default is used if a resource is not specified in the argument list
+or in the resource database or if the conversion from the representation
+type stored in the resource database fails,
+which can happen for various reasons (for example, a misspelled entry in a
+resource file).
+</para>
+
+<para>
+Two special representation types
+(XtRImmediate
+and
+XtRCallProc)
+are usable only as default resource types.
+XtRImmediate
+indicates that the value in the <emphasis remap='I'>default_addr</emphasis> field is the actual value of
+the resource rather than the address of the value.
+The value must be in the correct representation type for the resource,
+coerced to an
+<function>XtPointer</function>.
+No conversion is possible, since there is no source representation type.
+XtRCallProc
+indicates that the value in the <emphasis remap='I'>default_addr</emphasis> field is a procedure
+pointer.
+This procedure is automatically invoked with the widget,
+<emphasis remap='I'>resource_offset</emphasis>, and a pointer to an
+<function>XrmValue</function>
+in which to store the result.
+XtRCallProc
+procedure pointers are of type
+<xref linkend='XtResourceDefaultProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtResourceDefaultProc'>
+<funcprototype>
+<funcdef>typedef void <function>(*XtResourceDefaultProc)</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>int <parameter>offset</parameter></paramdef>
+   <paramdef>XrmValue *<parameter>value</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget whose resource value is to be obtained.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>offset</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the offset of the field in the widget record.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>value</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the resource value descriptor to return.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtResourceDefaultProc' xrefstyle='select: title'/>
+procedure should fill in the <emphasis remap='I'>value-&gt;addr</emphasis> field with a pointer
+to the resource value in its correct representation type.
+</para>
+
+<para>
+To get the resource list structure for a particular class, use
+<xref linkend='XtGetResourceList' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtGetResourceList'>
+<funcprototype>
+<funcdef>void <function>XtGetResourceList</function></funcdef>
+
+   <paramdef>WidgetClass <parameter>class</parameter></paramdef>
+   <paramdef>XtResourceList *<parameter>resources_return</parameter></paramdef>
+   <paramdef>Cardinal *<parameter>num_resources_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the object class to be queried.  It must be
+<function>objectClass</function>
+or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>resources_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the resource list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_resources_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of entries in the resource list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If
+<xref linkend='XtGetResourceList' xrefstyle='select: title'/>
+is called before the class is initialized,
+it returns the resource list as specified in the class record.
+If it is called after the class has been initialized,
+<xref linkend='XtGetResourceList' xrefstyle='select: title'/>
+returns a merged resource list that includes the resources
+for all superclasses.
+The list returned by
+<xref linkend='XtGetResourceList' xrefstyle='select: title'/>
+should be freed using
+<xref linkend='XtFree' xrefstyle='select: title'/>
+when it is no longer needed.
+</para>
+
+<para>
+To get the constraint resource list structure for a particular widget
+class, use
+<xref linkend='XtGetConstraintResourceList' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtGetConstraintResourceList'>
+<funcprototype>
+<funcdef>void <function>XtGetConstraintResourceList</function></funcdef>
+   <paramdef>WidgetClass <parameter>class</parameter></paramdef>
+   <paramdef>XtResourceList *<parameter>resources_return</parameter></paramdef>
+   <paramdef>Cardinal *<parameter>num_resources_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the object class to be queried.  It must be
+<function>objectClass</function>
+or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>resources_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the constraint resource list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_resources_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of entries in the constraint resource list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If
+<xref linkend='XtGetConstraintResourceList' xrefstyle='select: title'/>
+is called before the widget class is
+initialized, the resource list as specified in the widget
+class Constraint part is returned.  If
+<xref linkend='XtGetConstraintResourceList' xrefstyle='select: title'/>
+is called after the widget class has been initialized, the merged
+resource list for the class and all Constraint superclasses is
+returned.  If the
+specified class is not a subclass of
+<function>constraintWidgetClass</function>,
+*<emphasis remap='I'>resources_return</emphasis> is set to NULL
+and *<emphasis remap='I'>num_resources_return</emphasis> is set to zero.
+The list returned by
+<xref linkend='XtGetConstraintResourceList' xrefstyle='select: title'/>
+should be freed using
+<xref linkend='XtFree' xrefstyle='select: title'/>
+when it is no longer needed.
+</para>
+
+<para>
+The routines
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+and
+<xref linkend='XtGetValues' xrefstyle='select: title'/>
+also use the resource list to set and get widget state;
+see <xref linkend='Obtaining_Widget_State' /> and
+<xref linkend='Setting_Widget_State' />.
+</para>
+
+<para>
+Here is an abbreviated version of a possible resource list for a Label widget:
+</para>
+<programlisting>
+/* Resources specific to Label */
+static XtResource resources[] = {
+{XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
+   XtOffsetOf(LabelRec, label.foreground), XtRString, XtDefaultForeground},
+{XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct*),
+   XtOffsetOf(LabelRec, label.font), XtRString, XtDefaultFont},
+{XtNlabel, XtCLabel, XtRString, sizeof(String),
+   XtOffsetOf(LabelRec, label.label), XtRString, NULL},
+        .
+        .
+        .
+}
+</programlisting>
+<para>
+The complete resource name for a field of a widget instance is the
+concatenation of the application shell name (from
+<function>XtAppCreateShell</function>),
+the instance names of all the widget's parents up to the
+top of the widget tree,
+the instance name of the widget itself,
+and the resource name of the specified field of the widget.
+Similarly,
+the full resource class of a field of a widget instance is the
+concatenation of the application class (from
+<function>XtAppCreateShell</function>),
+the widget class names of all the widget's parents up to the
+top of the widget tree,
+the widget class name of the widget itself,
+and the resource class of the specified field of the widget.
+</para>
+</sect1>
+
+<sect1 id="Byte_Offset_Calculations">
+<title>Byte Offset Calculations</title>
+<para>
+To determine the byte offset of a field within a structure type, use
+<xref linkend='XtOffsetOf' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtOffsetOf'>
+<funcprototype>
+<funcdef>Cardinal <function>XtOffsetOf</function></funcdef>
+      <paramdef>Type <parameter>structure_type</parameter></paramdef>
+      <paramdef>Field <parameter>field_name</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>structure_type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a type that is declared as a structure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>field_name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the name of a member within the structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtOffsetOf' xrefstyle='select: title'/>
+macro expands to a constant expression that gives the
+offset in bytes to the specified structure member from the beginning
+of the structure.  It is normally used to statically initialize
+resource lists and is more portable than
+<xref linkend='XtOffset' xrefstyle='select: title'/>,
+which serves the same function.
+</para>
+
+<para>
+To determine the byte offset of a field within a structure pointer type, use
+<xref linkend='XtOffset' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtOffset'>
+<funcprototype>
+<funcdef>Cardinal <function>XtOffset</function></funcdef>
+      <paramdef>Type <parameter> pointer_type</parameter></paramdef>
+      <paramdef>Field <parameter> field_name</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>pointer_type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a type that is declared as a pointer to a structure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>field_name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the name of a member within the structure.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtOffset' xrefstyle='select: title'/>
+macro expands to a constant expression that gives the
+offset in bytes to the specified structure member from the beginning
+of the structure.  It may be used to statically initialize
+resource lists.
+<xref linkend='XtOffset' xrefstyle='select: title'/>
+is less portable than
+<xref linkend='XtOffsetOf' xrefstyle='select: title'/>.
+</para>
+</sect1>
+
+<sect1 id="Superclass_to_Subclass_Chaining_of_Resource_Lists">
+<title>Superclass-to-Subclass Chaining of Resource Lists</title>
+<para>
+The
+<xref linkend='XtCreateWidget' xrefstyle='select: title'/>
+function gets resources as a superclass-to-subclass chained operation.
+That is, the resources specified in the
+<function>objectClass</function>
+resource list are fetched,
+then those in
+<function>rectObjClass</function>,
+and so on down to the resources specified
+for this widget's class. Within a class, resources are fetched in the order
+they are declared.
+</para>
+
+<para>
+In general, if a widget resource field is declared in a superclass,
+that field is included in the superclass's resource list and need not be
+included in the subclass's resource list.
+For example, the
+Core
+class contains a resource entry for <emphasis remap='I'>background_pixel</emphasis>.
+Consequently,
+the implementation of Label need not also have a resource entry
+for <emphasis remap='I'>background_pixel</emphasis>.
+However, a subclass,
+by specifying a resource entry for that field in its own resource list,
+can override the resource entry for any field declared in a superclass.
+This is most often done to override the defaults provided in the
+superclass with new ones.
+At class initialization time,
+resource lists for that class are scanned from the superclass down
+to the class to look for resources with the same offset.
+A matching resource in a subclass will be reordered to override
+the superclass entry.
+If reordering is necessary, a copy of the superclass resource list is made to
+avoid affecting other subclasses of the superclass.
+</para>
+
+<para>
+Also at class initialization time, the Intrinsics produce an
+internal representation of the resource list to optimize access time
+when creating widgets.  In order to save memory, the Intrinsics may
+overwrite the storage allocated for the resource list in the class
+record; therefore, widgets must allocate resource lists in writable
+storage and must not access the list contents directly after the
+class_initialize procedure has returned.
+</para>
+</sect1>
+
+<sect1 id="Subresources">
+<title>Subresources</title>
+<para>
+A widget does not do anything to retrieve its own resources;
+instead,
+<xref linkend='XtCreateWidget' xrefstyle='select: title'/>
+does this automatically before calling the class initialize procedure.
+</para>
+
+<para>
+Some widgets have subparts that are not widgets but for which the widget
+would like to fetch resources.
+Such widgets call
+<xref linkend='XtGetSubresources' xrefstyle='select: title'/>
+to accomplish this.
+</para>
+
+<funcsynopsis id='XtGetSubresources'>
+<funcprototype>
+<funcdef>void <function>XtGetSubresources</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>XtPointer <parameter>base</parameter></paramdef>
+   <paramdef>const char * <parameter>name</parameter></paramdef>
+   <paramdef>const char * <parameter>class</parameter></paramdef>
+   <paramdef>XtResourceList <parameter>resources</parameter></paramdef>
+   <paramdef>Cardinal <parameter>num_resources</parameter></paramdef>
+   <paramdef>ArgList <parameter>args</parameter></paramdef>
+   <paramdef>Cardinal <parameter>num_args</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the object used to qualify the subpart resource name and
+class.  Must be of class Object or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>base</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the base address of the subpart data structure into which the
+resources will be written.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the name of the subpart.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the class of the subpart.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>resources</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the resource list for the subpart.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_resources</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the resource list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the argument list to override any other resource specifications.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the argument list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtGetSubresources' xrefstyle='select: title'/>
+function constructs a name and class list from the application name and class,
+the names and classes of all the object's ancestors, and the object itself.
+Then it appends to this list the <emphasis remap='I'>name</emphasis> and <emphasis remap='I'>class</emphasis> pair passed in.
+The resources are fetched from the argument list, the resource database,
+or the default values in the resource list.
+Then they are copied into the subpart record.
+If <emphasis remap='I'>args</emphasis> is NULL,
+<emphasis remap='I'>num_args</emphasis> must be zero.
+However, if <emphasis remap='I'>num_args</emphasis> is zero,
+the argument list is not referenced.
+</para>
+
+<para>
+<xref linkend='XtGetSubresources' xrefstyle='select: title'/>
+may overwrite the specified resource list with an
+equivalent representation in an internal format, which optimizes access
+time if the list is used repeatedly.  The resource list must be
+allocated in writable storage, and the caller must not modify the list
+contents after the call if the same list is to be used again.
+Resources fetched by
+<xref linkend='XtGetSubresources' xrefstyle='select: title'/>
+are reference-counted as
+if they were referenced by the specified object.  Subresources might
+therefore be freed from the conversion cache and destroyed
+when the object is destroyed, but not before then.
+</para>
+
+<para>
+To fetch resources for widget subparts using varargs lists, use
+<xref linkend='XtVaGetSubresources' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtVaGetSubresources'>
+<funcprototype>
+<funcdef>void <function>XtVaGetSubresources</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>XtPointer <parameter>base</parameter></paramdef>
+   <paramdef>const char * <parameter>name</parameter></paramdef>
+   <paramdef>const char * <parameter>class</parameter></paramdef>
+   <paramdef>XtResourceList <parameter>resources</parameter></paramdef>
+   <paramdef>Cardinal <parameter>num_resources</parameter></paramdef>
+   <paramdef>...</paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the object used to qualify the subpart resource name and
+class.  Must be of class Object or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>base</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the base address of the subpart data structure into which the
+resources will be written.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the name of the subpart.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the class of the subpart.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>resources</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the resource list for the subpart.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_resources</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the resource list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      ...
+    </term>
+    <listitem>
+      <para>
+Specifies the variable argument list to override any other
+resource specifications.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtVaGetSubresources' xrefstyle='select: title'/>
+is identical in function to
+<xref linkend='XtGetSubresources' xrefstyle='select: title'/>
+with the <emphasis remap='I'>args</emphasis> and <emphasis remap='I'>num_args</emphasis> parameters replaced by a varargs list, as
+described in Section 2.5.1.
+</para>
+</sect1>
+
+<sect1 id="Obtaining_Application_Resources">
+<title>Obtaining Application Resources</title>
+<para>
+To retrieve resources that are not specific to a widget
+but apply to the overall application, use
+<xref linkend='XtGetApplicationResources' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtGetApplicationResources'>
+<funcprototype>
+<funcdef>void <function>XtGetApplicationResources</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>XtPointer <parameter>base</parameter></paramdef>
+   <paramdef>XtResourceList <parameter>resources</parameter></paramdef>
+   <paramdef>Cardinal <parameter>num_resources</parameter></paramdef>
+   <paramdef>ArgList <parameter>args</parameter></paramdef>
+   <paramdef>Cardinal <parameter>num_args</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the object that identifies the resource database to search
+(the database is that associated with the display for this object).  Must be of class Object or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>base</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the base address into which
+the resource values will be written.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>resources</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the resource list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_resources</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the resource list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the argument list to override any other resource specifications.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the argument list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtGetApplicationResources' xrefstyle='select: title'/>
+function first uses the passed object,
+which is usually an application shell widget,
+to construct a resource name and class list.
+The full name and class of the specified object (that is, including its
+ancestors, if any) is logically added to the
+front of each resource name and class.
+Then it retrieves the resources from the argument list,
+the resource database, or the resource list default values.
+After adding base to each address,
+<xref linkend='XtGetApplicationResources' xrefstyle='select: title'/>
+copies the resources into the addresses
+obtained by adding <emphasis remap='I'>base</emphasis> to each <emphasis remap='I'>offset</emphasis> in the resource list.
+If <emphasis remap='I'>args</emphasis> is NULL,
+<emphasis remap='I'>num_args</emphasis> must be zero.
+However, if <emphasis remap='I'>num_args</emphasis> is zero,
+the argument list is not referenced.
+The portable way to specify application resources is to declare them
+as members of a structure and pass the address of the structure
+as the <emphasis remap='I'>base</emphasis> argument.
+</para>
+
+<para>
+<xref linkend='XtGetApplicationResources' xrefstyle='select: title'/>
+may overwrite the specified resource list
+with an equivalent representation in an internal format, which
+optimizes access time if the list is used repeatedly.  The resource
+list must be allocated in writable storage, and the caller must not
+modify the list contents after the call if the same list is to be
+used again.  Any per-display resources fetched by
+<xref linkend='XtGetApplicationResources' xrefstyle='select: title'/>
+will not be freed from the resource cache until the display is closed.
+</para>
+
+<para>
+To retrieve resources for the overall application using varargs lists, use
+<xref linkend='XtVaGetApplicationResources' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtVaGetApplicationResources'>
+<funcprototype>
+<funcdef>void <function>XtVaGetApplicationResources</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>XtPointer <parameter>base</parameter></paramdef>
+   <paramdef>XtResourceList <parameter>resources</parameter></paramdef>
+   <paramdef>Cardinal <parameter>num_resources</parameter></paramdef>
+   <paramdef>...</paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the object that identifies the resource database to search
+(the database is that associated with the display for this object).  Must be of class Object or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>base</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the base address into which
+the resource values will be written.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>resources</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the resource list for the subpart.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_resources</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the resource list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      ...
+    </term>
+    <listitem>
+      <para>
+Specifies the variable argument list to override any other
+resource specifications.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtVaGetApplicationResources' xrefstyle='select: title'/>
+is identical in function to
+<xref linkend='XtGetApplicationResources' xrefstyle='select: title'/>
+with the <emphasis remap='I'>args</emphasis> and <emphasis remap='I'>num_args</emphasis> parameters
+replaced by a varargs list, as described in Section 2.5.1.
+</para>
+</sect1>
+
+<sect1 id="Resource_Conversions">
+<title>Resource Conversions</title>
+<para>
+The Intrinsics provide a mechanism for registering representation converters that
+are automatically invoked by the resource-fetching routines.
+The Intrinsics additionally provide and register several commonly used converters.
+This resource conversion mechanism serves several purposes:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+It permits user and application resource files to contain textual
+representations of nontextual values.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It allows textual or other representations of default resource values that
+are dependent on the display, screen, or colormap, and thus must be
+computed at runtime.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It caches conversion source and result data.
+Conversions that require much computation or space
+(for example, string-to-translation-table)
+or that require round-trips to the server
+(for example, string-to-font or string-to-color) are performed only once.
+    </para>
+  </listitem>
+</itemizedlist>
+<sect2 id="Predefined_Resource_Converters">
+<title>Predefined Resource Converters</title>
+<para>
+The Intrinsics define all the representations used in the
+Object,
+RectObj,
+Core,
+Composite,
+Constraint,
+and
+Shell
+widget classes.
+The Intrinsics register the following resource converters that accept
+input values of representation type
+<function>XtRString</function>.
+</para>
+
+<informaltable frame='topbot'>
+  <?dbfo keep-together="auto" ?>
+  <tgroup cols='3' align='left' rowsep='0' colsep='0'>
+  <colspec colwidth='0.7*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <colspec colwidth='0.6*' colname='c3'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Target Representation</entry>
+      <entry>Converter Name</entry>
+      <entry>Additional Args</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry><function>XtRAcceleratorTable</function></entry>
+      <entry><function>XtCvtStringToAcceleratorTable</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRAtom</function></entry>
+      <entry><function>XtCvtStringToAtom</function></entry>
+      <entry>Display*</entry>
+    </row>
+    <row>
+      <entry><function>XtRBoolean</function></entry>
+      <entry><function>XtCvtStringToBoolean</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRBool</function></entry>
+      <entry><function>XtCvtStringToBool</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRCommandArgArray</function></entry>
+      <entry><function>XtCvtStringToCommandArgArray</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRCursor</function></entry>
+      <entry><function>XtCvtStringToCursor</function></entry>
+      <entry>Display*</entry>
+    </row>
+    <row>
+      <entry><function>XtRDimension</function></entry>
+      <entry><function>XtCvtStringToDimension</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRDirectoryString</function></entry>
+      <entry><function>XtCvtStringToDirectoryString</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRDisplay</function></entry>
+      <entry><function>XtCvtStringToDisplay</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRFile</function></entry>
+      <entry><function>XtCvtStringToFile</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRFloat</function></entry>
+      <entry><function>XtCvtStringToFloat</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRFont</function></entry>
+      <entry><function>XtCvtStringToFont</function></entry>
+      <entry>Display*</entry>
+    </row>
+    <row>
+      <entry><function>XtRFontSet</function></entry>
+      <entry><function>XtCvtStringToFontSet</function></entry>
+      <entry>Display*, String <emphasis remap='I'>locale</emphasis></entry>
+    </row>
+    <row>
+      <entry><function>XtRFontStruct</function></entry>
+      <entry><function>XtCvtStringToFontStruct</function></entry>
+      <entry>Display*</entry>
+    </row>
+    <row>
+      <entry><function>XtRGravity</function></entry>
+      <entry><function>XtCvtStringToGravity</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRInitialState</function></entry>
+      <entry><function>XtCvtStringToInitialState</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRInt</function></entry>
+      <entry><function>XtCvtStringToInt</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRPixel</function></entry>
+      <entry><function>XtCvtStringToPixel</function></entry>
+      <entry><function>colorConvertArgs</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRPosition</function></entry>
+      <entry><function>XtCvtStringToPosition</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRRestartStyle</function></entry>
+      <entry><function>XtCvtStringToRestartStyle</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRShort</function></entry>
+      <entry><function>XtCvtStringToShort</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRTranslationTable</function></entry>
+      <entry><function>XtCvtStringToTranslationTable</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRUnsignedChar</function></entry>
+      <entry><function>XtCvtStringToUnsignedChar</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRVisual</function></entry>
+      <entry><function>XtCvtStringToVisual</function></entry>
+      <entry>Screen*, Cardinal <emphasis remap='I'>depth</emphasis></entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The String-to-Pixel conversion has two predefined constants that are
+guaranteed to work and contrast with each other:
+<function>XtDefaultForeground</function>
+and
+<function>XtDefaultBackground</function>.
+They evaluate to the black and white pixel values of the widget's screen,
+respectively.
+If the application resource reverseVideo is
+<function>True</function>,
+they evaluate to the white and black pixel values of the widget's screen,
+respectively.
+Similarly, the String-to-Font and String-to-FontStruct converters recognize
+the constant
+<function>XtDefaultFont</function>
+and evaluate this in the following manner:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Query the resource database for the resource whose full name
+is &ldquo;xtDefaultFont&rdquo;, class &ldquo;XtDefaultFont&rdquo; (that is, no widget
+name/class prefixes), and use a type
+<function>XtRString</function>
+value returned as the font name or a type
+<function>XtRFont</function>
+or
+<function>XtRFontStruct</function>
+value directly as the resource value.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the resource database does not contain a value for xtDefaultFont,
+class XtDefaultFont, or if the returned font name cannot be
+successfully opened, an implementation-defined font in ISO8859-1
+character set encoding is opened.  (One possible algorithm is to
+perform an
+<function>XListFonts</function>
+using a wildcard font name and use the first
+font in the list.  This wildcard font name should be as broad as
+possible to maximize the probability of locating a useable font;
+for example, &ldquo;<code>-*-*-*-R-*-*-*-120-*-*-*-*-ISO8859-1</code>&rdquo;.)
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If no suitable ISO8859-1 font can be found, issue a warning message
+and return
+<function>False</function>.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+The String-to-FontSet converter recognizes the constant
+<function>XtDefaultFontSet</function>
+and evaluate this in the following manner:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Query the resource database for the resource whose full name
+is &ldquo;xtDefaultFontSet&rdquo;, class &ldquo;XtDefaultFontSet&rdquo; (that is, no widget
+name/class prefixes), and use a type
+<function>XtRString</function>
+value returned as the base font name list or a type
+<function>XtRFontSet</function>
+value directly as the resource value.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the resource database does not contain a value for xtDefaultFontSet,
+class XtDefaultFontSet, or if a font set cannot be
+successfully created from this resource,
+an implementation-defined font set is created.
+(One possible algorithm is to
+perform an
+<function>XCreateFontSet</function>
+using a wildcard base font name.
+This wildcard base font name should be as broad as
+possible to maximize the probability of locating a useable font;
+for example, &ldquo;<code>-*-*-*-R-*-*-*-120-*-*-*-*</code>&rdquo;.)
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If no suitable font set can be created, issue a warning message
+and return
+<function>False</function>.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+If a font set is created but <emphasis remap='I'>missing_charset_list</emphasis> is not
+empty, a warning is issued and the partial font set is returned.
+The Intrinsics register the String-to-FontSet converter with
+a conversion argument list that extracts the current process
+locale at the time the converter is invoked.   This ensures
+that the converter is invoked again if the same conversion
+is required in a different locale.
+</para>
+
+<para>
+The String-to-Gravity conversion accepts string values that are the
+names of window and bit gravities and their numerical equivalents,
+as defined in <emphasis remap='I'>Xlib &mdash; C Language X Interface</emphasis>:
+<function>ForgetGravity</function>,
+<function>UnmapGravity</function>,
+<function>NorthWestGravity</function>,
+<function>NorthGravity</function>,
+<function>NorthEastGravity</function>,
+<function>WestGravity</function>,
+<function>CenterGravity</function>,
+<function>EastGravity</function>,
+<function>SouthWestGravity</function>,
+<function>SouthGravity</function>,
+<function>SouthEastGravity</function>,
+and
+<function>StaticGravity</function>.
+Alphabetic case is not significant in the conversion.
+</para>
+
+<para>
+The String-to-CommandArgArray conversion parses a String into an
+array of strings.
+White space characters separate elements of the command line.
+The converter recognizes the backslash character &ldquo;\&rdquo; as an escape
+character to allow the following white space character to be part of the
+array element.
+</para>
+
+<para>
+The String-to-DirectoryString conversion recognizes the
+string &ldquo;XtCurrentDirectory&rdquo; and returns the result of a call
+to the operating system to get the current directory.
+</para>
+
+<para>
+The String-to-RestartStyle conversion accepts the values
+<function>RestartIfRunning</function>,
+<function>RestartAnyway</function>,
+<function>RestartImmediately</function>,
+and
+<function>RestartNever</function>
+as defined by the <emphasis remap='I'>X Session Management Protocol</emphasis>.
+</para>
+
+<para>
+The String-to-InitialState conversion accepts the values
+<function>NormalState</function>
+or
+<function>IconicState</function>
+as defined by the <emphasis remap='I'>Inter-Client Communication Conventions Manual</emphasis>.
+</para>
+
+<para>
+The String-to-Visual conversion calls
+<function>XMatchVisualInfo</function>
+using the
+<emphasis remap='I'>screen</emphasis> and <emphasis remap='I'>depth</emphasis> fields from the core part and returns the first
+matching Visual on the list.  The widget resource list must be certain
+to specify any resource of type
+<function>XtRVisual</function>
+after the depth resource.
+The allowed string values are the visual class names defined in <emphasis remap='I'>X Window System Protocol</emphasis>,
+Section 8;
+<function>StaticGray</function>,
+<function>StaticColor</function>,
+<function>TrueColor</function>,
+<function>GrayScale</function>,
+<function>PseudoColor</function>,
+and
+<function>DirectColor</function>.
+</para>
+
+<para>
+The Intrinsics register the following resource converter that accepts
+an input value of representation type
+<function>XtRColor</function>.
+</para>
+
+<informaltable frame='topbot'>
+  <?dbfo keep-together="auto" ?>
+  <tgroup cols='3' align='left' rowsep='0' colsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <colspec colwidth='1.0*' colname='c3'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Target Representation</entry>
+      <entry>Converter Name</entry>
+      <entry>Additional Args</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry><function>XtRPixel</function></entry>
+      <entry><function>XtCvtColorToPixel</function></entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The Intrinsics register the following resource converters that accept
+input values of representation type
+<function>XtRInt</function>.
+</para>
+
+<informaltable frame='topbot'>
+  <?dbfo keep-together="auto" ?>
+  <tgroup cols='3' align='left' rowsep='0' colsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <colspec colwidth='1.0*' colname='c3'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Target Representation</entry>
+      <entry>Converter Name</entry>
+      <entry>Additional Args</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry><function>XtRBoolean</function></entry>
+      <entry><function>XtCvtIntToBoolean</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRBool</function></entry>
+      <entry><function>XtCvtIntToBool</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRColor</function></entry>
+      <entry><function>XtCvtIntToColor</function></entry>
+      <entry><function>colorConvertArgs</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRDimension</function></entry>
+      <entry><function>XtCvtIntToDimension</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRFloat</function></entry>
+      <entry><function>XtCvtIntToFloat</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRFont</function></entry>
+      <entry><function>XtCvtIntToFont</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRPixel</function></entry>
+      <entry><function>XtCvtIntToPixel</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRPixmap</function></entry>
+      <entry><function>XtCvtIntToPixmap</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRPosition</function></entry>
+      <entry><function>XtCvtIntToPosition</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRShort</function></entry>
+      <entry><function>XtCvtIntToShort</function></entry>
+    </row>
+    <row>
+      <entry><function>XtRUnsignedChar</function></entry>
+      <entry><function>XtCvtIntToUnsignedChar</function></entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The Intrinsics register the following resource converter that accepts
+an input value of representation type
+<function>XtRPixel</function>.
+</para>
+
+<informaltable frame='topbot'>
+  <?dbfo keep-together="auto" ?>
+  <tgroup cols='3' align='left' rowsep='0' colsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <colspec colwidth='1.0*' colname='c3'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Target Representation</entry>
+      <entry>Converter Name</entry>
+      <entry>Additional Args</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry><function>XtRColor</function></entry>
+      <entry><function>XtCvtPixelToColor</function></entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+</sect2>
+
+<sect2 id="New_Resource_Converters">
+<title>New Resource Converters</title>
+<para>
+Type converters use pointers to
+<function>XrmValue</function>
+structures (defined in
+<filename class="headerfile">&lt;X11/Xresource.h&gt;;</filename>
+see Section 15.4 in
+Xlib &mdash; C Language X Interface)
+for input and output values.
+</para>
+<programlisting>
+typedef struct {
+       unsigned int size;
+       XPointer addr;
+} XrmValue, *XrmValuePtr;
+</programlisting>
+<para>
+The <emphasis remap='I'>addr</emphasis> field specifies the address of the data, and the <emphasis remap='I'>size</emphasis>
+field gives the total number of significant bytes in the data.
+For values of type
+<function>String</function>,
+<emphasis remap='I'>addr</emphasis> is the address of the first character and <emphasis remap='I'>size</emphasis>
+includes the NULL-terminating byte.
+</para>
+
+<para>
+A resource converter procedure pointer is of type
+<xref linkend='XtTypeConverter' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtTypeConverter'>
+<funcprototype>
+<funcdef>typedef Boolean <function>(*XtTypeConverter)</function></funcdef>
+   <paramdef>Display *<parameter>display</parameter></paramdef>
+   <paramdef>XrmValue *<parameter>args</parameter></paramdef>
+   <paramdef>Cardinal *<parameter>num_args</parameter></paramdef>
+   <paramdef>XrmValue *<parameter>from</parameter></paramdef>
+   <paramdef>XrmValue *<parameter>to</parameter></paramdef>
+   <paramdef>XtPointer *<parameter>converter_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display connection with which this conversion is associated.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a list of additional
+<function>XrmValue</function>
+arguments to the converter if additional context is needed
+to perform the conversion, or NULL.
+For example, the String-to-Font converter needs the widget's <emphasis remap='I'>display</emphasis>,
+and the String-to-Pixel converter needs the widget's <emphasis remap='I'>screen</emphasis> and <emphasis remap='I'>colormap</emphasis>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in <emphasis remap='I'>args</emphasis>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>from</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the value to convert.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>to</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a descriptor for a location into which to store the converted value.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>converter_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a location into which the converter may
+store converter-specific data associated
+with this conversion.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The <emphasis remap='I'>display</emphasis> argument is normally used only when generating error
+messages, to identify the application context (with the function
+<function>XtDisplayToApplicationContext ).</function>
+</para>
+
+<para>
+The <emphasis remap='I'>to</emphasis> argument specifies the size and location into which the
+converter should store the converted value.  If the <emphasis remap='I'>addr</emphasis> field is NULL,
+the converter should allocate appropriate storage and store the size
+and location into the <emphasis remap='I'>to</emphasis> descriptor.  If the type converter allocates
+the storage, it remains under the ownership of the converter and must
+not be modified by the caller.  The type converter is permitted to use
+static storage for this purpose, and therefore the caller must
+immediately copy the data upon return from the converter.  If the
+<emphasis remap='I'>addr</emphasis> field is not NULL, the converter must check the <emphasis remap='I'>size</emphasis> field to
+ensure that sufficient space has been allocated before storing the
+converted value.  If insufficient space is specified, the converter
+should update the <emphasis remap='I'>size</emphasis> field with the number of bytes required and
+return
+<function>False</function>
+without modifying the data at the specified location.
+If sufficient space was allocated by the caller, the converter should
+update the <emphasis remap='I'>size</emphasis> field with the number of bytes actually occupied by the
+converted value.  For converted values of type
+<function>XtRString</function>,
+the size should
+include the NULL-terminating byte, if any.
+The converter may store any value in the location specified
+in <emphasis remap='I'>converter_data</emphasis>; this value will be passed to the destructor, if any,
+when the resource is freed by the Intrinsics.
+</para>
+
+<para>
+The converter must return
+<function>True</function>
+if the conversion was successful and
+<function>False</function>
+otherwise.  If the conversion cannot be performed because of an
+improper source value, a warning message should also be issued with
+<xref linkend='XtAppWarningMsg' xrefstyle='select: title'/>.
+</para>
+
+<para>
+Most type converters just take the data described by the specified <emphasis remap='I'>from</emphasis>
+argument and return data by writing into the location specified in
+the <emphasis remap='I'>to</emphasis> argument.
+A few need other information, which is available in <emphasis remap='I'>args</emphasis>.
+A type converter can invoke another type converter,
+which allows differing sources that may convert into a common intermediate
+result to make maximum use of the type converter cache.
+</para>
+
+<para>
+Note that if an address is written into <emphasis remap='I'>to-&gt;addr</emphasis>, it cannot be that
+of a local variable of the converter because the data will not be
+valid after the converter returns.  Static variables may be used,
+as in the following example.
+If the converter modifies the resource database,
+the changes affect any in-progress widget creation,
+<xref linkend='XtGetApplicationResources' xrefstyle='select: title'/>,
+or
+<xref linkend='XtGetSubresources' xrefstyle='select: title'/>
+in an implementation-defined manner; however, insertion of new entries
+or changes to existing entries is allowed and will not directly cause
+an error.
+</para>
+
+<para>
+The following is an example of a converter that takes a
+<function>string</function>
+and converts it to a
+<function>Pixel</function>.
+Note that the <emphasis remap='I'>display</emphasis> parameter is
+used only to generate error messages; the
+<function>Screen</function>
+conversion argument is
+still required to inform the Intrinsics that the converted value is
+a function of the particular display (and colormap).
+</para>
+
+<programlisting>
+#define done(type, value) \
+     {                                                 \
+          if (toVal-&gt;addr != NULL) {                   \
+               if (toVal-&gt;size &lt; sizeof(type)) {       \
+                    toVal-&gt;size = sizeof(type);        \
+                    return False;                      \
+               }                                       \
+               *(type*)(toVal-&gt;addr) = (value);        \
+          }                                            \
+          else {                                       \
+               static type static_val;                 \
+               static_val = (value);                   \
+               toVal-&gt;addr = (XPointer)&amp;static_val;    \
+          }                                            \
+          toVal-&gt;size = sizeof(type);                  \
+          return True;                                 \
+     }
+
+static Boolean CvtStringToPixel(
+     Display   *dpy,
+     XrmValue  *args,
+     Cardinal  *num_args,
+     XrmValue  *fromVal,
+     XrmValue  *toVal,
+     XtPointer *converter_data)
+{
+     static XColor  screenColor;
+     XColor         exactColor;
+     Screen         *screen;
+     Colormap       colormap;
+     Status         status;
+
+     if (*num_args != 2)
+          XtAppWarningMsg(XtDisplayToApplicationContext(dpy),
+               "wrongParameters", "cvtStringToPixel", "XtToolkitError",
+               "String to pixel conversion needs screen and colormap arguments",
+               (String *)NULL, (Cardinal *)NULL);
+     screen = *((Screen**) args[0].addr);
+     colormap = *((Colormap *) args[1].addr);
+     if (CompareISOLatin1(str, XtDefaultBackground) == 0) {
+          *closure_ret = False;
+          done(Pixel, WhitePixelOfScreen(screen));
+     }
+     if (CompareISOLatin1(str, XtDefaultForeground) == 0) {
+          *closure_ret = False;
+          done(Pixel, BlackPixelOfScreen(screen));
+     }
+     status = XAllocNamedColor(DisplayOfScreen(screen),
+                               colormap, (char*)fromVal-&gt;addr,
+                               &amp;screenColor, &amp;exactColor);
+     if (status == 0) {
+          String params[1];
+          Cardinal num_params = 1;
+          params[0] = (String)fromVal-&gt;addr;
+          XtAppWarningMsg(XtDisplayToApplicationContext(dpy),
+                          "noColormap",
+                          "cvtStringToPixel",
+                          "XtToolkitError",
+                          "Cannot allocate colormap entry for \"%s\"",
+                          params, &amp;num_params);
+          *converter_data = (char *) False;
+          return False;
+     } else {
+          *converter_data = (char *) True;
+          done(Pixel, &amp;screenColor.pixel);
+     }
+}
+</programlisting>
+
+<para>
+All type converters should define some set of conversion values for which they
+are guaranteed to succeed so these can be used in the resource defaults.
+This issue arises only with conversions, such as fonts and colors,
+where there is no string representation that all server implementations
+will necessarily recognize.
+For resources like these,
+the converter should define a symbolic constant
+in the same manner as
+<function>XtDefaultForeground</function>,
+<function>XtDefaultBackground</function>,
+and
+<function>XtDefaultFont</function>.
+</para>
+
+<para>
+To allow the Intrinsics to deallocate resources produced by type
+converters, a resource destructor procedure may also be provided.
+</para>
+
+<para>
+A resource destructor procedure pointer is of type
+<xref linkend='XtDestructor' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtDestructor'>
+<funcprototype>
+  <funcdef>typedef void <function>(*XtDestructor)</function></funcdef>
+   <paramdef>XtAppContext <parameter>app</parameter></paramdef>
+   <paramdef>XrmValue *<parameter>to</parameter></paramdef>
+   <paramdef>XtPointer <parameter>converter_data</parameter></paramdef>
+   <paramdef>XrmValue *<parameter>args</parameter></paramdef>
+   <paramdef>Cardinal *<parameter>num_args</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an application context in which the resource is being freed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>to</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a descriptor for the resource produced by the type converter.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>converter_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the converter-specific data returned by the type converter.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the additional converter arguments as passed
+to the type converter when the conversion was performed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in <emphasis remap='I'>args</emphasis>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The destructor procedure is responsible for freeing the resource
+specified by the <emphasis remap='I'>to</emphasis> argument, including any auxiliary storage
+associated with that resource, but not the memory directly addressed
+by the size and location in the <emphasis remap='I'>to</emphasis> argument or the memory specified
+by <emphasis remap='I'>args</emphasis>.
+</para>
+</sect2>
+
+<sect2 id="Issuing_Conversion_Warnings">
+<title>Issuing Conversion Warnings</title>
+<para>
+The
+<xref linkend='XtDisplayStringConversionWarning' xrefstyle='select: title'/>
+procedure is a convenience routine for resource type converters
+that convert from string values.
+</para>
+
+<funcsynopsis id='XtDisplayStringConversionWarning'>
+<funcprototype>
+<funcdef>void <function>XtDisplayStringConversionWarning</function></funcdef>
+   <paramdef>Display *<parameter>display</parameter></paramdef>
+   <paramdef>const char * <parameter>from_value</parameter></paramdef>
+   <paramdef>const char * <parameter>to_type</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display connection with which the conversion is associated.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>from_value</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the string that could not be converted.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>to_type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the target representation type requested.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtDisplayStringConversionWarning' xrefstyle='select: title'/>
+procedure issues a warning message using
+<xref linkend='XtAppWarningMsg' xrefstyle='select: title'/>
+with <emphasis remap='I'>name</emphasis> &ldquo;conversionError&rdquo;,
+<emphasis remap='I'>type</emphasis> &ldquo;string&rdquo;, <emphasis remap='I'>class</emphasis> &ldquo;XtToolkitError&rdquo;, and the default message
+&ldquo;Cannot convert "<emphasis remap='I'>from_value</emphasis>" to type <emphasis remap='I'>to_type</emphasis>&rdquo;.
+</para>
+
+<para>
+To issue other types of warning or error messages, the type converter
+should use
+<xref linkend='XtAppWarningMsg' xrefstyle='select: title'/>
+or
+<xref linkend='XtAppErrorMsg' xrefstyle='select: title'/>.
+</para>
+
+<para>
+To retrieve the application context associated with a given
+display connection, use
+<xref linkend='XtDisplayToApplicationContext' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtDisplayToApplicationContext'>
+<funcprototype>
+<funcdef>XtAppContext <function>XtDisplayToApplicationContext</function></funcdef>
+   <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an open and initialized display connection.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtDisplayToApplicationContext' xrefstyle='select: title'/>
+function returns the application
+context in which the specified <emphasis remap='I'>display</emphasis> was initialized.  If the
+display is not known to the Intrinsics, an error message is issued.
+</para>
+</sect2>
+
+<sect2 id="Registering_a_New_Resource_Converter">
+<title>Registering a New Resource Converter</title>
+<para>
+When registering a resource converter, the client must specify the
+manner in which the conversion cache is to be used when there are multiple
+calls to the converter.  Conversion cache control is specified
+via an <function>XtCacheType</function>
+argument.  </para>
+
+<programlisting>
+typedef int XtCacheType;
+</programlisting>
+
+<para>
+An <function>XtCacheType</function>
+field may contain one of the following values:
+</para>
+
+<para>
+<function>XtCacheNone</function>
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Specifies that the results of a previous conversion
+may not be reused to satisfy any other resource
+requests; the specified converter will be called
+each time the converted value is required.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<function>XtCacheAll</function>
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Specifies that the results of a previous conversion
+should be reused for any resource request that depends
+upon the same source value and conversion arguments.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+<function>XtCacheByDisplay</function>
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Specifies that the results of a previous conversion
+should be used as for
+<function>XtCacheAll</function>
+but the destructor will be called, if specified, if
+<xref linkend='XtCloseDisplay' xrefstyle='select: title'/>
+is called
+for the display connection associated with the converted value, and
+the value will be removed from the conversion cache.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+The qualifier
+<function>XtCacheRefCount</function>
+may be ORed with any of the above values.  If
+<function>XtCacheRefCount</function>
+is specified, calls to
+<xref linkend='XtCreateWidget' xrefstyle='select: title'/>,
+<xref linkend='XtCreateManagedWidget' xrefstyle='select: title'/>,
+<xref linkend='XtGetApplicationResources' xrefstyle='select: title'/>,
+and
+<xref linkend='XtGetSubresources' xrefstyle='select: title'/>
+that use the converted value will be counted.  When a widget using the
+converted value is destroyed, the count is decremented, and, if the
+count reaches zero, the destructor procedure will be called and the
+converted value will be removed from the conversion cache.
+</para>
+
+<para>
+To register a type converter for all application contexts in a
+process, use
+<xref linkend='XtSetTypeConverter' xrefstyle='select: title'/>,
+and to register a type converter in a single application context, use
+<xref linkend='XtAppSetTypeConverter' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtSetTypeConverter'>
+<funcprototype>
+<funcdef>void <function>XtSetTypeConverter</function></funcdef>
+   <paramdef>const char * <parameter>from_type</parameter></paramdef>
+   <paramdef>const char * <parameter>to_type</parameter></paramdef>
+   <paramdef>XtTypeConverter <parameter>converter</parameter></paramdef>
+   <paramdef>XtConvertArgList <parameter>convert_args</parameter></paramdef>
+   <paramdef>Cardinal <parameter>num_args</parameter></paramdef>
+   <paramdef>XtCacheType <parameter>cache_type</parameter></paramdef>
+   <paramdef>XtDestructor <parameter>destructor</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>from_type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the source type.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>to_type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the destination type.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>converter</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the resource type converter procedure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>convert_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies additional conversion arguments, or NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in <emphasis remap='I'>convert_args</emphasis>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>cache_type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies whether or not resources produced by this
+converter are sharable or display-specific and when
+they should be freed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>destructor</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a destroy procedure for resources produced by
+this conversion, or NULL if no additional action is
+required to deallocate resources produced by the converter.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<funcsynopsis id='XtAppSetTypeConverter'>
+<funcprototype>
+<funcdef>void <function>XtAppSetTypeConverter</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+   <paramdef>const char * <parameter>from_type</parameter></paramdef>
+   <paramdef>const char * <parameter>to_type</parameter></paramdef>
+   <paramdef>XtTypeConverter <parameter>converter</parameter></paramdef>
+   <paramdef>XtConvertArgList <parameter>convert_args</parameter></paramdef>
+   <paramdef>Cardinal <parameter>num_args</parameter></paramdef>
+   <paramdef>XtCacheType <parameter>cache_type</parameter></paramdef>
+   <paramdef>XtDestructor <parameter>destructor</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>from_type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the source type.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>to_type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the destination type.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>converter</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the resource type converter procedure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>convert_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies additional conversion arguments, or NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in <emphasis remap='I'>convert_args</emphasis>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>cache_type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies whether or not resources produced by this
+converter are sharable or display-specific and when
+they should be freed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>destructor</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a destroy procedure for resources produced by
+this conversion, or NULL if no additional action is
+required to deallocate resources produced by the converter.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtSetTypeConverter' xrefstyle='select: title'/>
+registers the specified type converter and
+destructor in all application contexts created by the calling process,
+including any future application contexts that may be created.
+<xref linkend='XtAppSetTypeConverter' xrefstyle='select: title'/>
+registers the specified type converter in the
+single application context specified.  If the same <emphasis remap='I'>from_type</emphasis> and
+<emphasis remap='I'>to_type</emphasis> are specified in multiple calls to either function, the most
+recent overrides the previous ones.
+</para>
+
+<para>
+For the few type converters that need additional arguments,
+the Intrinsics conversion mechanism provides a method of specifying
+how these arguments should be computed.
+The enumerated type
+<function>XtAddressMode</function>
+and the structure
+<function>XtConvertArgRec</function>
+specify how each argument is derived.
+These are defined in
+<filename class="headerfile">&lt;X11/Intrinsic.h&gt;</filename>.
+</para>
+<programlisting>
+typedef enum {
+        /* address mode parameter representation */
+           XtAddress,           /* address */
+           XtBaseOffset,        /* offset */
+           XtImmediate,         /* constant */
+           XtResourceString,    /* resource name string */
+           XtResourceQuark,     /* resource name quark */
+           XtWidgetBaseOffset,  /* offset */
+           XtProcedureArg       /* procedure to call */
+} XtAddressMode;
+
+typedef struct {
+        XtAddressMode   address_mode;
+        XtPointer       address_id;
+        Cardinal        size;
+} XtConvertArgRec, *XtConvertArgList;
+</programlisting>
+<para>
+The <emphasis remap='I'>size</emphasis> field specifies the length of the data in bytes.
+The <emphasis remap='I'>address_mode</emphasis> field specifies how the <emphasis remap='I'>address_id</emphasis> field should be
+interpreted.
+<function>XtAddress</function>
+causes <emphasis remap='I'>address_id</emphasis> to be interpreted as the address of the data.
+<function>XtBaseOffset</function>
+causes <emphasis remap='I'>address_id</emphasis> to be interpreted as the offset from the widget base.
+<function>XtImmediate</function>
+causes <emphasis remap='I'>address_id</emphasis> to be interpreted as a constant.
+<function>XtResourceString</function>
+causes <emphasis remap='I'>address_id</emphasis> to be interpreted as the name of a resource
+that is to be converted into an offset from the widget base.
+<function>XtResourceQuark</function>
+causes <emphasis remap='I'>address_id</emphasis> to be interpreted as the result of an
+<function>XrmStringToQuark</function>
+conversion on the name of a resource,
+which is to be converted into an offset from the widget base.
+<function>XtWidgetBaseOffset</function>
+is similar to
+<function>XtBaseOffset</function>
+except that it
+searches for the closest windowed ancestor if the object is not
+of a subclass of
+Core
+(see <xref linkend='Nonwidget_Objects' />).
+<function>XtProcedureArg</function>
+specifies that <emphasis remap='I'>address_id</emphasis> is a pointer to a procedure to
+be invoked to return the conversion argument.  If
+<function>XtProcedureArg</function>
+is specified, <emphasis remap='I'>address_id</emphasis> must contain
+the address of a function of type
+<xref linkend='XtConvertArgProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtConvertArgProc'>
+<funcprototype>
+<funcdef>typedef void <function>(*XtConvertArgProc)</function></funcdef>
+   <paramdef>Widget <parameter>object</parameter></paramdef>
+   <paramdef>Cardinal *<parameter>size</parameter></paramdef>
+   <paramdef>XrmValue *<parameter>value</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>object</emphasis>
+    </term>
+    <listitem>
+      <para>
+Passes the object for which the resource is being
+converted, or NULL if the converter was invoked by
+<xref linkend='XtCallConverter' xrefstyle='select: title'/> or
+<xref linkend='XtDirectConvert' xrefstyle='select: title'/>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>size</emphasis>
+    </term>
+    <listitem>
+      <para>
+Passes a pointer to the size field from the XtConvertArgRec.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>value</emphasis>
+    </term>
+    <listitem>
+      <para>
+Passes a pointer to a descriptor into which the procedure must store the
+conversion argument.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+<para>
+When invoked, the <function>XtConvertArgProc</function> procedure must derive a
+conversion argument and store the address and size of the
+argument in the location pointed to by value.
+</para>
+<para>
+In order to permit reentrancy, the <function>XtConvertArgProc</function> should
+return the address of storage whose lifetime is no shorter
+than the lifetime of object.
+If object is NULL,
+the lifetime of the conversion argument must be no shorter than the
+lifetime of the resource with which the conversion argument
+is associated.	The Intrinsics do not guarantee to copy this
+storage but do guarantee not to reference it if the resource
+is removed from the conversion cache.
+</para>
+<para>
+The following example illustrates how to register the
+<function>CvtStringToPixel</function>
+routine given earlier:
+</para>
+<programlisting>
+static XtConvertArgRec colorConvertArgs[] = {
+  {XtWidgetBaseOffset,
+   (XtPointer)XtOffset(Widget, core.screen),
+   sizeof(Screen*)},
+  {XtWidgetBaseOffset,
+   (XtPointer)XtOffset(Widget, core.colormap),
+   sizeof(Colormap)}
+};
+
+XtSetTypeConverter(XtRString,
+                   XtRPixel,
+                   CvtStringToPixel,
+                   colorConvertArgs,
+                   XtNumber(colorConvertArgs),
+                   XtCacheByDisplay, NULL);
+</programlisting>
+<para>
+The conversion argument descriptors colorConvertArgs and
+screenConvertArg are predefined by the Intrinsics.  Both
+take the values from the closest windowed ancestor if the
+object is not of a subclass of Core.  The screenConvertArg
+descriptor puts the widget’s screen field into args[0].  The
+colorConvertArgs descriptor puts the widget’s screen field
+into args[0], and the widget’s colormap field into args[1].
+</para>
+<para>
+Conversion routines should not just put a descriptor for the
+address of the base of the widget into args[0], and use that
+in the routine.  They should pass in the actual values on
+which the conversion depends.  By keeping the dependencies
+of the conversion procedure specific, it is more likely that
+subsequent conversions will find what they need in the conversion cache.
+This way the cache is smaller and has fewer
+and more widely applicable entries.
+</para>
+<para>
+If any conversion arguments of type
+<type>XtBaseOffset</type>,
+<type>XtResourceString</type>,
+<type>XtResourceQuark</type>,
+and
+<type>XtWidgetBaseOffset</type>
+are
+specified for conversions performed by
+<type>XtGetApplicationResources</type>,
+<type>XtGetSubresources</type>,
+<type>XtVaGetApplicationResources</type>,
+or
+<type>XtVaGetSubresources</type>,
+the arguments are computed with respect
+to the specified widget, not the base address or resource
+list specified in the call.
+</para>
+<para>
+If the <function>XtConvertArgProc</function> modifies the resource database, the
+changes affect any in-progress widget creation,
+<xref linkend='XtGetApplicationResources' xrefstyle='select: title'/>,
+or
+<xref linkend='XtGetSubresources' xrefstyle='select: title'/>
+in an implementation-defined manner;
+however, insertion of new entries or changes
+to existing entries are allowed and will not directly cause
+an error.
+</para>
+</sect2>
+
+<sect2 id="Resource_Converter_Invocation">
+<title>Resource Converter Invocation</title>
+<para>
+All resource-fetching routines (for example,
+<xref linkend='XtGetSubresources' xrefstyle='select: title'/>,
+<xref linkend='XtGetApplicationResources' xrefstyle='select: title'/>,
+and so on) call resource converters if the resource database or
+varargs list specifies a value
+that has a different representation from the desired representation or if the
+widget's default resource value representation is different from the desired
+representation.
+</para>
+
+<para>
+To invoke explicit resource conversions, use
+<xref linkend='XtConvertAndStore' xrefstyle='select: title'/>
+or
+<xref linkend='XtCallConverter' xrefstyle='select: title'/>.
+</para>
+<programlisting>
+typedef XtPointer XtCacheRef;
+</programlisting>
+
+<funcsynopsis id='XtCallConverter'>
+<funcprototype>
+<funcdef>Boolean  <function>XtCallConverter</function></funcdef>
+   <paramdef>Display* <parameter>display</parameter></paramdef>
+   <paramdef>XtTypeConverter <parameter>converter</parameter></paramdef>
+   <paramdef>XrmValuePtr <parameter>conversion_args</parameter></paramdef>
+   <paramdef>Cardinal <parameter>num_args</parameter></paramdef>
+   <paramdef>XrmValuePtr <parameter>from</parameter></paramdef>
+   <paramdef>XrmValuePtr <parameter>to_in_out</parameter></paramdef>
+   <paramdef>XtCacheRef *<parameter>cache_ref_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display with which the conversion is to be associated.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>converter</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the conversion procedure to be called.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>conversion_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the additional conversion arguments needed
+to perform the conversion, or NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in <emphasis remap='I'>conversion_args</emphasis>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>from</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a descriptor for the source value.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>to_in_out</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the converted value.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>cache_ref_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns a conversion cache id.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtCallConverter' xrefstyle='select: title'/>
+function looks up the
+specified type converter in the application context associated with
+the display and, if the converter was not registered or was registered
+with cache type
+<function>XtCacheAll</function>
+or
+<function>XtCacheByDisplay</function>,
+looks in the conversion cache to see if this conversion procedure
+has been called with the specified conversion arguments.  If so, it
+checks the success status of the prior call, and if
+the conversion failed,
+<xref linkend='XtCallConverter' xrefstyle='select: title'/>
+returns
+<function>False</function>
+immediately;
+otherwise it checks the size specified in the <emphasis remap='I'>to</emphasis> argument, and, if it is
+greater than or equal to the size stored in the cache, copies the
+information stored in the cache into the location specified by
+<emphasis remap='I'>to-&gt;addr</emphasis>, stores the cache size into <emphasis remap='I'>to-&gt;size</emphasis>, and returns
+<function>True</function>.
+If the size specified in the <emphasis remap='I'>to</emphasis> argument is smaller than the size stored
+in the cache,
+<xref linkend='XtCallConverter' xrefstyle='select: title'/>
+copies the cache size into <emphasis remap='I'>to-&gt;size</emphasis> and returns
+<function>False</function>.
+If the converter was registered with cache type
+<function>XtCacheNone</function>
+or no value was found in the conversion cache,
+<xref linkend='XtCallConverter' xrefstyle='select: title'/>
+calls the converter, and if it was not registered with cache type
+<function>XtCacheNone</function>,
+enters the result in the cache.
+<xref linkend='XtCallConverter' xrefstyle='select: title'/>
+then returns what the converter returned.
+</para>
+
+<para>
+The <emphasis remap='I'>cache_ref_return</emphasis> field specifies storage allocated by the caller in which
+an opaque value will be stored.  If the type converter has been
+registered with the
+<function>XtCacheRefCount</function>
+modifier and if the value returned
+in <emphasis remap='I'>cache_ref_return</emphasis> is non-NULL, then the caller should store the
+<emphasis remap='I'>cache_ref_return</emphasis> value in order to decrement the reference count when
+the converted value is no longer required.  The <emphasis remap='I'>cache_ref_return</emphasis>
+argument should be
+NULL if the caller is unwilling or unable to store the
+value.
+</para>
+
+<para>
+To explicitly decrement the reference counts for resources obtained
+from
+<xref linkend='XtCallConverter' xrefstyle='select: title'/>,
+use
+<xref linkend='XtAppReleaseCacheRefs' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppReleaseCacheRefs'>
+<funcprototype>
+<funcdef>void <function>XtAppReleaseCacheRefs</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+   <paramdef>XtCacheRef *<parameter>refs</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>refs</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the list of cache references to be released.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtAppReleaseCacheRefs' xrefstyle='select: title'/>
+decrements the reference count for the
+conversion entries identified by the <emphasis remap='I'>refs</emphasis> argument.
+This argument is a
+pointer to a NULL-terminated list of
+<function>XtCacheRef</function>
+values.  If any reference
+count reaches zero, the destructor, if any, will be called and
+the resource removed from the conversion cache.
+</para>
+
+<para>
+As a convenience to clients needing to explicitly decrement reference
+counts via a callback function, the Intrinsics define two callback
+procedures,
+<xref linkend='XtCallbackReleaseCacheRef' xrefstyle='select: title'/>
+and
+<xref linkend='XtCallbackReleaseCacheRefList' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtCallbackReleaseCacheRef'>
+<funcprototype>
+<funcdef>void <function>XtCallbackReleaseCacheRef</function></funcdef>
+   <paramdef>Widget <parameter>object</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+   <paramdef>XtPointer <parameter>call_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>object</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the object with which the resource is associated.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the conversion cache entry to be released.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>call_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Is ignored.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+This callback procedure may be added to a callback list to release a
+previously returned
+<function>XtCacheRef</function>
+value.  When adding the callback, the
+callback <emphasis remap='I'>client_data</emphasis> argument must be specified as the value of the
+<function>XtCacheRef</function>
+data cast to type
+<function>XtPointer</function>.
+</para>
+
+<funcsynopsis id='XtCallbackReleaseCacheRefList'>
+<funcprototype>
+<funcdef>void <function>XtCallbackReleaseCacheRefList</function></funcdef>
+   <paramdef>Widget <parameter>object</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+   <paramdef>XtPointer <parameter>call_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>object</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the object with which the resources are associated.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the conversion cache entries to be released.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>call_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Is ignored.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+This callback procedure may be added to a callback list to release a
+list of previously returned
+<function>XtCacheRef</function>
+values.  When adding the
+callback, the callback <emphasis remap='I'>client_data</emphasis> argument must be specified as a
+pointer to a NULL-terminated list of
+<function>XtCacheRef</function>
+values.
+</para>
+
+<para>
+To lookup and call a resource converter, copy the resulting value,
+and free a cached resource when a widget is destroyed, use
+<xref linkend='XtConvertAndStore' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtConvertAndStore'>
+<funcprototype>
+<funcdef>Boolean <function>XtConvertAndStore</function></funcdef>
+   <paramdef>Widget <parameter>object</parameter></paramdef>
+   <paramdef>const char * <parameter>from_type</parameter></paramdef>
+   <paramdef>XrmValuePtr <parameter>from</parameter></paramdef>
+   <paramdef>const char * <parameter>to_type</parameter></paramdef>
+   <paramdef>XrmValuePtr <parameter>to_in_out</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>object</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the object to use for additional arguments, if any are needed,
+and the destroy callback list.  Must be of class Object or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>from_type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the source type.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>from</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the value to be converted.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>to_type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the destination type.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>to_in_out</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a descriptor for storage into which the converted value
+will be returned.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtConvertAndStore' xrefstyle='select: title'/>
+function looks up the type converter registered
+to convert <emphasis remap='I'>from_type</emphasis> to <emphasis remap='I'>to_type</emphasis>, computes any additional arguments
+needed, and then calls
+<xref linkend='XtCallConverter' xrefstyle='select: title'/>
+(or
+<xref linkend='XtDirectConvert' xrefstyle='select: title'/>
+if an old-style converter was registered with
+<xref linkend='XtAddConverter' xrefstyle='select: title'/>
+or
+<xref linkend='XtAppAddConverter' xrefstyle='select: title'/>;
+see Appendix C) with the <emphasis remap='I'>from</emphasis> and <emphasis remap='I'>to_in_out</emphasis> arguments.  The
+<emphasis remap='I'>to_in_out</emphasis> argument specifies the size and location into which the
+converted value will be stored and is passed directly to the
+converter.  If the location is specified as NULL, it will be replaced
+with a pointer to private storage and the size will be returned in the
+descriptor.  The caller is expected to copy this private storage
+immediately and must not modify it in any way.  If a non-NULL location
+is specified, the caller must allocate sufficient storage to hold the
+converted value and must also specify the size of that storage in the
+descriptor.
+The <emphasis remap='I'>size</emphasis> field will be modified on return to indicate the actual
+size of the converted data.
+If the conversion succeeds,
+<xref linkend='XtConvertAndStore' xrefstyle='select: title'/>
+returns
+<function>True</function>;
+otherwise, it returns
+<function>False</function>.
+</para>
+
+<para>
+<xref linkend='XtConvertAndStore' xrefstyle='select: title'/>
+adds
+<xref linkend='XtCallbackReleaseCacheRef' xrefstyle='select: title'/>
+to the destroyCallback list of the specified object if the conversion
+returns an
+<function>XtCacheRef</function>
+value.  The resulting resource should not be referenced
+after the object has been destroyed.
+</para>
+
+<para>
+<xref linkend='XtCreateWidget' xrefstyle='select: title'/>
+performs processing equivalent to
+<xref linkend='XtConvertAndStore' xrefstyle='select: title'/>
+when initializing the object instance.  Because there is extra memory
+overhead required to implement reference counting, clients may
+distinguish those objects that are never destroyed before the
+application exits from those that may be destroyed and whose
+resources should be deallocated.
+</para>
+
+<para>
+To specify whether reference counting is to be enabled for the
+resources of a particular object when the object is created, the
+client can specify a value for the
+<function>Boolean</function>
+resource
+XtNinitialResourcesPersistent,
+class
+XtCInitialResourcesPersistent.
+</para>
+
+<para>
+When
+<xref linkend='XtCreateWidget' xrefstyle='select: title'/>
+is called, if this resource is not specified as
+<function>False</function>
+in either the arglist or the resource database, then the
+resources referenced by this object are not reference-counted, regardless of
+how the type converter may have been registered.  The effective
+default value is
+<function>True</function>;
+thus clients that expect to destroy one or
+more objects and want resources deallocated must explicitly specify
+<function>False</function>
+for
+XtNinitialResourcesPersistent.
+</para>
+
+<para>
+The resources are still freed and destructors called when
+<xref linkend='XtCloseDisplay' xrefstyle='select: title'/>
+is called if the conversion was registered as
+<function>XtCacheByDisplay</function>.
+</para>
+</sect2>
+</sect1>
+
+<sect1 id="Reading_and_Writing_Widget_State">
+<title>Reading and Writing Widget State</title>
+<para>
+Any resource field in a widget can be read or written by a client.
+On a write operation,
+the widget decides what changes it will actually allow and updates all
+derived fields appropriately.
+</para>
+<sect2 id="Obtaining_Widget_State">
+<title>Obtaining Widget State</title>
+<para>
+To retrieve the current values of resources associated with a
+widget instance, use
+<xref linkend='XtGetValues' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtGetValues'>
+<funcprototype>
+<funcdef>void <function>XtGetValues</function></funcdef>
+   <paramdef>Widget <parameter>object</parameter></paramdef>
+   <paramdef>ArgList <parameter>args</parameter></paramdef>
+   <paramdef>Cardinal <parameter>num_args</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>object</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the object whose resource values are to be returned.  Must be of class Object or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the argument list of name/address pairs that contain the
+resource names and the addresses into which the resource values are to
+be stored.
+The resource names are widget-dependent.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the argument list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtGetValues' xrefstyle='select: title'/>
+function starts with the resources specified for the Object class
+and proceeds down the subclass chain to the class of the object.
+The <emphasis remap='I'>value</emphasis> field of a passed argument list must contain the
+address into which to copy the contents of the corresponding
+object instance field.  If the field is a pointer type, the lifetime
+of the pointed-to data is defined by the object class.  For the
+Intrinsics-defined resources, the following lifetimes apply:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Not valid following any operation that modifies the resource:
+    </para>
+    <itemizedlist spacing='compact'>
+      <listitem>
+        <para>
+XtNchildren resource of composite widgets.
+        </para>
+      </listitem>
+      <listitem>
+        <para>
+All resources of representation type XtRCallback.
+        </para>
+      </listitem>
+    </itemizedlist>
+  </listitem>
+  <listitem>
+    <para>
+Remain valid at least until the widget is destroyed:
+    </para>
+    <itemizedlist spacing='compact'>
+      <listitem>
+        <para>
+XtNaccelerators, XtNtranslations.
+        </para>
+      </listitem>
+    </itemizedlist>
+  </listitem>
+  <listitem>
+    <para>
+Remain valid until the Display is closed:
+    </para>
+    <itemizedlist spacing='compact'>
+      <listitem>
+        <para>
+XtNscreen.
+        </para>
+      </listitem>
+    </itemizedlist>
+  </listitem>
+</itemizedlist>
+<para>
+It is the caller's responsibility
+to allocate and deallocate storage for the copied data
+according to the size of the
+resource representation type used within the object.
+</para>
+
+<para>
+If the class of the object's parent is a subclass of
+<function>constraintWidgetClass</function>,
+<xref linkend='XtGetValues' xrefstyle='select: title'/>
+then fetches the values for any constraint resources requested.
+It starts with the constraint resources specified for
+<function>constraintWidgetClass</function>
+and proceeds down the subclass chain to the parent's constraint resources.
+If the argument list contains a resource name that is not found in any of the
+resource lists searched,
+the value at the corresponding address is not modified.
+If any get_values_hook procedures in the
+object's class or superclass records are non-NULL,
+they are called in superclass-to-subclass order after
+all the resource values have been fetched by
+<xref linkend='XtGetValues' xrefstyle='select: title'/>.
+Finally, if the object's parent is a
+subclass of
+<function>constraintWidgetClass</function>,
+and if any of the parent's class or
+superclass records have declared
+<function>ConstraintClassExtension</function>
+records in
+the Constraint class part <emphasis remap='I'>extension</emphasis> field with a record type of
+<emphasis role='strong'>NULLQUARK</emphasis>,
+and if the <emphasis remap='I'>get_values_hook</emphasis> field in the extension record is non-NULL,
+<xref linkend='XtGetValues' xrefstyle='select: title'/>
+calls the get_values_hook procedures in superclass-to-subclass order.
+This permits a Constraint parent to provide
+nonresource data via
+<xref linkend='XtGetValues' xrefstyle='select: title'/>.
+</para>
+
+<para>
+Get_values_hook procedures may modify the data stored at the
+location addressed by the <emphasis remap='I'>value</emphasis> field, including (but not
+limited to) making a copy of data whose resource representation is a
+pointer.  None of the Intrinsics-defined object classes copy
+data in this manner.  Any operation that modifies the queried
+object resource may invalidate the pointed-to data.
+</para>
+
+<para>
+To retrieve the current values of resources associated with a widget
+instance using varargs lists, use
+<xref linkend='XtVaGetValues' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtVaGetValues'>
+<funcprototype>
+<funcdef>void <function>XtVaGetValues</function></funcdef>
+   <paramdef>Widget <parameter>object</parameter></paramdef>
+   <paramdef><parameter>...</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>object</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the object whose resource values are to be returned.  Must be of class Object or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      ...
+    </term>
+    <listitem>
+      <para>
+Specifies the variable argument list for the resources to
+be returned.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtVaGetValues' xrefstyle='select: title'/>
+is identical in function to
+<xref linkend='XtGetValues' xrefstyle='select: title'/>
+with the <emphasis remap='I'>args</emphasis>
+and <emphasis remap='I'>num_args</emphasis> parameters replaced by a varargs list, as described in
+Section 2.5.1.  All value entries in the list must specify pointers to
+storage allocated by the caller to which the resource value will be
+copied.  It is the caller's responsibility to ensure that sufficient
+storage is allocated.  If
+<function>XtVaTypedArg</function>
+is specified, the <emphasis remap='I'>type</emphasis> argument
+specifies the representation desired by the caller and <emphasis remap='I'>the</emphasis> size argument
+specifies the number of bytes allocated to store the result of the
+conversion.  If the size is insufficient, a warning message is issued
+and the list entry is skipped.
+</para>
+<sect3 id="Widget_Subpart_Resource_Data_The_get_values_hook_Procedure">
+<title>Widget Subpart Resource Data: The get_values_hook Procedure</title>
+<para>
+Widgets that have subparts can return resource values from them through
+<xref linkend='XtGetValues' xrefstyle='select: title'/>
+by supplying a get_values_hook procedure.
+The get_values_hook procedure pointer is of type
+<xref linkend='XtArgsProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='_XtArgsProc'>
+<funcprototype>
+<funcdef>typedef void <function>(*XtArgsProc)</function></funcdef>
+
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>ArgList <parameter>args</parameter></paramdef>
+   <paramdef>Cardinal *<parameter>num_args</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget whose subpart resource values are to be retrieved.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the argument list that was passed to
+<xref linkend='XtGetValues' xrefstyle='select: title'/>
+or the transformed varargs list passed to
+<xref linkend='XtVaGetValues' xrefstyle='select: title'/>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the argument list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The widget with subpart resources should call
+<xref linkend='XtGetSubvalues' xrefstyle='select: title'/>
+in the get_values_hook procedure
+and pass in its subresource list and the <emphasis remap='I'>args</emphasis> and <emphasis remap='I'>num_args</emphasis> parameters.
+</para>
+</sect3>
+<sect3 id="Widget_Subpart_State">
+<title>Widget Subpart State</title>
+<para>
+To retrieve the current values of subpart resource data associated with a
+widget instance, use
+<xref linkend='XtGetSubvalues' xrefstyle='select: title'/>.
+For a discussion of subpart resources,
+see <xref linkend='Subresources' />.
+</para>
+
+<funcsynopsis id='XtGetSubvalues'>
+<funcprototype>
+<funcdef>void <function>XtGetSubvalues</function></funcdef>
+   <paramdef>XtPointer <parameter>base</parameter></paramdef>
+   <paramdef>XtResourceList <parameter>resources</parameter></paramdef>
+   <paramdef>Cardinal <parameter>num_resources</parameter></paramdef>
+   <paramdef>ArgList <parameter>args</parameter></paramdef>
+   <paramdef>Cardinal <parameter>num_args</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>base</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the base address of the subpart data structure for which the
+resources should be retrieved.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>resources</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the subpart resource list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_resources</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the resource list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the argument list of name/address pairs that contain the
+resource names and the addresses into which the resource values are to
+be stored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the argument list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtGetSubvalues' xrefstyle='select: title'/>
+function obtains resource values from the structure identified by <emphasis remap='I'>base</emphasis>.
+The <emphasis remap='I'>value</emphasis> field in each argument entry must contain the address into
+which to store the corresponding resource value.  It is the caller's
+responsibility to allocate and deallocate this storage according to
+the size of the resource representation type used within the subpart.
+If the argument list contains a resource name that is not found in the
+resource list, the value at the corresponding address is not modified.
+</para>
+
+<para>
+To retrieve the current values of subpart resources associated with
+a widget instance using varargs lists, use
+<xref linkend='XtVaGetSubvalues' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtVaGetSubvalues'>
+<funcprototype>
+<funcdef>void <function>XtVaGetSubvalues</function></funcdef>
+   <paramdef>XtPointer <parameter>base</parameter></paramdef>
+   <paramdef>XtResourceList <parameter>resources</parameter></paramdef>
+   <paramdef>Cardinal <parameter>num_resources</parameter></paramdef>
+   <paramdef> <parameter>...</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>base</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the base address of the subpart data structure for which the
+resources should be retrieved.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>resources</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the subpart resource list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_resources</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the resource list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      ...
+    </term>
+    <listitem>
+      <para>
+Specifies a variable argument list of name/address pairs that
+contain the resource names and the addresses into which the resource
+values are to be stored.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtVaGetSubvalues' xrefstyle='select: title'/>
+is identical in function to
+<xref linkend='XtGetSubvalues' xrefstyle='select: title'/>
+with the
+<emphasis remap='I'>args</emphasis> and <emphasis remap='I'>num_args</emphasis> parameters replaced by a varargs list, as described
+in Section 2.5.1.
+<function>XtVaTypedArg</function>
+is not supported for
+<xref linkend='XtVaGetSubvalues' xrefstyle='select: title'/>.
+If
+<function>XtVaTypedArg</function>
+is specified in the list, a warning message is issued
+and the entry is then ignored.
+</para>
+</sect3>
+</sect2>
+
+<sect2 id="Setting_Widget_State">
+<title>Setting Widget State</title>
+<para>
+To modify the current values of resources associated with a widget
+instance, use
+<xref linkend='XtSetValues' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtSetValues'>
+<funcprototype>
+<funcdef>void <function>XtSetValues</function></funcdef>
+   <paramdef>Widget <parameter>object</parameter></paramdef>
+   <paramdef>ArgList <parameter>args</parameter></paramdef>
+   <paramdef>Cardinal <parameter>num_args</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>object</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the object whose resources are to be modified.  Must be of class Object or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the argument list of name/value pairs that contain the
+resources to be modified and their new values.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the argument list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+function starts with the resources specified for the
+Object
+class fields and proceeds down the subclass chain to the object.
+At each stage, it replaces the <emphasis remap='I'>object</emphasis> resource fields with any values
+specified in the argument list.
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+then calls the set_values procedures for the object in superclass-to-subclass
+order.
+If the object has any non-NULL <emphasis remap='I'>set_values_hook</emphasis> fields,
+these are called immediately after the
+corresponding set_values procedure.
+This procedure permits subclasses to set subpart data via
+<xref linkend='XtSetValues' xrefstyle='select: title'/>.
+</para>
+
+<para>
+If the class of the object's parent is a subclass of
+<function>constraintWidgetClass</function>,
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+also updates the object's constraints.
+It starts with the constraint resources specified for
+<function>constraintWidgetClass</function>
+and proceeds down the subclass chain to the parent's class.
+At each stage, it replaces the constraint resource fields with any
+values specified in the argument list.
+It then calls the constraint set_values procedures from
+<function>constraintWidgetClass</function>
+down to the parent's class.
+The constraint set_values procedures are called with widget arguments,
+as for all set_values procedures, not just the constraint records,
+so that they can make adjustments to the desired values based
+on full information about the widget.  Any arguments specified that
+do not match a resource list entry are silently ignored.
+</para>
+
+<para>
+If the object is of a subclass of
+RectObj,
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+determines if a geometry request is needed by comparing the old object to
+the new object.
+If any geometry changes are required,
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+restores the original geometry and makes the request on behalf of the widget.
+If the geometry manager returns
+<function>XtGeometryYes</function>,
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+calls the object's resize procedure.
+If the geometry manager returns
+<function>XtGeometryDone</function>,
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+continues, as the object's resize procedure should have been called
+by the geometry manager.
+If the geometry manager returns
+<function>XtGeometryNo</function>,
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+ignores the geometry request and continues.
+If the geometry manager returns
+<function>XtGeometryAlmost</function>,
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+calls the set_values_almost procedure,
+which determines what should be done.
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+then repeats this process,
+deciding once more whether the geometry manager should be called.
+</para>
+
+<para>
+Finally, if any of the set_values procedures returned
+<function>True</function>,
+and the widget is realized,
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+causes the widget's expose procedure to be invoked by calling
+<function>XClearArea</function>
+on the widget's window.
+</para>
+
+<para>
+To modify the current values of resources associated with a widget
+instance using varargs lists, use
+<xref linkend='XtVaSetValues' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtVaSetValues'>
+<funcprototype>
+<funcdef>void <function>XtVaSetValues</function></funcdef>
+   <paramdef>Widget <parameter>object</parameter></paramdef>
+   <paramdef> <parameter>...</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>object</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the object whose resources are to be modified.  Must be of class Object or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      ...
+    </term>
+    <listitem>
+      <para>
+Specifies the variable argument list of name/value pairs that
+contain the resources to be modified and their new values.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtVaSetValues' xrefstyle='select: title'/>
+is identical in function to
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+with the <emphasis remap='I'>args</emphasis> and <emphasis remap='I'>num_args</emphasis> parameters replaced by a varargs list, as
+described in Section 2.5.1.
+</para>
+<sect3 id="Widget_State_The_set_values_Procedure">
+<title>Widget State: The set_values Procedure</title>
+<para>
+The set_values procedure pointer in a widget class is of type
+<xref linkend='XtSetValuesFunc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtSetValuesFunc'>
+<funcprototype>
+<funcdef>typedef Boolean <function>(*XtSetValuesFunc)</function></funcdef>
+
+   <paramdef>Widget <parameter>current</parameter></paramdef>
+   <paramdef>Widget <parameter>request</parameter></paramdef>
+   <paramdef>Widget <parameter>new</parameter></paramdef>
+   <paramdef>ArgList <parameter>args</parameter></paramdef>
+   <paramdef>Cardinal *<parameter>num_args</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>current</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a copy of the widget as it was before the
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+call.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>request</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a copy of the widget with all values changed as asked for by the
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+call before any class set_values procedures have been called.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>new</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget with the new values that are actually allowed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the argument list passed to
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+or the transformed argument list passed to
+<xref linkend='XtVaSetValues' xrefstyle='select: title'/>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the argument list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The set_values procedure should recompute any field
+derived from resources that are changed
+(for example, many GCs depend on foreground and background pixels).
+If no recomputation is necessary, and if none of the resources specific to a
+subclass require the window to be redisplayed when their values are changed,
+you can specify NULL for the <emphasis remap='I'>set_values</emphasis> field in the class record.
+</para>
+
+<para>
+Like the initialize procedure,
+set_values mostly deals only with the fields defined in the subclass,
+but it has to resolve conflicts with its superclass,
+especially conflicts over width and height.
+</para>
+
+<para>
+Sometimes a subclass may want to overwrite values filled in by its
+superclass.
+In particular, size calculations of a superclass are often
+incorrect for a subclass, and, in this case,
+the subclass must modify or recalculate fields declared
+and computed by its superclass.
+</para>
+
+<para>
+As an example,
+a subclass can visually surround its superclass display.
+In this case, the width and height calculated by the superclass set_values
+procedure are too small and need to be incremented by the size of the surround.
+The subclass needs to know if its superclass's size was calculated by the
+superclass or was specified explicitly.
+All widgets must place themselves into whatever size is explicitly given,
+but they should compute a reasonable size if no size is requested.
+How does a subclass know the difference between a specified size
+and a size computed by a superclass?
+</para>
+
+<para>
+The <emphasis remap='I'>request</emphasis> and <emphasis remap='I'>new</emphasis> parameters provide the necessary information.
+The <emphasis remap='I'>request</emphasis> widget is a copy of the widget, updated as originally requested.
+The <emphasis remap='I'>new</emphasis> widget starts with the values in the request,
+but it has additionally been updated by all superclass set_values
+procedures called so far.
+A subclass set_values procedure can compare these two to resolve
+any potential conflicts.
+The set_values procedure need not refer to the <emphasis remap='I'>request</emphasis> widget
+unless it must resolve conflicts between the <emphasis remap='I'>current</emphasis> and <emphasis remap='I'>new</emphasis> widgets.
+Any changes the widget needs to make, including geometry changes,
+should be made in the <emphasis remap='I'>new</emphasis> widget.
+</para>
+
+<para>
+In the above example,
+the subclass with the visual surround can see
+if the <emphasis remap='I'>width</emphasis> and <emphasis remap='I'>height</emphasis> in the <emphasis remap='I'>request</emphasis> widget are zero.
+If so,
+it adds its surround size to the <emphasis remap='I'>width</emphasis> and
+<emphasis remap='I'>height</emphasis> fields in the <emphasis remap='I'>new</emphasis> widget.
+If not, it must make do with the size originally specified.
+In this case, zero is a special value defined by the class to permit
+the application to invoke this behavior.
+</para>
+
+<para>
+The <emphasis remap='I'>new</emphasis> widget is the actual widget instance record.
+Therefore,
+the set_values procedure should do all its work on the <emphasis remap='I'>new</emphasis> widget;
+the <emphasis remap='I'>request</emphasis> widget should never be modified.
+If the set_values procedure needs to call any routines that operate on
+a widget, it should specify <emphasis remap='I'>new</emphasis> as the widget instance.
+</para>
+
+<para>
+Before calling the set_values procedures, the Intrinsics modify the
+resources of the <emphasis remap='I'>request</emphasis> widget according to the contents of the arglist;
+if the widget names all its resources in the class resource list, it is
+never necessary to examine the contents of <emphasis remap='I'>args</emphasis>.
+</para>
+
+<para>
+Finally, the set_values procedure must return a Boolean that indicates whether
+the widget needs to be redisplayed.
+Note that a change in the geometry fields alone does not require
+the set_values procedure to return
+<function>True</function>;
+the X server will eventually generate an
+<function>Expose</function>
+event, if necessary.
+After calling all the set_values procedures,
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+forces a redisplay by calling
+<function>XClearArea</function>
+if any of the set_values procedures returned
+<function>True</function>.
+Therefore, a set_values procedure should not try to do its own redisplaying.
+</para>
+
+<para>
+Set_values procedures should not do any work in response to changes in
+geometry because
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+eventually will perform a geometry request, and that request might be denied.
+If the widget actually changes size in response to a
+call to
+<xref linkend='XtSetValues' xrefstyle='select: title'/>,
+its resize procedure is called.
+Widgets should do any geometry-related work in their resize procedure.
+</para>
+
+<para>
+Note that it is permissible to call
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+before a widget is realized.
+Therefore, the set_values procedure must not assume that the widget is realized.
+</para>
+</sect3>
+<sect3 id="Widget_State_The_set_values_almost_Procedure">
+<title>Widget State: The set_values_almost Procedure</title>
+<para>
+The set_values_almost procedure pointer in the widget class record is of type
+<xref linkend='XtAlmostProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAlmostProc'>
+<funcprototype>
+<funcdef>typedef void <function>(*XtAlmostProc)</function></funcdef>
+
+   <paramdef>Widget <parameter>old</parameter></paramdef>
+   <paramdef>Widget <parameter>new</parameter></paramdef>
+   <paramdef>XtWidgetGeometry *<parameter>request</parameter></paramdef>
+   <paramdef>XtWidgetGeometry *<parameter>reply</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>old</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a copy of the object as it was before the
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+call.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>new</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the object instance record.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>request</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the original geometry request that was sent to the geometry
+manager that caused
+<function>XtGeometryAlmost</function>
+to be returned.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>reply</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the compromise geometry that was returned by the geometry
+manager with
+<function>XtGeometryAlmost</function>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+Most classes inherit the set_values_almost procedure from their superclass by
+specifying
+<function>XtInheritSetValuesAlmost</function>
+in the class initialization.
+The
+set_values_almost procedure in
+<function>rectObjClass</function>
+accepts the compromise suggested.
+</para>
+
+<para>
+The set_values_almost procedure is called when a client tries to set a widget's
+geometry by means of a call to
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+and the geometry manager cannot
+satisfy the request but instead returns
+<function>XtGeometryNo</function>
+or
+<function>XtGeometryAlmost</function>
+and a compromise geometry.
+The <emphasis remap='I'>new</emphasis> object is the actual instance record.  The <emphasis remap='I'>x</emphasis>, <emphasis remap='I'>y</emphasis>,
+<emphasis remap='I'>width</emphasis>, <emphasis remap='I'>height</emphasis>,
+and <emphasis remap='I'>border_width</emphasis> fields contain the original values as they were
+before the
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+call, and all other fields contain the new
+values.  The <emphasis remap='I'>request</emphasis> parameter contains the new geometry request that
+was made to the parent.  The <emphasis remap='I'>reply</emphasis> parameter contains
+<emphasis remap='I'>reply-&gt;request_mode</emphasis> equal to zero if the parent returned
+<function>XtGeometryNo</function>
+and contains the parent's compromise geometry otherwise.  The
+set_values_almost procedure takes the original geometry and the
+compromise geometry and determines if the compromise is
+acceptable or whether
+to try a different compromise.
+It returns its results in the <emphasis remap='I'>request</emphasis> parameter,
+which is then sent back to the geometry manager for another try.
+To accept the compromise, the procedure must copy the contents
+of the <emphasis remap='I'>reply</emphasis> geometry into the <emphasis remap='I'>request</emphasis> geometry; to attempt an
+alternative geometry, the procedure may modify any part of the <emphasis remap='I'>request</emphasis>
+argument; to terminate the geometry negotiation and retain the
+original geometry, the procedure must set <emphasis remap='I'>request-&gt;request_mode</emphasis> to
+zero.  The geometry fields of the <emphasis remap='I'>old</emphasis> and <emphasis remap='I'>new</emphasis> instances must not be modified
+directly.
+</para>
+</sect3>
+<sect3 id="Widget_State_The_ConstraintClassPart_set_values_Procedure">
+<title>Widget State: The ConstraintClassPart set_values Procedure</title>
+<para>
+The constraint set_values procedure pointer is of type
+<xref linkend='XtSetValuesFunc' xrefstyle='select: title'/>.
+The values passed to the parent's constraint set_values procedure
+are the same as those passed to the child's class
+set_values procedure.
+A class can specify NULL for the <emphasis remap='I'>set_values</emphasis> field of the
+<function>ConstraintPart</function>
+if it need not compute anything.
+</para>
+
+<para>
+The constraint set_values procedure should recompute any constraint fields
+derived from constraint resources that are changed.
+Furthermore, it may modify other widget fields as appropriate.
+For example, if a constraint for the maximum height of a widget is changed
+to a value smaller than the widget's current height,
+the constraint set_values procedure may reset the <emphasis remap='I'>height</emphasis> field in the
+widget.
+</para>
+</sect3>
+<sect3 id='Widget_Subpart_State_2'>
+<title>Widget Subpart State</title>
+<para>
+To set the current values of subpart resources associated with a
+widget instance, use
+<xref linkend='XtSetSubvalues' xrefstyle='select: title'/>.
+For a discussion of subpart resources,
+see <xref linkend='Subresources' />.
+</para>
+
+<funcsynopsis id='XtSetSubvalues'>
+<funcprototype>
+<funcdef>void <function>XtSetSubvalues</function></funcdef>
+   <paramdef>XtPointer <parameter>base</parameter></paramdef>
+   <paramdef>XtResourceList <parameter>resources</parameter></paramdef>
+   <paramdef>Cardinal <parameter>num_resources</parameter></paramdef>
+   <paramdef>ArgList <parameter>args</parameter></paramdef>
+   <paramdef>Cardinal <parameter>num_args</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>base</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the base address of the subpart data structure into which the
+resources should be written.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>resources</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the subpart resource list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_resources</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the resource list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the argument list of name/value pairs that contain the
+resources to be modified and their new values.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the argument list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtSetSubvalues' xrefstyle='select: title'/>
+function updates the resource fields of the structure identified by
+<emphasis remap='I'>base</emphasis>.  Any specified arguments that do not match an entry in the
+resource list are silently ignored.
+</para>
+
+<para>
+To set the current values of subpart resources associated with
+a widget instance using varargs lists, use
+<xref linkend='XtVaSetSubvalues' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtVaSetSubvalues'>
+<funcprototype>
+<funcdef>void <function>XtVaSetSubvalues</function></funcdef>
+   <paramdef>XtPointer <parameter>base</parameter></paramdef>
+   <paramdef>XtResourceList <parameter>resources</parameter></paramdef>
+   <paramdef>Cardinal <parameter>num_resources</parameter></paramdef>
+   <paramdef>...</paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>base</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the base address of the subpart data structure into which the
+resources should be written.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>resources</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the subpart resource list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_resources</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the resource list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      ...
+    </term>
+    <listitem>
+      <para>
+Specifies the variable argument list of name/value pairs that
+contain the resources to be modified and their new values.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtVaSetSubvalues' xrefstyle='select: title'/>
+is identical in function to
+<xref linkend='XtSetSubvalues' xrefstyle='select: title'/>
+with the <emphasis remap='I'>args</emphasis> and <emphasis remap='I'>num_args</emphasis> parameters replaced by a varargs list, as
+described in Section 2.5.1.
+<function>XtVaTypedArg</function>
+is not supported for
+<xref linkend='XtVaSetSubvalues' xrefstyle='select: title'/>.
+If an entry containing
+<function>XtVaTypedArg</function>
+is specified in the list, a warning message is issued
+and the entry is ignored.
+</para>
+</sect3>
+
+<sect3 id='Widget_Subpart_Resource_Data_The_set_values_hook_Procedure'>
+<title>Widget Subpart Resource Data: The set_values_hook Procedure</title>
+<note><para>
+The set_values_hook procedure is obsolete, as the same information
+is now available to the set_values procedure.  The procedure has been
+retained for those widgets that used it in versions prior to Release 4.
+</para>
+</note>
+<para>
+Widgets that have a subpart can set the subpart resource values through
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+by supplying a set_values_hook procedure.
+The set_values_hook procedure pointer in a widget class is of type
+<xref linkend='XtArgsFunc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtArgsFunc'>
+<funcprototype>
+<funcdef>typedef Boolean <function>(*XtArgsFunc)</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Arglist <parameter>args</parameter></paramdef>
+   <paramdef>Cardinal *<parameter>num_args</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget whose subpart resource values are to be changed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the argument list that was passed to
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+or the transformed varargs list passed to
+<xref linkend='XtVaSetValues' xrefstyle='select: title'/>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_args</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in the argument list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The widget with subpart resources may call
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+from the set_values_hook procedure
+and pass in its subresource list and the
+<emphasis remap='I'>args</emphasis> and <emphasis remap='I'>num_args</emphasis> parameters.
+</para>
+</sect3>
+</sect2>
+</sect1>
+</chapter>
Index: lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs/CH10.xml
===================================================================
--- lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs/CH10.xml	(nonexistent)
+++ lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs/CH10.xml	(revision 5)
@@ -0,0 +1,2215 @@
+<?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">
+
+<chapter id='Translation_Management'>
+<title>Translation Management</title>
+<para>
+Except under unusual circumstances,
+widgets do not hardwire the mapping of user events into widget behavior
+by using the event manager.
+Instead, they provide a default mapping of events into behavior
+that you can override.
+</para>
+
+<para>
+The translation manager provides an interface to specify and manage the
+mapping of X event sequences into widget-supplied functionality,
+for example, calling procedure <emphasis remap='I'>Abc</emphasis> when the <emphasis remap='I'>y</emphasis> key
+is pressed.
+</para>
+
+<para>
+The translation manager uses two kinds of tables to perform translations:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+The action tables, which are in the widget class structure,
+specify the mapping of externally available procedure name strings
+to the corresponding procedure implemented by the widget class.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A translation table, which is in the widget class structure,
+specifies the mapping of event sequences to procedure name strings.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+You can override the translation table in the class structure
+for a specific widget instance by supplying a different translation table
+for the widget instance.  The resources
+XtNtranslations and XtNbaseTranslations are used to modify the class
+default translation table; see <xref linkend='Translation_Table_Management' />.
+</para>
+<sect1 id="Action_Tables">
+<title>Action Tables</title>
+<para>
+All widget class records contain an action table,
+an array of
+<function>XtActionsRec</function>
+entries.
+In addition,
+an application can register its own action tables with the translation manager
+so that the translation tables it provides to widget instances can access
+application functionality directly.
+The translation action procedure pointer is of type
+<xref linkend='XtActionProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtActionProc'>
+<funcprototype>
+<funcdef>typedef void <function>(*XtActionProc)</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>XEvent *<parameter>event</parameter></paramdef>
+   <paramdef>String *<parameter>params</parameter></paramdef>
+   <paramdef>Cardinal *<parameter>num_params</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget that caused the action to be called.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the event that caused the action to be called.
+If the action is called after a sequence of events,
+then the last event in the sequence is used.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>params</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to the list of strings that were specified
+in the translation table as arguments to the action, or NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_params</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in <emphasis remap='I'>params</emphasis>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<programlisting>
+typedef struct _XtActionsRec {
+        String          string;
+        XtActionProc    proc;
+} XtActionsRec, *XtActionList;
+</programlisting>
+<para>
+The <emphasis remap='I'>string</emphasis> field is the name used in translation tables to access
+the procedure.
+The <emphasis remap='I'>proc</emphasis> field is a pointer to a procedure that implements
+the functionality.
+</para>
+
+<para>
+When the action list is specified as the
+<function>CoreClassPart</function>
+<emphasis remap='I'>actions</emphasis> field, the string pointed to by <emphasis remap='I'>string</emphasis> must be
+permanently allocated prior to or during the execution of the class
+initialization procedure and must not be subsequently deallocated.
+</para>
+
+<para>
+Action procedures should not assume that the widget in which they
+are invoked is realized; an accelerator specification can cause
+an action procedure to be called for a widget that does not yet
+have a window.  Widget writers should also note which of a widget's
+callback lists are invoked from action procedures and warn clients
+not to assume the widget is realized in those callbacks.
+</para>
+
+<para>
+For example, a Pushbutton widget has procedures to take the following actions:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Set the button to indicate it is activated.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Unset the button back to its normal mode.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Highlight the button borders.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Unhighlight the button borders.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Notify any callbacks that the button has been activated.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+The action table for the Pushbutton widget class makes these functions
+available to translation tables written for Pushbutton or any subclass.
+The string entry is the name used in translation tables.
+The procedure entry (usually spelled identically to the string)
+is the name of the C procedure that implements that function:
+</para>
+<programlisting>
+XtActionsRec actionTable[] = {
+        {"Set",         Set},
+        {"Unset",       Unset},
+        {"Highlight",   Highlight},
+        {"Unhighlight", Unhighlight}
+        {"Notify",      Notify},
+};
+</programlisting>
+<para>
+The Intrinsics reserve all action names and parameters starting with
+the characters &ldquo;Xt&rdquo; for future standard enhancements.  Users,
+applications, and widgets should not declare action names or pass
+parameters starting with these characters except to invoke specified
+built-in Intrinsics functions.
+</para>
+<sect2 id="Action_Table_Registration">
+<title>Action Table Registration</title>
+<para>
+The <emphasis remap='I'>actions</emphasis> and <emphasis remap='I'>num_actions</emphasis> fields of
+<function>CoreClassPart</function>
+specify the actions implemented by a widget class.  These are
+automatically registered with the Intrinsics when the class is initialized
+and must be allocated in writable storage prior to Core class_part
+initialization, and never deallocated.  To save memory and optimize
+access, the Intrinsics may overwrite the storage in order to compile the
+list into an internal representation.
+</para>
+
+<para>
+To declare an action table within an application
+and register it with the translation manager, use
+<xref linkend='XtAppAddActions' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppAddActions'>
+<funcprototype>
+<funcdef>void <function>XtAppAddActions</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+   <paramdef>XtActionList <parameter>actions</parameter></paramdef>
+   <paramdef>Cardinal <parameter>num_actions</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>actions</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the action table to register.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_actions</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in this action table.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If more than one action is registered with the same name,
+the most recently registered action is used.
+If duplicate actions exist in an action table,
+the first is used.
+The Intrinsics register an action table containing
+<xref linkend='XtMenuPopup' xrefstyle='select: title'/>
+and
+<xref linkend='XtMenuPopdown' xrefstyle='select: title'/>
+as part of
+<xref linkend='XtCreateApplicationContext' xrefstyle='select: title'/>.
+</para>
+</sect2>
+
+<sect2 id="Action_Names_to_Procedure_Translations">
+<title>Action Names to Procedure Translations</title>
+<para>
+The translation manager uses a simple algorithm to resolve the name of
+a procedure specified in a translation table into the
+actual procedure specified
+in an action table.
+When the widget
+is realized, the translation manager
+performs a search for the name in the following tables, in order:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+The widget's class and all superclass action tables, in subclass-to-superclass
+order.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The parent's class and all superclass action tables, in subclass-to-superclass
+order, then on up the ancestor tree.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+The action tables registered with
+<xref linkend='XtAppAddActions' xrefstyle='select: title'/>
+and
+<xref linkend='XtAddActions' xrefstyle='select: title'/>
+from the most recently added table to the oldest table.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+As soon as it finds a name,
+the translation manager stops the search.
+If it cannot find a name,
+the translation manager generates a warning message.
+</para>
+</sect2>
+
+<sect2 id="Action_Hook_Registration">
+<title>Action Hook Registration</title>
+<para>
+An application can specify a procedure that will be called just before
+every action routine is dispatched by the translation manager.  To do
+so, the application supplies a procedure pointer of type
+<xref linkend='XtActionHookProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtActionHookProc'>
+<funcprototype>
+<funcdef>typedef void <function>(*XtActionHookProc)</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+   <paramdef>String <parameter>action_name</parameter></paramdef>
+   <paramdef>XEvent* <parameter>event</parameter></paramdef>
+   <paramdef>String* <parameter>params</parameter></paramdef>
+   <paramdef>Cardinal* <parameter>num_params</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget whose action is about to be dispatched.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application-specific closure that was passed to
+<function>XtAppAddActionHook.</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>action_name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the name of the action to be dispatched.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the event argument that will be passed to the action routine.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>params</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the action parameters that will be passed to the action routine.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_params</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in <emphasis remap='I'>params</emphasis>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+Action hooks should not modify any of the data pointed to by the
+arguments other than the <emphasis remap='I'>client_data</emphasis> argument.
+</para>
+
+<para>
+To add an action hook, use
+<xref linkend='XtAppAddActionHook' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppAddActionHook'>
+<funcprototype>
+<funcdef>XtActionHookId <function>XtAppAddActionHook</function></funcdef>
+   <paramdef>XtAppContext <parameter>app</parameter></paramdef>
+   <paramdef>XtActionHookProc <parameter>proc</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the action hook procedure.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies application-specific data to be passed to the action hook.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtAppAddActionHook' xrefstyle='select: title'/>
+adds the specified procedure to the front of a list
+maintained in the application context.  In the future, when an action
+routine is about to be invoked for any widget in this application
+context, either through the translation manager or via
+<xref linkend='XtCallActionProc' xrefstyle='select: title'/>,
+the action hook procedures will be called in reverse
+order of registration just prior to invoking the action routine.
+</para>
+
+<para>
+Action hook procedures are removed automatically and the
+<function>XtActionHookId is</function>
+destroyed when the application context in which
+they were added is destroyed.
+</para>
+
+<para>
+To remove an action hook procedure without destroying the application
+context, use
+<xref linkend='XtRemoveActionHook' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtRemoveActionHook'>
+<funcprototype>
+<funcdef>void <function>XtRemoveActionHook</function></funcdef>
+   <paramdef>XtActionHookId <parameter>id</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>id</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the action hook id returned by
+<xref linkend='XtAppAddActionHook' xrefstyle='select: title'/>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtRemoveActionHook' xrefstyle='select: title'/>
+removes the specified action hook procedure from
+the list in which it was registered.
+</para>
+</sect2>
+</sect1>
+
+<sect1 id="Translation_Tables">
+<title>Translation Tables</title>
+<para>
+All widget instance records contain a translation table,
+which is a resource with a default value specified elsewhere in the
+class record.
+A translation table specifies what action procedures are invoked for
+an event or a sequence of events.
+A translation table
+is a string containing a list of translations from an event sequence
+into one or more action procedure calls.
+The translations are separated from one another by newline characters
+(ASCII LF).
+The complete syntax of translation tables is specified in Appendix B.
+</para>
+
+<para>
+As an example, the default behavior of Pushbutton is
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Highlight on enter window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Unhighlight on exit window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Invert on left button down.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Call callbacks and reinvert on left button up.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+The following illustrates Pushbutton's default translation table:
+</para>
+<programlisting>
+static String defaultTranslations =
+        "&lt;EnterWindow&gt;:   Highlight()\n\
+        &lt;LeaveWindow&gt;:    Unhighlight()\n\
+        &lt;Btn1Down&gt;:       Set()\n\
+        &lt;Btn1Up&gt;: Notify() Unset()";
+</programlisting>
+<para>
+The <emphasis remap='I'>tm_table</emphasis> field of the
+<function>CoreClassPart</function>
+should be filled in at class initialization time with
+the string containing the class's default translations.
+If a class wants to inherit its superclass's translations,
+it can store the special value
+<function>XtInheritTranslations</function>
+into <emphasis remap='I'>tm_table</emphasis>.
+In Core's class part initialization procedure,
+the Intrinsics compile this translation table into an efficient internal form.
+Then, at widget creation time,
+this default translation table is
+combined with the XtNtranslations
+and XtNbaseTranslations resources; see
+<xref linkend='Translation_Table_Management' />.
+</para>
+
+<para>
+The resource conversion mechanism automatically compiles
+string translation tables that are specified in the resource database.
+If a client uses translation tables that are not retrieved via a
+resource conversion,
+it must compile them itself using
+<xref linkend='XtParseTranslationTable' xrefstyle='select: title'/>.
+</para>
+
+<para>
+The Intrinsics use the compiled form of the translation table to register the
+necessary events with the event manager.
+Widgets need do nothing other than specify the action and translation tables
+for events to be processed by the translation manager.
+</para>
+<sect2 id="Event_Sequences">
+<title>Event Sequences</title>
+<para>
+An event sequence is a comma-separated list of X event descriptions
+that describes a specific sequence of X events to map to a set of
+program actions.
+Each X event description consists of three parts:
+The X event type, a prefix consisting of the X modifier bits, and
+an event-specific suffix.
+</para>
+
+<para>
+Various abbreviations are supported to make translation tables easier
+to read.  The events must match incoming events in left-to-right order
+to trigger the action sequence.
+</para>
+</sect2>
+
+<sect2 id="Action_Sequences">
+<title>Action Sequences</title>
+<para>
+Action sequences specify what program or widget actions to take in response to
+incoming X events. An action sequence consists of space-separated
+action procedure call specifications.
+Each action procedure call consists of the name of an action procedure and a
+parenthesized list of zero or more comma-separated
+string parameters to pass to that procedure.
+The actions are invoked in left-to-right order as specified in the
+action sequence.
+</para>
+</sect2>
+
+<sect2 id="Multi_Click_Time">
+<title>Multi-Click Time</title>
+<para>
+Translation table entries may specify actions that are taken when two
+or more identical events occur consecutively within a short time
+interval, called the multi-click time.  The multi-click time value may
+be specified as an application resource with name &ldquo;multiClickTime&rdquo; and
+class &ldquo;MultiClickTime&rdquo; and may also be modified dynamically by the
+application.  The multi-click time is unique for each Display value and
+is retrieved from the resource database by
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>.
+If no value is specified, the initial value is 200 milliseconds.
+</para>
+
+<para>
+To set the multi-click time dynamically, use
+<xref linkend='XtSetMultiClickTime' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtSetMultiClickTime'>
+<funcprototype>
+<funcdef>void <function>XtSetMultiClickTime</function></funcdef>
+   <paramdef>Display *<parameter>display</parameter></paramdef>
+   <paramdef>int <parameter>time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display connection.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the multi-click time in milliseconds.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtSetMultiClickTime' xrefstyle='select: title'/>
+sets the time interval used by the translation
+manager to determine when multiple events are interpreted as a
+repeated event.  When a repeat count is specified in a translation
+entry, the interval between the timestamps in each pair of repeated
+events (e.g., between two
+<function>ButtonPress</function>
+events) must be less than the
+multi-click time in order for the translation actions to be taken.
+</para>
+
+<para>
+To read the multi-click time, use
+<xref linkend='XtGetMultiClickTime' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtGetMultiClickTime'>
+<funcprototype>
+<funcdef>int <function>XtGetMultiClickTime</function></funcdef>
+   <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display connection.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtGetMultiClickTime' xrefstyle='select: title'/>
+returns the time in milliseconds that the
+translation manager uses to determine if multiple events are to be
+interpreted as a repeated event for purposes of matching a translation
+entry containing a repeat count.
+</para>
+</sect2>
+</sect1>
+
+<sect1 id="Translation_Table_Management">
+<title>Translation Table Management</title>
+<para>
+Sometimes an application needs to merge
+its own translations with a widget's translations.
+For example, a window manager provides functions to move a window.
+The window manager wishes to bind this operation to a specific
+pointer button in the title bar without the possibility of user
+override and bind it to other buttons that may be overridden by the user.
+</para>
+
+<para>
+To accomplish this,
+the window manager should first create the title bar
+and then should merge the two translation tables into
+the title bar's translations.
+One translation table contains the translations that the window manager
+wants only if the user has not specified a translation for a particular event
+or event sequence (i.e., those that may be overridden).
+The other translation table contains the translations that the
+window manager wants regardless of what the user has specified.
+</para>
+
+<para>
+Three Intrinsics functions support this merging:
+</para>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>XtParseTranslationTable</emphasis>
+    </term>
+    <listitem>
+      <para>Compiles a translation table.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>XtAugmentTranslations</emphasis>
+    </term>
+    <listitem>
+      <para>Merges a compiled translation table into a widget's
+      compiled translation table, ignoring any new translations that
+      conflict with existing translations.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>XtOverrideTranslations</emphasis>
+    </term>
+    <listitem>
+      <para>Merges a compiled translation table into a widget's
+      compiled translation table, replacing any existing translations that
+      conflict with new translations.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+To compile a translation table, use
+<xref linkend='XtParseTranslationTable' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtParseTranslationTable'>
+<funcprototype>
+<funcdef>XtTranslations <function>XtParseTranslationTable</function></funcdef>
+   <paramdef>const char * <parameter>table</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>table</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the translation table to compile.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtParseTranslationTable' xrefstyle='select: title'/>
+function compiles the translation table, provided in the format given
+in Appendix B, into an opaque internal representation
+of type
+<function>XtTranslations</function>.
+Note that if an empty translation table is required for any purpose,
+one can be obtained by calling
+<xref linkend='XtParseTranslationTable' xrefstyle='select: title'/>
+and passing an empty string.
+</para>
+
+<para>
+To merge additional translations into an existing translation table, use
+<xref linkend='XtAugmentTranslations' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAugmentTranslations'>
+<funcprototype>
+<funcdef>void <function>XtAugmentTranslations</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>XtTranslations <parameter>translations</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget into which the new translations are to be merged.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>translations</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the compiled translation table to merge in.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtAugmentTranslations' xrefstyle='select: title'/>
+function merges the new translations into the existing widget
+translations, ignoring any
+<function>#replace</function>,
+<function>#augment</function>,
+or
+<function>#override</function>
+directive that may have been specified
+in the translation string.  The translation table specified by
+<emphasis remap='I'>translations</emphasis> is not altered by this process.
+<xref linkend='XtAugmentTranslations' xrefstyle='select: title'/>
+logically appends the string representation of the new translations to
+the string representation of the widget's current translations and reparses
+the result with no warning messages about duplicate left-hand sides, then
+stores the result back into the widget instance; i.e.,
+if the new translations contain an event or event sequence that
+already exists in the widget's translations,
+the new translation is ignored.
+</para>
+
+<para>
+To overwrite existing translations with new translations, use
+<xref linkend='XtOverrideTranslations' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtOverrideTranslations'>
+<funcprototype>
+<funcdef>void <function>XtOverrideTranslations</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>XtTranslations <parameter>translations</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget into which the new translations are to be merged. Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>translations</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the compiled translation table to merge in.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtOverrideTranslations' xrefstyle='select: title'/>
+function merges the new translations into the existing widget
+translations, ignoring any
+<function>#replace</function>,
+<function>#augment</function>,
+or
+<function>#override</function>
+directive that may have been
+specified in the translation string.  The translation table
+specified by <emphasis remap='I'>translations</emphasis> is not altered by this process.
+<xref linkend='XtOverrideTranslations' xrefstyle='select: title'/>
+logically appends the string representation of the widget's current
+translations to the string representation of the new translations and
+reparses the result with no warning messages about duplicate left-hand
+sides, then stores the result back into the widget instance; i.e.,
+if the new translations contain an event or event sequence that
+already exists in the widget's translations,
+the new translation overrides the widget's translation.
+</para>
+
+<para>
+To replace a widget's translations completely, use
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+on the XtNtranslations resource and specify a compiled translation table
+as the value.
+</para>
+
+<para>
+To make it possible for users to easily modify translation tables in their
+resource files,
+the string-to-translation-table resource type converter
+allows the string to specify whether the table should replace,
+augment, or override any
+existing translation table in the widget.
+To specify this,
+a pound sign (#) is given as the first character of the table
+followed by one of the keywords &ldquo;replace&rdquo;, &ldquo;augment&rdquo;, or
+&ldquo;override&rdquo; to indicate
+whether to replace, augment, or override the existing table.
+The replace or merge
+operation is performed during the
+Core
+instance initialization.
+Each merge operation produces a new
+translation resource value; if the original tables were shared by
+other widgets, they are unaffected.  If no directive is
+specified, &ldquo;#replace&rdquo; is assumed.
+</para>
+
+<para>
+At instance initialization
+the XtNtranslations resource is first fetched.  Then, if it was
+not specified or did not contain &ldquo;#replace&rdquo;, the
+resource database is searched for the resource XtNbaseTranslations.
+If XtNbaseTranslations is found, it is merged into the widget class
+translation table.  Then the widget <emphasis remap='I'>translations</emphasis> field is
+merged into the result or into the class translation table if
+XtNbaseTranslations was not found.  This final table is then
+stored into the widget <emphasis remap='I'>translations</emphasis> field.  If the XtNtranslations
+resource specified &ldquo;#replace&rdquo;, no merge is done.
+If neither XtNbaseTranslations or XtNtranslations are specified,
+the class translation table is copied into the widget instance.
+</para>
+
+<para>
+To completely remove existing translations, use
+<xref linkend='XtUninstallTranslations' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtUninstallTranslations'>
+<funcprototype>
+<funcdef>void <function>XtUninstallTranslations</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget from which the translations are to be removed.   Must be of class Core or any subclass thereof.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtUninstallTranslations' xrefstyle='select: title'/>
+function causes the entire translation table for the widget to be removed.
+</para>
+</sect1>
+
+<sect1 id="Using_Accelerators">
+<title>Using Accelerators</title>
+<para>
+It is often desirable to be able to bind events in one widget to actions in
+another.
+In particular,
+it is often useful to be able to invoke menu actions from the keyboard.
+The Intrinsics provide a facility, called accelerators, that lets you
+accomplish this.
+An accelerator table is a translation table that is bound with its
+actions in the context of a particular widget, the <emphasis remap='I'>source</emphasis> widget.
+The accelerator table can then be installed on one or more <emphasis remap='I'>destination</emphasis> widgets.
+When an event sequence in the destination widget would cause an
+accelerator action to be taken, and if the source widget is sensitive,
+the actions are executed as though triggered by the same event sequence
+in the accelerator source
+widget.  The event is
+passed to the action procedure without modification.  The action
+procedures used within accelerators must not assume that the source
+widget is realized nor that any fields of the event are in reference
+to the source widget's window if the widget is realized.
+</para>
+
+<para>
+Each widget instance contains that widget's exported accelerator table
+as a resource.
+Each class of widget exports a method that takes a
+displayable string representation of the accelerators
+so that widgets can display their current accelerators.
+The representation is the accelerator table in canonical
+translation table form (see Appendix B).
+The display_accelerator procedure pointer is of type
+<xref linkend='XtStringProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtStringProc'>
+<funcprototype>
+<funcdef>typedef void <function>(*XtStringProc)</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>String <parameter>string</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the source widget that supplied the accelerators.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>string</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the string representation of the accelerators for this widget.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+Accelerators can be specified in resource files,
+and the string representation is the same as for a translation table.
+However,
+the interpretation of the
+<function>#augment</function>
+and
+<function>#override</function>
+directives applies to
+what will happen when the accelerator is installed;
+that is, whether or not the accelerator translations will override the
+translations in the destination widget.
+The default is
+<function>#augment</function>,
+which means that the accelerator translations have lower priority
+than the destination translations.
+The
+<function>#replace</function>
+directive is ignored for accelerator tables.
+</para>
+
+<para>
+To parse an accelerator table, use
+<xref linkend='XtParseAcceleratorTable' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtParseAcceleratorTable'>
+<funcprototype>
+<funcdef>XtAccelerators <function>XtParseAcceleratorTable</function></funcdef>
+   <paramdef>const char * <parameter>source</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>source</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the accelerator table to compile.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtParseAcceleratorTable' xrefstyle='select: title'/>
+function compiles the accelerator table into an opaque internal representation.
+The client
+should set the XtNaccelerators resource of
+each widget that is to be activated by these translations
+to the returned value.
+</para>
+
+<para>
+To install accelerators from a widget on another widget, use
+<xref linkend='XtInstallAccelerators' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtInstallAccelerators'>
+<funcprototype>
+<funcdef>void <function>XtInstallAccelerators</function></funcdef>
+   <paramdef>Widget <parameter>destination</parameter></paramdef>
+   <paramdef>Widget <parameter>source</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>destination</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget on which the accelerators are to be installed.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>source</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget from which the accelerators are to come.  Must be of class Core or any subclass thereof.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtInstallAccelerators' xrefstyle='select: title'/>
+function installs the <emphasis remap='I'>accelerators</emphasis> resource value from
+<emphasis remap='I'>source</emphasis> onto <emphasis remap='I'>destination</emphasis>
+by merging the source accelerators into the destination translations.
+If the source <emphasis remap='I'>display_accelerator</emphasis> field is non-NULL,
+<xref linkend='XtInstallAccelerators' xrefstyle='select: title'/>
+calls it with the source widget and a string representation
+of the accelerator table,
+which indicates that its accelerators have been installed
+and that it should display them appropriately.
+The string representation of the accelerator table is its
+canonical translation table representation.
+</para>
+
+<para>
+As a convenience for installing all accelerators from a widget and all its
+descendants onto one destination, use
+<xref linkend='XtInstallAllAccelerators' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtInstallAllAccelerators'>
+<funcprototype>
+<funcdef>void <function>XtInstallAllAccelerators</function></funcdef>
+   <paramdef>Widget <parameter>destination</parameter></paramdef>
+   <paramdef>Widget <parameter>source</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>destination</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget on which the accelerators are to be installed.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>source</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the root widget of the widget tree
+from which the accelerators are to come.  Must be of class Core or any subclass thereof.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtInstallAllAccelerators' xrefstyle='select: title'/>
+function recursively descends the widget tree rooted at <emphasis remap='I'>source</emphasis>
+and installs the accelerators resource value
+of each widget encountered onto <emphasis remap='I'>destination</emphasis>.
+A common use is to call
+<xref linkend='XtInstallAllAccelerators' xrefstyle='select: title'/>
+and pass the application main window as the source.
+</para>
+</sect1>
+
+<sect1 id="KeyCode_to_KeySym_Conversions">
+<title>KeyCode-to-KeySym Conversions</title>
+<para>
+The translation manager provides support for automatically translating
+KeyCodes in incoming key events into KeySyms.
+KeyCode-to-KeySym translator procedure pointers are of type
+<xref linkend='XtKeyProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtKeyProc'>
+<funcprototype>
+<funcdef>typedef void <function>(*XtKeyProc)</function></funcdef>
+   <paramdef>Display *<parameter>display</parameter></paramdef>
+   <paramdef>KeyCode <parameter>keycode</parameter></paramdef>
+   <paramdef>Modifiers <parameter>modifiers</parameter></paramdef>
+   <paramdef>Modifiers *<parameter>modifiers_return</parameter></paramdef>
+   <paramdef>KeySym *<parameter>keysym_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display that the KeyCode is from.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keycode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the KeyCode to translate.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modifiers</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the modifiers to the KeyCode.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modifiers_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a location in which to store
+a mask that indicates the subset of all
+modifiers that are examined by the key translator for the specified keycode.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keysym_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a location in which to store the resulting KeySym.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+This procedure takes a KeyCode and modifiers and produces a KeySym.
+For any given key translator function and keyboard encoding,
+<emphasis remap='I'>modifiers_return</emphasis> will be a constant per KeyCode that indicates
+the subset of all modifiers that are examined by the key translator
+for that KeyCode.
+</para>
+
+<para>
+The KeyCode-to-KeySym translator procedure
+must be implemented such that multiple calls with the same
+<emphasis remap='I'>display</emphasis>, <emphasis remap='I'>keycode</emphasis>, and <emphasis remap='I'>modifiers</emphasis> return the same
+result until either a new case converter, an
+<xref linkend='XtCaseProc' xrefstyle='select: title'/>,
+is installed or a
+<function>MappingNotify</function>
+event is received.
+</para>
+
+<para>
+The Intrinsics maintain tables internally to map KeyCodes to KeySyms
+for each open display.  Translator procedures and other clients may
+share a single copy of this table to perform the same mapping.
+</para>
+
+<para>
+To return a pointer to the KeySym-to-KeyCode mapping table for a
+particular display, use
+<xref linkend='XtGetKeysymTable' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtGetKeysymTable'>
+<funcprototype>
+<funcdef>KeySym *<function>XtGetKeysymTable</function></funcdef>
+   <paramdef>Display *<parameter>display</parameter></paramdef>
+   <paramdef>KeyCode *<parameter>min_keycode_return</parameter></paramdef>
+   <paramdef>int *<parameter>keysyms_per_keycode_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display whose table is required.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>min_keycode_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the minimum KeyCode valid for the display.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keysyms_per_keycode_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of KeySyms stored for each KeyCode.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtGetKeysymTable' xrefstyle='select: title'/>
+returns a pointer to the Intrinsics' copy of the
+server's KeyCode-to-KeySym table.  This table must not be modified.
+There are <emphasis remap='I'>keysyms_per_keycode_return</emphasis> KeySyms associated with each
+KeyCode, located in the table with indices starting at index
+</para>
+<programlisting>
+    (test_keycode - min_keycode_return) * keysyms_per_keycode_return
+</programlisting>
+<para>
+for KeyCode <emphasis remap='I'>test_keycode</emphasis>.  Any entries that have no KeySyms associated
+with them contain the value
+<function>NoSymbol</function>.
+Clients should not cache the KeySym table but should call
+<xref linkend='XtGetKeysymTable' xrefstyle='select: title'/>
+each time the value is
+needed, as the table may change prior to dispatching each event.
+</para>
+
+<para>
+For more information on this table, see
+Section 12.7 in
+Xlib &mdash; C Language X Interface.
+</para>
+
+<para>
+To register a key translator, use
+<xref linkend='XtSetKeyTranslator' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtSetKeyTranslator'>
+<funcprototype>
+<funcdef>void <function>XtSetKeyTranslator</function></funcdef>
+   <paramdef>Display *<parameter>display</parameter></paramdef>
+   <paramdef>XtKeyProc <parameter>proc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display from which to translate the events.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to perform key translations.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtSetKeyTranslator' xrefstyle='select: title'/>
+function sets the specified procedure as the current key translator.
+The default translator is
+<function>XtTranslateKey</function>,
+an
+<xref linkend='XtKeyProc' xrefstyle='select: title'/>
+that uses the Shift, Lock, numlock, and group modifiers
+with the interpretations defined in <emphasis remap='I'>X Window System Protocol</emphasis>, Section 5.
+It is provided so that new translators can call it to get default
+KeyCode-to-KeySym translations and so that the default translator
+can be reinstalled.
+</para>
+
+<para>
+To invoke the currently registered KeyCode-to-KeySym translator,
+use
+<xref linkend='XtTranslateKeycode' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtTranslateKeycode'>
+<funcprototype>
+<funcdef>void <function>XtTranslateKeycode</function></funcdef>
+   <paramdef>Display *<parameter>display</parameter></paramdef>
+   <paramdef>KeyCode <parameter>keycode</parameter></paramdef>
+   <paramdef>Modifiers <parameter>modifiers</parameter></paramdef>
+   <paramdef>Modifiers *<parameter>modifiers_return</parameter></paramdef>
+   <paramdef>KeySym *<parameter>keysym_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display that the KeyCode is from.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keycode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the KeyCode to translate.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modifiers</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the modifiers to the KeyCode.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modifiers_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns a mask that indicates the modifiers actually used
+to generate the KeySym.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keysym_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the resulting KeySym.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtTranslateKeycode' xrefstyle='select: title'/>
+function passes the specified arguments
+directly to the currently registered KeyCode-to-KeySym translator.
+</para>
+
+<para>
+To handle capitalization of nonstandard KeySyms, the Intrinsics allow
+clients to register case conversion routines.
+Case converter procedure pointers are of type
+<xref linkend='XtCaseProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtCaseProc'>
+<funcprototype>
+<funcdef>typedef void <function>(*XtCaseProc)</function></funcdef>
+   <paramdef>Display *<parameter>display</parameter></paramdef>
+   <paramdef>KeySym <parameter>keysym</parameter></paramdef>
+   <paramdef>KeySym *<parameter>lower_return</parameter></paramdef>
+   <paramdef>KeySym *<parameter>upper_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display connection for which the conversion is required.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keysym</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the KeySym to convert.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>lower_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a location into which to store the lowercase equivalent for
+the KeySym.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>upper_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a location into which to store the uppercase equivalent for
+the KeySym.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If there is no case distinction,
+this procedure should store the KeySym into both return values.
+</para>
+
+<para>
+To register a case converter, use
+<xref linkend='XtRegisterCaseConverter' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtRegisterCaseConverter'>
+<funcprototype>
+<funcdef>void <function>XtRegisterCaseConverter</function></funcdef>
+   <paramdef>Display *<parameter>display</parameter></paramdef>
+   <paramdef>XtCaseProc <parameter>proc</parameter></paramdef>
+   <paramdef>KeySym <parameter>start</parameter></paramdef>
+   <paramdef>KeySym <parameter>stop</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display from which the key events are to come.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the
+<xref linkend='XtCaseProc' xrefstyle='select: title'/>
+to do the conversions.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>start</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the first KeySym for which this converter is valid.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>stop</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the last KeySym for which this converter is valid.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtRegisterCaseConverter' xrefstyle='select: title'/>
+registers the specified case converter.
+The <emphasis remap='I'>start</emphasis> and <emphasis remap='I'>stop</emphasis> arguments provide the inclusive range of KeySyms
+for which this converter is to be called.
+The new converter overrides any previous converters for KeySyms in that range.
+No interface exists to remove converters;
+you need to register an identity converter.
+When a new converter is registered,
+the Intrinsics  refresh the keyboard state if necessary.
+The default converter understands case conversion for all
+Latin KeySyms defined in <emphasis remap='I'>X Window System Protocol</emphasis>, Appendix A.
+</para>
+
+<para>
+To determine uppercase and lowercase equivalents for a KeySym, use
+<xref linkend='XtConvertCase' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtConvertCase'>
+<funcprototype>
+<funcdef>void <function>XtConvertCase</function></funcdef>
+   <paramdef>Display *<parameter>display</parameter></paramdef>
+   <paramdef>KeySym <parameter>keysym</parameter></paramdef>
+   <paramdef>KeySym *<parameter>lower_return</parameter></paramdef>
+   <paramdef>KeySym *<parameter>upper_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display that the KeySym came from.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keysym</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the KeySym to convert.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>lower_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the lowercase equivalent of the KeySym.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>upper_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the uppercase equivalent of the KeySym.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtConvertCase' xrefstyle='select: title'/>
+function calls the appropriate converter and returns the results.
+A user-supplied
+<xref linkend='XtKeyProc' xrefstyle='select: title'/>
+may need to use this function.
+</para>
+</sect1>
+
+<sect1 id="Obtaining_a_KeySym_in_an_Action_Procedure">
+<title>Obtaining a KeySym in an Action Procedure</title>
+<para>
+When an action procedure is invoked on a
+<function>KeyPress</function>
+or
+<function>KeyRelease</function>
+event, it often has a need to retrieve the KeySym and modifiers
+corresponding to the event that caused it to be invoked.  In order to
+avoid repeating the processing that was just performed by the
+Intrinsics to match the translation entry, the KeySym and modifiers
+are stored for the duration of the action procedure and are made
+available to the client.
+</para>
+
+<para>
+To retrieve the KeySym and modifiers that matched the final event
+specification in the translation table entry, use
+<xref linkend='XtGetActionKeysym' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtGetActionKeysym'>
+<funcprototype>
+<funcdef>KeySym <function>XtGetActionKeysym</function></funcdef>
+   <paramdef>XEvent *<parameter>event</parameter></paramdef>
+   <paramdef>Modifiers *<parameter>modifiers_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the event pointer passed to the action procedure by the Intrinsics.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>modifiers_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the modifiers that caused the match, if non-NULL.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If
+<xref linkend='XtGetActionKeysym' xrefstyle='select: title'/>
+is called after an action procedure has been
+invoked by the Intrinsics and before that action procedure returns, and
+if the event pointer has the same value as the event pointer passed to
+that action routine, and if the event is a
+<function>KeyPress</function>
+or
+<function>KeyRelease</function>
+event, then
+<xref linkend='XtGetActionKeysym' xrefstyle='select: title'/>
+returns the KeySym that matched the final
+event specification in the translation table and, if <emphasis remap='I'>modifiers_return</emphasis>
+is non-NULL, the modifier state actually used to generate this KeySym;
+otherwise, if the event is a
+<function>KeyPress</function>
+or
+<function>KeyRelease</function>
+event, then
+<xref linkend='XtGetActionKeysym' xrefstyle='select: title'/>
+calls
+<xref linkend='XtTranslateKeycode' xrefstyle='select: title'/>
+and returns the results;
+else it returns
+<function>NoSymbol</function>
+and does not examine <emphasis remap='I'>modifiers_return</emphasis>.
+</para>
+
+<para>
+Note that if an action procedure invoked by the Intrinsics
+invokes a subsequent action procedure (and so on) via
+<xref linkend='XtCallActionProc' xrefstyle='select: title'/>,
+the nested action procedure may also call
+<xref linkend='XtGetActionKeysym' xrefstyle='select: title'/>
+to retrieve the Intrinsics' KeySym and modifiers.
+</para>
+</sect1>
+
+<sect1 id="KeySym_to_KeyCode_Conversions">
+<title>KeySym-to-KeyCode Conversions</title>
+<para>
+To return the list of KeyCodes that map to a particular KeySym in
+the keyboard mapping table maintained by the Intrinsics, use
+<xref linkend='XtKeysymToKeycodeList' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtKeysymToKeycodeList'>
+<funcprototype>
+<funcdef>void <function>XtKeysymToKeycodeList</function></funcdef>
+   <paramdef>Display *<parameter>display</parameter></paramdef>
+   <paramdef>KeySym <parameter>keysym</parameter></paramdef>
+   <paramdef>KeyCode **<parameter>keycodes_return</parameter></paramdef>
+   <paramdef>Cardinal *<parameter>keycount_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display whose table is required.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keysym</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the KeySym for which to search.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keycodes_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns a list of KeyCodes that have <emphasis remap='I'>keysym</emphasis>
+associated with them, or NULL if <emphasis remap='I'>keycount_return</emphasis> is 0.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keycount_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of KeyCodes in the keycode list.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtKeysymToKeycodeList' xrefstyle='select: title'/>
+procedure returns all the KeyCodes that have <emphasis remap='I'>keysym</emphasis>
+in their entry for the keyboard mapping table associated with <emphasis remap='I'>display</emphasis>.
+For each entry in the
+table, the first four KeySyms (groups 1 and 2) are interpreted as
+specified by <emphasis remap='I'>X Window System Protocol</emphasis>, Section 5.  If no KeyCodes map to the
+specified KeySym, <emphasis remap='I'>keycount_return</emphasis> is zero and *<emphasis remap='I'>keycodes_return</emphasis> is NULL.
+</para>
+
+<para>
+The caller should free the storage pointed to by <emphasis remap='I'>keycodes_return</emphasis> using
+<xref linkend='XtFree' xrefstyle='select: title'/>
+when it is no longer useful.  If the caller needs to examine
+the KeyCode-to-KeySym table for a particular KeyCode, it should call
+<xref linkend='XtGetKeysymTable' xrefstyle='select: title'/>.
+</para>
+</sect1>
+
+<sect1 id="Registering_Button_and_Key_Grabs_for_Actions">
+<title>Registering Button and Key Grabs for Actions</title>
+<para>
+To register button and key grabs for a widget's window according to the
+event bindings in the widget's translation table, use
+<xref linkend='XtRegisterGrabAction' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtRegisterGrabAction'>
+<funcprototype>
+<funcdef>void <function>XtRegisterGrabAction</function></funcdef>
+   <paramdef>XtActionProc <parameter>action_proc</parameter></paramdef>
+   <paramdef>Boolean <parameter>owner_events</parameter></paramdef>
+   <paramdef>unsigned int <parameter>event_mask</parameter></paramdef>
+   <paramdef>int <parameter>pointer_mode</parameter></paramdef>
+   <paramdef>int <parameter>keyboard_mode</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>action_proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the action procedure to search for in translation tables.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>owner_events</emphasis>
+    </term>
+    <listitem>
+      <para></para>
+
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event_mask</emphasis>
+    </term>
+    <listitem>
+      <para></para>
+
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>pointer_mode</emphasis>
+    </term>
+    <listitem>
+      <para></para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>keyboard_mode</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify arguments to
+<xref linkend='XtGrabButton' xrefstyle='select: title'/>
+or
+<xref linkend='XtGrabKey' xrefstyle='select: title'/>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtRegisterGrabAction' xrefstyle='select: title'/>
+adds the specified <emphasis remap='I'>action_proc</emphasis> to a list known to
+the translation manager.  When a widget is realized, or when the
+translations of a realized widget or the accelerators installed on a
+realized widget are modified, its translation table and any installed
+accelerators are scanned for action procedures on this list.
+If any are invoked on
+<function>ButtonPress</function>
+or
+<function>KeyPress</function>
+events as the only or final event
+in a sequence, the Intrinsics will call
+<xref linkend='XtGrabButton' xrefstyle='select: title'/>
+or
+<xref linkend='XtGrabKey' xrefstyle='select: title'/>
+for the widget with every button or KeyCode which maps to the
+event detail field, passing the specified <emphasis remap='I'>owner_events</emphasis>, <emphasis remap='I'>event_mask</emphasis>,
+<emphasis remap='I'>pointer_mode</emphasis>, and <emphasis remap='I'>keyboard_mode</emphasis>.  For
+<function>ButtonPress</function>
+events, the modifiers
+specified in the grab are determined directly from the translation
+specification and <emphasis remap='I'>confine_to</emphasis> and <emphasis remap='I'>cursor</emphasis> are specified as
+<function>None</function>.
+For
+<function>KeyPress</function>
+events, if the translation table entry specifies colon (:) in
+the modifier list, the modifiers are determined by calling the key
+translator procedure registered for the display and calling
+<xref linkend='XtGrabKey' xrefstyle='select: title'/>
+for every combination of standard modifiers which map the KeyCode to
+the specified event detail KeySym, and ORing any modifiers specified in
+the translation table entry, and <emphasis remap='I'>event_mask</emphasis> is ignored.  If the
+translation table entry does not specify colon in the modifier list,
+the modifiers specified in the grab are those specified in the
+translation table entry only.  For both
+<function>ButtonPress</function>
+and
+<function>KeyPress</function>
+events, don't-care modifiers are ignored unless the translation entry
+explicitly specifies &ldquo;Any&rdquo; in the <emphasis remap='I'>modifiers</emphasis> field.
+</para>
+
+<para>
+If the specified <emphasis remap='I'>action_proc</emphasis> is already registered for the calling
+process, the new values will replace the previously specified values
+for any widgets that become realized following the call, but existing
+grabs are not altered on currently realized widgets.
+</para>
+
+<para>
+When translations or installed accelerators are modified for a
+realized widget, any previous key or button grabs registered
+as a result of the old bindings are released if they do not appear in
+the new bindings and are not explicitly grabbed by the client with
+<xref linkend='XtGrabKey' xrefstyle='select: title'/>
+or
+<xref linkend='XtGrabButton' xrefstyle='select: title'/>.
+</para>
+</sect1>
+
+<sect1 id="Invoking_Actions_Directly">
+<title>Invoking Actions Directly</title>
+<para>
+Normally action procedures are invoked by the Intrinsics when an
+event or event sequence arrives for a widget. To
+invoke an action procedure directly, without generating
+(or synthesizing) events, use
+<xref linkend='XtCallActionProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtCallActionProc'>
+<funcprototype>
+<funcdef>void <function>XtCallActionProc</function></funcdef>
+   <paramdef>Widget <parameter>widget</parameter></paramdef>
+   <paramdef>const char * <parameter>action</parameter></paramdef>
+   <paramdef>XEvent * <parameter>event</parameter></paramdef>
+   <paramdef>String * <parameter>params</parameter></paramdef>
+   <paramdef>Cardinal <parameter>num_params</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget in which the action is to be invoked.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>action</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the name of the action routine.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the contents of the <emphasis remap='I'>event</emphasis> passed to the action routine.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>params</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the contents of the <emphasis remap='I'>params</emphasis> passed to the action routine.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_params</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in <emphasis remap='I'>params</emphasis>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtCallActionProc' xrefstyle='select: title'/>
+searches for the named action routine in the same
+manner and order as translation tables are bound, as described in
+Section 10.1.2, except that application action tables are searched, if
+necessary, as of the time of the call to
+<xref linkend='XtCallActionProc' xrefstyle='select: title'/>.
+If found,
+the action routine is invoked with the specified widget, event pointer,
+and parameters.  It is the responsibility of the caller to ensure that
+the contents of the <emphasis remap='I'>event</emphasis>, <emphasis remap='I'>params</emphasis>, and <emphasis remap='I'>num_params</emphasis> arguments are
+appropriate for the specified action routine and, if necessary, that
+the specified widget is realized or sensitive.  If the named action
+routine cannot be found,
+<xref linkend='XtCallActionProc' xrefstyle='select: title'/>
+generates a warning message and returns.
+</para>
+</sect1>
+
+<sect1 id="Obtaining_a_Widget_s_Action_List">
+<title>Obtaining a Widget's Action List</title>
+<para>
+Occasionally a subclass will require the pointers to one or more of
+its superclass's action procedures.  This would be needed, for
+example, in order to envelop the superclass's action.  To retrieve
+the list of action procedures registered in the superclass's
+<emphasis remap='I'>actions</emphasis> field, use
+<xref linkend='XtGetActionList' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtGetActionList'>
+<funcprototype>
+<funcdef>void <function>XtGetActionList</function></funcdef>
+   <paramdef>WidgetClass <parameter>widget_class</parameter></paramdef>
+   <paramdef>XtActionList *<parameter>actions_return</parameter></paramdef>
+   <paramdef>Cardinal *<parameter>num_actions_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget_class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget class whose actions are to be returned.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>actions_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the action list.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_actions_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of action procedures declared by the class.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtGetActionList' xrefstyle='select: title'/>
+returns the action table defined by the specified
+widget class.  This table does not include actions defined by the
+superclasses.  If <emphasis remap='I'>widget_class</emphasis> is not initialized, or is not
+<function>coreWidgetClass</function>
+or a subclass thereof, or if the class does not define any actions,
+*<emphasis remap='I'>actions_return</emphasis> will be NULL and *<emphasis remap='I'>num_actions_return</emphasis>
+will be zero.
+If *<emphasis remap='I'>actions_return</emphasis> is non-NULL the client is responsible for freeing
+the table using
+<xref linkend='XtFree' xrefstyle='select: title'/>
+when it is no longer needed.
+</para>
+</sect1>
+</chapter>
Index: lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs/CH11.xml
===================================================================
--- lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs/CH11.xml	(nonexistent)
+++ lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs/CH11.xml	(revision 5)
@@ -0,0 +1,5548 @@
+<?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">
+
+<chapter id='Utility_Functions'>
+<title>Utility Functions</title>
+<para>
+The Intrinsics provide a number of utility functions that you can use to
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Determine the number of elements in an array.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Translate strings to widget instances.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Manage memory usage.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Share graphics contexts.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Manipulate selections.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Merge exposure events into a region.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Translate widget coordinates.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Locate a widget given a window id.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Handle errors.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Set the WM_COLORMAP_WINDOWS property.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Locate files by name with string substitutions.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Register callback functions for external agents.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Locate all the displays of an application context.
+    </para>
+  </listitem>
+</itemizedlist>
+
+<sect1 id="Determining_the_Number_of_Elements_in_an_Array">
+<title>Determining the Number of Elements in an Array</title>
+<para>
+To determine the number of elements in a fixed-size array, use
+<xref linkend='XtNumber' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtNumber'>
+<funcprototype>
+<funcdef>Cardinal <function>XtNumber</function></funcdef>
+  <paramdef>ArrayType <parameter>array</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>array</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a fixed-size array of arbitrary type.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtNumber' xrefstyle='select: title'/>
+macro returns the number of elements allocated to the array.
+</para>
+</sect1>
+
+<sect1 id="Translating_Strings_to_Widget_Instances">
+<title>Translating Strings to Widget Instances</title>
+<para>
+To translate a widget name to a widget instance, use
+<xref linkend='XtNameToWidget' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtNameToWidget'>
+<funcprototype>
+<funcdef>Widget <function>XtNameToWidget</function></funcdef>
+   <paramdef>Widget <parameter>reference</parameter></paramdef>
+   <paramdef>const char * <parameter>names</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>reference</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget from which the search is to start.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>names</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the partially qualified name of the desired widget.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtNameToWidget' xrefstyle='select: title'/>
+function searches for a descendant of the <emphasis remap='I'>reference</emphasis>
+widget whose name matches the specified names.  The <emphasis remap='I'>names</emphasis> parameter
+specifies a simple object name or a series of simple object name
+components separated by periods or asterisks.
+<xref linkend='XtNameToWidget' xrefstyle='select: title'/>
+returns the descendant with the shortest name matching the specification
+according to the following rules, where child is either a pop-up child
+or a normal child if the widget's class is a subclass of
+Composite :
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Enumerate the object subtree rooted at the reference widget in
+breadth-first order, qualifying the name of each object with the
+names of all its ancestors up to, but not including, the reference
+widget.  The ordering between children of a common parent is
+not defined.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Return the first object in the enumeration that matches the
+specified name, where each component of <emphasis remap='I'>names</emphasis> matches exactly the
+corresponding component of the qualified object name and asterisk
+matches any series of components, including none.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If no match is found, return NULL.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+Since breadth-first traversal is specified, the descendant with the
+shortest matching name (i.e., the fewest number of components), if any,
+will always be returned.  However, since the order of enumeration of
+children is undefined and since the Intrinsics do not require that all
+children of a widget have unique names,
+<xref linkend='XtNameToWidget' xrefstyle='select: title'/>
+may return any
+child that matches if there are multiple objects in the subtree with
+the same name.  Consecutive separators (periods or asterisks)
+including at least one asterisk are treated as a single asterisk.
+Consecutive periods are treated as a single period.
+</para>
+</sect1>
+
+<sect1 id="Managing_Memory_Usage">
+<title>Managing Memory Usage</title>
+<para>
+The Intrinsics memory management functions provide uniform checking for
+null pointers and error reporting on memory allocation errors.
+These functions are completely compatible with their standard C language
+runtime counterparts
+<function>malloc</function>,
+<function>calloc</function>,
+<function>realloc</function>,
+and
+<function>free</function>
+with the following added functionality:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+<xref linkend='XtMalloc' xrefstyle='select: title'/>,
+<xref linkend='XtCalloc' xrefstyle='select: title'/>,
+and
+<xref linkend='XtRealloc' xrefstyle='select: title'/>
+give an error if there is not enough memory.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XtFree' xrefstyle='select: title'/>
+simply returns if passed a NULL pointer.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XtRealloc' xrefstyle='select: title'/>
+simply allocates new storage if passed a NULL pointer.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+See the standard C library documentation on
+<function>malloc</function>,
+<function>calloc</function>,
+<function>realloc</function>,
+and
+<function>free</function>
+for more information.
+</para>
+
+<para>
+To allocate storage, use
+<xref linkend='XtMalloc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtMalloc'>
+<funcprototype>
+<funcdef>char * <function>XtMalloc</function></funcdef>
+   <paramdef>Cardinal <parameter>size</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>size</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of bytes desired.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtMalloc' xrefstyle='select: title'/>
+function returns a pointer to a block of storage of at least
+the specified <emphasis remap='I'>size</emphasis> bytes.
+If there is insufficient memory to allocate the new block,
+<xref linkend='XtMalloc' xrefstyle='select: title'/>
+calls
+<xref linkend='XtErrorMsg' xrefstyle='select: title'/>.
+</para>
+
+<para>
+To allocate and initialize an array, use
+<xref linkend='XtCalloc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtCalloc'>
+<funcprototype>
+<funcdef>char * <function>XtCalloc</function></funcdef>
+   <paramdef>Cardinal <parameter>num</parameter></paramdef>
+   <paramdef>Cardinal <parameter>size</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of array elements to allocate.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>size</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the size of each array element in bytes.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtCalloc' xrefstyle='select: title'/>
+function allocates space for the specified number of array elements
+of the specified size and initializes the space to zero.
+If there is insufficient memory to allocate the new block,
+<xref linkend='XtCalloc' xrefstyle='select: title'/>
+calls
+<xref linkend='XtErrorMsg' xrefstyle='select: title'/>.
+<xref linkend='XtCalloc' xrefstyle='select: title'/>
+returns the address of the allocated storage.
+</para>
+
+<para>
+To change the size of an allocated block of storage, use
+<xref linkend='XtRealloc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtRealloc'>
+<funcprototype>
+<funcdef>char *<function>XtRealloc</function></funcdef>
+   <paramdef>char *<parameter>ptr</parameter></paramdef>
+   <paramdef>Cardinal <parameter>num</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ptr</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to the old storage allocated with
+<xref linkend='XtMalloc' xrefstyle='select: title'/>,
+<xref linkend='XtCalloc' xrefstyle='select: title'/>,
+or
+<xref linkend='XtRealloc' xrefstyle='select: title'/>,
+or NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies number of bytes desired in new storage.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtRealloc' xrefstyle='select: title'/>
+function changes the size of a block of storage, possibly moving it.
+Then it copies the old contents (or as much as will fit) into the new block
+and frees the old block.
+If there is insufficient memory to allocate the new block,
+<xref linkend='XtRealloc' xrefstyle='select: title'/>
+calls
+<xref linkend='XtErrorMsg' xrefstyle='select: title'/>.
+If <emphasis remap='I'>ptr</emphasis> is NULL,
+<xref linkend='XtRealloc' xrefstyle='select: title'/>
+simply calls
+<xref linkend='XtMalloc' xrefstyle='select: title'/>.
+<xref linkend='XtRealloc' xrefstyle='select: title'/>
+then returns the address of the new block.
+</para>
+
+<para>
+To free an allocated block of storage, use
+<xref linkend='XtFree' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtFree'>
+<funcprototype>
+<funcdef>void <function>XtFree</function></funcdef>
+   <paramdef>char *<parameter>ptr</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ptr</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to a block of storage allocated with
+<xref linkend='XtMalloc' xrefstyle='select: title'/>,
+<xref linkend='XtCalloc' xrefstyle='select: title'/>,
+or
+<xref linkend='XtRealloc' xrefstyle='select: title'/>,
+or NULL.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtFree' xrefstyle='select: title'/>
+function returns storage, allowing it to be reused.
+If <emphasis remap='I'>ptr</emphasis> is NULL,
+<xref linkend='XtFree' xrefstyle='select: title'/>
+returns immediately.
+</para>
+
+<para>
+To allocate storage for a new instance of a type, use
+<xref linkend='XtNew' xrefstyle='select: title'/>.
+</para>
+
+
+<funcsynopsis id='XtNew'>
+<funcprototype>
+<funcdef>type <function>XtNew</function></funcdef>
+      <paramdef>type <parameter>t</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a previously declared type.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtNew' xrefstyle='select: title'/>
+returns a pointer to the allocated storage.
+If there is insufficient memory to allocate the new block,
+<xref linkend='XtNew' xrefstyle='select: title'/>
+calls
+<xref linkend='XtErrorMsg' xrefstyle='select: title'/>.
+<xref linkend='XtNew' xrefstyle='select: title'/>
+is a convenience macro that calls
+<xref linkend='XtMalloc' xrefstyle='select: title'/>
+with the following arguments specified:
+</para>
+<programlisting>
+((type *) XtMalloc((unsigned) sizeof(type)))
+</programlisting>
+<para>
+The storage allocated by
+<xref linkend='XtNew' xrefstyle='select: title'/>
+should be freed using
+<xref linkend='XtFree' xrefstyle='select: title'/>.
+</para>
+
+<para>
+To copy an instance of a string, use
+<xref linkend='XtNewString' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtNewString'>
+<funcprototype>
+<funcdef>String <function>XtNewString</function></funcdef>
+   <paramdef>String <parameter>string</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>string</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a previously declared string.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtNewString' xrefstyle='select: title'/>
+returns a pointer to the allocated storage.
+If there is insufficient memory to allocate the new block,
+<xref linkend='XtNewString' xrefstyle='select: title'/>
+calls
+<xref linkend='XtErrorMsg' xrefstyle='select: title'/>.
+<xref linkend='XtNewString' xrefstyle='select: title'/>
+is a convenience macro that calls
+<xref linkend='XtMalloc' xrefstyle='select: title'/>
+with the following arguments specified:
+</para>
+<programlisting>
+(strcpy(XtMalloc((unsigned)strlen(str) + 1), str))
+</programlisting>
+<para>
+The storage allocated by
+<xref linkend='XtNewString' xrefstyle='select: title'/>
+should be freed using
+<xref linkend='XtFree' xrefstyle='select: title'/>.
+</para>
+</sect1>
+
+<sect1 id="Sharing_Graphics_Contexts">
+<title>Sharing Graphics Contexts</title>
+<para>
+The Intrinsics provide a mechanism whereby cooperating objects can share a
+graphics context (GC), thereby reducing both the number of GCs
+created and the total number of server calls in any given application.
+The mechanism is a simple caching scheme
+and allows for clients to declare both modifiable and nonmodifiable
+fields of the shared GCs.
+</para>
+
+<para>
+To obtain a shareable GC with modifiable fields, use
+<xref linkend='XtAllocateGC' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAllocateGC'>
+<funcprototype>
+<funcdef>GC <function>XtAllocateGC</function></funcdef>
+   <paramdef>Widget <parameter>object</parameter></paramdef>
+   <paramdef>Cardinal <parameter>depth</parameter></paramdef>
+   <paramdef>XtGCMask <parameter>value_mask</parameter></paramdef>
+   <paramdef>XGCValues *<parameter>values</parameter></paramdef>
+   <paramdef>XtGCMask <parameter>dynamic_mask</parameter></paramdef>
+   <paramdef>XtGCMask <parameter>unused_mask</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>object</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an object, giving the screen for which the
+returned GC is valid.  Must be of class Object or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>depth</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the depth for which the returned GC is valid, or 0.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>value_mask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies fields of the GC that are initialized from <emphasis remap='I'>values</emphasis>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>values</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the values for the initialized fields.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>dynamic_mask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies fields of the GC that will be modified by the caller.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>unused_mask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies fields of the GC that will not be needed by the caller.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtAllocateGC' xrefstyle='select: title'/>
+function returns a shareable GC that may be
+modified by the client.  The <emphasis remap='I'>screen</emphasis> field of the specified
+widget or of the nearest widget ancestor of the specified
+object and the specified <emphasis remap='I'>depth</emphasis> argument supply
+the root and drawable depths for which the GC is to be
+valid.  If <emphasis remap='I'>depth</emphasis> is zero, the depth is taken from the
+<emphasis remap='I'>depth</emphasis> field of the specified widget or of the nearest
+widget ancestor of the specified object.
+</para>
+
+<para>
+The <emphasis remap='I'>value_mask</emphasis> argument specifies fields of the GC
+that are initialized with the respective member of the
+<emphasis remap='I'>values</emphasis> structure.  The <emphasis remap='I'>dynamic_mask</emphasis> argument specifies fields
+that the caller intends to modify during program execution.
+The caller must ensure that the corresponding GC field is set
+prior to each use of the GC.  The <emphasis remap='I'>unused_mask</emphasis> argument
+specifies fields of the GC that are of no interest to the
+caller.  The caller may make no assumptions about the contents
+of any fields specified in <emphasis remap='I'>unused_mask</emphasis>.  The caller may assume
+that at all times all fields not specified in either
+<emphasis remap='I'>dynamic_mask</emphasis> or <emphasis remap='I'>unused_mask</emphasis> have their default value if not
+specified in <emphasis remap='I'>value_mask</emphasis> or the value specified by <emphasis remap='I'>values</emphasis>.
+If a field is specified in both <emphasis remap='I'>value_mask</emphasis> and <emphasis remap='I'>dynamic_mask</emphasis>,
+the effect is as if it were specified only in <emphasis remap='I'>dynamic_mask</emphasis>
+and then immediately set to the value in <emphasis remap='I'>values</emphasis>.  If a field
+is set in <emphasis remap='I'>unused_mask</emphasis> and also in either <emphasis remap='I'>value_mask</emphasis> or
+<emphasis remap='I'>dynamic_mask</emphasis>, the specification in <emphasis remap='I'>unused_mask</emphasis> is ignored.
+</para>
+
+<para>
+<xref linkend='XtAllocateGC' xrefstyle='select: title'/>
+tries to minimize the number of unique GCs
+created by comparing the arguments with those of previous
+calls and returning an existing GC when there are no
+conflicts.
+<xref linkend='XtAllocateGC' xrefstyle='select: title'/>
+may modify and return an existing GC if it was allocated with a
+nonzero <emphasis remap='I'>unused_mask</emphasis>.
+</para>
+
+<para>
+To obtain a shareable GC with no modifiable fields, use
+<xref linkend='XtGetGC' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtGetGC'>
+<funcprototype>
+<funcdef>GC <function>XtGetGC</function></funcdef>
+   <paramdef>Widget <parameter>object</parameter></paramdef>
+   <paramdef>XtGCMask <parameter>value_mask</parameter></paramdef>
+   <paramdef>XGCValues *<parameter>values</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>object</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an object, giving the screen and depth for which the
+returned GC is valid.  Must be of class Object or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>value_mask</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies which fields of the <emphasis remap='I'>values</emphasis> structure are specified.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>values</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the actual values for this GC.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtGetGC' xrefstyle='select: title'/>
+function returns a shareable, read-only GC.
+The parameters to this function are the same as those for
+<function>XCreateGC</function>
+except that an Object is passed instead of a Display.
+<xref linkend='XtGetGC' xrefstyle='select: title'/>
+is equivalent to
+<xref linkend='XtAllocateGC' xrefstyle='select: title'/>
+with <emphasis remap='I'>depth</emphasis>, <emphasis remap='I'>dynamic_mask</emphasis>, and <emphasis remap='I'>unused_mask</emphasis> all zero.
+</para>
+
+<para>
+<xref linkend='XtGetGC' xrefstyle='select: title'/>
+shares only GCs in which all values in the GC returned by
+<function>XCreateGC</function>
+are the same.
+In particular, it does not use the <emphasis remap='I'>value_mask</emphasis> provided to
+determine which fields of the GC a widget considers relevant.
+The <emphasis remap='I'>value_mask</emphasis> is used only to tell the server which fields should be
+filled in from <emphasis remap='I'>values</emphasis> and which it should fill in with default values.
+</para>
+
+<para>
+To deallocate a shared GC when it is no longer needed, use
+<xref linkend='XtReleaseGC' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtReleaseGC'>
+<funcprototype>
+<funcdef>void <function>XtReleaseGC</function></funcdef>
+   <paramdef>Widget <parameter>object</parameter></paramdef>
+   <paramdef>GC <parameter>gc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>object</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies any object on the Display for which the GC was created.  Must be of class Object or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>gc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the shared GC obtained with either
+<xref linkend='XtAllocateGC' xrefstyle='select: title'/>
+or
+<xref linkend='XtGetGC' xrefstyle='select: title'/>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+References to shareable GCs are counted and a free request is generated to the
+server when the last user of a given GC releases it.
+</para>
+</sect1>
+
+<sect1 id="Managing_Selections">
+<title>Managing Selections</title>
+<para>
+Arbitrary widgets in multiple applications can communicate
+with each other by means of the Intrinsics global selection mechanism,
+which conforms to the specifications in the <emphasis remap='I'>Inter-Client Communication Conventions Manual</emphasis>.
+The Intrinsics supply functions for providing and receiving selection data in
+one logical piece (atomic transfers)
+or in smaller logical segments (incremental transfers).
+</para>
+
+<para>
+The incremental interface is provided for a selection owner or
+selection requestor that cannot or prefers not to pass the selection
+value to and from the Intrinsics in a single call.  For instance,
+either an application that is running on a machine with limited memory
+may not be able to store the entire selection value in memory or a
+selection owner may already have the selection value available in
+discrete chunks, and it would be more efficient not to have to
+allocate additional storage to copy the pieces contiguously.  Any
+owner or requestor that prefers to deal with the selection value in
+segments can use the incremental interfaces to do so.
+The transfer between the selection owner or requestor and the Intrinsics is not
+required to match the underlying
+transport protocol between the application and the X server;
+the Intrinsics will break too large a selection
+into smaller pieces for transport if necessary
+and will coalesce a selection transmitted incrementally if the value
+was requested atomically.
+</para>
+
+<sect2 id='Setting_and_Getting_the_Selection_Timeout_Value'>
+<title>Setting and Getting the Selection Timeout Value</title>
+<para>
+To set the Intrinsics selection timeout, use
+<xref linkend='XtAppSetSelectionTimeout' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppSetSelectionTimeout'>
+<funcprototype>
+<funcdef>void <function>XtAppSetSelectionTimeout</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+   <paramdef>unsigned long <parameter>timeout</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>timeout</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the selection timeout in milliseconds.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+To get the current selection timeout value, use
+<xref linkend='XtAppGetSelectionTimeout' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppGetSelectionTimeout'>
+<funcprototype>
+<funcdef>unsigned long <function>XtAppGetSelectionTimeout</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtAppGetSelectionTimeout' xrefstyle='select: title'/>
+function returns the current selection timeout value in milliseconds.
+The selection timeout is the time within which the two communicating
+applications must respond to one another.
+The initial timeout value is set by the
+selectionTimeout
+application resource as retrieved by
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>.
+If
+selectionTimeout
+is not specified,
+the default is five seconds.
+</para>
+</sect2>
+
+<sect2 id="Using_Atomic_Transfers">
+<title>Using Atomic Transfers</title>
+<para>
+When using atomic transfers, the owner will completely
+process one selection request at a time.
+The owner may consider each request individually,
+since there is no possibility for overlap
+between evaluation of two requests.
+</para>
+
+<sect3 id="Atomic_Transfer_Procedures">
+<title>Atomic Transfer Procedures</title>
+<para>
+The following procedures are used by the selection owner when
+providing selection data in a single unit.
+</para>
+
+<para>
+The procedure pointer specified by the owner to supply the selection
+data to the Intrinsics is of type
+<xref linkend='XtConvertSelectionProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtConvertSelectionProc'>
+<funcprototype>
+<funcdef>typedef Boolean <function>(*XtConvertSelectionProc)</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Atom *<parameter>selection</parameter></paramdef>
+   <paramdef>Atom *<parameter>target</parameter></paramdef>
+   <paramdef>Atom *<parameter>type_return</parameter></paramdef>
+   <paramdef>XtPointer *<parameter>value_return</parameter></paramdef>
+   <paramdef>unsigned long *<parameter>length_return</parameter></paramdef>
+   <paramdef>int *<parameter>format_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget that currently owns this selection.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the atom naming the selection requested
+(for example,
+<function>XA_PRIMARY</function>
+or
+<function>XA_SECONDARY ).</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>target</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the target type of the selection that has been requested,
+which indicates the desired information about the selection
+(for example, File Name, Text, Window).
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>type_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to an atom into which the property type of the
+converted value of the selection is to be stored.
+For instance, either File Name or Text might have property type
+<function>XA_STRING</function>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>value_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer into which a pointer to the converted value of the
+selection is to be stored.
+The selection owner is responsible for allocating this storage.
+If the selection owner has provided an
+<xref linkend='XtSelectionDoneProc' xrefstyle='select: title'/>
+for the selection,
+this storage is owned by the selection owner;
+otherwise, it is owned by the Intrinsics selection mechanism,
+which frees it by calling
+<xref linkend='XtFree' xrefstyle='select: title'/>
+when it is done with it.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>length_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer into which the number of elements in <emphasis remap='I'>value_return</emphasis>,
+each of size indicated by <emphasis remap='I'>format_return</emphasis>, is to be stored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>format_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer into which the size in bits of the data elements
+of the selection value is to be stored.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+This procedure is called by the Intrinsics selection mechanism
+to get the value of a selection as a given type
+from the current selection owner.
+It returns
+<function>True</function>
+if the owner successfully converted the selection to the target type or
+<function>False</function>
+otherwise.
+If the procedure returns
+<function>False</function>,
+the values of the return arguments are undefined.
+Each
+<xref linkend='XtConvertSelectionProc' xrefstyle='select: title'/>
+should respond to target value
+<function>TARGETS</function>
+by returning a value containing the list of the targets
+into which it is
+prepared to convert the selection.
+The value returned in
+<emphasis remap='I'>format_return</emphasis> must be one of 8, 16, or 32 to allow the server to
+byte-swap the data if necessary.
+</para>
+
+<para>
+This procedure does not need to worry about responding to the
+MULTIPLE or the TIMESTAMP target values (see
+<xref linkend='Window_Creation_Convenience_Routine' />
+in the Inter-Client Communication Conventions Manual).
+A selection request with
+the MULTIPLE target type is transparently transformed into a
+series of calls to this procedure, one for each target type, and a
+selection request with the TIMESTAMP target value is answered
+automatically by the Intrinsics using the time specified in the
+call to
+<xref linkend='XtOwnSelection' xrefstyle='select: title'/>
+or
+<xref linkend='XtOwnSelectionIncremental' xrefstyle='select: title'/>.
+</para>
+
+<para>
+To retrieve the
+<function>SelectionRequest</function>
+event that triggered the
+<xref linkend='XtConvertSelectionProc' xrefstyle='select: title'/>
+procedure, use
+<xref linkend='XtGetSelectionRequest' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtGetSelectionRequest'>
+<funcprototype>
+<funcdef>XSelectionRequestEvent *<function>XtGetSelectionRequest</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Atom <parameter>selection</parameter></paramdef>
+   <paramdef>XtRequestId <parameter>request_id</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget that currently owns this selection.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the selection being processed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>request_id</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the requestor id in the case of incremental
+selections, or NULL in the case of atomic transfers.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtGetSelectionRequest' xrefstyle='select: title'/>
+may be called only from within an
+<xref linkend='XtConvertSelectionProc' xrefstyle='select: title'/>
+procedure and returns a pointer to the
+<function>SelectionRequest</function>
+event that caused the conversion procedure to be invoked.
+<emphasis remap='I'>Request_id</emphasis> specifies a unique id for the individual request in the
+case that multiple incremental transfers are outstanding.  For atomic
+transfers, <emphasis remap='I'>request_id</emphasis> must be specified as NULL.  If no
+<function>SelectionRequest</function>
+event is being processed for the specified
+<emphasis remap='I'>widget</emphasis>, <emphasis remap='I'>selection</emphasis>, and <emphasis remap='I'>request_id</emphasis>,
+<xref linkend='XtGetSelectionRequest' xrefstyle='select: title'/>
+returns NULL.
+</para>
+
+<para>
+The procedure pointer specified by the owner when it desires
+notification upon losing ownership is of type
+<xref linkend='XtLoseSelectionProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtLoseSelectionProc'>
+<funcprototype>
+<funcdef>typedef void <function>(*XtLoseSelectionProc)</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Atom *<parameter>selection</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget that has lost selection ownership.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the atom naming the selection.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+This procedure is called by the Intrinsics selection mechanism
+to inform the specified widget that it has lost the given selection.
+Note that this procedure does not ask the widget to relinquish the
+selection ownership; it is merely informative.
+</para>
+
+<para>
+The procedure pointer specified by the owner when it desires
+notification of receipt of the data or when it manages the storage
+containing the data is of type
+<xref linkend='XtSelectionDoneProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtSelectionDoneProc'>
+<funcprototype>
+<funcdef>typedef void <function>(*XtSelectionDoneProc)</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Atom *<parameter>selection</parameter></paramdef>
+   <paramdef>Atom *<parameter>target</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget that owns the converted selection.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the atom naming the selection that was converted.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>target</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the target type to which the conversion was done.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+This procedure is called by the Intrinsics selection mechanism
+to inform the selection owner that a selection requestor has successfully
+retrieved a selection value.
+If the selection owner has registered an
+<xref linkend='XtSelectionDoneProc' xrefstyle='select: title'/>,
+it should expect it to be called once for each conversion that it performs,
+after the converted value has been successfully transferred
+to the requestor.
+If the selection owner has registered an
+<xref linkend='XtSelectionDoneProc' xrefstyle='select: title'/>,
+it also owns the storage containing the converted
+selection value.
+</para>
+</sect3>
+<sect3 id="Getting_the_Selection_Value">
+<title>Getting the Selection Value</title>
+<para>
+The procedure pointer specified by the requestor to receive the
+selection data from the Intrinsics is of type
+<xref linkend='XtSelectionCallbackProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtSelectionCallbackProc'>
+<funcprototype>
+<funcdef>typedef void <function>(*XtSelectionCallbackProc)</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+   <paramdef>Atom *<parameter>selection</parameter></paramdef>
+   <paramdef>Atom *<parameter>type</parameter></paramdef>
+   <paramdef>XtPointer <parameter>value</parameter></paramdef>
+   <paramdef>unsigned long *<parameter>length</parameter></paramdef>
+   <paramdef>int *<parameter>format</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget that requested the selection value.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a value passed in by the widget when it requested the
+selection.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the name of the selection that was requested.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the representation type of the selection value (for example,
+<function>XA_STRING ).</function>
+Note that it is not the target that was requested (which the client
+must remember for itself), but the type that
+is used to represent the target.
+The special symbolic constant
+<function>XT_CONVERT_FAIL</function>
+is used to indicate that the selection conversion failed because the
+selection owner did not respond within the Intrinsics selection timeout
+interval.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>value</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to the selection value.
+The requesting client owns this storage and is responsible for freeing it
+by calling
+<xref linkend='XtFree' xrefstyle='select: title'/>
+when it is done with it.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>length</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of elements in <emphasis remap='I'>value</emphasis>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>format</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the size in bits of the data in each element of <emphasis remap='I'>value</emphasis>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+This procedure is called by the Intrinsics selection mechanism to deliver the
+requested selection to the requestor.
+</para>
+
+<para>
+If the
+<function>SelectionNotify</function>
+event returns a property of
+<function>None</function>,
+meaning the conversion has been refused because there is no owner for the
+specified selection or the owner cannot convert the selection to the
+requested target for any reason, the procedure is called with a value
+of NULL and a length of zero.
+</para>
+
+<para>
+To obtain the selection value in a single logical unit, use
+<xref linkend='XtGetSelectionValue' xrefstyle='select: title'/>
+or
+<xref linkend='XtGetSelectionValues' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtGetSelectionValue'>
+<funcprototype>
+<funcdef>void <function>XtGetSelectionValue</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Atom <parameter>selection</parameter></paramdef>
+   <paramdef>Atom <parameter>target</parameter></paramdef>
+   <paramdef>XtSelectionCallbackProc <parameter>callback</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+   <paramdef>Time <parameter>time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget making the request.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the particular selection desired; for example,
+<function>XA_PRIMARY</function>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>target</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the type of information needed about the selection.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>callback</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to be called when the selection value
+has been obtained.
+Note that this is how the selection value is communicated back to the client.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies additional data to be passed to the specified procedure
+when it is called.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the timestamp that indicates when the selection request was
+initiated.
+This should be the timestamp of the event that triggered this request;
+the value
+<function>CurrentTime</function>
+is not acceptable.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtGetSelectionValue' xrefstyle='select: title'/>
+function requests the value of the selection converted to
+the target type.
+The specified callback is called at some time after
+<xref linkend='XtGetSelectionValue' xrefstyle='select: title'/>
+is called, when the selection value is received from the X server.
+It may be called before or after
+<xref linkend='XtGetSelectionValue' xrefstyle='select: title'/>
+returns.
+For more information about <emphasis remap='I'>selection</emphasis>,
+<emphasis remap='I'>target</emphasis>, and
+<emphasis remap='I'>time</emphasis>, see
+Section 2.6 in the
+Inter-Client Communication Conventions Manual.
+</para>
+
+<funcsynopsis id='XtGetSelectionValues'>
+<funcprototype>
+<funcdef>void <function>XtGetSelectionValues</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Atom <parameter>selection</parameter></paramdef>
+   <paramdef>Atom *<parameter>targets</parameter></paramdef>
+   <paramdef>int <parameter>count</parameter></paramdef>
+   <paramdef>XtSelectionCallbackProc <parameter>callback</parameter></paramdef>
+   <paramdef>XtPointer *<parameter>client_data</parameter></paramdef>
+   <paramdef>Time <parameter>time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget making the request.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the particular selection desired (that is, primary or secondary).
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>targets</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the types of information needed about the selection.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the length of the <emphasis remap='I'>targets</emphasis> and <emphasis remap='I'>client_data</emphasis> lists.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>callback</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the callback procedure
+to be called with each selection value obtained.
+Note that this is how the selection values are communicated back to the
+client.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a list of additional data values, one for each target type,
+that are passed to the callback procedure when it is called for that target.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the timestamp that indicates when the selection request was
+initiated.
+This should be the timestamp of the event that triggered this request;
+the value
+<function>CurrentTime</function>
+is not acceptable.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtGetSelectionValues' xrefstyle='select: title'/>
+function is similar to multiple calls to
+<xref linkend='XtGetSelectionValue' xrefstyle='select: title'/>
+except that it guarantees that no other client can assert ownership
+between requests and therefore that all the conversions will refer to
+the same selection value.  The callback is invoked once for each
+target value with the corresponding client data.
+For more information about <emphasis remap='I'>selection</emphasis>, <emphasis remap='I'>target</emphasis>, and
+<emphasis remap='I'>time</emphasis>, see
+section 2.6
+in the <emphasis remap='I'>Inter-Client Communication Conventions Manual</emphasis>.
+</para>
+</sect3>
+<sect3 id="Setting_the_Selection_Owner">
+<title>Setting the Selection Owner</title>
+<para>
+To set the selection owner and indicate that the selection value will
+be provided in one piece, use
+<xref linkend='XtOwnSelection' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtOwnSelection'>
+<funcprototype>
+<funcdef>Boolean <function>XtOwnSelection</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Atom <parameter>selection</parameter></paramdef>
+   <paramdef>Time <parameter>time</parameter></paramdef>
+   <paramdef>XtConvertSelectionProc <parameter>convert_proc</parameter></paramdef>
+   <paramdef>XtLoseSelectionProc <parameter>lose_selection</parameter></paramdef>
+   <paramdef>XtSelectionDoneProc <parameter>done_proc</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget that wishes to become the owner.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the name of the selection (for example,
+<function>XA_PRIMARY ).</function>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the timestamp that indicates when the ownership request was
+initiated.
+This should be the timestamp of the event that triggered ownership;
+the value
+<function>CurrentTime</function>
+is not acceptable.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>convert_proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to be called whenever a client requests the
+current value of the selection.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>lose_selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to be called whenever the widget has
+lost selection ownership, or NULL if the owner is not interested in being
+called back.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>done_proc</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure called
+after the requestor has received the selection value, or NULL if the
+owner is not
+interested in being called back.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtOwnSelection' xrefstyle='select: title'/>
+function informs the Intrinsics selection mechanism that a
+widget wishes to own a selection.
+It returns
+<function>True</function>
+if the widget successfully becomes the owner and
+<function>False</function>
+otherwise.
+The widget may fail to become the owner if some other widget
+has asserted ownership at a time later than this widget.
+The widget can lose selection ownership either
+because some other widget asserted later ownership of the selection
+or because the widget voluntarily gave up ownership of the selection.
+The lose_selection procedure is not called
+if the widget fails to obtain selection ownership in the first place.
+</para>
+
+<para>
+If a done_proc is specified, the client owns the storage allocated
+for passing the value to the Intrinsics.  If <emphasis remap='I'>done_proc</emphasis> is NULL,
+the convert_proc must allocate storage using
+<xref linkend='XtMalloc' xrefstyle='select: title'/>,
+<xref linkend='XtRealloc' xrefstyle='select: title'/>,
+or
+<xref linkend='XtCalloc' xrefstyle='select: title'/>,
+and the value specified is freed by the
+Intrinsics when the transfer is complete.
+</para>
+
+<para>
+Usually, a selection owner maintains ownership indefinitely until some
+other widget requests ownership, at which time
+the Intrinsics selection mechanism informs the previous owner that it
+has lost ownership of the selection.
+However, in response to some user actions
+(for example, when a user deletes the information selected),
+the application may wish to explicitly inform the Intrinsics
+by using
+<xref linkend='XtDisownSelection' xrefstyle='select: title'/>
+that it no longer is to be the selection owner.
+</para>
+
+<funcsynopsis id='XtDisownSelection'>
+<funcprototype>
+<funcdef>void <function>XtDisownSelection</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Atom <parameter>selection</parameter></paramdef>
+   <paramdef>Time <parameter>time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget that wishes to relinquish ownership.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the atom naming the selection being given up.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the timestamp that indicates when the request to
+relinquish selection ownership was initiated.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtDisownSelection' xrefstyle='select: title'/>
+function informs the Intrinsics selection mechanism that
+the specified widget is to lose ownership of the selection.
+If the widget does not currently own the selection, either
+because it lost the selection
+or because it never had the selection to begin with,
+<xref linkend='XtDisownSelection' xrefstyle='select: title'/>
+does nothing.
+</para>
+
+<para>
+After a widget has called
+<xref linkend='XtDisownSelection' xrefstyle='select: title'/>,
+its convert procedure is not called even if a request arrives later
+with a timestamp during the period that this widget owned the selection.
+However, its done procedure is called if a conversion that started
+before the call to
+<xref linkend='XtDisownSelection' xrefstyle='select: title'/>
+finishes after the call to
+<xref linkend='XtDisownSelection' xrefstyle='select: title'/>.
+</para>
+</sect3>
+</sect2>
+
+<sect2 id="Using_Incremental_Transfers">
+<title>Using Incremental Transfers</title>
+<para>
+When using the incremental interface, an owner may have to process
+more than one selection request for the same selection, converted to
+the same target, at the same time.  The incremental functions take a
+<emphasis remap='I'>request_id</emphasis> argument, which is an identifier that is guaranteed to be
+unique among all incremental requests that are active concurrently.
+</para>
+
+<para>
+For example, consider the following:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+Upon receiving a request for the selection value, the owner sends
+the first segment.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+While waiting to be called to provide the next segment value but
+before sending it, the owner receives another request from a
+different requestor for the same selection value.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+To distinguish between the requests, the owner uses the request_id
+value.  This allows the owner to distinguish between the first
+requestor, which is asking for the second segment, and the second
+requestor, which is asking for the first segment.
+    </para>
+  </listitem>
+</itemizedlist>
+<sect3 id="Incremental_Transfer_Procedures">
+<title>Incremental Transfer Procedures</title>
+<para>
+The following procedures are used by selection owners who wish to
+provide the selection data in multiple segments.
+</para>
+
+<para>
+The procedure pointer specified by the incremental owner to supply the
+selection data to the Intrinsics is of type
+<xref linkend='XtConvertSelectionIncrProc' xrefstyle='select: title'/>.
+</para>
+<programlisting>
+typedef XtPointer XtRequestId;
+</programlisting>
+
+<funcsynopsis id='XtConvertSelectionIncrProc'>
+<funcprototype>
+<funcdef>typedef Boolean <function>(*XtConvertSelectionIncrProc)</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Atom *<parameter>selection</parameter></paramdef>
+   <paramdef>Atom *<parameter>target</parameter></paramdef>
+   <paramdef>Atom *<parameter>type_return</parameter></paramdef>
+   <paramdef>XtPointer *<parameter>value_return</parameter></paramdef>
+   <paramdef>unsigned long *<parameter>length_return</parameter></paramdef>
+   <paramdef>int *<parameter>format_return</parameter></paramdef>
+   <paramdef>unsigned long *<parameter>max_length</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+   <paramdef>XtRequestId *<parameter>request_id</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget that currently owns this selection.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the atom that names the selection requested.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>target</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the type of information required about the selection.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>type_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to an atom into which the property
+type of the converted value of the selection is to be
+stored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>value_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer into which a pointer to the
+converted value of the selection is to be stored.
+The selection owner is responsible for allocating this storage.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>length_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer into which the number of elements
+in <emphasis remap='I'>value_return</emphasis>, each of size indicated by
+<emphasis remap='I'>format_return</emphasis>, is to be stored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>format_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer into which the size in bits of the
+data elements of the selection value is to be stored so that the
+server may byte-swap the data if necessary.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>max_length</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the maximum number of bytes which may be
+transferred at any one time.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the value passed in by the widget when it
+took ownership of the selection.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>request_id</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an opaque identification for a specific request.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+This procedure is called repeatedly by the Intrinsics selection mechanism to get
+the next incremental chunk of data from a selection owner who has
+called
+<xref linkend='XtOwnSelectionIncremental' xrefstyle='select: title'/>.
+It must return
+<function>True</function>
+if the procedure has succeeded in converting the selection data or
+<function>False</function>
+otherwise.
+On the first call with a particular request id, the owner must begin
+a new incremental transfer for the requested selection and target.  On
+subsequent calls with the same request id, the owner may assume that
+the previously supplied value is no longer needed by the Intrinsics;
+that is, a fixed transfer area may be allocated and returned in <emphasis remap='I'>value_return</emphasis>
+for each segment to be transferred.  This procedure should store a
+non-NULL value in <emphasis remap='I'>value_return</emphasis> and zero in <emphasis remap='I'>length_return</emphasis> to indicate that the
+entire selection has been delivered.  After returning this final
+segment, the request id may be reused by the Intrinsics to begin a
+new transfer.
+</para>
+
+<para>
+To retrieve the
+<function>SelectionRequest</function>
+event that triggered the selection conversion procedure, use
+<xref linkend='XtGetSelectionRequest' xrefstyle='select: title'/>,
+described in Section 11.5.2.1.
+</para>
+
+<para>
+The procedure pointer specified by the incremental selection owner
+when it desires notification upon no longer having ownership is of
+type
+<xref linkend='XtLoseSelectionIncrProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtLoseSelectionIncrProc'>
+<funcprototype>
+<funcdef>typedef void <function>(*XtLoseSelectionIncrProc)</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Atom *<parameter>selection</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget that has lost the selection ownership.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the atom that names the selection.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the value passed in by the widget when it
+took ownership of the selection.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+This procedure, which is optional, is called by the Intrinsics to
+inform the selection owner that it no longer owns the selection.
+</para>
+
+<para>
+The procedure pointer specified by the incremental selection owner
+when it desires notification of receipt of the data or when it manages
+the storage containing the data is of type
+<xref linkend='XtSelectionDoneIncrProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtSelectionDoneIncrProc'>
+<funcprototype>
+<funcdef>typedef void <function>(*XtSelectionDoneIncrProc)</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Atom *<parameter>selection</parameter></paramdef>
+   <paramdef>Atom *<parameter>target</parameter></paramdef>
+   <paramdef>XtRequestId *<parameter>request_id</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget that owns the selection.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the atom that names the selection being transferred.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>target</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the target type to which the conversion was done.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>request_id</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an opaque identification for a specific request.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specified the value passed in by the widget when it
+took ownership of the selection.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+This procedure, which is optional, is called by the Intrinsics after
+the requestor has retrieved the final (zero-length) segment of the
+incremental transfer to indicate that the entire transfer is complete.
+If this procedure is not specified, the Intrinsics will free only the
+final value returned by the selection owner using
+<xref linkend='XtFree' xrefstyle='select: title'/>.
+</para>
+
+<para>
+The procedure pointer specified by the incremental selection owner to
+notify it if a transfer should be terminated prematurely is of type
+<xref linkend='XtCancelConvertSelectionProc' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtCancelConvertSelectionProc'>
+<funcprototype>
+<funcdef>typedef void <function>(*XtCancelConvertSelectionProc)</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Atom *<parameter>selection</parameter></paramdef>
+   <paramdef>Atom *<parameter>target</parameter></paramdef>
+   <paramdef>XtRequestId *<parameter>request_id</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget that owns the selection.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the atom that names the selection being transferred.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>target</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the target type to which the conversion was done.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>request_id</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an opaque identification for a specific request.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the value passed in by the widget when it took ownership of
+the selection.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+This procedure is called by the Intrinsics when it has been determined
+by means of a timeout or other mechanism that any remaining segments
+of the selection no longer need to be transferred.  Upon receiving
+this callback, the selection request is considered complete and the
+owner can free the memory and any other resources that have been
+allocated for the transfer.
+</para>
+</sect3>
+<sect3 id="Getting_the_Selection_Value_Incrementally">
+<title>Getting the Selection Value Incrementally</title>
+<para>
+To obtain the value of the selection using incremental transfers, use
+<xref linkend='XtGetSelectionValueIncremental' xrefstyle='select: title'/>
+or
+<xref linkend='XtGetSelectionValuesIncremental' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtGetSelectionValueIncremental'>
+<funcprototype>
+<funcdef>void <function>XtGetSelectionValueIncremental</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Atom <parameter>selection</parameter></paramdef>
+   <paramdef>Atom <parameter>target</parameter></paramdef>
+   <paramdef>XtSelectionCallbackProc <parameter>selection_callback</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+   <paramdef>Time <parameter>time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget making the request.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the particular selection desired.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>target</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the type of information needed
+about the selection.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection_callback</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the callback procedure to be
+called to receive each data segment.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies client-specific data to be passed to
+the specified callback procedure when it is invoked.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the timestamp that indicates when the
+selection request was initiated.  This should be the
+timestamp of the event that triggered this request;
+the value
+<function>CurrentTime</function>
+is not acceptable.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtGetSelectionValueIncremental' xrefstyle='select: title'/>
+function is similar to
+<xref linkend='XtGetSelectionValue' xrefstyle='select: title'/>
+except that the selection_callback procedure will
+be called repeatedly upon delivery of multiple segments of the
+selection value.  The end of the selection value is indicated when
+<emphasis remap='I'>selection_callback</emphasis> is called with a non-NULL value of length zero,
+which must still be freed by the client.  If the
+transfer of the selection is aborted in the middle of a transfer
+(for example, because of a timeout), the selection_callback procedure is
+called with a type value equal to the symbolic constant
+<function>XT_CONVERT_FAIL</function>
+so that the requestor can dispose
+of the partial selection value it has collected up until that point.
+Upon receiving
+<function>XT_CONVERT_FAIL</function>,
+the requesting client must determine
+for itself whether or not a partially completed data transfer is meaningful.
+For more information about <emphasis remap='I'>selection</emphasis>,
+<emphasis remap='I'>target</emphasis>, and
+<emphasis remap='I'>time</emphasis>, see
+Use of Selection Atoms in the
+Inter-Client Communication Conventions Manual.
+</para>
+
+<funcsynopsis id='XtGetSelectionValuesIncremental'>
+<funcprototype>
+<funcdef>void <function>XtGetSelectionValuesIncremental</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Atom <parameter>selection</parameter></paramdef>
+   <paramdef>Atom *<parameter>targets</parameter></paramdef>
+   <paramdef>int <parameter>count</parameter></paramdef>
+   <paramdef>XtSelectionCallbackProc <parameter>selection_callback</parameter></paramdef>
+   <paramdef>XtPointer *<parameter>client_data</parameter></paramdef>
+   <paramdef>Time <parameter>time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget making the request.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the particular selection desired.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>targets</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the types of information needed about
+the selection.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the length of the <emphasis remap='I'>targets</emphasis> and <emphasis remap='I'>client_data</emphasis> lists.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection_callback</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the callback procedure to be called
+to receive each selection value.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a list of client data (one for each target
+type) values that are passed to the callback procedure when
+it is invoked for the corresponding target.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the timestamp that indicates when the
+selection request was initiated.  This should be the
+timestamp of the event that triggered this request;
+the value
+<function>CurrentTime</function>
+is not acceptable.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtGetSelectionValuesIncremental' xrefstyle='select: title'/>
+function is similar to
+<xref linkend='XtGetSelectionValueIncremental' xrefstyle='select: title'/>
+except that it takes a list of targets and client data.
+<xref linkend='XtGetSelectionValuesIncremental' xrefstyle='select: title'/>
+is equivalent to calling
+<xref linkend='XtGetSelectionValueIncremental' xrefstyle='select: title'/>
+successively for each <emphasis remap='I'>target/client_data</emphasis> pair except that
+<xref linkend='XtGetSelectionValuesIncremental' xrefstyle='select: title'/>
+does guarantee that all the conversions will use the same selection
+value because the ownership of the selection cannot change in the
+middle of the list, as would be possible when calling
+<xref linkend='XtGetSelectionValueIncremental' xrefstyle='select: title'/>
+repeatedly.
+For more information about <emphasis remap='I'>selection</emphasis>, <emphasis remap='I'>target</emphasis>, and
+<emphasis remap='I'>time</emphasis>, see
+Section 2.6 in the
+Inter-Client Communication Conventions Manual.
+</para>
+</sect3>
+<sect3 id="Setting_the_Selection_Owner_for_Incremental_Transfers">
+<title>Setting the Selection Owner for Incremental Transfers</title>
+<para>
+To set the selection owner when using incremental transfers, use
+<xref linkend='XtOwnSelectionIncremental' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtOwnSelectionIncremental'>
+<funcprototype>
+<funcdef>Boolean <function>XtOwnSelectionIncremental</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Atom <parameter>selection</parameter></paramdef>
+   <paramdef>Time <parameter>time</parameter></paramdef>
+   <paramdef>XtConvertSelectionIncrProc <parameter>convert_callback</parameter></paramdef>
+   <paramdef>XtLoseSelectionIncrProc <parameter>lose_callback</parameter></paramdef>
+   <paramdef>XtSelectionDoneIncrProc <parameter>done_callback</parameter></paramdef>
+   <paramdef>XtCancelConvertSelectionProc <parameter>cancel_callback</parameter></paramdef>
+   <paramdef>XtPointer <parameter>client_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget that wishes to become the owner.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the atom that names the selection.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the timestamp that indicates when the
+selection ownership request was initiated.  This should be
+the timestamp of the event that triggered ownership; the value
+<function>CurrentTime</function>
+is not acceptable.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>convert_callback</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to be called whenever
+the current value of the selection is requested.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>lose_callback</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure to be called whenever
+the widget has lost selection ownership, or NULL if the
+owner is not interested in being notified.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>done_callback</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the procedure called after the
+requestor has received the entire selection, or NULL if
+the owner is not interested in being notified.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>cancel_callback</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the callback procedure to be called
+when a selection request aborts because a timeout expires,
+or NULL if the owner is not interested in being notified.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>client_data</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the argument to be passed to each of
+the callback procedures when they are called.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtOwnSelectionIncremental' xrefstyle='select: title'/>
+procedure informs the Intrinsics
+incremental selection mechanism that the specified widget wishes to
+own the selection.  It returns
+<function>True</function>
+if the specified widget successfully becomes the selection owner or
+<function>False</function>
+otherwise.
+For more information about <emphasis remap='I'>selection</emphasis>, <emphasis remap='I'>target</emphasis>, and
+<emphasis remap='I'>time</emphasis>, see
+Section 2.6 in the
+Inter-Client Communication Conventions Manual.
+</para>
+
+<para>
+If a done_callback procedure is specified, the client owns the storage allocated
+for passing the value to the Intrinsics.  If <emphasis remap='I'>done_callback</emphasis> is NULL,
+the convert_callback procedure must allocate storage using
+<xref linkend='XtMalloc' xrefstyle='select: title'/>,
+<xref linkend='XtRealloc' xrefstyle='select: title'/>,
+or
+<xref linkend='XtCalloc' xrefstyle='select: title'/>,
+and the final value specified is freed by the
+Intrinsics when the transfer is complete.  After a selection transfer
+has started, only one of the done_callback or cancel_callback
+procedures is invoked to indicate completion of the transfer.
+</para>
+
+<para>
+The lose_callback procedure does not indicate completion of any in-progress
+transfers; it is invoked at the time a
+<function>SelectionClear</function>
+event is dispatched regardless of any active transfers, which are still
+expected to continue.
+</para>
+
+<para>
+A widget that becomes the selection owner using
+<xref linkend='XtOwnSelectionIncremental' xrefstyle='select: title'/>
+may use
+<xref linkend='XtDisownSelection' xrefstyle='select: title'/>
+to relinquish selection ownership.
+</para>
+</sect3>
+</sect2>
+
+<sect2 id="Setting_and_Retrieving_Selection_Target_Parameters">
+<title>Setting and Retrieving Selection Target Parameters</title>
+<para>
+To specify target parameters for a selection request with a single target,
+use
+<xref linkend='XtSetSelectionParameters' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtSetSelectionParameters'>
+<funcprototype>
+<funcdef>void <function>XtSetSelectionParameters</function></funcdef>
+   <paramdef>Widget <parameter>requestor</parameter></paramdef>
+   <paramdef>Atom <parameter>selection</parameter></paramdef>
+   <paramdef>Atom <parameter>type</parameter></paramdef>
+   <paramdef>XtPointer <parameter>value</parameter></paramdef>
+   <paramdef>unsigned long <parameter>length</parameter></paramdef>
+   <paramdef>int <parameter>format</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>requestor</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget making the request.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the atom that names the selection.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the type of the property in which the parameters are passed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>value</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to the parameters.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>length</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of elements containing data in <emphasis remap='I'>value</emphasis>,
+each element of a size indicated by <emphasis remap='I'>format</emphasis>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>format</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the size in bits of the data in the elements of <emphasis remap='I'>value</emphasis>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The specified parameters are copied and stored in a new property
+of the specified type and format on the requestor's window.  To initiate
+a selection request with a target and these parameters, a subsequent
+call to
+<xref linkend='XtGetSelectionValue' xrefstyle='select: title'/>
+or to
+<xref linkend='XtGetSelectionValueIncremental' xrefstyle='select: title'/>
+specifying the same requestor widget and selection atom will generate a
+<function>ConvertSelection</function>
+request referring to the property containing the parameters.  If
+<xref linkend='XtSetSelectionParameters' xrefstyle='select: title'/>
+is called more than once with the same widget and selection without
+a call to specify a request, the most recently specified parameters
+are used in the subsequent request.
+</para>
+
+<para>
+The possible values of <emphasis remap='I'>format</emphasis> are 8, 16, or 32.  If the format is 8,
+the elements of <emphasis remap='I'>value</emphasis> are assumed to be sizeof(char);
+if 16, sizeof(short); if 32, sizeof(long).
+</para>
+
+<para>
+To generate a MULTIPLE
+target request with parameters for any of the multiple targets of the
+selection request, precede individual calls to
+<xref linkend='XtGetSelectionValue' xrefstyle='select: title'/>
+and
+<xref linkend='XtGetSelectionValueIncremental' xrefstyle='select: title'/>
+with corresponding individual calls to
+<xref linkend='XtSetSelectionParameters' xrefstyle='select: title'/>,
+and enclose these all within
+<xref linkend='XtCreateSelectionRequest' xrefstyle='select: title'/>
+and
+<function>XtSendSelectionRequest.</function>
+<xref linkend='XtGetSelectionValues' xrefstyle='select: title'/>
+and
+<xref linkend='XtGetSelectionValuesIncremental' xrefstyle='select: title'/>
+cannot be used to make selection requests with parameterized targets.
+</para>
+
+<para>
+To retrieve any target parameters needed to perform a selection conversion,
+the selection owner calls
+<xref linkend='XtGetSelectionParameters' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtGetSelectionParameters'>
+<funcprototype>
+<funcdef>void <function>XtGetSelectionParameters</function></funcdef>
+   <paramdef>Widget <parameter>owner</parameter></paramdef>
+   <paramdef>Atom <parameter>selection</parameter></paramdef>
+   <paramdef>XtRequestId <parameter>request_id</parameter></paramdef>
+   <paramdef>Atom *<parameter>type_return</parameter></paramdef>
+   <paramdef>XtPointer *<parameter>value_return</parameter></paramdef>
+   <paramdef>unsigned long *<parameter>length_return</parameter></paramdef>
+   <paramdef>int *<parameter>format_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>owner</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget that owns the specified selection.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the selection being processed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>request_id</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the requestor id in the case of incremental selections,
+or NULL in the case of atomic transfers.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>type_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to an atom in which the property type
+of the parameters is stored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>value_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer into which a pointer to the parameters is to be stored.
+A NULL is stored if no parameters accompany the request.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>length_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer into which the number of data elements
+in <emphasis remap='I'>value_return</emphasis> of size indicated by <emphasis remap='I'>format_return</emphasis> are stored.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>format_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer into which the size in bits of the parameter data
+in the elements of <emphasis remap='I'>value</emphasis> is stored.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtGetSelectionParameters' xrefstyle='select: title'/>
+may be called only from within an
+<xref linkend='XtConvertSelectionProc' xrefstyle='select: title'/>
+or from within the first call to an
+<xref linkend='XtConvertSelectionIncrProc' xrefstyle='select: title'/>
+with a new request_id.
+</para>
+
+<para>
+It is the responsibility of the caller to free the returned parameters using
+<xref linkend='XtFree' xrefstyle='select: title'/>
+when the parameters are no longer needed.
+</para>
+</sect2>
+
+<sect2 id="Generating_MULTIPLE_Requests">
+<title>Generating MULTIPLE Requests</title>
+<para>
+To have the Intrinsics bundle multiple calls to make selection requests into
+a single request using a <emphasis role='strong'>MULTIPLE</emphasis> target, use
+<xref linkend='XtCreateSelectionRequest' xrefstyle='select: title'/>
+and
+<xref linkend='XtSendSelectionRequest' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtCreateSelectionRequest'>
+<funcprototype>
+<funcdef>void <function>XtCreateSelectionRequest</function></funcdef>
+   <paramdef>Widget <parameter>requestor</parameter></paramdef>
+   <paramdef>Atom <parameter>selection</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>requestor</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget making the request.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the particular selection desired.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+When
+<xref linkend='XtCreateSelectionRequest' xrefstyle='select: title'/>
+is called, subsequent calls to
+<xref linkend='XtGetSelectionValue' xrefstyle='select: title'/>,
+<xref linkend='XtGetSelectionValueIncremental' xrefstyle='select: title'/>,
+<xref linkend='XtGetSelectionValues' xrefstyle='select: title'/>,
+and
+<xref linkend='XtGetSelectionValuesIncremental' xrefstyle='select: title'/>,
+with the requestor and selection as specified to
+<xref linkend='XtCreateSelectionRequest' xrefstyle='select: title'/>,
+are bundled into a single selection request with
+multiple targets.  The request is made by calling
+<xref linkend='XtSendSelectionRequest' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtSendSelectionRequest'>
+<funcprototype>
+<funcdef>void <function>XtSendSelectionRequest</function></funcdef>
+   <paramdef>Widget <parameter>requestor</parameter></paramdef>
+   <paramdef>Atom <parameter>selection</parameter></paramdef>
+   <paramdef>Time <parameter>time</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>requestor</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget making the request.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the particular selection desired.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the timestamp that indicates when the selection request was
+initiated.  The value
+<function>CurrentTime</function>
+is not acceptable.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+When
+<xref linkend='XtSendSelectionRequest' xrefstyle='select: title'/>
+is called with a value of <emphasis remap='I'>requestor</emphasis> and <emphasis remap='I'>selection</emphasis> matching
+a previous call to
+<xref linkend='XtCreateSelectionRequest' xrefstyle='select: title'/>,
+a selection request is sent to the selection owner.
+If a single target request is queued, that request is made.
+If multiple targets are queued, they are bundled into a single request
+with a target of MULTIPLE using the specified timestamp.
+As the values are returned, the callbacks specified in
+<xref linkend='XtGetSelectionValue' xrefstyle='select: title'/>,
+<xref linkend='XtGetSelectionValueIncremental' xrefstyle='select: title'/>,
+<xref linkend='XtGetSelectionValues' xrefstyle='select: title'/>,
+and
+<xref linkend='XtGetSelectionValueIncremental' xrefstyle='select: title'/>
+are invoked.
+</para>
+
+<para>
+Multi-threaded applications should lock the application context before
+calling
+<xref linkend='XtCreateSelectionRequest' xrefstyle='select: title'/>
+and release the lock after calling
+<xref linkend='XtSendSelectionRequest' xrefstyle='select: title'/>
+to ensure that the thread assembling the request is safe from interference
+by another thread assembling a different request naming the same widget
+and selection.
+</para>
+
+<para>
+To relinquish the composition of a MULTIPLE request without sending it, use
+<xref linkend='XtCancelSelectionRequest' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtCancelSelectionRequest'>
+<funcprototype>
+<funcdef>void <function>XtCancelSelectionRequest</function></funcdef>
+   <paramdef>Widget <parameter>requestor</parameter></paramdef>
+   <paramdef>Atom <parameter>selection</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>requestor</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget making the request.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>selection</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the particular selection desired.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+When
+<xref linkend='XtCancelSelectionRequest' xrefstyle='select: title'/>
+is called, any requests queued since the last call to
+<xref linkend='XtCreateSelectionRequest' xrefstyle='select: title'/>
+for the same widget and selection are discarded
+and any resources reserved are released.
+A subsequent call to
+<xref linkend='XtSendSelectionRequest' xrefstyle='select: title'/>
+will not result in any request being made.
+Subsequent calls to
+<xref linkend='XtGetSelectionValue' xrefstyle='select: title'/>,
+<xref linkend='XtGetSelectionValues' xrefstyle='select: title'/>,
+<xref linkend='XtGetSelectionValueIncremental' xrefstyle='select: title'/>,
+or
+<xref linkend='XtGetSelectionValuesIncremental' xrefstyle='select: title'/>
+will not be deferred.
+</para>
+</sect2>
+
+<sect2 id="Auxiliary_Selection_Properties">
+<title>Auxiliary Selection Properties</title>
+<para>
+Certain uses of parameterized selections require clients to name
+other window properties within a selection parameter.  To permit
+reuse of temporary property names in these circumstances and
+thereby reduce the number of unique atoms created in the server,
+the Intrinsics provides two interfaces for acquiring temporary property names.
+</para>
+
+<para>
+To acquire a temporary property name atom for use in a selection
+request, the client may call
+<xref linkend='XtReservePropertyAtom' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtReservePropertyAtom'>
+<funcprototype>
+<funcdef>Atom <function>XtReservePropertyAtom</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget making a selection request.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtReservePropertyAtom' xrefstyle='select: title'/>
+returns an atom that may be used as a property name during selection
+requests involving the specified widget.
+As long as the atom remains reserved, it is unique with respect to all
+other reserved atoms for the widget.
+</para>
+
+<para>
+To return a temporary property name atom for reuse and to delete
+the property named by that atom, use
+<xref linkend='XtReleasePropertyAtom' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtReleasePropertyAtom'>
+<funcprototype>
+<funcdef>void <function>XtReleasePropertyAtom</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Atom <parameter>atom</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget used to reserve the property name atom.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>atom</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the property name atom returned by
+<xref linkend='XtReservePropertyAtom' xrefstyle='select: title'/>
+that is to be released for reuse.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtReleasePropertyAtom' xrefstyle='select: title'/>
+marks the specified property name atom as
+no longer in use and ensures that any property having that name
+on the specified widget's window is deleted.  If <emphasis remap='I'>atom</emphasis> does not
+specify a value returned by
+<xref linkend='XtReservePropertyAtom' xrefstyle='select: title'/>
+for the specified widget, the results are undefined.
+</para>
+</sect2>
+
+<sect2 id="Retrieving_the_Most_Recent_Timestamp">
+<title>Retrieving the Most Recent Timestamp</title>
+<para>
+To retrieve the timestamp from the most recent call to
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>
+that contained a timestamp, use
+<xref linkend='XtLastTimestampProcessed' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtLastTimestampProcessed'>
+<funcprototype>
+<funcdef>Time <function>XtLastTimestampProcessed</function></funcdef>
+   <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an open display connection.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If no
+<function>KeyPress</function>,
+<function>KeyRelease</function>,
+<function>ButtonPress</function>,
+<function>ButtonRelease</function>,
+<function>MotionNotify</function>,
+<function>EnterNotify</function>,
+<function>LeaveNotify</function>,
+<function>PropertyNotify</function>,
+or
+<function>SelectionClear</function>
+event has yet been passed to
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>
+for the specified display,
+<xref linkend='XtLastTimestampProcessed' xrefstyle='select: title'/>
+returns zero.
+</para>
+</sect2>
+
+<sect2 id="Retrieving_the_Most_Recent_Event">
+<title>Retrieving the Most Recent Event</title>
+<para>
+To retrieve the event from the most recent call to
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>
+for a specific display, use
+<xref linkend='XtLastEventProcessed' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtLastEventProcessed'>
+<funcprototype>
+<funcdef>XEvent *<function>XtLastEventProcessed</function></funcdef>
+   <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display connection from which to retrieve the event.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+Returns the last event passed to
+<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>
+for the specified display.  Returns NULL if there is no such event.
+The client must not modify the contents of the returned event.
+</para>
+</sect2>
+</sect1>
+
+<sect1 id="Merging_Exposure_Events_into_a_Region">
+<title>Merging Exposure Events into a Region</title>
+<para>
+The Intrinsics provide an
+<xref linkend='XtAddExposureToRegion' xrefstyle='select: title'/>
+utility function that merges
+<function>Expose</function>
+and
+<function>GraphicsExpose</function>
+events into a region for clients to process at once
+rather than processing individual rectangles.
+For further information about regions,
+see Manipulating Regions
+in 
+Xlib &mdash; C Language X Interface.
+</para>
+
+<para>
+To merge
+<function>Expose</function>
+and
+<function>GraphicsExpose</function>
+events into a region, use
+<xref linkend='XtAddExposureToRegion' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAddExposureToRegion'>
+<funcprototype>
+<funcdef>void <function>XtAddExposureToRegion</function></funcdef>
+   <paramdef>XEvent *<parameter>event</parameter></paramdef>
+   <paramdef>Region <parameter>region</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>event</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to the
+<function>Expose</function>
+or
+<function>GraphicsExpose</function>
+event.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>region</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the region object (as defined in
+<filename class="headerfile">&lt;X11/Xutil.h&gt;</filename>).
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtAddExposureToRegion' xrefstyle='select: title'/>
+function computes the union of the rectangle defined by the exposure
+event and the specified region.
+Then it stores the results back in <emphasis remap='I'>region</emphasis>.
+If the event argument is not an
+<function>Expose</function>
+or
+<function>GraphicsExpose</function>
+event,
+<xref linkend='XtAddExposureToRegion' xrefstyle='select: title'/>
+returns without an error and without modifying <emphasis remap='I'>region</emphasis>.
+</para>
+
+<para>
+This function is used by the exposure compression mechanism;
+see <xref linkend='Exposure_Compression' />
+</para>
+</sect1>
+
+<sect1 id="Translating_Widget_Coordinates">
+<title>Translating Widget Coordinates</title>
+<para>
+To translate an x-y coordinate pair from widget coordinates to root
+window absolute coordinates, use
+<xref linkend='XtTranslateCoords' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtTranslateCoords'>
+<funcprototype>
+<funcdef>void <function>XtTranslateCoords</function></funcdef>
+   <paramdef>Widget <parameter>w</parameter></paramdef>
+   <paramdef>Position <parameter>x</parameter></paramdef>
+   <paramdef>Position <parameter>y</parameter></paramdef>
+   <paramdef>Position *<parameter>rootx_return</parameter></paramdef>
+   <paramdef>Position *<parameter>rooty_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>w</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget.  Must be of class RectObj or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>x</emphasis>
+    </term>
+    <listitem>
+      <para></para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>y</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the widget-relative x and y coordinates.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>rootx_return</emphasis>
+    </term>
+    <listitem>
+      <para></para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>rooty_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Return the root-relative x and y coordinates.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+While
+<xref linkend='XtTranslateCoords' xrefstyle='select: title'/>
+is similar to the Xlib
+<function>XTranslateCoordinates</function>
+function, it does not generate a server request because all the required
+information already is in the widget's data structures.
+</para>
+</sect1>
+
+<sect1 id="Translating_a_Window_to_a_Widget">
+<title>Translating a Window to a Widget</title>
+<para>
+To translate a given window and display pointer into a widget instance, use
+<xref linkend='XtWindowToWidget' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtWindowToWidget'>
+<funcprototype>
+<funcdef>Widget <function>XtWindowToWidget</function></funcdef>
+   <paramdef>Display *<parameter>display</parameter></paramdef>
+   <paramdef>Window <parameter>window</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display on which the window is defined.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>window</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the drawable for which you want the widget.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If there is a realized widget whose window is the specified drawable on
+the specified <emphasis remap='I'>display</emphasis>,
+<xref linkend='XtWindowToWidget' xrefstyle='select: title'/>
+returns that widget.
+If not and if the drawable has been associated with a widget through
+<xref linkend='XtRegisterDrawable' xrefstyle='select: title'/>,
+<xref linkend='XtWindowToWidget' xrefstyle='select: title'/>
+returns the widget associated with the drawable.  In other cases it
+returns NULL.
+</para>
+</sect1>
+
+<sect1 id="Handling_Errors">
+<title>Handling Errors</title>
+<para>
+The Intrinsics allow a client to register procedures that are called
+whenever a fatal or nonfatal error occurs.
+These facilities are intended for both error reporting and logging
+and for error correction or recovery.
+</para>
+
+<para>
+Two levels of interface are provided:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+A high-level interface that takes an error
+name and class and retrieves the error message text from
+an error resource database.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A low-level interface that takes a simple string to display.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+The high-level functions construct a string to pass to the lower-level
+interface.
+The strings may be specified in application code and are
+overridden by the contents of an external systemwide file,
+the &ldquo;error database file&rdquo;.  The location and name of this file are
+implementation-dependent.
+</para>
+<note>
+<para>
+The application-context-specific error handling is not
+implemented on many systems, although the interfaces are
+always present.
+Most implementations will have just one set of error handlers
+for all application contexts within a process.
+If they are set for different application contexts,
+the ones registered last will prevail.
+</para>
+</note>
+
+<para>
+To obtain the error database (for example, to merge with
+an application- or widget-specific database), use
+<xref linkend='XtAppGetErrorDatabase' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppGetErrorDatabase'>
+<funcprototype> <funcdef>XrmDatabase *<function>XtAppGetErrorDatabase</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtAppGetErrorDatabase' xrefstyle='select: title'/>
+function returns the address of the error database.
+The Intrinsics do a lazy binding of the error database and do not merge in the
+database file until the first call to
+<xref linkend='XtAppGetErrorDatabaseText' xrefstyle='select: title'/>.
+</para>
+
+<para>
+For a complete listing of all errors and warnings
+that can be generated by the Intrinsics, see <xref linkend='Intrinsics_Error_Messages' />
+</para>
+
+<para>
+The high-level error and warning handler procedure pointers are of type
+<xref linkend='XtErrorMsgHandler' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtErrorMsgHandler'>
+<funcprototype>
+<funcdef>typedef void <function>(*XtErrorMsgHandler)</function></funcdef>
+   <paramdef>String <parameter>name</parameter></paramdef>
+   <paramdef>String <parameter>type</parameter></paramdef>
+   <paramdef>String <parameter>class</parameter></paramdef>
+   <paramdef>String <parameter>defaultp</parameter></paramdef>
+   <paramdef>String *<parameter>params</parameter></paramdef>
+   <paramdef>Cardinal *<parameter>num_params</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the name to be concatenated with the specified type to form
+the resource name of the error message.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the type to be concatenated with the name to form the
+resource name of the error message.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the resource class of the error message.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>defaultp</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the default message to use if no error database entry is found.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>params</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to a list of parameters to be substituted in the message.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_params</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in <emphasis remap='I'>params</emphasis>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The specified name can be a general kind of error,
+like &ldquo;invalidParameters&rdquo; or &ldquo;invalidWindow&rdquo;,
+and the specified type gives extra information
+such as the name of the routine in which the error was detected.
+Standard
+<function>printf</function>
+notation is used to substitute the parameters into the message.
+</para>
+
+<para>
+An error message handler can obtain the error database text for an
+error or a warning by calling
+<xref linkend='XtAppGetErrorDatabaseText' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppGetErrorDatabaseText'>
+<funcprototype>
+<funcdef>void <function>XtAppGetErrorDatabaseText</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+   <paramdef>const char * <parameter>name</parameter></paramdef>
+   <paramdef>const char * <parameter>type</parameter></paramdef>
+   <paramdef>const char * <parameter>class</parameter></paramdef>
+   <paramdef>const char * <parameter>default</parameter></paramdef>
+   <paramdef>char * <parameter>buffer_return</parameter></paramdef>
+   <paramdef>int <parameter>nbytes</parameter></paramdef>
+   <paramdef>XrmDatabase <parameter>database</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>name</emphasis>
+    </term>
+    <term>
+      <emphasis remap='I'>type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify the name and type concatenated to form the resource name
+of the error message.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the resource class of the error message.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>default</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the default message to use if an error database entry is not found.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>buffer_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the buffer into which the error message is to be returned.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>nbytes</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the size of the buffer in bytes.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>database</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the name of the alternative database to be used,
+or NULL if the application context's error database is to be used.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XtAppGetErrorDatabaseText' xrefstyle='select: title'/>
+returns the appropriate message from the error database
+or returns the specified default message if one is not found in the
+error database.
+To form the full resource name and class when querying the database,
+the <emphasis remap='I'>name</emphasis> and <emphasis remap='I'>type</emphasis> are concatenated with a single &ldquo;.&rdquo;
+between them and the <emphasis remap='I'>class</emphasis> is concatenated with itself with a
+single &ldquo;.&rdquo; if it does not already contain a &ldquo;.&rdquo;.
+</para>
+
+<para>
+To return the application name and class as passed to
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>
+for a particular Display, use
+<xref linkend='XtGetApplicationNameAndClass' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtGetApplicationNameAndClass'>
+<funcprototype>
+<funcdef>void <function>XtGetApplicationNameAndClass</function></funcdef>
+    <paramdef>Display* <parameter>display</parameter></paramdef>
+    <paramdef>String* <parameter>name_return</parameter></paramdef>
+    <paramdef>String* <parameter>class_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies an open display connection that has been initialized with
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>name_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the application name.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>class_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the application class.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtGetApplicationNameAndClass' xrefstyle='select: title'/>
+returns the application name and class passed to
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>
+for the specified display.  If the display was
+never initialized or has been closed, the result is undefined.  The
+returned strings are owned by the Intrinsics and must not be modified
+or freed by the caller.
+</para>
+
+<para>
+To register a procedure to be called on fatal error conditions, use
+<xref linkend='XtAppSetErrorMsgHandler' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppSetErrorMsgHandler'>
+<funcprototype>
+<funcdef>XtErrorMsgHandler <function>XtAppSetErrorMsgHandler</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+   <paramdef>XtErrorMsgHandler <parameter>msg_handler</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>msg_handler</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the new fatal error procedure, which should not return.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtAppSetErrorMsgHandler' xrefstyle='select: title'/>
+returns a pointer to the previously
+installed high-level fatal error handler.
+The default high-level fatal error handler provided by the Intrinsics is named
+<function>_XtDefaultErrorMsg</function>
+and constructs a string from the error resource database and calls
+<xref linkend='XtError' xrefstyle='select: title'/>.
+Fatal error message handlers should not return.
+If one does,
+subsequent Intrinsics behavior is undefined.
+</para>
+
+<para>
+To call the high-level error handler, use
+<xref linkend='XtAppErrorMsg' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppErrorMsg'>
+<funcprototype>
+<funcdef>void <function>XtAppErrorMsg</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+   <paramdef>const char * <parameter>name</parameter></paramdef>
+   <paramdef>const char * <parameter>type</parameter></paramdef>
+   <paramdef>const char * <parameter>class</parameter></paramdef>
+   <paramdef>const char * <parameter>default</parameter></paramdef>
+   <paramdef>String * <parameter>params</parameter></paramdef>
+   <paramdef>Cardinal * <parameter>num_params</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the general kind of error.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the detailed name of the error.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the resource class.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>default</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the default message to use if an error database entry is not found.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>params</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to a list of values to be stored in the message.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_params</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in <emphasis remap='I'>params</emphasis>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The Intrinsics internal errors all have class
+&ldquo;XtToolkitError&rdquo;.
+</para>
+
+<para>
+To register a procedure to be called on nonfatal error conditions, use
+<xref linkend='XtAppSetWarningMsgHandler' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppSetWarningMsgHandler'>
+<funcprototype>
+<funcdef>XtErrorMsgHandler <function>XtAppSetWarningMsgHandler</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+   <paramdef>XtErrorMsgHandler <parameter>msg_handler</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>msg_handler</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the new nonfatal error procedure, which usually returns.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtAppSetWarningMsgHandler' xrefstyle='select: title'/>
+returns a pointer to the previously
+installed high-level warning handler.
+The default high-level warning handler provided by the Intrinsics is named
+<function>_XtDefaultWarningMsg</function>
+and constructs a string
+from the error resource database and calls
+<xref linkend='XtWarning' xrefstyle='select: title'/>.
+</para>
+
+<para>
+To call the installed high-level warning handler, use
+<xref linkend='XtAppWarningMsg' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppWarningMsg'>
+<funcprototype>
+<funcdef>void <function>XtAppWarningMsg</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+   <paramdef>const char * <parameter>name</parameter></paramdef>
+   <paramdef>const char * <parameter>type</parameter></paramdef>
+   <paramdef>const char * <parameter>class</parameter></paramdef>
+   <paramdef>const char * <parameter>default</parameter></paramdef>
+   <paramdef>String * <parameter>params</parameter></paramdef>
+   <paramdef>Cardinal * <parameter>num_params</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>name</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the general kind of error.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>type</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the detailed name of the error.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>class</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the resource class.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>default</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the default message to use if an error database entry is not found.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>params</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a pointer to a list of values to be stored in the message.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_params</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in <emphasis remap='I'>params</emphasis>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The Intrinsics internal warnings all have class
+&ldquo;XtToolkitError&rdquo;.
+</para>
+
+<para>
+The low-level error and warning handler procedure pointers are of type
+<xref linkend='XtErrorHandler' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtErrorHandler'>
+<funcprototype>
+<funcdef>typedef void <function>(*XtErrorHandler)</function></funcdef>
+   <paramdef>String <parameter>message</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>message</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the error message.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The error handler should display the message string in some appropriate fashion.
+</para>
+
+<para>
+To register a procedure to be called on fatal error conditions, use
+<xref linkend='XtAppSetErrorHandler' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppSetErrorHandler'>
+<funcprototype>
+<funcdef>XtErrorHandler <function>XtAppSetErrorHandler</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+   <paramdef>XtErrorHandler <parameter>handler</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>handler</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the new fatal error procedure, which should not return.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtAppSetErrorHandler' xrefstyle='select: title'/>
+returns a pointer to the previously installed
+low-level fatal error handler.
+The default low-level error handler provided by the Intrinsics is
+<function>_XtDefaultError</function>.
+On POSIX-based systems,
+it prints the message to standard error and terminates the application.
+Fatal error message handlers should not return.
+If one does,
+subsequent Intrinsics behavior is undefined.
+</para>
+
+<para>
+To call the installed fatal error procedure, use
+<xref linkend='XtAppError' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppError'>
+<funcprototype>
+<funcdef>void <function>XtAppError</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+   <paramdef>const char * <parameter>message</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>message</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the message to be reported.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+Most programs should use
+<xref linkend='XtAppErrorMsg' xrefstyle='select: title'/>,
+not
+<xref linkend='XtAppError' xrefstyle='select: title'/>,
+to provide for customization and internationalization of error messages.
+</para>
+
+<para>
+To register a procedure to be called on nonfatal error conditions, use
+<xref linkend='XtAppSetWarningHandler' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppSetWarningHandler'>
+<funcprototype>
+<funcdef>XtErrorHandler <function>XtAppSetWarningHandler</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+   <paramdef>XtErrorHandler <parameter>handler</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>handler</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the new nonfatal error procedure, which usually returns.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtAppSetWarningHandler' xrefstyle='select: title'/>
+returns a pointer to the previously installed
+low-level warning handler.
+The default low-level warning handler provided by the Intrinsics is
+<function>_XtDefaultWarning</function>.
+On POSIX-based systems,
+it prints the message to standard error and returns to the caller.
+</para>
+
+<para>
+To call the installed nonfatal error procedure, use
+<xref linkend='XtAppWarning' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtAppWarning'>
+<funcprototype>
+<funcdef>void <function>XtAppWarning</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+   <paramdef>const char * <parameter>message</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>message</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the nonfatal error message to be reported.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+Most programs should use
+<xref linkend='XtAppWarningMsg' xrefstyle='select: title'/>,
+not
+<xref linkend='XtAppWarning' xrefstyle='select: title'/>,
+to provide for customization and internationalization of warning messages.
+</para>
+</sect1>
+
+<sect1 id="Setting_WM_COLORMAP_WINDOWS">
+<title>Setting WM_COLORMAP_WINDOWS</title>
+<para>
+A client may set the value of the <emphasis role='strong'>WM_COLORMAP_WINDOWS</emphasis>
+property on a widget's window by calling
+<xref linkend='XtSetWMColormapWindows' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtSetWMColormapWindows'>
+<funcprototype>
+<funcdef>void <function>XtSetWMColormapWindows</function></funcdef>
+   <paramdef>Widget <parameter>widget</parameter></paramdef>
+   <paramdef>Widget* <parameter>list</parameter></paramdef>
+   <paramdef>Cardinal <parameter>count</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>widget</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the widget on whose window the <emphasis role='strong'>WM_COLORMAP_WINDOWS</emphasis>
+property is stored.  Must be of class Core or any subclass thereof.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>list</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a list of widgets whose windows are potentially to be
+listed in the <emphasis role='strong'>WM_COLORMAP_WINDOWS</emphasis> property.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>count</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of widgets in <emphasis remap='I'>list</emphasis>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtSetWMColormapWindows' xrefstyle='select: title'/>
+returns immediately if <emphasis remap='I'>widget</emphasis> is not realized or if <emphasis remap='I'>count</emphasis> is 0.
+Otherwise,
+<xref linkend='XtSetWMColormapWindows' xrefstyle='select: title'/>
+constructs an ordered list of windows
+by examining each widget in <emphasis remap='I'>list</emphasis> in turn and
+ignoring the widget if it is not realized, or
+adding the widget's window to the window list if the widget is realized
+and if its colormap resource is different from the colormap
+resources of all widgets whose windows are already on the window list.
+</para>
+
+<para>
+Finally,
+<xref linkend='XtSetWMColormapWindows' xrefstyle='select: title'/>
+stores the resulting window list in the <emphasis role='strong'>WM_COLORMAP_WINDOWS</emphasis>
+property on the specified widget's window.
+Refer to Section 4.1.8 in the <emphasis remap='I'>Inter-Client Communication Conventions Manual</emphasis> for details of
+the semantics of the <emphasis role='strong'>WM_COLORMAP_WINDOWS</emphasis> property.
+</para>
+</sect1>
+<!--    FIXME: -->
+<sect1 id="Finding_File_Names">
+<title>Finding File Names</title>
+<para>
+The Intrinsics provide procedures to look for a file by name, allowing
+string substitutions in a list of file specifications.  Two
+routines are provided for this:
+<xref linkend='XtFindFile' xrefstyle='select: title'/>
+and
+<xref linkend='XtResolvePathname' xrefstyle='select: title'/>.
+<xref linkend='XtFindFile' xrefstyle='select: title'/>
+uses an arbitrary set of client-specified substitutions, and
+<xref linkend='XtResolvePathname' xrefstyle='select: title'/>
+uses a set of standard substitutions corresponding
+to the <emphasis remap='I'>X/Open Portability Guide</emphasis> language localization conventions.
+Most applications should use
+<xref linkend='XtResolvePathname' xrefstyle='select: title'/>.
+</para>
+
+<para>
+A string substitution is defined by a list of
+<function>Substitution</function>
+entries.
+</para>
+<programlisting>
+typedef struct {
+        char    match;
+        String  substitution;
+} SubstitutionRec, *Substitution;
+</programlisting>
+<para>
+File name evaluation is handled in an operating-system-dependent
+fashion by an
+<xref linkend='XtFilePredicate' xrefstyle='select: title'/>
+procedure.
+</para>
+
+<funcsynopsis id='XtFilePredicate'>
+<funcprototype>
+<funcdef>typedef Boolean <function>(*XtFilePredicate)</function></funcdef>
+   <paramdef>String <parameter>filename</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>filename</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a potential filename.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+A file predicate procedure is called with a string that is
+potentially a file name.  It should return
+<function>True</function>
+if this string specifies a file that is appropriate for the intended use and
+<function>False</function>
+otherwise.
+</para>
+
+<para>
+To search for a file using substitutions in a path list, use
+<xref linkend='XtFindFile' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtFindFile'>
+<funcprototype>
+<funcdef>char * <function>XtFindFile</function></funcdef>
+   <paramdef>const char * <parameter>path</parameter></paramdef>
+   <paramdef>Substitution <parameter>substitutions</parameter></paramdef>
+   <paramdef>Cardinal <parameter>num_substitutions</parameter></paramdef>
+   <paramdef>XtFilePredicate <parameter>predicate</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>path</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a path of file names, including substitution characters.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>substitutions</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a list of substitutions to make into the path.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_substitutions</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of substitutions passed in.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>predicate</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a procedure called to judge each potential file name, or NULL.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The <emphasis remap='I'>path</emphasis> parameter specifies a string that consists of a series of
+potential file names delimited by colons.  Within each name, the
+percent character specifies a string substitution selected by the
+following character.  The character sequence &ldquo;%:&rdquo; specifies an
+embedded colon that is not a delimiter; the sequence is replaced by a
+single colon.  The character sequence &ldquo;%%&rdquo; specifies a percent
+character that does not introduce a substitution; the sequence is
+replaced by a single percent character.  If a percent character is
+followed by any other character,
+<xref linkend='XtFindFile' xrefstyle='select: title'/>
+looks through the
+specified <emphasis remap='I'>substitutions</emphasis> for that character in the <emphasis remap='I'>match</emphasis> field
+and, if found,
+replaces the percent and match characters with the string in the
+corresponding <emphasis remap='I'>substitution</emphasis> field.  A <emphasis remap='I'>substitution</emphasis> field entry of NULL
+is equivalent to a pointer to an empty string.  If the operating
+system does not interpret multiple embedded name separators in the
+path (i.e., &ldquo;/&rdquo; in POSIX) the same way as a single separator,
+<xref linkend='XtFindFile' xrefstyle='select: title'/>
+will collapse multiple separators into a single one after performing
+all string substitutions.  Except for collapsing embedded separators,
+the contents of the string substitutions are not interpreted by
+<xref linkend='XtFindFile' xrefstyle='select: title'/>
+and may therefore contain any operating-system-dependent
+characters, including additional name separators.  Each resulting
+string is passed to the predicate procedure until a string is found for
+which the procedure returns
+<function>True</function>;
+this string is the return value for
+<xref linkend='XtFindFile' xrefstyle='select: title'/>.
+If no string yields a
+<function>True</function>
+return from the predicate,
+<xref linkend='XtFindFile' xrefstyle='select: title'/>
+returns NULL.
+</para>
+
+<para>
+If the <emphasis remap='I'>predicate</emphasis> parameter is NULL, an internal procedure that checks
+if the file exists, is readable, and is not a directory is used.
+</para>
+
+<para>
+It is the responsibility of the caller to free the returned string using
+<xref linkend='XtFree' xrefstyle='select: title'/>
+when it is no longer needed.
+</para>
+
+<para>
+To search for a file using standard substitutions in a path list, use
+<xref linkend='XtResolvePathname' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtResolvePathname'>
+<funcprototype>
+<funcdef>char * <function>XtResolvePathname</function></funcdef>
+   <paramdef>Display *<parameter>display</parameter></paramdef>
+   <paramdef>const char * <parameter>type</parameter></paramdef>
+   <paramdef>const char * <parameter>filename</parameter></paramdef>
+   <paramdef>const char * <parameter>suffix</parameter></paramdef>
+   <paramdef>const char * <parameter>path</parameter></paramdef>
+   <paramdef>Substitution <parameter>substitutions</parameter></paramdef>
+   <paramdef>Cardinal <parameter>num_substitutions</parameter></paramdef>
+   <paramdef>XtFilePredicate <parameter>predicate</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the display to use to find the language for language substitutions.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>type</emphasis>
+    </term>
+    <listitem>
+      <para></para>
+
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>filename</emphasis>
+    </term>
+    <listitem>
+      <para></para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>suffix</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specify values to substitute into the path.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>path</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the list of file specifications, or NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>substitutions</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a list of additional substitutions to make into the path, or NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_substitutions</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of entries in <emphasis remap='I'>substitutions</emphasis>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>predicate</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies a procedure called to judge each potential file name, or NULL.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The substitutions specified by
+<xref linkend='XtResolvePathname' xrefstyle='select: title'/>
+are determined from the value of the language string retrieved by
+<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>
+for the specified display.
+To set the
+language for all applications specify &ldquo;*xnlLanguage: <emphasis remap='I'>lang</emphasis>&rdquo; in the
+resource database.
+The format and content of the language string are
+implementation-defined.   One suggested syntax is to compose
+the language string of three parts;  a  &ldquo;language  part&rdquo;,  a
+&ldquo;territory  part&rdquo; and a &ldquo;codeset part&rdquo;.  The manner in which
+this composition is accomplished is implementation-defined,
+and the Intrinsics make no interpretation of the parts other
+than to use them in substitutions as described below.
+</para>
+
+
+<para>
+<xref linkend='XtResolvePathname' xrefstyle='select: title'/>
+calls
+<xref linkend='XtFindFile' xrefstyle='select: title'/>
+with the following substitutions
+in addition to any passed by the caller and returns the value returned by
+<xref linkend='XtFindFile' xrefstyle='select: title'/>:
+</para>
+<!-- PROBLEM BELOW HERE -->
+
+
+<variablelist>
+  <varlistentry>
+    <term>
+%N
+    </term>
+    <listitem>
+      <para>
+The value of the <emphasis remap='I'>filename</emphasis> parameter, or the application's
+class name if <emphasis remap='I'>filename</emphasis> is NULL.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+%T
+    </term>
+    <listitem>
+      <para>
+The value of the <emphasis remap='I'>type</emphasis> parameter.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+%S
+    </term>
+    <listitem>
+      <para>
+The value of the <emphasis remap='I'>suffix</emphasis> parameter.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+%L
+    </term>
+    <listitem>
+      <para>
+The language string associated with the specified display.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+%l
+    </term>
+    <listitem>
+      <para>
+The language part of the display's language string.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+%t
+    </term>
+    <listitem>
+      <para>
+The territory part of the display's language string.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+%c
+    </term>
+    <listitem>
+      <para>
+The codeset part of the display's language string.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+%C
+    </term>
+    <listitem>
+      <para>
+The customization string retrieved from the resource
+database associated with <emphasis remap='I'>display</emphasis>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+%D
+    </term>
+    <listitem>
+      <para>
+The value of the implementation-specific default path.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<!-- PROBLEM ABOVE HERE -->
+<para>
+If a path is passed to
+<xref linkend='XtResolvePathname' xrefstyle='select: title'/>,
+it is passed along to
+<xref linkend='XtFindFile' xrefstyle='select: title'/>.
+If the <emphasis remap='I'>path</emphasis> argument is NULL, the value of the
+<emphasis role='strong'>XFILESEARCHPATH</emphasis>
+environment variable is passed to
+<xref linkend='XtFindFile' xrefstyle='select: title'/>.
+If <emphasis role='strong'>XFILESEARCHPATH</emphasis>
+is not defined, an implementation-specific default path is used
+that contains at least six entries.  These entries
+must contain the following substitutions:
+</para>
+
+
+<!-- OK PAST HERE -->
+
+<programlisting>
+1.     %C, %N, %S, %T, %L   or   %C, %N, %S, %T, %l, %t, %c
+2.     %C, %N, %S, %T, %l
+3.     %C, %N, %S, %T
+4.     %N, %S, %T, %L       or   %N, %S, %T, %l, %t, %c
+5.     %N, %S, %T, %l
+6.     %N, %S, %T
+</programlisting>
+
+<para>
+The order of these six entries within the path must be as given above.
+The order and use of substitutions within a given entry
+are implementation-dependent.
+If the path begins
+with a colon, it is preceded by %N%S.  If the path includes two
+adjacent colons, <function>%N%S</function> is inserted between them.
+</para>
+
+<para>
+The <emphasis remap='I'>type</emphasis> parameter is intended to be a category of files, usually
+being translated into a directory in the pathname.  Possible values
+might include &ldquo;app-defaults&rdquo;, &ldquo;help&rdquo;, and &ldquo;bitmap&rdquo;.
+</para>
+
+<para>
+The <emphasis remap='I'>suffix</emphasis> parameter is intended to be appended to the file name.
+Possible values might include &ldquo;.txt&rdquo;, &ldquo;.dat&rdquo;, and &ldquo;.bm&rdquo;.
+</para>
+
+<para>
+A suggested value for the default path on POSIX-based systems is
+</para>
+<programlisting>
+   /usr/lib/X11/%L/%T/%N%C%S:/usr/lib/X11/%l/%T/%N%C%S:\
+   /usr/lib/X11/%T/%N%C%S:/usr/lib/X11/%L/%T/%N%S:\
+   /usr/lib/X11/%l/%T/%N%S:/usr/lib/X11/%T/%N%S
+</programlisting>
+
+
+<para>
+Using this example, if the user has specified a language, it is
+used as a subdirectory of /usr/lib/X11 that is searched for other
+files.  If the desired file is not found there, the lookup is
+tried again using just the language part of the specification.  If the
+file is not there, it is looked for in /usr/lib/X11.  The <emphasis remap='I'>type</emphasis>
+parameter is used as a subdirectory of the language directory or of
+/usr/lib/X11, and <emphasis remap='I'>suffix</emphasis> is appended to the file name.
+</para>
+
+<para>
+The %D substitution allows the addition of path
+elements to the implementation-specific default path, typically to
+allow additional directories to be searched without preventing
+resources in the system directories from being found.  For example, a
+user installing resource files under a directory called &ldquo;ourdir&rdquo;
+might set
+<emphasis role='strong'>XFILESEARCHPATH</emphasis>
+to
+</para>
+<programlisting>
+   %D:ourdir/%T/%N%C:ourdir/%T/%N
+</programlisting>
+
+<para>
+The customization string is obtained by querying the resource database
+currently associated with the display (the database returned by
+<function>XrmGetDatabase</function>)
+for the resource <emphasis remap='I'>application_name</emphasis>.customization, class
+<emphasis remap='I'>application_class</emphasis>.Customization, where <emphasis remap='I'>application_name</emphasis>
+and <emphasis remap='I'>application_class</emphasis> are the values returned by
+<xref linkend='XtGetApplicationNameAndClass' xrefstyle='select: title'/>.
+If no value is specified in the database, the empty string is used.
+</para>
+
+<para>
+It is the responsibility of the caller to free the returned string using
+<xref linkend='XtFree' xrefstyle='select: title'/>
+when it is no longer needed.
+</para>
+
+
+</sect1>
+<!-- END OF FIXME -->
+<sect1 id="Hooks_for_External_Agents">
+<title>Hooks for External Agents</title>
+<para>
+Applications may register
+functions that are called at a particular control points in the Intrinsics.
+These functions are intended to be used to provide notification
+of an &ldquo;X Toolkit event&rdquo;, such as widget creation, to an external agent,
+such as an interactive resource editor, drag-and-drop server, or
+an aid for physically challenged users.
+The control points containing such registration hooks are identified
+in a &ldquo;hook registration&rdquo; object.
+</para>
+
+<para>
+To retrieve the hook registration widget, use
+<xref linkend='XtHooksOfDisplay' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtHooksOfDisplay'>
+<funcprototype>
+<funcdef>Widget <function>XtHooksOfDisplay</function></funcdef>
+   <paramdef>Display *<parameter>display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the desired display.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The class of this object is a private, implementation-dependent
+subclass of
+<function>Object</function>.
+The hook object has no parent.  The resources of this object are
+the callback lists for hooks and the read-only resources for getting
+a list of parentless shells.  All of the callback lists are initially
+empty.  When a display is closed, the hook object associated with it
+is destroyed.
+</para>
+
+<para>
+The following procedures can be called with the hook registration object
+as an argument:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+<xref linkend='XtAddCallback' xrefstyle='select: title'/>,
+<xref linkend='XtAddCallbacks' xrefstyle='select: title'/>,
+<xref linkend='XtRemoveCallback' xrefstyle='select: title'/>,
+<xref linkend='XtRemoveCallbacks' xrefstyle='select: title'/>,
+<xref linkend='XtRemoveAllCallbacks' xrefstyle='select: title'/>,
+<xref linkend='XtCallCallbacks' xrefstyle='select: title'/>,
+<xref linkend='XtHasCallbacks' xrefstyle='select: title'/>,
+<xref linkend='XtCallCallbackList' xrefstyle='select: title'/>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XtClass' xrefstyle='select: title'/>,
+<function>XtSuperclass</function>,
+<xref linkend='XtIsSubclass' xrefstyle='select: title'/>,
+<xref linkend='XtCheckSubclass' xrefstyle='select: title'/>,
+<function>XtIsObject</function>,
+<function>XtIsRectObj</function>,
+<function>XtIsWidget</function>,
+<function>XtIsComposite</function>,
+<function>XtIsConstraint</function>,
+<function>XtIsShell</function>,
+<function>XtIsOverrideShell</function>,
+<function>XtIsWMShell</function>,
+<function>XtIsVendorShell</function>,
+<function>XtIsTransientShell</function>,
+<function>XtIsTopLevelShell</function>,
+<function>XtIsApplicationShell</function>,
+<function>XtIsSessionShell</function>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XtWidgetToApplicationContext' xrefstyle='select: title'/>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XtName' xrefstyle='select: title'/>,
+<function>XtParent</function>,
+<xref linkend='XtDisplayOfObject' xrefstyle='select: title'/>,
+<xref linkend='XtScreenOfObject' xrefstyle='select: title'/>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XtSetValues' xrefstyle='select: title'/>,
+<xref linkend='XtGetValues' xrefstyle='select: title'/>,
+<xref linkend='XtVaSetValues' xrefstyle='select: title'/>,
+<xref linkend='XtVaGetValues' xrefstyle='select: title'/>
+    </para>
+  </listitem>
+</itemizedlist>
+
+<sect2 id="Hook_Object_Resources">
+<title>Hook Object Resources</title>
+<para>
+The resource names, classes, and representation types that are specified
+in the hook object resource list are:
+<informaltable frame='topbot'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+  <colspec colwidth='1.0*' colname='c1'/>
+  <colspec colwidth='1.0*' colname='c2'/>
+  <colspec colwidth='1.0*' colname='c3'/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Name</entry>
+      <entry>Class</entry>
+      <entry>Representation</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>XtNcreateHook</entry>
+      <entry>XtCCallback</entry>
+      <entry>XtRCallback</entry>
+    </row>
+    <row>
+      <entry>XtNchangeHook</entry>
+      <entry>XtCCallback</entry>
+      <entry>XtRCallback</entry>
+    </row>
+    <row>
+      <entry>XtNconfigureHook</entry>
+      <entry>XtCCallback</entry>
+      <entry>XtRCallback</entry>
+    </row>
+    <row>
+      <entry>XtNgeometryHook</entry>
+      <entry>XtCCallback</entry>
+      <entry>XtRCallback</entry>
+    </row>
+    <row>
+      <entry>XtNdestroyHook</entry>
+      <entry>XtCCallback</entry>
+      <entry>XtRCallback</entry>
+    </row>
+    <row>
+      <entry>XtNshells</entry>
+      <entry>XtCReadOnly</entry>
+      <entry>XtRWidgetList</entry>
+    </row>
+    <row>
+      <entry>XtNnumShells</entry>
+      <entry>XtCReadOnly</entry>
+      <entry>XtRCardinal</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+</para>
+
+<para>
+Descriptions of each of these resources:
+</para>
+
+<para>
+The XtNcreateHook callback list is called from:
+<xref linkend='XtCreateWidget' xrefstyle='select: title'/>,
+<xref linkend='XtCreateManagedWidget' xrefstyle='select: title'/>,
+<xref linkend='XtCreatePopupShell' xrefstyle='select: title'/>,
+<xref linkend='XtAppCreateShell' xrefstyle='select: title'/>,
+and their corresponding varargs versions.
+</para>
+
+<para>
+The <emphasis remap='I'>call_data</emphasis> parameter in a createHook callback may be
+cast to type
+<function>XtCreateHookData</function>.
+</para>
+<programlisting>
+typedef struct {
+        String   type;
+        Widget   widget;
+        ArgList  args;
+        Cardinal num_args;
+} XtCreateHookDataRec, *XtCreateHookData;
+</programlisting>
+<para>
+The <emphasis remap='I'>type</emphasis> is set to
+<function>XtHcreate</function>,
+<emphasis remap='I'>widget</emphasis> is the newly created widget, and <emphasis remap='I'>args</emphasis> and <emphasis remap='I'>num_args</emphasis>
+are the arguments passed to the create function. The callbacks are
+called before returning from the create function.
+</para>
+
+<para>
+The XtNchangeHook callback list is called from:
+</para>
+<itemizedlist spacing='compact'>
+  <listitem>
+    <para>
+<xref linkend='XtSetValues' xrefstyle='select: title'/>,
+<xref linkend='XtVaSetValues' xrefstyle='select: title'/>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XtManageChild' xrefstyle='select: title'/>,
+<xref linkend='XtManageChildren' xrefstyle='select: title'/>,
+<xref linkend='XtUnmanageChild' xrefstyle='select: title'/>,
+<xref linkend='XtUnmanageChildren' xrefstyle='select: title'/>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XtRealizeWidget' xrefstyle='select: title'/>,
+<xref linkend='XtUnrealizeWidget' xrefstyle='select: title'/>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XtAddCallback' xrefstyle='select: title'/>,
+<xref linkend='XtRemoveCallback' xrefstyle='select: title'/>,
+<function>XtAddCallbacks,</function>
+<xref linkend='XtRemoveCallbacks' xrefstyle='select: title'/>,
+<xref linkend='XtRemoveAllCallbacks' xrefstyle='select: title'/>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XtAugmentTranslations' xrefstyle='select: title'/>,
+<xref linkend='XtOverrideTranslations' xrefstyle='select: title'/>,
+<xref linkend='XtUninstallTranslations' xrefstyle='select: title'/>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XtSetKeyboardFocus' xrefstyle='select: title'/>,
+<xref linkend='XtSetWMColormapWindows' xrefstyle='select: title'/>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XtSetMappedWhenManaged' xrefstyle='select: title'/>,
+<xref linkend='XtMapWidget' xrefstyle='select: title'/>,
+<xref linkend='XtUnmapWidget' xrefstyle='select: title'/>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XtPopup' xrefstyle='select: title'/>,
+<xref linkend='XtPopupSpringLoaded' xrefstyle='select: title'/>,
+<xref linkend='XtPopdown' xrefstyle='select: title'/>
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+The <emphasis remap='I'>call_data</emphasis> parameter in a changeHook callback may
+be cast to type
+<function>XtChangeHookData</function>.
+</para>
+<programlisting>
+typedef struct {
+        String          type;
+        Widget          widget;
+        XtPointer       event_data;
+        Cardinal        num_event_data;
+} XtChangeHookDataRec, *XtChangeHookData;
+</programlisting>
+<para>
+When the changeHook callbacks are called as a result of a call to
+<xref linkend='XtSetValues' xrefstyle='select: title'/>
+or
+<xref linkend='XtVaSetValues' xrefstyle='select: title'/>,
+<emphasis remap='I'>type</emphasis> is set to
+<function>XtHsetValues</function>,
+<emphasis remap='I'>widget</emphasis> is the new widget passed to the set_values procedure, and
+<emphasis remap='I'>event_data</emphasis> may be cast to type
+<function>XtChangeHookSetValuesData</function>.
+</para>
+<programlisting>
+typedef struct {
+        Widget          old, req;
+        ArgList         args;
+        Cardinal        num_args;
+} XtChangeHookSetValuesDataRec, *XtChangeHookSetValuesData;
+</programlisting>
+<para>
+The <emphasis remap='I'>old</emphasis>, <emphasis remap='I'>req</emphasis>, <emphasis remap='I'>args</emphasis>, and <emphasis remap='I'>num_args</emphasis> are the
+parameters passed to the set_values procedure.  The callbacks are called
+after the set_values and constraint set_values procedures have been called.
+</para>
+
+<para>
+When the changeHook callbacks are called as a result of a call to
+<xref linkend='XtManageChild' xrefstyle='select: title'/>
+or
+<xref linkend='XtManageChildren' xrefstyle='select: title'/>,
+<emphasis remap='I'>type</emphasis> is set to
+<function>XtHmanageChildren</function>,
+<emphasis remap='I'>widget</emphasis> is the parent, <emphasis remap='I'>event_data</emphasis> may be cast to type
+WidgetList and is the list of children being managed, and
+<emphasis remap='I'>num_event_data</emphasis> is the length of the widget list.
+The callbacks are called after the children have been managed.
+</para>
+
+<para>
+When the changeHook callbacks are called as a result of a call to
+<xref linkend='XtUnmanageChild' xrefstyle='select: title'/>
+or
+<xref linkend='XtUnmanageChildren' xrefstyle='select: title'/>,
+<emphasis remap='I'>type</emphasis> is set to
+<function>XtHunmanageChildren</function>,
+<emphasis remap='I'>widget</emphasis> is the parent, <emphasis remap='I'>event_data</emphasis> may be cast to type
+WidgetList and is a list of the children being unmanaged, and
+<emphasis remap='I'>num_event_data</emphasis> is the length of the widget list.
+The callbacks are called after the children have been unmanaged.
+</para>
+
+<para>
+The changeHook callbacks are called twice as a result of a call to
+<xref linkend='XtChangeManagedSet' xrefstyle='select: title'/>,
+once after unmanaging and again after managing.
+When the callbacks are called the first time, <emphasis remap='I'>type</emphasis> is set to
+<function>XtHunmanageSet</function>,
+<emphasis remap='I'>widget</emphasis> is the parent, <emphasis remap='I'>event_data</emphasis> may be cast to type
+WidgetList and is a list of the children being unmanaged, and
+<emphasis remap='I'>num_event_data</emphasis> is the length of the widget list.
+When the callbacks are called the second time, the <emphasis remap='I'>type</emphasis> is set to
+<function>XtHmanageSet</function>,
+<emphasis remap='I'>widget</emphasis> is the parent, <emphasis remap='I'>event_data</emphasis> may be cast to type
+WidgetList and is a list of the children being managed, and
+<emphasis remap='I'>num_event_data</emphasis> is the length of the widget list.
+</para>
+
+<para>
+When the changeHook callbacks are called as a result of a call to
+<xref linkend='XtRealizeWidget' xrefstyle='select: title'/>,
+the <emphasis remap='I'>type</emphasis> is set to
+<function>XtHrealizeWidget</function>
+and <emphasis remap='I'>widget</emphasis> is the widget being realized.
+The callbacks are called after the widget has been realized.
+</para>
+
+<para>
+When the changeHook callbacks are called as a result of a call to
+<xref linkend='XtUnrealizeWidget' xrefstyle='select: title'/>,
+the <emphasis remap='I'>type</emphasis> is set to
+<function>XtHunrealizeWidget</function>,
+and <emphasis remap='I'>widget</emphasis> is the widget being unrealized.
+The callbacks are called after the widget has been unrealized.
+</para>
+
+<para>
+When the changeHook callbacks are called as a result of a call to
+<xref linkend='XtAddCallback' xrefstyle='select: title'/>,
+<emphasis remap='I'>type</emphasis> is set to
+<function>XtHaddCallback</function>,
+<emphasis remap='I'>widget</emphasis> is the widget to which the callback is being added, and
+<emphasis remap='I'>event_data</emphasis> may be cast to type String and is the name of the
+callback being added.
+The callbacks are called after the callback has been added to the widget.
+</para>
+
+<para>
+When the changeHook callbacks are called as a result of a call to
+<xref linkend='XtAddCallbacks' xrefstyle='select: title'/>,
+the <emphasis remap='I'>type</emphasis> is set to
+<function>XtHaddCallbacks</function>,
+<emphasis remap='I'>widget</emphasis> is the widget to which the callbacks are being added, and
+<emphasis remap='I'>event_data</emphasis> may be cast to type String and is the name of the
+callbacks being added.
+The callbacks are called after the callbacks have been added to the widget.
+</para>
+
+<para>
+When the changeHook callbacks are called as a result of a call to
+<xref linkend='XtRemoveCallback' xrefstyle='select: title'/>,
+the <emphasis remap='I'>type</emphasis> is set to
+<function>XtHremoveCallback</function>,
+<emphasis remap='I'>widget</emphasis> is the widget from which the callback is being removed, and
+<emphasis remap='I'>event_data</emphasis> may be cast to type String and is the name of
+the callback being removed.  The callbacks are called after the callback
+has been removed from the widget.
+</para>
+
+<para>
+When the changeHook callbacks are called as a result of a call to
+<xref linkend='XtRemoveCallbacks' xrefstyle='select: title'/>,
+the <emphasis remap='I'>type</emphasis> is set to
+<function>XtHremoveCallbacks</function>,
+<emphasis remap='I'>widget</emphasis> is the widget from which the callbacks are being removed, and
+<emphasis remap='I'>event_data</emphasis> may be cast to type String and is the name of the
+callbacks being removed.  The callbacks are called after the callbacks
+have been removed from the widget.
+</para>
+
+<para>
+When the changeHook callbacks are called as a result of a call to
+<xref linkend='XtRemoveAllCallbacks' xrefstyle='select: title'/>,
+the <emphasis remap='I'>type</emphasis> is set to
+<function>XtHremoveAllCallbacks</function>
+and <emphasis remap='I'>widget</emphasis> is the widget from which the callbacks are being removed.
+The callbacks are called after the callbacks have been removed from the
+widget.
+</para>
+
+<para>
+When the changeHook callbacks are called as a result of a call to
+<xref linkend='XtAugmentTranslations' xrefstyle='select: title'/>,
+the <emphasis remap='I'>type</emphasis> is set to
+<function>XtHaugmentTranslations</function>
+and <emphasis remap='I'>widget</emphasis> is the widget whose translations are being modified.
+The callbacks are called after the widget's translations have been
+modified.
+</para>
+
+<para>
+When the changeHook callbacks are called as a result of a call to
+<xref linkend='XtOverrideTranslations' xrefstyle='select: title'/>,
+the <emphasis remap='I'>type</emphasis> is set to
+<function>XtHoverrideTranslations</function>
+and <emphasis remap='I'>widget</emphasis> is the widget whose translations are being modified.
+The callbacks are called after the widget's translations have been
+modified.
+</para>
+
+<para>
+When the changeHook callbacks are called as a result of a call to
+<xref linkend='XtUninstallTranslations' xrefstyle='select: title'/>,
+The <emphasis remap='I'>type</emphasis> is
+<function>XtHuninstallTranslations</function>
+and <emphasis remap='I'>widget</emphasis> is the widget whose translations are being uninstalled.
+The callbacks are called after the widget's translations have been
+uninstalled.
+</para>
+
+<para>
+When the changeHook callbacks are called as a result of a call to
+<xref linkend='XtSetKeyboardFocus' xrefstyle='select: title'/>,
+the <emphasis remap='I'>type</emphasis> is set to
+<function>XtHsetKeyboardFocus</function>
+and <emphasis remap='I'>event_data</emphasis> may be cast to type Widget and is the value of
+the descendant argument passed to <xref linkend='XtSetKeyboardFocus' xrefstyle='select: title'/>. The
+callbacks are called before returning from <xref linkend='XtSetKeyboardFocus' xrefstyle='select: title'/>.
+</para>
+
+<para>
+When the changeHook callbacks are called as a result of a call to
+<xref linkend='XtSetWMColormapWindows' xrefstyle='select: title'/>,
+<emphasis remap='I'>type</emphasis> is set to
+<function>XtHsetWMColormapWindows</function>,
+<emphasis remap='I'>event_data</emphasis> may be cast to type WidgetList and is the value of
+the list argument passed to <xref linkend='XtSetWMColormapWindows' xrefstyle='select: title'/>, and
+<emphasis remap='I'>num_event_data</emphasis> is the length of the list. The callbacks are
+called before returning from <xref linkend='XtSetWMColormapWindows' xrefstyle='select: title'/>.
+</para>
+
+<para>
+When the changeHook callbacks are called as a result of a call to
+<xref linkend='XtSetMappedWhenManaged' xrefstyle='select: title'/>,
+the <emphasis remap='I'>type</emphasis> is set to
+<function>XtHsetMappedWhenManaged</function>
+and <emphasis remap='I'>event_data</emphasis> may be cast to type Boolean and is the value of
+the mapped_when_managed argument passed to <xref linkend='XtSetMappedWhenManaged' xrefstyle='select: title'/>.
+The callbacks are called after setting the widget's mapped_when_managed
+field and before realizing or unrealizing the widget.
+</para>
+
+<para>
+When the changeHook callbacks are called as a result of a call to
+<xref linkend='XtMapWidget' xrefstyle='select: title'/>,
+the <emphasis remap='I'>type </emphasis> is set to
+<function>XtHmapWidget</function>
+and <emphasis remap='I'>widget</emphasis> is the widget being mapped.
+The callbacks are called after mapping the widget.
+</para>
+
+<para>
+When the changeHook callbacks are called as a result of a call to
+<xref linkend='XtUnmapWidget' xrefstyle='select: title'/>,
+the <emphasis remap='I'>type </emphasis> is set to
+<function>XtHunmapWidget</function>
+and <emphasis remap='I'>widget</emphasis> is the widget being unmapped.
+The callbacks are called after unmapping the widget.
+</para>
+
+<para>
+When the changeHook callbacks are called as a result of a call to
+<xref linkend='XtPopup' xrefstyle='select: title'/>,
+the <emphasis remap='I'>type</emphasis> is set to
+<function>XtHpopup</function>,
+<emphasis remap='I'>widget</emphasis> is the widget being popped up, and <emphasis remap='I'>event_data</emphasis> may
+be cast to type XtGrabKind and is the value of the grab_kind argument
+passed to <xref linkend='XtPopup' xrefstyle='select: title'/>.
+The callbacks are called before returning from <xref linkend='XtPopup' xrefstyle='select: title'/>.
+</para>
+
+<para>
+When the changeHook callbacks are called as a result of a call to
+<xref linkend='XtPopupSpringLoaded' xrefstyle='select: title'/>,
+the <emphasis remap='I'>type</emphasis> is set to
+<function>XtHpopupSpringLoaded</function>
+and <emphasis remap='I'>widget</emphasis> is the widget being popped up.
+The callbacks are called
+before returning from <xref linkend='XtPopupSpringLoaded' xrefstyle='select: title'/>.
+</para>
+
+<para>
+When the changeHook callbacks are called as a result of a call to
+<xref linkend='XtPopdown' xrefstyle='select: title'/>,
+the <emphasis remap='I'>type</emphasis> is set to
+<function>XtHpopdown</function>
+and <emphasis remap='I'>widget</emphasis> is the widget being popped down.
+The callbacks are called
+before returning from <xref linkend='XtPopdown' xrefstyle='select: title'/>.
+</para>
+
+<para>
+A widget set that exports interfaces that change application state
+without employing the Intrinsics library should invoke the change hook
+itself.  This is done by:
+</para>
+
+<programlisting>
+        XtCallCallbacks(XtHooksOfDisplay(dpy), XtNchangeHook, call_data);
+</programlisting>
+<para>
+The XtNconfigureHook callback list is called any time the Intrinsics
+move, resize, or configure a widget and when
+<xref linkend='XtResizeWindow' xrefstyle='select: title'/>
+is called.
+</para>
+
+<para>
+The <emphasis remap='I'>call_data</emphasis> parameter may be cast to type
+<function>XtConfigureHookData.</function>
+</para>
+<programlisting>
+typedef struct {
+        String          type;
+        Widget          widget;
+        XtGeometryMask  changeMask;
+        XWindowChanges  changes;
+} XtConfigureHookDataRec, *XtConfigureHookData;
+</programlisting>
+<para>
+When the configureHook callbacks are called, the <emphasis remap='I'>type</emphasis> is
+<function>XtHconfigure</function>,
+<emphasis remap='I'>widget</emphasis> is the widget being configured, and <emphasis remap='I'>changeMask</emphasis> and
+<emphasis remap='I'>changes</emphasis> reflect the changes made to the widget. The callbacks
+are called after changes have been made to the widget.
+</para>
+
+<para>
+The XtNgeometryHook callback list is called from
+<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>
+and
+<xref linkend='XtMakeResizeRequest' xrefstyle='select: title'/>
+once before and once after geometry negotiation occurs.
+</para>
+
+<para>
+The <emphasis remap='I'>call_data</emphasis> parameter may be cast to type
+<function>XtGeometryHookData</function>.
+</para>
+
+<programlisting>
+typedef struct {
+        String          type;
+        Widget          widget;
+        XtWidgetGeometry* request;
+        XtWidgetGeometry* reply;
+        XtGeometryResult result;
+} XtGeometryHookDataRec, *XtGeometryHookData;
+</programlisting>
+<para>
+When the geometryHook callbacks are called prior to geometry negotiation,
+the <emphasis remap='I'>type</emphasis> is
+<function>XtHpreGeometry</function>,
+<emphasis remap='I'>widget</emphasis> is the widget for which the request is being made, and
+<emphasis remap='I'>request</emphasis> is the requested geometry.
+When the geometryHook callbacks
+are called after geometry negotiation, the <emphasis remap='I'>type</emphasis> is
+<function>XtHpostGeometry</function>,
+<emphasis remap='I'>widget</emphasis> is the widget for which the request was made, <emphasis remap='I'>request</emphasis>
+is the requested geometry, <emphasis remap='I'>reply</emphasis> is the resulting geometry granted,
+and <emphasis remap='I'>result</emphasis> is the value returned from the geometry negotiation.
+</para>
+
+<para>
+The XtNdestroyHook callback list is called when a widget is destroyed.
+The <emphasis remap='I'>call_data parameter</emphasis> may be cast to type
+<function>XtDestroyHookData</function>.
+</para>
+<programlisting>
+typedef struct {
+        String type;
+        Widget widget;
+} XtDestroyHookDataRec, *XtDestroyHookData;
+</programlisting>
+<para>
+When the destroyHook callbacks are called as a result of a call to
+<xref linkend='XtDestroyWidget' xrefstyle='select: title'/>,
+the <emphasis remap='I'>type</emphasis> is
+<function>XtHdestroy</function>
+and <emphasis remap='I'>widget</emphasis> is the widget being destroyed. The callbacks are
+called upon completion of phase one destroy for a widget.
+</para>
+
+<para>
+The XtNshells and XtNnumShells are read-only resources that report a
+list of all parentless shell widgets associated with a display.
+</para>
+
+<para>
+Clients who use these hooks must exercise caution in calling Intrinsics
+functions in order to avoid recursion.
+</para>
+</sect2>
+
+<sect2 id="Querying_Open_Displays">
+<title>Querying Open Displays</title>
+<para>
+To retrieve a list of the Displays associated with an application context,
+use
+<xref linkend='XtGetDisplays' xrefstyle='select: title'/>.
+</para>
+
+<funcsynopsis id='XtGetDisplays'>
+<funcprototype>
+<funcdef>void <function>XtGetDisplays</function></funcdef>
+   <paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
+   <paramdef>Display ***<parameter>dpy_return</parameter></paramdef>
+   <paramdef>Cardinal *<parameter>num_dpy_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>app_context</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the application context.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>dpy_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns a list of open Display connections in the specified application
+context.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>num_dpy_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the count of open Display connections in <emphasis remap='I'>dpy_return</emphasis>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XtGetDisplays' xrefstyle='select: title'/> may be used by an external agent to query the
+list of open displays that belong to an application context. To free
+the list of displays, use
+<xref linkend='XtFree' xrefstyle='select: title'/>.
+</para>
+</sect2>
+</sect1>
+
+</chapter>
Index: lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs
===================================================================
--- lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs	(nonexistent)
+++ lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs	(revision 5)

Property changes on: lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new/specs
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new
===================================================================
--- lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new	(nonexistent)
+++ lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new	(revision 5)

Property changes on: lib/libXt/create-1.2.1-docbook-patch/libXt-1.2.1-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXt/create-1.2.1-docbook-patch
===================================================================
--- lib/libXt/create-1.2.1-docbook-patch	(nonexistent)
+++ lib/libXt/create-1.2.1-docbook-patch	(revision 5)

Property changes on: lib/libXt/create-1.2.1-docbook-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXt/patches/README
===================================================================
--- lib/libXt/patches/README	(nonexistent)
+++ lib/libXt/patches/README	(revision 5)
@@ -0,0 +1,6 @@
+
+/* begin *
+
+   TODO: Leave some comment here.
+
+ * end */
Index: lib/libXt/patches
===================================================================
--- lib/libXt/patches	(nonexistent)
+++ lib/libXt/patches	(revision 5)

Property changes on: lib/libXt/patches
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXt
===================================================================
--- lib/libXt	(nonexistent)
+++ lib/libXt	(revision 5)

Property changes on: lib/libXt
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXtst/Makefile
===================================================================
--- lib/libXtst/Makefile	(nonexistent)
+++ lib/libXtst/Makefile	(revision 5)
@@ -0,0 +1,56 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXtst
+
+versions    = 1.2.4
+pkgname     = libXtst
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+patches     = $(CURDIR)/patches/libXtst-1.2.4-docbook.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-1.2.4-docbook-patch ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s) $(patches)
Index: lib/libXtst/create-1.2.4-docbook-patch/create.patch.sh
===================================================================
--- lib/libXtst/create-1.2.4-docbook-patch/create.patch.sh	(nonexistent)
+++ lib/libXtst/create-1.2.4-docbook-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=1.2.4
+
+tar --files-from=file.list -xJvf ../libXtst-$VERSION.tar.xz
+mv libXtst-$VERSION libXtst-$VERSION-orig
+
+cp -rf ./libXtst-$VERSION-new ./libXtst-$VERSION
+
+diff --unified -Nr  libXtst-$VERSION-orig  libXtst-$VERSION > libXtst-$VERSION-docbook.patch
+
+mv libXtst-$VERSION-docbook.patch ../patches
+
+rm -rf ./libXtst-$VERSION
+rm -rf ./libXtst-$VERSION-orig

Property changes on: lib/libXtst/create-1.2.4-docbook-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: lib/libXtst/create-1.2.4-docbook-patch/file.list
===================================================================
--- lib/libXtst/create-1.2.4-docbook-patch/file.list	(nonexistent)
+++ lib/libXtst/create-1.2.4-docbook-patch/file.list	(revision 5)
@@ -0,0 +1 @@
+libXtst-1.2.4/specs/recordlib.xml
Index: lib/libXtst/create-1.2.4-docbook-patch/libXtst-1.2.4-new/specs/recordlib.xml
===================================================================
--- lib/libXtst/create-1.2.4-docbook-patch/libXtst-1.2.4-new/specs/recordlib.xml	(nonexistent)
+++ lib/libXtst/create-1.2.4-docbook-patch/libXtst-1.2.4-new/specs/recordlib.xml	(revision 5)
@@ -0,0 +1,1509 @@
+<?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"
+[
+<!ENTITY % defs SYSTEM "defs.ent"> %defs;
+]>
+
+
+<!-- lifted from troff+ms+XMan by doclifter -->
+<book id="recordlib">
+
+<bookinfo>
+   <title>X Record Extension Library</title>
+   <subtitle>X Consortium Standard</subtitle>
+   <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
+   <releaseinfo>Version 1.13</releaseinfo>
+   <authorgroup>
+      <author>
+         <firstname>Martha</firstname><surname>Zimet</surname>
+         <affiliation><orgname>Network Computing Devices, Inc.</orgname></affiliation>
+      </author>
+      <editor>
+         <firstname>Stephen</firstname><surname>Gildea</surname>
+         <affiliation><orgname>X Consortium</orgname></affiliation>
+      </editor>
+   </authorgroup>
+   <copyright><year>1994</year><holder>Network Computing Devices, Inc.</holder></copyright>
+
+<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.  Network Computing Devices, Inc.
+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>
+
+<legalnotice>
+<para role="multiLicensing">Copyright © 1995 X Consortium</para>
+<para>
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files
+(the &ldquo;Software&rdquo;), 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 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>
+<para>X Window System is a trademark of The Open Group.</para>
+</legalnotice>
+</bookinfo>
+
+<chapter id='Record_Extension_Overview'>
+<title>Record Extension Overview</title>
+<para>
+The purpose of this extension is to support the recording and reporting of
+all core X protocol and arbitrary X extension protocol. This first section
+gives an overview of the Record extension. The following sections describe
+how to use the Record extension library.
+</para>
+
+<sect1 id='Synchronous_Playback'>
+<title>Synchronous Playback</title>
+<para>
+Environment information is generally provided to an X-based playback
+mechanism, which might use the XTest extension to synthesize input
+events. This synchronization information defines the X state prior to
+event synthesis (for example, location of the cursor, window locations
+and sizes, installed colormap, window manager running, and so on) and
+the consequences that occur after the playback mechanism synthesizes
+the event. If the user moves the mouse into the icon window and presses
+and releases a mouse button, the device events
+<function>MotionNotify</function>, <function>ButtonPress</function>,
+and <function>ButtonRelease</function> are generated by the X server.
+Because X follows an
+event-driven model, there are consequences that follow from the user
+actions, or device events, that are in the form of X protocol. As a result
+of the previous user actions, the client could generate requests such as
+<function>ImageText8</function> and <function>PolyLine</function> to the
+X server, or the X server could send non-device events such as
+<function>Expose</function> and <function>MapNotify</function> to the
+client window. Both the
+requests and non-device events that result from user actions are known
+as consequences, which can be used as a synchronization, or control point,
+during playback. That is, the playback mechanism does not generate a specific
+synthesized event until its matching synchronization condition occurs
+(for example, the window is mapped or unmapped, the cursor changes, a text
+string displays, and so on)
+</para>
+<para>
+Because it cannot be predicted what synchronization information is required
+during playback, the Record extension makes no assumptions about the intended
+use of the recorded data. Facilities exist to record any core X protocol or
+X extension protocol. Therefore, Record does not enforce a specific
+synchronization methodology.
+</para>
+</sect1>
+
+<sect1 id='Design_Approach'>
+<title>Design Approach</title>
+<para>
+The design approach of the extension is to record core X protocol and
+arbitrary X extension protocol entirely within the X server itself. When
+the extension has been requested to record specific protocol by one or more
+recording clients, the protocol data is formatted and returned to the
+recording clients. The extension provides a mechanism for capturing all
+events, including input device events that do not go to any clients.
+</para>
+</sect1>
+
+<sect1 id='Record_Clients'>
+<title>Record Clients</title>
+<para>
+The recommended communication model for a Record application is to open two
+connections to the server—one connection for recording control and one
+connection for reading recorded protocol data.
+</para>
+<para>
+Information about recording (for example, what clients to record, what
+protocol to record for each client, and so on) is stored in resources
+called record contexts (type <function>XRecordContext</function>). Most
+Record extension functions take a record context as an argument. Although
+in theory it is possible to share record contexts between applications,
+it is expected that applications will use their own context when performing
+recording operations.
+</para>
+<para>
+A client that wishes to record X protocol does so through the library
+functions defined in
+<xref linkend='Library_Extension_Requests' xrefstyle='select: title'/>
+A typical sequence of requests that a client would make is as follows:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+<xref linkend='XRecordQueryVersion' xrefstyle='select: title'/>
+    </para>
+    <para>
+query the extension protocol version.
+    </para>
+</listitem>
+<listitem>
+    <para>
+<xref linkend='XRecordCreateContext' xrefstyle='select: title'/>
+    </para>
+    <para>
+request that the server create a record context for access by this client,
+and express interest in clients and protocol to be recorded. This request
+returns an <function>XRecord-Context</function>, which is an XID that is
+used by most other extension requests to identify the specified context.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XRecordEnableContext' xrefstyle='select: title'/>
+    </para>
+    <para>
+begin the recording and reporting of protocol data.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XRecordDisableContext' xrefstyle='select: title'/>
+    </para>
+    <para>
+end the recording and reporting of protocol data.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<xref linkend='XRecordFreeContext' xrefstyle='select: title'/>
+    </para>
+    <para>
+free the record context.
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+The header for this library is
+&lt;<function>X11/extensions/record.h</function>&gt;. All identifiers defined
+in the interface are supplied by this header and are prefixed with "XRecord".
+The <function>Xtst</function> library contains the
+<function>XRecord</function> functions.
+</para>
+
+</sect1>
+</chapter>
+
+<chapter id='Common_Arguments'>
+<title>Common Arguments</title>
+<para>
+The Record extension functions <xref linkend='XRecordCreateContext' xrefstyle='select: title'/>
+ and <xref linkend='XRecordRegisterClients' xrefstyle='select: title'/> allow applications to
+specify the following:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+Individual clients or sets of clients to record
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Ranges of core X protocol and X extension protocol to record for each client
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+Protocol in the ranges specified by the recording client will be recorded
+by the server. The device_events protocol type can be specified by a
+recording client although it may not be sent to a recorded client. The
+device_events type differs from delivered_events, which also can be
+specified by a recording client; delivered_events are actually delivered to
+one or more clients. These event types are discussed in
+<xref linkend='Protocol_Ranges' xrefstyle='select: title'/>
+</para>
+
+
+<para>
+The Record extension functions <xref linkend='XRecordCreateContext' xrefstyle='select: title'/>
+ and <xref linkend='XRecordRegisterClients' xrefstyle='select: title'/> have the common arguments
+datum_flags, clients, and ranges, which specify whether server time
+and/or client sequence number should precede protocol elements, the
+clients or client set to record, and the protocol ranges to record,
+respectively. These are discussed in the following sections.
+</para>
+
+<sect1 id='Datum_Flags'>
+<title>Datum Flags</title>
+<para>
+The datum_flags argument is a set of flags OR’ed together to specify options
+for the record context.  Specify zero to disable all the options.
+</para>
+
+<para>
+The <function>XRecordFromServerTime</function> flag specifies that
+<function>XRecordInterceptData</function> structures with a category of
+<function>XRecordFromServer</function> will have a server_time field specific to each
+protocol element.
+</para>
+
+<para>
+The <function>XRecordFromClientTime</function> flag specifies that
+<function>XRecordInterceptData</function> structures with a category of
+<function>XRecordFromClient</function> will have a server_time field specific
+to each protocol element.
+</para>
+
+<para>
+The <function>XRecordFromClientSequence</function> flag specifies that
+<function>XRecordInterceptData</function> structures with a category of
+<function>XRecordFromClient</function> or
+<function>XRecordClientDied</function> will have a valid client_seq field.
+</para>
+</sect1>
+
+<sect1 id='Selecting_Clients'>
+<title>Selecting Clients</title>
+
+<para>
+The clients argument is a pointer to an array of
+<function>XRecordClientSpec</function>.
+<function>XRecordClientSpec</function> is an integral type that holds a
+resource ID, a client resource ID base, or one of the client set constants
+defined below.
+</para>
+<para>
+Duplicate elements in the array are ignored by the functions, and if any
+element in the array is not valid, a
+<function>BadMatch</function>
+error results. A resource ID references the client that created that
+resource. The client set may be one of the following constants:
+<function>XRecordCurrentClients</function>,
+<function>XRecordFutureClients</function>, or
+<function>XRecordAllClients</function>.
+</para>
+<para>
+If the element in the array identifies a particular client, protocol
+specified by the ranges argument will be recorded by the server. The
+recorded protocol data will not be returned to the recording client until
+the record context has been enabled. This is described in
+<xref linkend='Data_Transfer' xrefstyle='select: title'/>
+</para>
+<para>
+If the element is <function>XRecordCurrentClients</function>, the protocol
+ranges specified by the ranges argument, except for device_events, are
+associated with each current client connection. If the element is
+<function>XRecordFutureClients</function>, the
+protocol ranges specified by the ranges argument are associated with each new
+client connection. If the element is
+<function>XRecordAllClients</function>,
+the protocol ranges specified by the ranges argument are associated with
+each current client connection and with each new client connection.
+When the context is enabled, the data connection is unregistered if it
+was registered. If the context is enabled,
+<function>XRecordCurrentClients</function> and
+<function>XRecordAllClients</function>
+silently exclude the recording data connection. It is an error to explicitly
+register the data connection.
+</para>
+</sect1>
+<sect1 id='Protocol_Ranges'>
+<title>Protocol Ranges</title>
+
+<para>
+The functions <xref linkend='XRecordCreateContext' xrefstyle='select: title'/> and
+<xref linkend='XRecordRegisterClients' xrefstyle='select: title'/> have another common argument,
+ranges, which is an array of pointers to <function>XRecordRange</function>
+structures. Each structure contains ranges of numeric values for each of
+the protocol types that can be specified and recorded individually by the
+Record extension. An <function>XRecordRange</function> structure must be
+allocated by the Record library using the
+<function>XRecordAllocRange</function> function.
+</para>
+<para>
+The <function>XRecordRange</function> typedef is a structure with the
+following members:
+</para>
+
+<literallayout remap='Ds'>
+XRecordRange:
+     XRecordRange8 core_requests     /* core X requests */
+     XRecordRange8 core_replies      /* core X replies */
+     XRecordExtRange ext_requests    /* extension requests */
+     XRecordExtRange ext_replies     /* extension replies */
+     XRecordRange8 delivered_events  /* delivered core and ext events */
+     XRecordRange8 device_events     /* all core and ext device events */
+     XRecordRange8 errors            /* core X and X ext errors */
+     Bool client_started             /* connection setup reply from server */
+     Bool client_died                /* notification of client disconnect */
+</literallayout>
+
+<para>
+The types used in
+<function>XRecordRange</function>
+members are defined as follows.  The
+<function>XRecordRange8</function>
+typedef is a structure with the following members:
+</para>
+
+<literallayout remap='Ds'>
+XRecordRange8:
+     unsigned char first
+     unsigned char last
+</literallayout>
+
+<para>
+The
+<function>XRecordRange16</function>
+typedef is a structure with the following members:
+</para>
+
+<literallayout remap='Ds'>
+XRecordRange16:
+     unsigned short first
+     unsigned short last
+</literallayout>
+
+<para>
+The
+<function>XRecordExtRange</function>
+typedef is a structure with the following members:
+</para>
+
+<literallayout remap='Ds'>
+XRecordExtRange:
+     XRecordRange8  ext_major
+     XRecordRange16 ext_minor
+</literallayout>
+
+<para>
+If any of the values specified in
+<function>XRecordRange</function>
+is invalid, a
+<function>BadValue</function>
+error results.
+</para>
+
+<para>
+The core_requests member specifies the range of core X protocol
+requests to record.  Core X protocol requests with a major opcode
+that is between first and last, inclusive, will be
+recorded.  A
+<function>BadValue</function>
+error results if the value of first is greater than the value of last.
+If the values of both first and last are zero, no core
+X protocol requests will be recorded.
+</para>
+
+<para>
+The core_replies member specifies the range of replies resulting
+from core X protocol requests to record.  Replies that result from
+core X protocol requests with a major opcode between first
+and last, inclusive, will be recorded.  A
+<function>BadValue</function>
+error results if the value of first is greater than the value of last.
+If the values of both first and last are zero, no core X protocol
+replies will be recorded.
+</para>
+
+<para>
+The ext_requests member specifies the range of X extension
+requests to record.  X extension requests with a major opcode
+between ext_major.first and ext_major.last, and with a
+minor opcode
+between ext_minor.first and ext_minor.last, inclusive, will be
+recorded.  A
+<function>BadValue</function>
+error results
+if the value of ext_major.first is greater than the value of
+ext_major.last or if the value of ext_minor.first is
+greater than the value of ext_minor.last.  If the values of both
+ext_major.first
+and ext_major.last are zero,
+no X extension requests will be recorded.
+</para>
+
+<para>
+The ext_replies member specifies the range of replies resulting
+from X extension requests to record.  Replies that result from an X
+extension request with a major opcode between
+ext_major.first and
+ext_major.last, and a minor opcode that is between
+ext_minor.first and ext_minor.last will be recorded.  A
+<function>BadValue</function>
+error results
+if the value of ext_major.first is greater than the value of
+ext_major.last or if the value of ext_minor.first is greater than
+the value of ext_minor.last.  If the values of both
+ext_major.first and ext_major.last are zero, no X extension
+replies will be recorded.
+</para>
+
+<para>
+The delivered_events member specifies the range of both core
+X events and X extension events to record.  These events are
+delivered to at least one client.  Core X events and X extension events
+with a code value between first and last inclusive will be recorded.  A
+<function>BadValue</function>
+error results if the value of first is greater than the value of last.
+If the values of first and last are zero, no events will be recorded.
+</para>
+
+<para>
+The device_events member specifies the range of both core X device
+events and X extension device events to record.  These events may or
+may not be delivered to a client.  Core X device events and X extension
+device events with a code value between first and last inclusive that
+are not delivered to any clients will be recorded.  A
+<function>BadValue</function>
+error results if the value of first is greater than the value of last.  A
+<function>BadValue</function>
+error results if first is less than two or last is less than two, except
+that if first and last are zero, no events will be recorded.
+</para>
+
+<para>
+The errors member specifies the range of both core X errors and X
+extension errors to record.  Core X errors and X extension errors with
+a code value between first and last inclusive will be
+recorded.  A
+<function>BadValue</function>
+error results if the value of first is greater than the value of last.
+If the values of first and last are zero, no errors will be recorded.
+</para>
+
+<para>
+A value of
+<function>True</function>
+for the client_started member specifies the
+connection setup reply from the server to new clients.  If
+<function>False</function>
+the connection setup reply is not specified by this
+<function>XRecordRange</function>
+</para>
+
+<para>
+A value of
+<function>True</function>
+for the client_died member specifies
+notification when a client disconnects.  If
+<function>False</function>
+notification when a client disconnects is not specified by this
+<function>XRecordRange</function>
+</para>
+</sect1>
+</chapter>
+
+<chapter id='Library_Extension_Requests'>
+<title>Library Extension Requests</title>
+
+<para>
+Recording operations are accessed by programs through the use of
+new protocol requests.  The following functions are provided as extensions
+to Xlib.  An Xlib error results if
+an extension request is made to an X server that does not support the
+Record extension.  Note that any of the extension protocol requests may generate
+<function>BadAlloc</function>
+or
+<function>BadLength</function>
+errors.
+</para>
+
+<sect1 id='Query_Extension_Version'>
+<title>Query Extension Version</title>
+
+<para>
+An application uses the
+<xref linkend='XRecordQueryVersion' xrefstyle='select: title'/>
+function to determine
+the version of the Record extension protocol supported by an X server.
+</para>
+
+<funcsynopsis id='XRecordQueryVersion'>
+<funcprototype>
+  <funcdef>Status <function>XRecordQueryVersion</function></funcdef>
+    <paramdef>Display <parameter> *display</parameter></paramdef>
+    <paramdef>int <parameter> cmajor_return</parameter></paramdef>
+    <paramdef>int <parameter> cminor_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>display</emphasis></term>
+    <listitem><para>Returns the connection to the X server.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>cmajor_return</emphasis></term>
+    <listitem><para>Returns the extension protocol major version in use.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>cminor_return</emphasis></term>
+    <listitem><para>Returns the extension protocol minor version in use.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XRecordQueryVersion' xrefstyle='select: title'/>
+function returns the major and minor protocol version numbers supported by
+the server.
+<xref linkend='XRecordQueryVersion' xrefstyle='select: title'/>
+returns nonzero (success) only if the returned version numbers are
+common to both the library and the server; otherwise, it returns zero.
+</para>
+</sect1>
+
+<sect1 id='Create_and_Modify_Context'>
+<title>Create and Modify Context</title>
+
+<para>
+An application uses the
+<xref linkend='XRecordCreateContext' xrefstyle='select: title'/>
+function to create a record context.  At the time the record context is
+created by the recording client, the clients to be recorded and the
+protocol to record for each client may be specified.
+</para>
+
+<funcsynopsis id='XRecordCreateContext'>
+<funcprototype>
+  <funcdef>XRecordContext <function>XRecordCreateContext</function></funcdef>
+    <paramdef>Display <parameter> *display</parameter></paramdef>
+    <paramdef>int <parameter> datum_flags</parameter></paramdef>
+    <paramdef>XRecordClientSpec <parameter> *clients</parameter></paramdef>
+    <paramdef>int <parameter> nclients</parameter></paramdef>
+    <paramdef>XRecordRange <parameter> *ranges</parameter></paramdef>
+    <paramdef>int <parameter> nranges</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>display</emphasis></term>
+    <listitem><para>Returns the connection to the X server.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>datum_flags</emphasis></term>
+    <listitem><para>Specifies whether detailed time or sequence info should be sent.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>clients</emphasis></term>
+    <listitem><para>Specifies the clients to record.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>nclients</emphasis></term>
+    <listitem><para>Specifies the number of clients.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>ranges</emphasis></term>
+    <listitem><para>Specifies the protocol ranges to record.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>nranges</emphasis></term>
+    <listitem><para>Specifies the number of protocol ranges.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XRecordCreateContext' xrefstyle='select: title'/>
+function creates a record context and returns an
+<function>XRecordContext</function>
+which is then used in the other Record library calls.  This request is
+typically executed by the recording client over its control connection to
+the X server.  The datum_flags specifies whether server time and/or client
+sequence number should precede protocol elements recorded by context (
+<xref linkend='Datum_Flags' xrefstyle='select: title'/>
+).  When a clients element identifies a particular client, the client is added
+to the context and the protocol to record for that client is set to the
+union of all ranges.  When a clients element is
+<function>XRecordCurrentClients</function>
+<function>XRecordFutureClients</function>
+or
+<function>XRecordAllClients</function>
+the actions described in
+<xref linkend='Selecting_Clients' xrefstyle='select: title'/>
+are performed.
+</para>
+
+<para>
+<xref linkend='XRecordCreateContext' xrefstyle='select: title'/>
+returns zero if the request failed.
+<xref linkend='XRecordCreateContext' xrefstyle='select: title'/>
+can generate
+<function>BadIDChoice</function>
+<function>BadMatch</function>
+and
+<function>BadValue</function>
+errors.
+</para>
+
+<para>The ranges argument is an
+<function>XRecordRange</function>
+array, that is, an array
+of pointers.  The structures the elements point to shall be allocated
+by calling
+<function>XRecordAllocRange</function></para>
+
+<literallayout remap='FD'>
+XRecordRange *
+XRecordAllocRange(void)
+</literallayout> <!-- remap='FN' -->
+
+<para>
+The
+<function>XRecordAllocRange</function>
+function
+allocates and returns an
+<function>XRecordRange</function>
+structure.
+The structure is initialized to specify no protocol.
+The function returns NULL if the structure allocation fails.
+The application can free the structure by calling
+<function>XFree</function>
+</para>
+
+<sect2 id='Additions'>
+<title>Additions</title>
+
+<para>
+An application uses the
+<xref linkend='XRecordRegisterClients' xrefstyle='select: title'/>
+function to modify a previously created
+record context, by adding clients or modifying the recorded protocol,
+typically over its control connection to the X server.
+</para>
+
+<funcsynopsis id='XRecordRegisterClients'>
+<funcprototype>
+  <funcdef>Status <function>XRecordRegisterClients</function></funcdef>
+    <paramdef>Display <parameter> *display</parameter></paramdef>
+    <paramdef>XRecordContext <parameter> context</parameter></paramdef>
+    <paramdef>int <parameter> datum_flags</parameter></paramdef>
+    <paramdef>XRecordClientSpec <parameter> *clients</parameter></paramdef>
+    <paramdef>int <parameter> nclients</parameter></paramdef>
+    <paramdef>XRecordRange <parameter> *ranges</parameter></paramdef>
+    <paramdef>int <parameter> nranges</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>display</emphasis></term>
+    <listitem><para>Returns the connection to the X server.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>context</emphasis></term>
+    <listitem><para>Specifies the record context to modify.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>datum_flags</emphasis></term>
+    <listitem><para>Specifies whether detailed time or sequence info should be sent.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>clients</emphasis></term>
+    <listitem><para>Specifies the clients to record.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>nclients</emphasis></term>
+    <listitem><para>Specifies the number of clients.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>ranges</emphasis></term>
+    <listitem><para>Specifies the protocol ranges to record.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>nranges</emphasis></term>
+    <listitem><para>Specifies the number of protocol ranges.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The datum_flags specifies whether server time and/or client sequence number
+should precede protocol elements for all clients recorded by context (See
+<xref linkend='Datum_Flags' xrefstyle='select: title'/>
+).  When a clients element identifies a particular client and the client is
+not yet targeted for recording in the given context, the client is added
+to the set of clients to record, and the protocol to record for that client
+is set to the union of all ranges.  When the client is
+already targeted for recording, the protocol to record for that client
+is set to the union of all ranges.  When the element is
+<function>XRecordCurrentClients</function>
+<function>XRecordFutureClients</function>
+or
+<function>XRecordAllClients</function>
+the actions described in
+<xref linkend='Selecting_Clients' xrefstyle='select: title'/>
+are performed.
+</para>
+
+<para>
+<xref linkend='XRecordRegisterClients' xrefstyle='select: title'/>
+returns zero if the request failed; otherwise, it
+returns nonzero.
+</para>
+
+<para>
+<xref linkend='XRecordRegisterClients' xrefstyle='select: title'/>
+can generate
+<function>XRecordBadContext</function>
+<function>BadMatch</function>
+and
+<function>BadValue</function>
+errors.
+</para>
+</sect2>
+
+<sect2 id='Deletions'>
+<title>Deletions</title>
+
+<para>
+An application uses the
+<function>XRecordUnregisterClients</function>
+function to delete clients from a previously created
+record context, typically over its control connection to the X server.
+</para>
+
+<funcsynopsis id='XRecordUnRegisterClients'>
+<funcprototype>
+  <funcdef>Status <function>XRecordUnRegisterClients</function></funcdef>
+    <paramdef>Display <parameter> *display</parameter></paramdef>
+    <paramdef>XRecordContext <parameter> context</parameter></paramdef>
+    <paramdef>XRecordClientSpec <parameter> *clients</parameter></paramdef>
+    <paramdef>int <parameter> nclients</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>display</emphasis></term>
+    <listitem><para>Returns the connection to the X server.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>context</emphasis></term>
+    <listitem><para>Specifies the record context to modify.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>clients</emphasis></term>
+    <listitem><para>Specifies the clients to stop recording.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>nclients</emphasis></term>
+    <listitem><para>Specifies the number of clients.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+When an element in clients identifies a particular client, and the
+specified client is already targeted for recording in the given
+context, the client and the set of protocol to record for that
+client are deleted from the context.  If the specified client is not
+targeted for recording, then no action is performed.
+</para>
+
+<para>
+When the element is
+<function>XRecordCurrentClients</function>
+all clients currently targeted for recording in context and their
+corresponding sets of protocol to record are deleted from context.
+</para>
+
+<para>
+When the item is
+<function>XRecordFutureClients</function>
+any future client connections will not automatically be targeted for
+recording in context.
+</para>
+
+<para>
+When the element is
+<function>XRecordAllClients</function>
+all clients currently targeted for recording in context and their
+corresponding sets of protocol to record are deleted from context.
+Any future client connections will not automatically be targeted
+for recording in context.
+</para>
+
+<para>
+<function>XRecordUnregisterClients</function>
+returns zero if the request failed; otherwise, it returns nonzero.
+</para>
+
+<para>
+<function>XRecordUnregisterClients</function>
+can generate
+<function>XRecordBadContext</function>
+<function>BadMatch</function>
+and
+<function>BadValue</function>
+errors.</para>
+</sect2>
+</sect1>
+
+<sect1 id='Query_Context_State'>
+<title>Query Context State</title>
+
+<para>
+An application uses the
+<xref linkend='XRecordGetContext' xrefstyle='select: title'/>
+function to query the current state of a record context, typically over
+its control connection to the X server.
+</para>
+
+<funcsynopsis id='XRecordGetContext'>
+<funcprototype>
+  <funcdef>Status <function>XRecordGetContext</function></funcdef>
+    <paramdef>Display <parameter> *display</parameter></paramdef>
+    <paramdef>XRecordContext <parameter> context</parameter></paramdef>
+    <paramdef>XRecordState <parameter> **state_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <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'>context</emphasis></term>
+    <listitem><para>Specifies the record context to query.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>state_return</emphasis></term>
+    <listitem><para>Specifies the address of a variable into which
+the function stores a pointer to the current state of the record context.
+    </para></listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<function>XRecordState</function>
+typedef returned by
+<xref linkend='XRecordGetContext' xrefstyle='select: title'/>
+is a structure with the following members:
+</para>
+
+<literallayout remap='Ds'>
+XRecordState:
+     Bool              enabled
+     int               datum_flags
+     unsigned long     nclients
+     XRecordClientInfo **client_info
+</literallayout>
+
+<para>
+The enabled member is set to the state of data transfer and is
+<function>True</function>
+when the recording client has asked that recorded data be sent;
+otherwise it is
+<function>False</function>
+The datum_flags member is set to the value of these flags for this context.
+The nclients member is set to the number of
+<function>XRecordClientInfo</function>
+structures returned.  The client_info member is an array of pointers to
+<function>XRecordClientInfo</function>
+structures that contain the protocol to record for each targeted client.  The
+<function>XRecordClientInfo</function>
+typedef is a structure with the following members:
+</para>
+
+<literallayout remap='Ds'>
+XRecordClientInfo:
+     XRecordClientSpec client
+     unsigned long nranges
+     XRecordRange **ranges
+</literallayout>
+
+<para>
+The client member either identifies a client targeted for recording
+or is set to
+<function>XRecordFutureClients</function>
+to describe how future clients will be automatically targeted for recording.
+The nranges member is set to the number of protocol
+ranges to be recorded for the specified client.  The ranges member
+is an array of pointers to
+<function>XRecordRange</function>
+structures, which specify the protocol ranges to record.
+</para>
+
+<para>
+<xref linkend='XRecordGetContext' xrefstyle='select: title'/>
+returns zero if the request failed; otherwise, it returns nonzero.
+The context argument must specify a valid
+<function>XRecordContext</function>
+or a
+<function>XRecordBadContext</function>
+error results.
+</para>
+
+<para>
+Recording clients should use the
+<xref linkend='XRecordFreeState' xrefstyle='select: title'/>
+function to free the state data returned by
+<xref linkend='XRecordGetContext' xrefstyle='select: title'/>
+</para>
+
+<funcsynopsis id='XRecordFreeState'>
+<funcprototype>
+  <funcdef>void <function>XRecordFreeState</function></funcdef>
+    <paramdef>XRecordState <parameter> *state</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>state</emphasis></term>
+    <listitem><para>Specifies the structure that is to be freed.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XRecordFreeState' xrefstyle='select: title'/>
+frees the data pointed to by state.  If the argument does not match an
+<function>XRecordState</function>
+pointer returned from a successful call to
+<xref linkend='XRecordGetContext' xrefstyle='select: title'/>
+or if
+<xref linkend='XRecordFreeState' xrefstyle='select: title'/>
+has already been called with it, the behavior is undefined.
+</para>
+</sect1>
+
+<sect1 id='Data_Transfer'>
+<title>Data Transfer</title>
+
+<para>
+An application uses the
+<xref linkend='XRecordEnableContext' xrefstyle='select: title'/>
+and
+<xref linkend='XRecordDisableContext' xrefstyle='select: title'/>
+functions to change the state of data transfer
+between the X server and the recording client.  These functions allow
+the application to start recording and reporting of protocol data
+and to stop recording and reporting of protocol data, respectively.
+</para>
+
+<sect2 id='Enable_Context'>
+<title>Enable Context</title>
+
+<para>
+To direct the X server to record and report protocol, a program uses
+<xref linkend='XRecordEnableContext' xrefstyle='select: title'/>
+typically over its data connection to the X
+server.  The reporting of recorded protocol back to the recording client
+is handled by the following data structures and procedure definitions.
+Each recorded protocol element is reported to the recording client through an
+<function>XRecordInterceptData</function>
+typedef, a structure with the following members:
+</para>
+
+<literallayout remap='Ds'>
+XRecordInterceptData:
+     XID              id_base
+     Time             server_time
+     unsigned long    client_seq
+     int              category
+     Bool             client_swapped
+     unsigned char    *data
+     unsigned long    data_len
+</literallayout>
+
+<para>
+The id_base member is set to the resource identifier base sent to the
+client in the connection setup reply and therefore identifies the client
+being recorded, except when the recorded protocol data is a device
+event that may have not been delivered to a client.  In this case,
+id_base is set to zero.  The server_time member
+is set to the time of the server when the protocol was recorded.
+It is the time that was attached to this protocol element in the reply,
+if so specified by datum_flags,
+or else the time from the header of the reply that contained
+this protocol element.
+The client_seq member is the sequence number of the recorded
+client's most recent request processed by the server at the time this
+protocol element was recorded, if this information were included in the
+recorded data; otherwise client_seq is 0.
+The category member is set to one of the following values:
+<function>XRecordStartOfData</function>
+<function>XRecordFromServer</function>
+<function>XRecordFromClient</function>
+<function>XRecordClientStarted</function>
+<function>XRecordClientDied</function>
+or
+<function>XRecordEndOfData</function>
+<function>XRecordStartOfData</function>
+is immediately sent as the first reply to confirm that the context is enabled.
+<function>XRecordFromClient</function>
+indicates the protocol
+data is from the recorded client to the server (requests).
+<function>XRecordFromServer</function>
+indicates the protocol data is from the server to the recorded client
+(replies, errors, events, or device events).
+<function>XRecordClientStarted</function>
+indicates that the protocol data is the connection setup reply from the server.
+<function>XRecordClientDied</function>
+indicates that the recorded client has closed its connection
+to the X server; there is no protocol data.
+<function>XRecordEndOfData</function>
+indicates that the context has been disabled and that
+this is the last datum.  It does not correspond to any protocol or
+state change in a recorded client.  There is no protocol data.
+</para>
+
+<para>
+The client_swapped member is set to
+<function>True</function>
+if the byte order of the client being recorded is swapped relative to
+the recording client; otherwise, it is set to
+<function>False</function>
+All recorded protocol data is returned in the byte order of the recorded
+client.  Therefore, recording clients are responsible for all byte swapping,
+if required.  Device events are in the byte order of the recording client.
+For replies of category
+<function>XRecordStartOfData</function>
+and
+<function>XRecordEndOfData</function>
+client_swapped is set according
+to the byte order of the server relative to the recording client.
+</para>
+
+<para>
+The data member contains the actual recorded protocol data.
+When category is set to
+<function>XRecordStartOfData</function>
+<function>XRecordClientDied</function>
+or
+<function>XRecordEndOfData</function>
+no protocol data are contained in data.
+</para>
+
+
+<!--  copied exactly from the protocol document -->
+<para>
+For the core X events
+<function>KeyPress</function>
+<function>KeyRelease</function>
+<function>ButtonPress</function>
+and
+<function>ButtonRelease</function>,
+the fields of a device event that contain
+valid information are time and detail.  For the core X event
+<function>MotionNotify</function>
+the fields of a device event that contain valid information are time, root,
+root-x and root-y.
+The time field refers to the time the event was generated by the device.
+</para>
+
+<para>For the extension input device events
+<function>DeviceKeyPress</function>
+<function>DeviceKeyRelease</function>
+<function>DeviceButtonPress</function>
+and
+<function>DeviceButtonRelease</function>
+the fields of a device event that contain valid information are
+device, time, and detail.  For
+<function>DeviceMotionNotify</function>
+the valid device event fields are device and time.
+For the extension input device events
+<function>ProximityIn</function>
+and
+<function>ProximityOut</function>
+the fields of a device event that contain valid
+information are device and time.  For the extension input device event
+<function>DeviceValuator</function>
+the fields of a device event that contain valid information are
+device, num_valuators, first_valuator, and valuators.
+The time field refers to the time the event was generated by the device.
+</para>
+
+
+<para>
+The data_len member is set to the length of the actual recorded protocol
+data in 4-byte units.
+</para>
+
+<para>
+When the context has been enabled, protocol data the recording client has
+previously expressed interest in is recorded and returned to the
+recording client via multiple replies.  Because the X server batches
+the recorded data, more than one protocol element may be contained
+in the same reply packet.  When a reply is received, a procedure of type
+<function>XRecordInterceptProc</function>
+is called for each protocol element in the reply.
+</para>
+
+<funcsynopsis id='XRecordInterceptProc'>
+<funcprototype>
+  <funcdef>typedef void <function>(*XRecordInterceptProc)</function></funcdef>
+    <paramdef>XPointer<parameter> closure</parameter></paramdef>
+    <paramdef>XRecordInterceptData<parameter> *recorded_data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>closure</emphasis></term>
+    <listitem><para>Pointer that was passed in when the context was enabled.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>recorded_data</emphasis></term>
+    <listitem><para>A protocol element recorded by the server extension.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+This callback may use the control display connection (or any display
+connection other than the data connection).
+</para>
+
+<para>
+Recording clients should use the
+<xref linkend='XRecordFreeData' xrefstyle='select: title'/>
+function to free the
+<function>XRecordInterceptData</function>
+structure.
+</para>
+
+<funcsynopsis id='XRecordEnableContext'>
+<funcprototype>
+  <funcdef>Status <function>XRecordEnableContext</function></funcdef>
+    <paramdef>Display<parameter> *display</parameter></paramdef>
+    <paramdef>XRecordContext<parameter> context</parameter></paramdef>
+    <paramdef>XRecordInterceptProc<parameter> callback</parameter></paramdef>
+    <paramdef>XPointer<parameter> closure</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <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'>context</emphasis></term>
+    <listitem><para>Specifies the record context to enable.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>callback</emphasis></term>
+    <listitem><para>Specifies the function to be called for each protocol element received.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>closure</emphasis></term>
+    <listitem><para>Specifies data passed to callback.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+<xref linkend='XRecordEnableContext' xrefstyle='select: title'/>
+enables data transfer between the recording client and
+the X server.  All core and extension protocol received from or sent to
+targeted clients that the recording client has expressed
+interest in will be recorded and reported to the recording client.
+</para>
+
+<para>
+<xref linkend='XRecordEnableContext' xrefstyle='select: title'/>
+returns zero if the request failed; otherwise, it
+returns nonzero.  The context argument must specify a valid
+<function>XRecordContext</function>
+or a
+<function>XRecordBadContext</function>
+error results.  The error
+<function>BadMatch</function>
+results when data transfer is already enabled on the given context.
+</para>
+</sect2>
+
+<sect2 id='Enable_Context_Asynchronously'>
+<title>Enable Context Asynchronously</title>
+
+<para>Because
+<xref linkend='XRecordEnableContext' xrefstyle='select: title'/>
+does not return until
+<xref linkend='XRecordDisableContext' xrefstyle='select: title'/>
+is executed on the control connection, a nonblocking interface in
+addition to
+<xref linkend='XRecordEnableContext' xrefstyle='select: title'/>
+is provided.  This interface also
+enables data transfer; however, it does not block.
+</para>
+
+<para>
+This interface is defined as follows:
+</para>
+
+<funcsynopsis id='XRecordEnableContextAsync'>
+<funcprototype>
+  <funcdef>Status <function>XRecordEnableContextAsync</function></funcdef>
+    <paramdef>Display<parameter> *display</parameter></paramdef>
+    <paramdef>XRecordContext<parameter> context</parameter></paramdef>
+    <paramdef>XRecordInterceptProc<parameter> callback</parameter></paramdef>
+    <paramdef>XPointer<parameter> closure</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <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'>context</emphasis></term>
+    <listitem><para>Specifies the record context to enable.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>callback</emphasis></term>
+    <listitem><para>Specifies the function to be called for each protocol element received.</para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><emphasis remap='I'>closure</emphasis></term>
+    <listitem><para>Specifies data passed to callback.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XRecordEnableContextAsync' xrefstyle='select: title'/>
+enables data transfer between the recording
+client and the X server just as
+<xref linkend='XRecordEnableContext' xrefstyle='select: title'/>
+does.  Unlike
+<xref linkend='XRecordEnableContext' xrefstyle='select: title'/>
+it does not wait for the context to be disabled
+before returning;
+<xref linkend='XRecordEnableContextAsync' xrefstyle='select: title'/>
+returns as soon as the
+<function>XRecordStartOfData</function>
+reply has been received and processed.
+</para>
+
+<para>
+<xref linkend='XRecordEnableContextAsync' xrefstyle='select: title'/>
+returns zero if it could not allocate the
+necessary memory and nonzero if it sent the request successfully to
+the server.  The context argument must specify a valid
+<function>XRecordContext</function>
+or a
+<function>XRecordBadContext</function>
+error results.  The error
+<function>BadMatch</function>
+results when data transfer is already enabled.
+</para>
+
+<para>
+Each time it reads data from the server connection, Xlib will check
+for incoming replies and call <emphasis remap='I'>callback</emphasis>
+as necessary.  The application may direct Xlib explicitly to check
+for Record data with the
+<xref linkend='XRecordProcessReplies' xrefstyle='select: title'/>
+function.
+</para>
+
+<funcsynopsis id='XRecordProcessReplies'>
+<funcprototype>
+  <funcdef>void <function>XRecordProcessReplies</function></funcdef>
+    <paramdef>Display<parameter> *display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>display</emphasis></term>
+    <listitem><para>Specifies the connection to the X server.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+<xref linkend='XRecordProcessReplies' xrefstyle='select: title'/>
+will check for any replies that have not yet
+been processed by the application.  The asynchronous callback will be called
+as appropriate.
+<xref linkend='XRecordProcessReplies' xrefstyle='select: title'/>
+returns when all immediately
+available replies have been processed.  It does not block.
+</para>
+
+<para>To free the data passed to the
+<function>XRecordInterceptProc</function>
+callback, use
+<xref linkend='XRecordFreeData' xrefstyle='select: title'/></para>
+
+<funcsynopsis id='XRecordFreeData'>
+<funcprototype>
+  <funcdef>void <function>XRecordFreeData</function></funcdef>
+    <paramdef>XRecordInterceptData<parameter> *data</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>data</emphasis></term>
+    <listitem><para>Specifies the structure that is to be freed.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+<xref linkend='XRecordFreeData' xrefstyle='select: title'/>
+frees the data pointed to by data.  If the argument does not match an
+<function>XRecordInterceptData</function>
+pointer earlier passed to an
+<function>XRecordInterceptProc</function>
+callback or if
+<xref linkend='XRecordFreeData' xrefstyle='select: title'/>
+has already been called with it, the behavior is undefined.
+</para>
+</sect2>
+
+<sect2 id='Disable_Context'>
+<title>Disable Context</title>
+
+<para>
+To direct the X server to halt the reporting of recorded protocol, the
+program executes
+<xref linkend='XRecordDisableContext' xrefstyle='select: title'/>
+typically over its control connection to the X server.
+</para>
+
+<funcsynopsis id='XRecordDisableContext'>
+<funcprototype>
+  <funcdef>Status <function>XRecordDisableContext</function></funcdef>
+    <paramdef>Display<parameter> *display</parameter></paramdef>
+    <paramdef>XRecordContext<parameter> context</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <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'>context</emphasis></term>
+    <listitem><para>Specifies the record context to disable.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+The
+<xref linkend='XRecordDisableContext' xrefstyle='select: title'/>
+function disables context, stopping all recording over its data connection.
+Any complete protocol elements for context that were buffered in the
+server will be sent to the recording client rather than being discarded.
+If a program attempts to disable an
+<function>XRecordContext</function>
+that has not been enabled, no action will take place.
+</para>
+
+<para>
+<xref linkend='XRecordDisableContext' xrefstyle='select: title'/>
+returns zero if the request failed; otherwise, it
+returns nonzero.  The context argument must specify a valid
+<function>XRecordContext</function>
+or an
+<function>XRecordBadContext</function>
+error results.
+</para>
+</sect2>
+</sect1>
+
+<sect1 id='ID_Base_Mask'>
+<title>ID Base Mask</title>
+
+<para>
+To determine the mask the server uses for the client ID base, use
+<xref linkend='XRecordIdBaseMask' xrefstyle='select: title'/></para>
+
+<funcsynopsis id='XRecordIdBaseMask'>
+<funcprototype>
+  <funcdef>XID <function>XRecordIdBaseMask</function></funcdef>
+    <paramdef>Display<parameter> *display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <varlistentry>
+    <term><emphasis remap='I'>display</emphasis></term>
+    <listitem><para>Specifies the connection to the X server.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XRecordIdBaseMask' xrefstyle='select: title'/>
+function returns the resource ID mask passed to the client by the
+server at connection setup.
+</para>
+
+</sect1>
+
+<sect1 id='Free_Context'>
+<title>Free Context</title>
+
+<para>
+Before terminating, the program should request that the server
+free the record context.  This is done with the
+<xref linkend='XRecordFreeContext' xrefstyle='select: title'/>
+function, typically over the record client's control connection
+to the X server.
+</para>
+
+<funcsynopsis id='XRecordFreeContext'>
+<funcprototype>
+  <funcdef>Status <function>XRecordFreeContext</function></funcdef>
+    <paramdef>Display<parameter> *display</parameter></paramdef>
+    <paramdef>XRecordContext<parameter> context</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist remap='IP'>
+  <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'>context</emphasis></term>
+    <listitem><para>Specifies the record context to free.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The
+<xref linkend='XRecordFreeContext' xrefstyle='select: title'/>
+function frees the given context for the
+requesting client.  Freeing a record context releases the clients
+targeted for recording and their respective protocol ranges to
+record.  If protocol data is being reported to the recording client,
+generally over the data connection to the X server, the reporting
+ceases as if
+<xref linkend='XRecordDisableContext' xrefstyle='select: title'/>
+had been called on the given context.  When a program terminates
+without freeing its record context, the X server will automatically
+free that context on behalf of the client.
+</para>
+
+<para>
+<xref linkend='XRecordFreeContext' xrefstyle='select: title'/>
+returns zero if the request failed; otherwise,it
+returns nonzero.  The context argument must specify a valid
+<function>XRecordContext</function>
+or a
+<function>XRecordBadContext</function>
+error results.
+</para>
+
+</sect1>
+</chapter>
+</book>
Index: lib/libXtst/create-1.2.4-docbook-patch/libXtst-1.2.4-new/specs
===================================================================
--- lib/libXtst/create-1.2.4-docbook-patch/libXtst-1.2.4-new/specs	(nonexistent)
+++ lib/libXtst/create-1.2.4-docbook-patch/libXtst-1.2.4-new/specs	(revision 5)

Property changes on: lib/libXtst/create-1.2.4-docbook-patch/libXtst-1.2.4-new/specs
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXtst/create-1.2.4-docbook-patch/libXtst-1.2.4-new
===================================================================
--- lib/libXtst/create-1.2.4-docbook-patch/libXtst-1.2.4-new	(nonexistent)
+++ lib/libXtst/create-1.2.4-docbook-patch/libXtst-1.2.4-new	(revision 5)

Property changes on: lib/libXtst/create-1.2.4-docbook-patch/libXtst-1.2.4-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXtst/create-1.2.4-docbook-patch
===================================================================
--- lib/libXtst/create-1.2.4-docbook-patch	(nonexistent)
+++ lib/libXtst/create-1.2.4-docbook-patch	(revision 5)

Property changes on: lib/libXtst/create-1.2.4-docbook-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXtst/patches/README
===================================================================
--- lib/libXtst/patches/README	(nonexistent)
+++ lib/libXtst/patches/README	(revision 5)
@@ -0,0 +1,6 @@
+
+/* begin *
+
+   TODO: Leave some comment here.
+
+ * end */
Index: lib/libXtst/patches
===================================================================
--- lib/libXtst/patches	(nonexistent)
+++ lib/libXtst/patches	(revision 5)

Property changes on: lib/libXtst/patches
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXtst
===================================================================
--- lib/libXtst	(nonexistent)
+++ lib/libXtst	(revision 5)

Property changes on: lib/libXtst
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXv/Makefile
===================================================================
--- lib/libXv/Makefile	(nonexistent)
+++ lib/libXv/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXv
+
+versions    = 1.0.12
+pkgname     = libXv
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXv
===================================================================
--- lib/libXv	(nonexistent)
+++ lib/libXv	(revision 5)

Property changes on: lib/libXv
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXvMC/Makefile
===================================================================
--- lib/libXvMC/Makefile	(nonexistent)
+++ lib/libXvMC/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXvMC
+
+versions    = 1.0.13
+pkgname     = libXvMC
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXvMC
===================================================================
--- lib/libXvMC	(nonexistent)
+++ lib/libXvMC	(revision 5)

Property changes on: lib/libXvMC
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXxf86dga/Makefile
===================================================================
--- lib/libXxf86dga/Makefile	(nonexistent)
+++ lib/libXxf86dga/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXxf86dga
+
+versions    = 1.1.6
+pkgname     = libXxf86dga
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXxf86dga
===================================================================
--- lib/libXxf86dga	(nonexistent)
+++ lib/libXxf86dga	(revision 5)

Property changes on: lib/libXxf86dga
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXxf86misc/Makefile
===================================================================
--- lib/libXxf86misc/Makefile	(nonexistent)
+++ lib/libXxf86misc/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXxf86misc
+
+versions    = 1.0.4
+pkgname     = libXxf86misc
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXxf86misc
===================================================================
--- lib/libXxf86misc	(nonexistent)
+++ lib/libXxf86misc	(revision 5)

Property changes on: lib/libXxf86misc
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libXxf86vm/Makefile
===================================================================
--- lib/libXxf86vm/Makefile	(nonexistent)
+++ lib/libXxf86vm/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libXxf86vm
+
+versions    = 1.1.5
+pkgname     = libXxf86vm
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libXxf86vm
===================================================================
--- lib/libXxf86vm	(nonexistent)
+++ lib/libXxf86vm	(revision 5)

Property changes on: lib/libXxf86vm
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libdmx/Makefile
===================================================================
--- lib/libdmx/Makefile	(nonexistent)
+++ lib/libdmx/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libdmx
+
+versions    = 1.1.4
+pkgname     = libdmx
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libdmx
===================================================================
--- lib/libdmx	(nonexistent)
+++ lib/libdmx	(revision 5)

Property changes on: lib/libdmx
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libfontenc/Makefile
===================================================================
--- lib/libfontenc/Makefile	(nonexistent)
+++ lib/libfontenc/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libfontenc
+
+versions    = 1.1.7
+pkgname     = libfontenc
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libfontenc
===================================================================
--- lib/libfontenc	(nonexistent)
+++ lib/libfontenc	(revision 5)

Property changes on: lib/libfontenc
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libpciaccess/Makefile
===================================================================
--- lib/libpciaccess/Makefile	(nonexistent)
+++ lib/libpciaccess/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libpciaccess
+
+versions    = 0.17
+pkgname     = libpciaccess
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libpciaccess
===================================================================
--- lib/libpciaccess	(nonexistent)
+++ lib/libpciaccess	(revision 5)

Property changes on: lib/libpciaccess
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libxcvt/Makefile
===================================================================
--- lib/libxcvt/Makefile	(nonexistent)
+++ lib/libxcvt/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libxcvt
+
+versions    = 0.1.2
+pkgname     = libxcvt
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libxcvt
===================================================================
--- lib/libxcvt	(nonexistent)
+++ lib/libxcvt	(revision 5)

Property changes on: lib/libxcvt
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libxkbfile/Makefile
===================================================================
--- lib/libxkbfile/Makefile	(nonexistent)
+++ lib/libxkbfile/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libxkbfile
+
+versions    = 1.1.2
+pkgname     = libxkbfile
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libxkbfile
===================================================================
--- lib/libxkbfile	(nonexistent)
+++ lib/libxkbfile	(revision 5)

Property changes on: lib/libxkbfile
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/libxshmfence/Makefile
===================================================================
--- lib/libxshmfence/Makefile	(nonexistent)
+++ lib/libxshmfence/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/libxshmfence
+
+versions    = 1.3.2
+pkgname     = libxshmfence
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/libxshmfence
===================================================================
--- lib/libxshmfence	(nonexistent)
+++ lib/libxshmfence	(revision 5)

Property changes on: lib/libxshmfence
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/pixman/Makefile
===================================================================
--- lib/pixman/Makefile	(nonexistent)
+++ lib/pixman/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/pixman
+
+versions    = 0.42.2
+pkgname     = pixman
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/pixman
===================================================================
--- lib/pixman	(nonexistent)
+++ lib/pixman	(revision 5)

Property changes on: lib/pixman
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib/xtrans/Makefile
===================================================================
--- lib/xtrans/Makefile	(nonexistent)
+++ lib/xtrans/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/lib/xtrans
+
+versions    = 1.4.0
+pkgname     = xtrans
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: lib/xtrans
===================================================================
--- lib/xtrans	(nonexistent)
+++ lib/xtrans	(revision 5)

Property changes on: lib/xtrans
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: lib
===================================================================
--- lib	(nonexistent)
+++ lib	(revision 5)

Property changes on: lib
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/Makefile
===================================================================
--- proto/Makefile	(nonexistent)
+++ proto/Makefile	(revision 5)
@@ -0,0 +1,13 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+SOURCE_REQUIRES += ALL_DIRS
+
+
+include ../../../build-system/core.mk
+
+
+download_clean:
+	@true
+
+.PHONY: download_clean
Index: proto/applewmproto/Makefile
===================================================================
--- proto/applewmproto/Makefile	(nonexistent)
+++ proto/applewmproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/applewmproto
+
+versions    = 1.4.2
+pkgname     = applewmproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/applewmproto
===================================================================
--- proto/applewmproto	(nonexistent)
+++ proto/applewmproto	(revision 5)

Property changes on: proto/applewmproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/bigreqsproto/Makefile
===================================================================
--- proto/bigreqsproto/Makefile	(nonexistent)
+++ proto/bigreqsproto/Makefile	(revision 5)
@@ -0,0 +1,56 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/bigreqsproto
+
+versions    = 1.1.2
+pkgname     = bigreqsproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+patches     = $(CURDIR)/patches/bigreqsproto-1.1.2-docbook.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-1.1.2-docbook-patch ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s) $(patches)
Index: proto/bigreqsproto/create-1.1.2-docbook-patch/bigreqsproto-1.1.2-new/specs/bigreq.xml
===================================================================
--- proto/bigreqsproto/create-1.1.2-docbook-patch/bigreqsproto-1.1.2-new/specs/bigreq.xml	(nonexistent)
+++ proto/bigreqsproto/create-1.1.2-docbook-patch/bigreqsproto-1.1.2-new/specs/bigreq.xml	(revision 5)
@@ -0,0 +1,323 @@
+<?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"
+[
+<!ENTITY % defs SYSTEM "defs.ent"> %defs;
+]>
+
+<!-- lifted from troff+ms+XMan by doclifter -->
+<book id="bigreq">
+
+<bookinfo>
+   <title>Big Requests Extension</title>
+   <subtitle>X Consortium Standard</subtitle>
+   <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
+   <releaseinfo>Version 2.0</releaseinfo>
+   <authorgroup>
+      <author>
+         <firstname>Bob</firstname><surname>Scheifler</surname>
+         <affiliation><orgname>X Consortium</orgname></affiliation>
+      </author>
+   </authorgroup>
+   <copyright><year>1993</year><year>1994</year><holder>X Consortium</holder></copyright>
+
+<legalnotice>
+<para>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &ldquo;Software&rdquo;), 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>
+
+<para>X Window System is a trademark of The Open Group.</para>
+</legalnotice>
+
+</bookinfo>
+
+<chapter id='Overview'>
+<title>Overview</title>
+
+<para>This extension enables the use of protocol requests that exceed 262140 bytes in length.</para>
+
+<para>The core protocol restricts the maximum length of a protocol request to 262140 bytes, in that it uses a 16-bit length field specifying the number of 4-byte units in the request.  This is a problem in the core protocol when joining large numbers of lines (<symbol role='Pn'>PolyLine</symbol>) or arcs (<symbol role='Pn'>PolyArc</symbol>), since these requests cannot be broken up into smaller requests without disturbing the rendering of the join points.  It is also much more of a problem for protocol extensions, such as the PEX extension for 3D graphics and the XIE extension for imaging, that need to send long data lists in output commands.</para>
+
+<para>This extension defines a mechanism for extending the length field beyond 16 bits.  If the normal 16-bit length field of the protocol request is zero, then an additional 32-bit field containing the actual length (in 4-byte units) is inserted into the request, immediately following the 16-bit length field.</para>
+
+<para>For example, a normal <function>PolyLine</function> encoding is:</para>
+
+<informaltable id='PolyLine' frame='none'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='4' align='left' colsep='0' rowsep='0'>
+    <colspec colname='c1' colwidth='1.0*'/>
+    <colspec colname='c2' colwidth='3.0*'/>
+    <colspec colname='c3' colwidth='2.0*'/>
+    <colspec colname='c4' colwidth='11.0*'/>
+    <thead>
+      <row>
+        <entry namest="c1" nameend="c4"><function>PolyLine</function></entry>
+      </row>
+    </thead>
+    <tbody>
+      <row>
+        <entry>1</entry>
+        <entry>65</entry>
+        <entry></entry>
+        <entry>opcode</entry>
+      </row>
+      <row>
+        <entry>1</entry>
+        <entry></entry>
+        <entry></entry>
+        <entry>coordinate-mode</entry>
+      </row>
+      <row>
+        <entry></entry>
+        <entry>0</entry>
+        <entry>Origin</entry>
+        <entry></entry>
+      </row>
+      <row>
+        <entry></entry>
+        <entry>1</entry>
+        <entry>Previous</entry>
+        <entry></entry>
+      </row>
+      <row>
+        <entry>2</entry>
+        <entry>3+n</entry>
+        <entry></entry>
+        <entry></entry>
+      </row>
+      <row>
+        <entry>4</entry>
+        <entry>DRAWABLE</entry>
+        <entry></entry>
+        <entry>drawable</entry>
+      </row>
+      <row>
+        <entry>4</entry>
+        <entry>GCONTEXT</entry>
+        <entry></entry>
+        <entry>gc</entry>
+      </row>
+      <row>
+        <entry>4n</entry>
+        <entry>LISTofPOINT</entry>
+        <entry></entry>
+        <entry>points</entry>
+      </row>
+     </tbody>
+  </tgroup>
+</informaltable>
+
+<para>An extended-length <function>PolyLine</function> encoding is:</para>
+
+<informaltable frame='none'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='4' align='left' colsep='0' rowsep='0'>
+    <colspec colname='c1' colwidth='1.0*'/>
+    <colspec colname='c2' colwidth='3.0*'/>
+    <colspec colname='c3' colwidth='2.0*'/>
+    <colspec colname='c4' colwidth='11.0*'/>
+    <thead>
+      <row>
+        <entry namest="c1" nameend="c4"><function>PolyLine</function></entry>
+      </row>
+    </thead>
+    <tbody>
+      <row>
+        <entry>1</entry>
+        <entry>65</entry>
+        <entry></entry>
+        <entry>opcode</entry>
+      </row>
+      <row>
+        <entry>1</entry>
+        <entry></entry>
+        <entry></entry>
+        <entry>coordinate-mode</entry>
+      </row>
+      <row>
+        <entry></entry>
+        <entry>0</entry>
+        <entry>Origin</entry>
+        <entry></entry>
+      </row>
+      <row>
+        <entry></entry>
+        <entry>1</entry>
+        <entry>Previous</entry>
+        <entry></entry>
+      </row>
+      <row>
+        <entry>2</entry>
+        <entry>0</entry>
+        <entry></entry>
+        <entry>extended length flag</entry>
+      </row>
+      <row>
+        <entry>4</entry>
+        <entry>4+n</entry>
+        <entry></entry>
+        <entry>request length</entry>
+      </row>
+      <row>
+        <entry>4</entry>
+        <entry>DRAWABLE</entry>
+        <entry></entry>
+        <entry>drawable</entry>
+      </row>
+      <row>
+        <entry>4</entry>
+        <entry>GCONTEXT</entry>
+        <entry></entry>
+        <entry>gc</entry>
+      </row>
+      <row>
+        <entry>4n</entry>
+        <entry>LISTofPOINT</entry>
+        <entry></entry>
+        <entry>points</entry>
+      </row>
+     </tbody>
+  </tgroup>
+</informaltable>
+
+<para>Extended-length protocol encodings, once enabled, can be used on all protocol requests, including all extensions.</para>
+</chapter>
+
+<chapter id='Requests'>
+<title>Requests</title>
+
+<para><function>BigReqEnable</function></para>
+
+<para>   =&gt;</para>
+
+<para><emphasis remap='I'>maximum-request-length</emphasis>: CARD32</para>
+
+<para>This request enables extended-length protocol requests for the requesting client.  It also returns the maximum length of a request, in 4-byte units, that can be used in extended-length protocol requests.  This value will always be greater than the maximum-request-length returned in the connection setup information.</para>
+</chapter>
+
+<chapter id='Events_and_Errors'>
+<title>Events and Errors</title>
+
+<para>No new events or errors are defined by this extension.</para>
+</chapter>
+
+<chapter 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 &ldquo;BIG-REQUESTS&rdquo;.</para>
+
+<informaltable frame='none'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+    <colspec colname='c1' colwidth='1.0*'/>
+    <colspec colname='c2' colwidth='2.0*'/>
+    <colspec colname='c3' colwidth='15.0*'/>
+    <thead>
+      <row>
+        <entry namest="c1" nameend="c3">BigReqEnable</entry>
+      </row>
+    </thead>
+    <tbody>
+      <row>
+        <entry>1</entry>
+        <entry>Card8</entry>
+        <entry>opcode</entry>
+      </row>
+      <row>
+        <entry>1</entry>
+        <entry>0</entry>
+        <entry>bigreq opcode</entry>
+      </row>
+      <row>
+        <entry>2</entry>
+        <entry>1</entry>
+        <entry>request length</entry>
+      </row>
+     </tbody>
+  </tgroup>
+  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+    <colspec colname='c1' colwidth='1.0*'/>
+    <colspec colname='c2' colwidth='2.0*'/>
+    <colspec colname='c3' colwidth='15.0*'/>
+    <thead>
+      <row>
+        <entry namest="c1" nameend="c3">=&gt;</entry>
+      </row>
+    </thead>
+    <tbody>
+      <row>
+        <entry>1</entry>
+        <entry>1</entry>
+        <entry>Reply</entry>
+      </row>
+      <row>
+        <entry>1</entry>
+        <entry></entry>
+        <entry>unused</entry>
+      </row>
+      <row>
+        <entry>2</entry>
+        <entry>CARD16</entry>
+        <entry>sequence number</entry>
+      </row>
+      <row>
+        <entry>4</entry>
+        <entry>0</entry>
+        <entry>length</entry>
+      </row>
+      <row>
+        <entry>4</entry>
+        <entry>CARD32</entry>
+        <entry>maximum-request-length</entry>
+      </row>
+      <row>
+        <entry>20</entry>
+        <entry></entry>
+        <entry>unused</entry>
+      </row>
+     </tbody>
+  </tgroup>
+</informaltable>
+
+</chapter>
+
+<chapter id='C_Language_Binding'>
+<title>C language binding</title>
+
+<para>It is desirable for core Xlib, and other extensions, to use this extension internally when necessary.
+It is also desirable to make the use of this extension as transparent as possible to the X client.
+For example, if enabling of the extension were delayed until the first time it was needed, an application that used
+<function>XNextRequest</function> to determine the sequence number of a request would no longer get the correct sequence number.  As such,
+<function>XOpenDisplay</function> will determine if the extension is supported by the server and, if it is, enable extended-length
+encodings.</para>
+
+<para>The core Xlib functions <function>XDrawLines</function>, <function>XDrawArcs</function>, <function>XFillPolygon</function>, <function>XChangeProperty</function>, <function>XSetClipRectangles</function>, and <function>XSetRegion</function>
+are required to use extended-length encodings when necessary, if supported by the server.  Use of extended-length encodings
+in other core Xlib functions (<function>XDrawPoints</function>, <function>XDrawRectangles</function>, <function>XDrawSegments</function>). <function>XFillArcs</function>, <function>XFillRectangles</function>, <function>XPutImage</function>
+is permitted but not required; an Xlib implementation may choose to split the data across multiple smaller requests
+instead.</para>
+
+<para>To permit clients to know what the maximum-request-length for extended-length encodings is, the following function is added to Xlib:
+
+<funcsynopsis id='XExtendedMaxRequestSize'>
+<funcprototype>
+  <funcdef>long <function>XExtendedMaxRequestSize</function></funcdef>
+    <paramdef>Display <parameter> *display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+Returns zero (0) if the specified display does not support this extension, otherwise returns the maximum-request-length (in 4-byte units) supported by the server through the extended-length encoding.</para>
+</chapter>
+
+<chapter id='Acknowledgements'>
+<title>Acknowledgements</title>
+
+<para>Clive Feather (IXI) originated the extended-length encoding used in this extension proposal.</para>
+</chapter>
+</book>
Index: proto/bigreqsproto/create-1.1.2-docbook-patch/bigreqsproto-1.1.2-new/specs
===================================================================
--- proto/bigreqsproto/create-1.1.2-docbook-patch/bigreqsproto-1.1.2-new/specs	(nonexistent)
+++ proto/bigreqsproto/create-1.1.2-docbook-patch/bigreqsproto-1.1.2-new/specs	(revision 5)

Property changes on: proto/bigreqsproto/create-1.1.2-docbook-patch/bigreqsproto-1.1.2-new/specs
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/bigreqsproto/create-1.1.2-docbook-patch/bigreqsproto-1.1.2-new
===================================================================
--- proto/bigreqsproto/create-1.1.2-docbook-patch/bigreqsproto-1.1.2-new	(nonexistent)
+++ proto/bigreqsproto/create-1.1.2-docbook-patch/bigreqsproto-1.1.2-new	(revision 5)

Property changes on: proto/bigreqsproto/create-1.1.2-docbook-patch/bigreqsproto-1.1.2-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/bigreqsproto/create-1.1.2-docbook-patch/create.patch.sh
===================================================================
--- proto/bigreqsproto/create-1.1.2-docbook-patch/create.patch.sh	(nonexistent)
+++ proto/bigreqsproto/create-1.1.2-docbook-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=1.1.2
+
+tar --files-from=file.list -xjvf ../bigreqsproto-$VERSION.tar.bz2
+mv bigreqsproto-$VERSION bigreqsproto-$VERSION-orig
+
+cp -rf ./bigreqsproto-$VERSION-new ./bigreqsproto-$VERSION
+
+diff --unified -Nr  bigreqsproto-$VERSION-orig  bigreqsproto-$VERSION > bigreqsproto-$VERSION-docbook.patch
+
+mv bigreqsproto-$VERSION-docbook.patch ../patches
+
+rm -rf ./bigreqsproto-$VERSION
+rm -rf ./bigreqsproto-$VERSION-orig

Property changes on: proto/bigreqsproto/create-1.1.2-docbook-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: proto/bigreqsproto/create-1.1.2-docbook-patch/file.list
===================================================================
--- proto/bigreqsproto/create-1.1.2-docbook-patch/file.list	(nonexistent)
+++ proto/bigreqsproto/create-1.1.2-docbook-patch/file.list	(revision 5)
@@ -0,0 +1 @@
+bigreqsproto-1.1.2/specs/bigreq.xml
Index: proto/bigreqsproto/create-1.1.2-docbook-patch
===================================================================
--- proto/bigreqsproto/create-1.1.2-docbook-patch	(nonexistent)
+++ proto/bigreqsproto/create-1.1.2-docbook-patch	(revision 5)

Property changes on: proto/bigreqsproto/create-1.1.2-docbook-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/bigreqsproto/patches/README
===================================================================
--- proto/bigreqsproto/patches/README	(nonexistent)
+++ proto/bigreqsproto/patches/README	(revision 5)
@@ -0,0 +1,6 @@
+
+/* begin *
+
+   TODO: Leave some comment here.
+
+ * end */
Index: proto/bigreqsproto/patches
===================================================================
--- proto/bigreqsproto/patches	(nonexistent)
+++ proto/bigreqsproto/patches	(revision 5)

Property changes on: proto/bigreqsproto/patches
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/bigreqsproto
===================================================================
--- proto/bigreqsproto	(nonexistent)
+++ proto/bigreqsproto	(revision 5)

Property changes on: proto/bigreqsproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/compositeproto/Makefile
===================================================================
--- proto/compositeproto/Makefile	(nonexistent)
+++ proto/compositeproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/compositeproto
+
+versions    = 0.4.2
+pkgname     = compositeproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/compositeproto
===================================================================
--- proto/compositeproto	(nonexistent)
+++ proto/compositeproto	(revision 5)

Property changes on: proto/compositeproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/damageproto/Makefile
===================================================================
--- proto/damageproto/Makefile	(nonexistent)
+++ proto/damageproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/damageproto
+
+versions    = 1.2.1
+pkgname     = damageproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/damageproto
===================================================================
--- proto/damageproto	(nonexistent)
+++ proto/damageproto	(revision 5)

Property changes on: proto/damageproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/dmxproto/Makefile
===================================================================
--- proto/dmxproto/Makefile	(nonexistent)
+++ proto/dmxproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/dmxproto
+
+versions    = 2.3.1
+pkgname     = dmxproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/dmxproto
===================================================================
--- proto/dmxproto	(nonexistent)
+++ proto/dmxproto	(revision 5)

Property changes on: proto/dmxproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/dri2proto/Makefile
===================================================================
--- proto/dri2proto/Makefile	(nonexistent)
+++ proto/dri2proto/Makefile	(revision 5)
@@ -0,0 +1,56 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/dri2proto
+
+versions    = 2.8
+pkgname     = dri2proto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+patches     = $(CURDIR)/patches/dri2proto-2.8-ti-glsdk.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-2.8-ti-glsdk-patch ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s) $(patches)
Index: proto/dri2proto/create-2.8-ti-glsdk-patch/create.patch.sh
===================================================================
--- proto/dri2proto/create-2.8-ti-glsdk-patch/create.patch.sh	(nonexistent)
+++ proto/dri2proto/create-2.8-ti-glsdk-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=2.8
+
+tar --files-from=file.list -xjvf ../dri2proto-$VERSION.tar.bz2
+mv dri2proto-$VERSION dri2proto-$VERSION-orig
+
+cp -rf ./dri2proto-$VERSION-new ./dri2proto-$VERSION
+
+diff --unified -Nr  dri2proto-$VERSION-orig  dri2proto-$VERSION > dri2proto-$VERSION-ti-glsdk.patch
+
+mv dri2proto-$VERSION-ti-glsdk.patch ../patches
+
+rm -rf ./dri2proto-$VERSION
+rm -rf ./dri2proto-$VERSION-orig

Property changes on: proto/dri2proto/create-2.8-ti-glsdk-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: proto/dri2proto/create-2.8-ti-glsdk-patch/dri2proto-2.8-new/dri2proto.h
===================================================================
--- proto/dri2proto/create-2.8-ti-glsdk-patch/dri2proto-2.8-new/dri2proto.h	(nonexistent)
+++ proto/dri2proto/create-2.8-ti-glsdk-patch/dri2proto-2.8-new/dri2proto.h	(revision 5)
@@ -0,0 +1,446 @@
+/*
+ * Copyright © 2008 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Soft-
+ * ware"), to deal in the Software without restriction, including without
+ * limitation the rights to use, copy, modify, merge, publish, distribute,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, provided that the above copyright
+ * notice(s) and this permission notice appear in all copies of the Soft-
+ * ware and that both the above copyright notice(s) and this permission
+ * notice appear in supporting documentation.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
+ * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
+ * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
+ * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE-
+ * QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR-
+ * MANCE OF THIS SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder shall
+ * not be used in advertising or otherwise to promote the sale, use or
+ * other dealings in this Software without prior written authorization of
+ * the copyright holder.
+ *
+ * Authors:
+ *   Kristian Høgsberg (krh@redhat.com)
+ */
+
+#ifndef _DRI2_PROTO_H_
+#define _DRI2_PROTO_H_
+
+#define DRI2_NAME			"DRI2"
+#define DRI2_MAJOR			1
+#define DRI2_MINOR			5
+
+#define DRI2NumberErrors		0
+#define DRI2NumberEvents		2
+#define DRI2NumberRequests		14
+
+#define X_DRI2QueryVersion		0
+#define X_DRI2Connect			1
+#define X_DRI2Authenticate		2
+#define X_DRI2CreateDrawable		3
+#define X_DRI2DestroyDrawable		4
+#define X_DRI2GetBuffers		5
+#define X_DRI2CopyRegion		6
+#define X_DRI2GetBuffersWithFormat	7
+#define X_DRI2SwapBuffers		8
+#define X_DRI2GetMSC			9
+#define X_DRI2WaitMSC			10
+#define X_DRI2WaitSBC			11
+#define X_DRI2SwapInterval		12
+#define X_DRI2GetParam			13
+#define X_DRI2GetBuffersVid		14
+#define X_DRI2SwapBuffersVid		15
+#define X_DRI2SetAttribute		16
+#define X_DRI2GetAttribute		17
+#define X_DRI2GetFormats		18
+
+/*
+ * Events
+ */
+#define DRI2_BufferSwapComplete	0
+#define DRI2_InvalidateBuffers	1
+
+typedef struct {
+    CARD32  attachment B32;
+    CARD32  name B32;
+    CARD32  pitch B32;
+    CARD32  cpp B32;
+    CARD32  flags B32;
+} xDRI2Buffer;
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  majorVersion B32;
+    CARD32  minorVersion B32;
+} xDRI2QueryVersionReq;
+#define sz_xDRI2QueryVersionReq   12
+
+typedef struct {
+    BYTE    type;   /* X_Reply */
+    BYTE    pad1;
+    CARD16  sequenceNumber B16;
+    CARD32  length B32;
+    CARD32  majorVersion B32;
+    CARD32  minorVersion B32;
+    CARD32  pad2 B32;
+    CARD32  pad3 B32;
+    CARD32  pad4 B32;
+    CARD32  pad5 B32;
+} xDRI2QueryVersionReply;
+#define sz_xDRI2QueryVersionReply	32
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  window B32;
+    CARD32  driverType B32;
+} xDRI2ConnectReq;
+#define sz_xDRI2ConnectReq	12
+
+typedef struct {
+    BYTE    type;   /* X_Reply */
+    BYTE    pad1;
+    CARD16  sequenceNumber B16;
+    CARD32  length B32;
+    CARD32  driverNameLength B32;
+    CARD32  deviceNameLength B32;
+    CARD32  pad2 B32;
+    CARD32  pad3 B32;
+    CARD32  pad4 B32;
+    CARD32  pad5 B32;
+} xDRI2ConnectReply;
+#define sz_xDRI2ConnectReply	32
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  window B32;
+    CARD32  magic B32;
+} xDRI2AuthenticateReq;
+#define sz_xDRI2AuthenticateReq   12
+
+typedef struct {
+    BYTE    type;   /* X_Reply */
+    BYTE    pad1;
+    CARD16  sequenceNumber B16;
+    CARD32  length B32;
+    CARD32  authenticated B32;
+    CARD32  pad2 B32;
+    CARD32  pad3 B32;
+    CARD32  pad4 B32;
+    CARD32  pad5 B32;
+    CARD32  pad6 B32;
+} xDRI2AuthenticateReply;
+#define sz_xDRI2AuthenticateReply	32
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+} xDRI2CreateDrawableReq;
+#define sz_xDRI2CreateDrawableReq   8
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+} xDRI2DestroyDrawableReq;
+#define sz_xDRI2DestroyDrawableReq   8
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+    CARD32  count B32;
+} xDRI2GetBuffersReq;
+#define sz_xDRI2GetBuffersReq   12
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+    CARD32  width B32;
+    CARD32  height B32;
+    CARD32  count B32;
+} xDRI2GetBuffersVidReq;
+#define sz_xDRI2GetBuffersVidReq   20
+
+typedef struct {
+    BYTE    type;   /* X_Reply */
+    BYTE    pad1;
+    CARD16  sequenceNumber B16;
+    CARD32  length B32;
+    CARD32  width B32;
+    CARD32  height B32;
+    CARD32  count B32;
+    CARD32  pad2 B32;
+    CARD32  pad3 B32;
+    CARD32  pad4 B32;
+} xDRI2GetBuffersReply;
+#define sz_xDRI2GetBuffersReply	32
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+    CARD32  region B32;
+    CARD32  dest B32;
+    CARD32  src B32;
+} xDRI2CopyRegionReq;
+#define sz_xDRI2CopyRegionReq   20
+
+typedef struct {
+    BYTE    type;   /* X_Reply */
+    BYTE    pad1;
+    CARD16  sequenceNumber B16;
+    CARD32  length B32;
+    CARD32  pad2 B32;
+    CARD32  pad3 B32;
+    CARD32  pad4 B32;
+    CARD32  pad5 B32;
+    CARD32  pad6 B32;
+    CARD32  pad7 B32;
+} xDRI2CopyRegionReply;
+#define sz_xDRI2CopyRegionReply	32
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+    CARD32  target_msc_hi B32;
+    CARD32  target_msc_lo B32;
+    CARD32  divisor_hi B32;
+    CARD32  divisor_lo B32;
+    CARD32  remainder_hi B32;
+    CARD32  remainder_lo B32;
+} xDRI2SwapBuffersReq;
+#define sz_xDRI2SwapBuffersReq  32
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+    CARD32  target_msc_hi B32;
+    CARD32  target_msc_lo B32;
+    CARD32  divisor_hi B32;
+    CARD32  divisor_lo B32;
+    CARD32  remainder_hi B32;
+    CARD32  remainder_lo B32;
+    CARD32  source B32;
+    CARD32  x1 B32;
+    CARD32  y1 B32;
+    CARD32  x2 B32;
+    CARD32  y2 B32;
+} xDRI2SwapBuffersVidReq;
+#define sz_xDRI2SwapBuffersVidReq  52
+
+typedef struct {
+    BYTE    type;   /* X_Reply */
+    BYTE    pad1;
+    CARD16  sequenceNumber B16;
+    CARD32  length B32;
+    CARD32  swap_hi B32;
+    CARD32  swap_lo B32;
+    CARD32  pad2 B32;
+    CARD32  pad3 B32;
+    CARD32  pad4 B32;
+    CARD32  pad5 B32;
+} xDRI2SwapBuffersReply;
+#define sz_xDRI2SwapBuffersReply 32
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+} xDRI2GetMSCReq;
+#define sz_xDRI2GetMSCReq 8
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+    CARD32  target_msc_hi B32;
+    CARD32  target_msc_lo B32;
+    CARD32  divisor_hi B32;
+    CARD32  divisor_lo B32;
+    CARD32  remainder_hi B32;
+    CARD32  remainder_lo B32;
+} xDRI2WaitMSCReq;
+#define sz_xDRI2WaitMSCReq 32
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+    CARD32  target_sbc_hi B32;
+    CARD32  target_sbc_lo B32;
+} xDRI2WaitSBCReq;
+#define sz_xDRI2WaitSBCReq 16
+
+typedef struct {
+    CARD8   type;
+    CARD8   pad1;
+    CARD16  sequenceNumber B16;
+    CARD32  length B32;
+    CARD32  ust_hi B32;
+    CARD32  ust_lo B32;
+    CARD32  msc_hi B32;
+    CARD32  msc_lo B32;
+    CARD32  sbc_hi B32;
+    CARD32  sbc_lo B32;
+} xDRI2MSCReply;
+#define sz_xDRI2MSCReply 32
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+    CARD32  interval B32;
+} xDRI2SwapIntervalReq;
+#define sz_xDRI2SwapIntervalReq 12
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+    CARD32  attribute B32;
+} xDRI2SetAttributeReq;
+#define sz_xDRI2SetAttributeReq 12
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+    CARD32  attribute B32;
+} xDRI2GetAttributeReq;
+#define sz_xDRI2GetAttributeReq 12
+
+typedef struct {
+    BYTE    type;   /* X_Reply */
+    BYTE    pad1;
+    CARD16  sequenceNumber B16;
+    CARD32  length B32;
+    CARD32  pad2 B32;
+    CARD32  pad3 B32;
+    CARD32  pad4 B32;
+    CARD32  pad5 B32;
+    CARD32  pad6 B32;
+    CARD32  pad7 B32;
+} xDRI2GetAttributeReply;
+#define sz_xDRI2GetAttributeReply 32
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+} xDRI2GetFormatsReq;
+#define sz_xDRI2GetFormatsReq 8
+
+typedef struct {
+    BYTE    type;   /* X_Reply */
+    BYTE    pad1;
+    CARD16  sequenceNumber B16;
+    CARD32  length B32;
+    CARD32  pad2 B32;
+    CARD32  pad3 B32;
+    CARD32  pad4 B32;
+    CARD32  pad5 B32;
+    CARD32  pad6 B32;
+    CARD32  pad7 B32;
+} xDRI2GetFormatsReply;
+#define sz_xDRI2GetFormatsReply 32
+
+typedef struct {
+    CARD8 type;
+    CARD8 pad;
+    CARD16 sequenceNumber B16;
+    CARD16 event_type B16;
+    CARD16 pad2;
+    CARD32 drawable B32;
+    CARD32 ust_hi B32;
+    CARD32 ust_lo B32;
+    CARD32 msc_hi B32;
+    CARD32 msc_lo B32;
+    CARD32 sbc_hi B32;
+    CARD32 sbc_lo B32;
+} xDRI2BufferSwapComplete;
+#define sz_xDRI2BufferSwapComplete 32
+
+typedef struct {
+    CARD8 type;
+    CARD8 pad;
+    CARD16 sequenceNumber B16;
+    CARD16 event_type B16;
+    CARD16 pad2;
+    CARD32 drawable B32;
+    CARD32 ust_hi B32;
+    CARD32 ust_lo B32;
+    CARD32 msc_hi B32;
+    CARD32 msc_lo B32;
+    CARD32 sbc B32;
+} xDRI2BufferSwapComplete2;
+#define sz_xDRI2BufferSwapComplete2 32
+
+typedef struct {
+    CARD8 type;
+    CARD8 pad;
+    CARD16 sequenceNumber B16;
+    CARD32 drawable B32;
+    CARD32 pad1 B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+} xDRI2InvalidateBuffers;
+#define sz_xDRI2InvalidateBuffers 32
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+    CARD32  param B32;
+} xDRI2GetParamReq;
+#define sz_xDRI2GetParamReq 12
+
+typedef struct {
+    BYTE    type; /*X_Reply*/
+    BOOL    is_param_recognized;
+    CARD16  sequenceNumber B16;
+    CARD32  length B32;
+    CARD32  value_hi B32;
+    CARD32  value_lo B32;
+    CARD32  pad1 B32;
+    CARD32  pad2 B32;
+    CARD32  pad3 B32;
+    CARD32  pad4 B32;
+} xDRI2GetParamReply;
+#define sz_xDRI2GetParamReply 32
+
+#endif
Index: proto/dri2proto/create-2.8-ti-glsdk-patch/dri2proto-2.8-new/dri2proto.txt
===================================================================
--- proto/dri2proto/create-2.8-ti-glsdk-patch/dri2proto-2.8-new/dri2proto.txt	(nonexistent)
+++ proto/dri2proto/create-2.8-ti-glsdk-patch/dri2proto-2.8-new/dri2proto.txt	(revision 5)
@@ -0,0 +1,1173 @@
+			  The DRI2 Extension
+			      Version 2.0
+			      2008-09-04
+      
+			  Kristian Høgsberg
+			    krh@redhat.com
+			     Red Hat, Inc
+
+
+1. Introduction
+
+The DRI2 extension is designed to associate and access auxillary
+rendering buffers with an X drawable.
+
+DRI2 is a essentially a helper extension to support implementation of
+direct rendering drivers/libraries/technologies.
+
+The main consumer of this extension will be a direct rendering OpenGL
+driver, but the DRI2 extension is not designed to be OpenGL specific.
+Direct rendering implementations of OpenVG, Xv, cairo and other
+graphics APIs should find the functionality exposed by this extension
+helpful and hopefully sufficient.
+
+Relation to XF86DRI
+
+
+1.1. Acknowledgements
+
+Kevin E. Martin <kem@redhat.com>
+Keith Packard <keithp@keithp.com>
+Eric Anholt <eric@anholt.net>
+Keith Whitwell <keith@tungstengraphics.com>
+Jerome Glisse <glisse@freedesktop.org>
+Ian Romanick <ian.d.romanick@intel.com>
+Michel Dänzer <michel@tungstengraphics.com>
+Jesse Barnes <jbarnes@virtuousgeek.org>
+
+
+			     ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+
+2. DRI2 Concepts
+
+
+2.1. Attachment points
+
+Stolen from OpenGL FBOs, I guess.
+
+
+2.2. Kernel rendering manager
+
+This specification assumes a rendering architechture, where an
+underlying kernel rendering manager that can provide 32 bit integer
+handles to video memory buffers.  These handles can be passed between
+processes, which, through a direct rendering driver, submit rendering
+to the kernel rendering manager, targeting and/or sourcing from these
+buffers.  This extension provides a means to communicate about such
+buffers as associated with an X drawable.
+
+The details of how the a direct rendering driver use the buffer names
+and submit the rendering requests is outside the scope of this
+specification.  However, Appendix B does discuss implementation of
+this specification on the Graphics Execution Manager (GEM).
+
+
+2.3. Request ordering
+
+No ordering between swap buffers and X rendering.  X rendering to src
+buffers will block if they have a vblank pending.
+
+
+2.4 Authentication model
+
+The purpose of the DRM authentication scheme is to grant access to the
+kernel rendering manager buffers created by the X server if, and only
+if, the client has access to the X server.  This is achieved in a
+three-step protocol:
+
+	1) The client gets a token from the kernel rendering manager
+	that uniquely identifies it.  The token is a 32 bit integer.
+
+	2) The client passes the token to the X server in the
+	DRI2Authenticate request.  This request is a round trip to
+	make sure the X server has received and processed the
+	authentication before the client starts accessing the DRM.
+
+	3) The X server authorizes the client by passing the token to
+	the kernel rendering manager.
+
+A kernel rendering manager can choose not to implement any
+authentication and just allow access to all buffers.
+
+
+2.5 Rendering to the X front buffer
+
+OpenGL allows the client to render to the front buffer, either by
+using a single-buffered configuration or but explicitly setting the
+draw buffer to GL_FRONT_LEFT.  Not allowed!
+
+The client must ask for a fake front buffer, render to that and then
+use DRI2CopyRegion to copy contents back and forth between the fake
+front buffer and the real front buffer.  When X and direct rendering
+to a front buffer is interleaved, it is the responsibility of the
+application to synchronize access using glXWaitGL and glXWaitX.  A
+DRI2 implementation of direct rendering GLX, should use these enty
+points to copy contents back and forth to as necessary to ensure
+consistent rendering.
+
+The client may also use the DRI2SwapBuffers function to request a swap
+of the front and back buffers.  If the display server supports it, this
+operation may be preferred, since it may be easier and/or more performant
+for the server to perform a simple buffer swap rather than a blit.
+
+2.6 Synchronizing rendering
+
+DRI2 provides several methods for synchronizing drawing with various events.
+The protocol for these methods is based on the SGI_video_sync and
+OML_sync_control GLX extensions.  Using the DRI2WaitMSC request, a client
+can wait for a specific frame count or divisor/remainder before continuing
+its processing.  With the DRI2WaitSBC request, clients can block until a given
+swap count is reached (as incremented by DRI2SwapBuffers).  Finally, using
+DRI2SwapBuffers, clients can limit their frame rate by specifying a swap
+interval using the swap interval call (currently only available through GLX)
+or by using the OML swap buffers routine.
+
+2.7 Events
+
+DRI2 provides an event to indicate when a DRI2SwapBuffers request has
+been completed.  This can be used to throttle drawing on the client
+side and tie into application main loops.
+
+Another event is generated when the validity of the requested buffers
+changes.
+
+			     ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+
+3. Data Types
+
+The server side region support specified in the Xfixes extension
+version 2 is used in the CopyRegion request.
+
+
+			     ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+
+4. Errors
+
+No errors are defined by the DRI2 extension.
+
+
+			     ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+5. Events
+
+The only events provided by DRI2 are DRI2_BufferSwapComplete
+and DRI2InvalidateBuffers.
+
+
+			     ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+
+6. Protocol Types
+
+DRI2DRIVER { DRI2DriverDRI
+	     DRI2DriverVDPAU,
+	     DRI2DriverXV }
+
+	These values describe the type of driver the client will want
+	to load.  The server sends back the name of the driver to use
+	for the screen in question.
+
+DRI2ATTACHMENT { DRI2BufferFrontLeft
+	       	 DRI2BufferBackLeft
+	       	 DRI2BufferFrontRight
+	       	 DRI2BufferBackRight
+	       	 DRI2BufferDepth
+	       	 DRI2BufferStencil
+	       	 DRI2BufferAccum
+		 DRI2BufferFakeFrontLeft
+		 DRI2BufferFakeFrontRight
+		 DRI2BufferDepthStencil
+		 DRI2BufferHiz }
+
+	These values describe various attachment points for DRI2
+	buffers.
+
+	In the case of video driver (DRI2DriverXV) the attachment,
+	other than DRI2BufferFrontLeft, just indicates buffer
+	number and has no other special significance.  There is no
+	automatic maintenance of DRI2BufferFakeFrontLeft.
+
+DRI2BUFFER { attachment: CARD32
+    	     name: CARD32
+	     pitch: CARD32
+    	     cpp: CARD32
+	     flags: CARD32 }
+
+	The DRI2BUFFER describes an auxillary rendering buffer
+	associated with an X drawable.  'attachment' describes the
+	attachment point for the buffer, 'name' is the name of the
+	underlying kernel buffer.
+
+
+DRI2ATTACH_FORMAT { attachment: CARD32
+		    format:     CARD32 }
+
+	The DRI2ATTACH_FORMAT describes an attachment and the associated
+	format.  'attachment' describes the attachment point for the buffer,
+	'format' describes an opaque, device-dependent format for the buffer,
+	or a fourcc for non-device-dependent formats.
+
+			     ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+
+7. Extension Initialization
+
+The name of this extension is "DRI2".
+
+┌───
+    DRI2QueryVersion
+	client-major-version:	CARD32
+	client-minor-version:	CARD32
+      ▶
+	major-version:		CARD32
+	minor-version:		CARD32
+└───
+
+	The client sends the highest supported version to the server
+	and the server sends the highest version it supports, but no
+	higher than the requested version. Major versions changes can
+	introduce incompatibilities in existing functionality, minor
+	version changes introduce only backward compatible changes.
+	It is the clients responsibility to ensure that the server
+	supports a version which is compatible with its expectations.
+
+	Backwards compatible changes included addition of new
+	requests, but also new value types in the DRI2CopyRegion
+	request.  When new values are introduced, the minor version
+	will be increased so the client can know which values the X
+	server understands from the version number.
+
+
+			     ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+
+8. Extension Requests
+
+┌───
+    DRI2Connect
+	window: WINDOW
+	driverType: DRI2DRIVER
+      ▶
+	driver: STRING
+	device: STRING
+└───
+
+	Returns the driver name and device file to use for the
+	specified driver type for the screen associated with 'window'.
+
+	'type' identifies the type of driver to query for.
+
+	'driver' is the name of the driver to load.  The client is
+	assumed to know where to look for the drivers and what to do
+	with it.
+
+	'device' is the filename of the DRM device file.
+
+	If the client is not local, or the request driver type is
+	unknown or not available, 'driver' and 'device' will be empty
+	strings.  We are not using an regular X
+	error here to indicate failure, which will allow the client
+	fall back to other options more easily.
+
+	ISSUE: We could add the list of supported attachments and the
+	supported DRI2CopyRegion values here (just the bitmask of all
+	supported values).
+	
+┌───
+    DRI2Authenticate
+	window: WINDOW
+	token: CARD32
+      ▶
+        authenticated: CARD32
+└───
+	Errors: Window
+
+	Request that the X server authenticates 'token', allowing the
+	client to access the DRM buffers created by the X server on
+	the screen associated with 'window'.
+
+	Authentication shouldn't fail at this point, except if an
+	invalid token is passed, in which case authenticated is False.
+
+┌───
+    DRI2GetBuffers
+	drawable: DRAWABLE
+	attachments: LISTofDRI2ATTACHMENTS
+      ▶	
+	width, height: CARD32
+	buffers: LISTofDRI2BUFFER
+└───
+	Errors: Window
+
+	Get buffers for the provided attachment points for the given
+	drawable.
+
+	If the DDX driver does not support one or more of the
+	specified attachment points, a Value error is generated, with
+	the first unsupported attachment point as the error value.
+
+	'width' and 'height' describes the dimensions of the drawable.
+
+	'buffers' is a list of DRI2BUFFER for the given DRI2
+	attachment points.
+
+┌───
+    DRI2CopyRegion
+	drawable: DRAWABLE
+	region: REGION
+	source: DRI2ATTACHMENT
+	destination: DRI2ATTACHMENT
+      ▶	
+└───
+	Errors: Window, Value
+
+	Schedule a copy from one DRI2 buffer to another.
+
+	The DRICopyRegion request has a reply but it is empty.  The
+	reply is there to let the direct rendering client wait until
+	the server has seen the request before proceeding with
+	rendering the next frame.
+
+┌───
+    DRI2SwapBuffers
+	drawable: DRAWABLE
+	target_msc: two CARD32s
+	divisor: two CARD32s
+	remainder: two CARD32s
+      ▶	
+	count: two CARD32s
+└───
+	Errors: Window
+
+	Schedule a swap of the front and back buffers with the display
+	server.
+
+	Returns the swap count value when the swap will actually occur (e.g.
+	the last queued swap count + (pending swap count * swap interval)).
+
+	This request is only available with protocol version 1.2 or
+	later.
+
+┌───
+    DRI2SwapBuffersVid
+	drawable: DRAWABLE
+	target_msc: two CARD32s
+	divisor: two CARD32s
+	remainder: two CARD32s
+	source: CARD32
+	x1: CARD32
+	y1: CARD32
+	x2: CARD32
+	y2: CARD32
+      ▶
+	count: two CARD32s
+└───
+	Errors: Window
+
+	Schedule a swap of the front and back buffers with the display
+	server.
+
+	Returns the swap count value when the swap will actually occur (e.g.
+	the last queued swap count + (pending swap count * swap interval)).
+
+	This request is only available with protocol version 1.4 or
+	later.
+
+┌───
+    DRI2GetBuffersWithFormat
+	drawable: DRAWABLE
+	attachments: LISTofDRI2ATTACH_FORMAT
+      ▶
+	width, height: CARD32
+	buffers: LISTofDRI2BUFFER
+└───
+	Errors: Window
+
+	Get buffers for the provided attachment points with the specified
+	formats for the given drawable.
+
+	If the DDX driver does not support one or more of the
+	specified attachment points or formats, a Value error is generated,
+	with the first unsupported attachment point as the error value.
+
+	'width' and 'height' describes the dimensions of the drawable.
+
+	'buffers' is a list of DRI2BUFFER for the given DRI2
+	attachment points.
+
+	This request is only available with protocol version 1.1 or
+	later.
+
+┌───
+    DRI2GetBuffersVid
+	drawable: DRAWABLE
+	width, height: CARD32
+	attachments: LISTofDRI2ATTACH_FORMAT
+      ▶
+	width, height: CARD32
+	buffers: LISTofDRI2BUFFER
+└───
+	Errors: Window
+
+	Get buffers for the provided attachment points with the specified
+	formats for the given drawable.  Like DRI2GetBuffersWithFormat,
+	but allows the client to specify a buffer size that differs from
+	the target drawable, for example to deal with decoded video which
+	is scaled as it is blit to the front buffer (or rendered via hw
+	overlay).
+
+	The DRI2BufferFrontLeft attachment point cannot be requested.  But
+	for video buffers, the client can dynamically allocate more buffers
+	by just requesting new attachment point id's.  Or release a buffer
+	by requesting it with 0,0 size.  If the same attachment point is
+	re-requested, then the previous buffer is deallocated and a new
+	buffer is allocated.  This allows for dynamic resolution changes
+	during playback.
+
+	This request is only available with protocol version 1.4 or
+	later.
+
+:	Note: originally I was not going to add a new DRI2GetBuffers variant,
+:	but instead use attributes to communicate width/height.  But the
+:	problem is that the client blindly picks up DRI2_MINOR from dri2proto.h
+:	and so there is otherwise no reliable way for the server to know if
+:	client supports extra_buffers..
+
+┌───
+    DRI2GetMSC
+	drawable: DRAWABLE
+      ▶
+	ust, msc, sbc: CARD64
+└───
+	Errors: Window
+
+	Get the current media stamp counter (MSC) and swap buffer count (SBC)
+	along with the unadjusted system time (UST) when the MSC was last
+	incremented.
+
+	This request is only available with protocol version 1.2 or
+	later.
+
+┌───
+    DRI2WaitMSC
+	drawable: DRAWABLE
+	target_msc: two CARD32s
+	divisor: two CARD32s
+	remainder: two CARD32s
+      ▶
+	ust, msc, sbc: CARD64
+└───
+	Errors: Window
+
+	Blocks the client until either the frame count reaches target_msc or,
+	if the frame count is already greater than target_msc when the request
+	is received, until the frame count % divisor = remainder.  If divisor
+	is 0, the client will be unblocked if the frame count is greater than
+	or equal to the target_msc.
+
+	Returns the current media stamp counter (MSC) and swap buffer count
+	(SBC) along with the unadjusted system time (UST) when the MSC was last
+	incremented.
+
+	This request is only available with protocol version 1.2 or
+	later.
+
+┌───
+    DRI2WaitSBC
+	drawable: DRAWABLE
+	target_sbc: two CARD32s
+      ▶
+	ust, msc, sbc: CARD64
+└───
+	Errors: Window
+
+	Blocks the client until the swap buffer count reaches target_sbc.  If
+	the swap buffer count is already greater than or equal to target_sbc
+	when the request is recieved, this request will return immediately.
+
+	If target_sbc is 0, this request will block the client until all
+	previous DRI2SwapBuffers requests have completed.
+
+	Returns the current media stamp counter (MSC) and swap buffer count
+	(SBC) along with the unadjusted system time (UST) when the MSC was last
+	incremented.
+
+	This request is only available with protocol version 1.2 or
+	later.
+
+┌───
+    DRI2SwapInterval
+	drawable: DRAWABLE
+	interval: CARD32
+      ▶
+└───
+	Errors: Window
+
+	Sets the swap interval for DRAWABLE.  This will throttle
+	DRI2SwapBuffers requests to swap at most once per interval frames,
+	which is useful useful for limiting the frame rate.
+
+┌───
+    DRI2GetParam
+	drawable: DRAWABLE
+	param: CARD32
+      ▶
+	is_param_recognized: BOOL
+	value: CARD64
+└───
+	Errors: Drawable
+
+	Get the value of a parameter.  The parameter's value is looked up on
+	the screen associated with 'drawable'.
+
+	Parameter names in which the value of the most significant byte is
+	0 are reserved for the X server. Currently, no such parameter names
+	are defined. (When any such names are defined, they will be defined in
+	this extension specification and its associated headers).
+
+	Parameter names in which the byte's value is 1 are reserved for the
+	DDX. Such names are private to each driver and shall be defined in the
+	respective driver's headers.
+
+	Parameter names in which the byte's value is neither 0 nor 1 are
+	reserved for future use.
+
+	Possible values of 'is_param_recognized' are true (1) and false (0).
+	If false, then 'value' is undefined.
+
+	This request is only available with protocol version 1.4 or later.
+
+┌───
+    DRI2SetAttribute
+	drawable: DRAWABLE
+	attribute: ATOM
+	value: LISTofCARD32
+      ▶
+└───
+	Errors: Window, Match, Value
+
+	The DRI2SetAttribute request sets the value of a drawable attribute.
+	The drawable attribute is identified by the attribute atom.  The
+	following strings are guaranteed to generate valid atoms using the
+	InternAtom request.
+
+	String                Size     Type
+	-----------------------------------------------------------------
+
+	"XV_CSC_MATRIX"       48       4x3 matrix of floats
+	"XV_OSD"              4        XID
+
+	If the given attribute doesn't match an attribute supported by the
+	drawable a Match error is generated.  The supplied encoding
+	must be one of the encodings listed for the adaptor, otherwise an
+	Encoding error is generated.
+
+	The XV_CSC_MATRIX attribute is defined to match the VDPAU
+	VdpCSCMatrix:
+
+	    ┌   ┐   ┌                 ┐   ┌     ┐
+	    │ R │   │ m00 m01 m02 m03 │   │  Y  │
+	    │ G │ = │ m10 m11 m12 m13 │ * │  Cb │
+	    │ B │   │ m20 m21 m22 m23 │   │  Cr │
+	    └   ┘   └                 ┘   │ 1.0 │
+	                                  └     ┘
+
+	If the adaptor doesn't support the specified CSC matrix, the closest
+	values supported are assumed.  The DRI2GetAttribute request can be used
+	to query the resulting values.
+
+	The "XV_OSD" attribute specifies the XID of a drawable containing
+	ARGB data to be non-destructively overlayed over the video.  This
+	could be used to implement subtiles, on-screen-menus, etc.  Note
+	that a DRI2DriverDRI driver could be connected to this drawable, to
+	enable GPU rendered OSD content, or alternatively normal indirect
+	X11 draw primitives can be used.
+
+	This request is only available with protocol version 1.4 or
+	later.
+
+┌───
+    DRI2GetAttribute
+	drawable: DRAWABLE
+	attribute: ATOM
+      ▶
+	value: LISTofCARD32
+└───
+	Errors: Window, Match
+
+	The DRI2GetAttribute request returns the current value of the
+	attribute identified by the given atom.  If the given atom
+	doesn't match an attribute supported by the adaptor a Match
+	error is generated.
+
+	This request is only available with protocol version 1.4 or
+	later.
+
+┌───
+    DRI2GetFormats
+	drawable: DRAWABLE
+      ▶
+	formats: LISTofCARD32
+└───
+	Errors: Window
+
+	Query the driver for supported formats, which can be used with
+	DRI2GetBuffersWithFormat.  The 'format' describes an opaque,
+	device-dependent format for the buffer,	or a fourcc for
+	non-device-dependent formats.  For device-dependent formats, use
+	at least one '\0' or non 7-bit ascii character.
+
+	This request is only available with protocol version 1.4 or
+	later.
+
+			     ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+9. Extension Events
+
+┌───
+    DRI2BufferSwapComplete
+      ▶
+      	event_type: CARD16
+	drawable: CARD32
+	ust: CARD64
+	msc: CARD64
+	sbc: CARD64
+└───
+
+	This event reports the status of the last DRI2SwapBuffers event to
+	the client.  The event type should be one of DRI2_EXCHANGE_COMPLETE,
+	indicating a successful buffer exchange, DRI2_BLIT_COMPLETE, indicating
+	the swap was performed with a blit, and DRI2_FLIP_COMPLETE, indicating
+	a full page flip was completed.
+
+┌───
+    DRI2InvalidateBuffers
+      ▶
+	drawable: CARD32
+└───
+
+	This event is generated when the buffers the client had
+	requested for 'drawable' (with DRI2GetBuffers or
+	DRI2GetBuffersWithFormat) become inappropriate because they
+	don't match the drawable dimensions anymore, or a buffer swap
+	has been performed.
+
+	Note that the server is only required to warn the client once
+	about this condition, until the client takes care of bringing
+	them back up-to-date with another GetBuffers request.
+
+			     ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+10. Extension Versioning
+
+The DRI2 extension has undergone a number of revisions before
+
+	1.0: Released, but never used.  Relied on a number of
+		constructs from the XF86DRI extension, such as a
+		shared memory area (SAREA) to communicate changes in
+		cliprects and window sizes, and
+
+	1.99.1: Move the swap buffer functionality into the X server,
+		introduce SwapBuffer request to copy back buffer
+		contents to the X drawable.
+
+	1.99.2: Rethink the SwapBuffer request as an asynchronous
+		request to copy a region between DRI2 buffers.  Drop
+		CreateDrawable and DestroyDrawable, update Connect to
+		support different driver types and to send the
+		authentication group.
+
+	1.99.3: Drop the bitmask argument intended to indicate
+		presence of optional arguments for CopyRegion.
+
+	2.0: Awesomeness!
+
+	2.1: True excellence.  Added DRI2GetBuffersWithFormat to allow
+             more flexible object creation.
+
+	2.2: Approaching perfection.  Added requests for swapbuffers,
+             MSC and SBC related requests, and events.
+
+	2.3: Added the DRI2InvalidateBuffers event.
+
+	2.6: Enlightenment attained.  Added the DRI2BufferHiz attachment.
+
+	2.7: Added the DRI2GetParam request.
+
+Compatibility up to 2.0 is not preserved, but was also never released.
+
+
+			     ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+
+11. Relationship with other extensions
+
+As an extension designed to support other extensions, there is
+naturally some interactions with other extensions.
+
+
+11.1 GLX
+
+The GL auxilary buffers map directly to the DRI2 buffers... eh
+
+
+11.2 DBE
+
+The DBE back buffer must correspond to the DRI2_BUFFER_FRONT_LEFT
+DRI2 buffer for servers that support both DBE and DRI2.
+
+
+11.3 XvMC / Xv
+
+We might add a DRI2_BUFFER_YUV to do vsynced colorspace conversion
+blits.  Maybe... not really sure.
+
+
+			     ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+
+Appendix A. Protocol Encoding
+
+Syntactic Conventions
+
+This document uses the same syntactic conventions as the core X
+protocol encoding document.
+
+
+A.1 Common Types
+
+┌───
+    DRI2DRIVER
+	0x0	DRI2DriverDRI
+	0x1	DRI2DriverVDPAU
+└───
+
+┌───
+    DRI2ATTACHMENT
+	0x0	DRI2BufferFrontLeft
+	0x1	DRI2BufferBackLeft
+	0x2	DRI2BufferFrontRight
+	0x3	DRI2BufferBackRight
+	0x4	DRI2BufferDepth
+	0x5	DRI2BufferStencil
+	0x6	DRI2BufferAccum
+	0x7	DRI2BufferFakeFrontLeft
+	0x8	DRI2BufferFakeFrontRight
+	0x9	DRI2BufferDepthStencil
+	0xa	DRI2BufferHiz
+└───
+	Used to encode the possible attachment points.  The attachment
+	DRI2BufferDepthStencil is only available with protocol version 1.1 or
+	later.
+
+┌───
+    DRI2BUFFER  (in response to DRI2GetBuffers & DRI2GetBuffersWithFormat)
+	4	CARD32	attachment
+	4	CARD32	name
+	4	CARD32	pitch
+	4	CARD32	cpp
+	4	CARD32	flags
+└───
+	A DRI2 buffer specifies the attachment, the kernel memory
+	manager name, the pitch and chars per pixel for a buffer
+	attached to a given drawable.
+
+┌───
+    DRI2BUFFER  (in response to DRI2GetBuffersVid)
+	4	CARD32	attachment
+	4	CARD32	name
+	4	CARD32	pitch
+	4	CARD32	cpp
+	4	CARD32	flags
+	4	n	extra names length
+	8n	LISTof	extra name, pitch
+└───
+	A DRI2 buffer specifies the attachment, the kernel memory manager
+	name and the pitch for a buffer attached to a given drawable.
+	Note that cpp is unused (it is a bit difficult to represent values
+	like 1.5 bytes/pixel as an integer).
+
+	In case of multi-planar video formats, 'extra names' will give the
+	list of additional buffer names (and their pitch) if there is one
+	buffer per plane.  For example, I420 has one Y plane in with a 8bit
+	luma value per pixel, followed by one U plane subsampled 2x2 (with
+	one 8bit U value per 2x2 pixel block), followed by one V plane
+	subsampled 2x2.  This could either be represented as a single buffer
+	name, or three separate buffer names, one each for Y, U, and V.
+
+┌───
+    DRI2ATTACH_FORMAT
+	4	CARD32	attachment
+	4	CARD32	format
+└───
+	Used to describe the attachment and format requested from the server.
+	This data type is only available with protocol version 1.1 or
+	later.
+
+A.2 Protocol Requests
+
+┌───
+    DRI2QueryVersion
+	1	CARD8			major opcode
+	1	0			DRI2 opcode
+	2	3			length
+	4	CARD32			major version
+	4	CARD32			minor version
+      ▶
+	1	1			Reply
+        1				unused
+	2	CARD16			sequence number
+	4	0			reply length
+	4	CARD32			major version
+        4	CARD32			minor version
+	16				unused	
+└───
+
+┌───
+    DRI2Connect
+	1	CARD8			major opcode
+	1	1			DRI2 opcode
+	2	3			length
+	4	WINDOW			window
+	4	CARD32			driver type
+      ▶
+	1	1			Reply
+        1				unused
+	2	CARD16			sequence number
+	4	(n+m+p+q)/4		reply length
+	4	n			driver name length
+	4	m			device name length
+	16				unused
+	n	CARD8			driver name
+	p				unused, p=pad(n)
+	m	CARD8			device name
+	q				unused, q=pad(m)
+└───
+
+┌───
+    DRI2Authenticate
+	1	CARD8			major opcode
+	1	2			DRI2 opcode
+	2	3			length
+	4	WINDOW			window
+	4	CARD32			authentication token
+      ▶
+	1	1			Reply
+        1				unused
+	2	CARD16			sequence number
+	4	0			reply length
+	4	CARD32			authenticated
+	20				unused	
+└───
+
+┌───
+    DRI2GetBuffers
+	1	CARD8			major opcode
+	1	5			DRI2 opcode
+	2	3			length
+	4	DRAWABLE		drawable
+	4	n			number of attachments
+	4n	LISTofDRI2ATTACHMENTS	attachments
+      ▶	
+	1	1			Reply
+        1				unused
+	2	CARD16			sequence number
+	4	0			reply length
+	4	CARD32			width of drawable
+	4	CARD32			height of drawable
+	4	CARD32			buffer count
+	12				unused	
+	5n	LISTofDRI2BUFFER	buffers
+└───
+
+┌───
+    DRI2CopyRegion
+	1	CARD8			major opcode
+	1	6			DRI2 opcode
+	2	3			length
+	4	DRAWABLE		drawable
+	4	REGION			region
+	4	DRI2ATTACHMENT		source
+	4	DRI2ATTACHMENT		destination
+      ▶	
+	1	1			Reply
+        1				unused
+	2	CARD16			sequence number
+	4	0			reply length
+	24				unused	
+└───
+
+┌───
+    DRI2GetBuffersWithFormat
+	1	CARD8			major opcode
+	1	7			DRI2 opcode
+	2	3			length
+	4	DRAWABLE		drawable
+	4	n			number of attachments
+	8n	LISTofDRI2ATTACH_FORMAT	attachments and formats
+      ▶
+	1	1			Reply
+       1				unused
+	2	CARD16			sequence number
+	4	0			reply length
+	4	CARD32			width of drawable
+	4	CARD32			height of drawable
+	4	CARD32			buffer count
+	12				unused	
+	5n	LISTofDRI2BUFFER	buffers
+└───
+
+┌───
+    DRI2GetBuffersVid
+	1	CARD8			major opcode
+	1	3			DRI2 opcode
+	2	3			length
+	4	DRAWABLE		drawable
+	4	CARD32			width
+	4	CARD32			height
+	4	n			number of attachments
+	4n	LISTofDRI2ATTACHMENTS	attachments
+      ▶
+	1	1			Reply
+        1				unused
+	2	CARD16			sequence number
+	4	0			reply length
+	4	CARD32			width of drawable
+	4	CARD32			height of drawable
+	4	CARD32			buffer count
+	12				unused
+	5n	LISTofDRI2BUFFER	buffers
+└───
+
+┌───
+    DRI2SwapBuffers
+	1	CARD8			major opcode
+	1	8			DRI2 opcode
+	2	8			length
+	4	DRAWABLE		drawable
+	4	CARD32			target_msc_hi
+	4	CARD32			target_msc_lo
+	4	CARD32			divisor_hi
+	4	CARD32			divisor_lo
+	4	CARD32			remainder_hi
+	4	CARD32			remainder_lo
+      ▶	
+	1	1			Reply
+        1				unused
+	2	CARD16			sequence number
+	4	0			reply length
+	4	CARD32			swap_hi
+	4	CARD32			swap_lo
+	5n	LISTofDRI2BUFFER	buffers
+└───
+
+┌───
+    DRI2SwapBuffersVid
+	1	CARD8			major opcode
+	1	8			DRI2 opcode
+	2	8			length
+	4	DRAWABLE		drawable
+	4	CARD32			target_msc_hi
+	4	CARD32			target_msc_lo
+	4	CARD32			divisor_hi
+	4	CARD32			divisor_lo
+	4	CARD32			remainder_hi
+	4	CARD32			remainder_lo
+	4	DRI2ATTACHMENT		source
+	4	CARD32			x1
+	4	CARD32			y1
+	4	CARD32			x2
+	4	CARD32			y2
+      ▶	
+	1	1			Reply
+        1				unused
+	2	CARD16			sequence number
+	4	0			reply length
+	4	CARD32			swap_hi
+	4	CARD32			swap_lo
+	5n	LISTofDRI2BUFFER	buffers
+└───
+
+┌───
+    DRI2GetMSC
+	1	CARD8			major opcode
+	1	9			DRI2 opcode
+	2	8			length
+	4	DRAWABLE		drawable
+      ▶
+	1	1			Reply
+        1				unused
+	2	CARD16			sequence number
+	4	0			reply length
+	4	CARD32			ust_hi
+	4	CARD32			ust_lo
+	4	CARD32			msc_hi
+	4	CARD32			msc_lo
+	4	CARD32			sbc_hi
+	4	CARD32			sbc_lo
+└───
+
+┌───
+    DRI2WaitMSC
+	1	CARD8			major opcode
+	1	10			DRI2 opcode
+	2	8			length
+	4	DRAWABLE		drawable
+	4	CARD32			target_msc_hi
+	4	CARD32			target_msc_lo
+	4	CARD32			divisor_hi
+	4	CARD32			divisor_lo
+	4	CARD32			remainder_hi
+	4	CARD32			remainder_lo
+      ▶
+	1	1			Reply
+        1				unused
+	2	CARD16			sequence number
+	4	0			reply length
+	4	CARD32			ust_hi
+	4	CARD32			ust_lo
+	4	CARD32			msc_hi
+	4	CARD32			msc_lo
+	4	CARD32			sbc_hi
+	4	CARD32			sbc_lo
+└───
+
+┌───
+    DRI2WaitSBC
+	1	CARD8			major opcode
+	1	11			DRI2 opcode
+	2	8			length
+	4	DRAWABLE		drawable
+ 	4	CARD32			swap_hi
+	4	CARD32			swap_lo
+     ▶
+	1	1			Reply
+        1				unused
+	2	CARD16			sequence number
+	4	0			reply length
+	4	CARD32			ust_hi
+	4	CARD32			ust_lo
+	4	CARD32			msc_hi
+	4	CARD32			msc_lo
+	4	CARD32			sbc_hi
+	4	CARD32			sbc_lo
+└───
+
+┌───
+    DRI2SwapInterval
+	1	CARD8			major opcode
+	1	12			DRI2 opcode
+	2	8			length
+	4	DRAWABLE		drawable
+ 	4	CARD32			interval
+     ▶
+└───
+
+┌───
+    DRI2GetParam
+	1	CARD8			major opcode
+	1	13			DRI2 opcode
+	2	8			length
+	4	DRAWABLE		drawable
+	4	CARD32			param
+     ▶
+	1	1			Reply
+	1	BOOL			is_param_recognized
+	2	CARD16			sequence number
+	4	0			reply length
+	4	CARD32			value_hi
+	4	CARD32			value_lo
+	16				unused
+└───
+
+┌───
+    DRI2SetAttribute
+	1	CARD8			major opcode
+	1	7			DRI2 opcode
+	2	8			length
+	4	DRAWABLE		drawable
+	4	ATOM			attribute
+	4n	LISTofCARD32		value
+      ▶
+└───
+
+┌───
+    DRI2GetAttribute
+	1	CARD8			major opcode
+	1	7			DRI2 opcode
+	2	8			length
+	4	DRAWABLE		drawable
+	4	ATOM			attribute
+      ▶
+	1	1			Reply
+	1				unused
+	2	CARD16			sequence number
+	4	0			reply length
+	24				unused
+	4n	LISTofCARD32		value
+└───
+
+┌───
+    DRI2GetFormats
+	1	CARD8			major opcode
+	1	7			DRI2 opcode
+	2	8			length
+	4	DRAWABLE		drawable
+      ▶
+	1	1			Reply
+	1				unused
+	2	CARD16			sequence number
+	4	0			reply length
+	24				unused
+	4n	LISTofCARD32		formats
+└───
+
+A.3 Protocol Events
+
+The DRI2 extension specifies DRI2_BufferSwapComplete and
+DRI2_InvalidateBuffers events.
+
+┌───
+    DRI2_BufferSwapComplete
+	1	CARD8			type
+	1	CARD8			extension
+	2	CARD16			sequenceNumber
+	2	CARD16			event_type
+	4	DRAWABLE		drawable
+	4	CARD32			ust_hi
+	4	CARD32			ust_lo
+	4	CARD32			msc_hi
+	4	CARD32			msc_lo
+	4	CARD32			sbc_hi
+	4	CARD32			sbc_lo
+└───
+
+
+┌───
+    DRI2_InvalidateBuffers
+	1	CARD8			type
+	1	CARD8			extension
+	2	CARD16			sequenceNumber
+	4	DRAWABLE		drawable
+	4	CARD32			unused
+	4	CARD32			unused
+	4	CARD32			unused
+	4	CARD32			unused
+	4	CARD32			unused
+	4	CARD32			unused
+└───
+
+A.4 Protocol Errors
+
+The DRI2 extension specifies no errors.
+
+
+			     ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+
+Appendix B. Implementation on GEM
+
+Where to begin...
Index: proto/dri2proto/create-2.8-ti-glsdk-patch/dri2proto-2.8-new/dri2tokens.h
===================================================================
--- proto/dri2proto/create-2.8-ti-glsdk-patch/dri2proto-2.8-new/dri2tokens.h	(nonexistent)
+++ proto/dri2proto/create-2.8-ti-glsdk-patch/dri2proto-2.8-new/dri2tokens.h	(revision 5)
@@ -0,0 +1,62 @@
+/*
+ * Copyright © 2008 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Soft-
+ * ware"), to deal in the Software without restriction, including without
+ * limitation the rights to use, copy, modify, merge, publish, distribute,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, provided that the above copyright
+ * notice(s) and this permission notice appear in all copies of the Soft-
+ * ware and that both the above copyright notice(s) and this permission
+ * notice appear in supporting documentation.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
+ * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
+ * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
+ * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE-
+ * QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR-
+ * MANCE OF THIS SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder shall
+ * not be used in advertising or otherwise to promote the sale, use or
+ * other dealings in this Software without prior written authorization of
+ * the copyright holder.
+ *
+ * Authors:
+ *   Kristian Høgsberg (krh@redhat.com)
+ */
+
+#ifndef _DRI2_TOKENS_H_
+#define _DRI2_TOKENS_H_
+
+#define DRI2BufferFrontLeft		0
+#define DRI2BufferBackLeft		1
+#define DRI2BufferFrontRight		2
+#define DRI2BufferBackRight		3
+#define DRI2BufferDepth			4
+#define DRI2BufferStencil		5
+#define DRI2BufferAccum			6
+#define DRI2BufferFakeFrontLeft		7
+#define DRI2BufferFakeFrontRight	8
+#define DRI2BufferDepthStencil		9
+#define DRI2BufferHiz			10
+
+/* keep bits 16 and above for prime IDs */
+#define DRI2DriverPrimeMask             7 /* 0 - 7 - allows for 6 devices*/
+#define DRI2DriverPrimeShift           16
+#define DRI2DriverPrimeId(x)         (((x) >> DRI2DriverPrimeShift) & (DRI2DriverPrimeMask))
+
+#define DRI2DriverDRI			0
+#define DRI2DriverVDPAU			1
+#define DRI2DriverXV			2
+
+/* Event sub-types for the swap complete event */
+#define DRI2_EXCHANGE_COMPLETE		0x1
+#define DRI2_BLIT_COMPLETE		0x2
+#define DRI2_FLIP_COMPLETE		0x3
+
+#endif
Index: proto/dri2proto/create-2.8-ti-glsdk-patch/dri2proto-2.8-new
===================================================================
--- proto/dri2proto/create-2.8-ti-glsdk-patch/dri2proto-2.8-new	(nonexistent)
+++ proto/dri2proto/create-2.8-ti-glsdk-patch/dri2proto-2.8-new	(revision 5)

Property changes on: proto/dri2proto/create-2.8-ti-glsdk-patch/dri2proto-2.8-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/dri2proto/create-2.8-ti-glsdk-patch/file.list
===================================================================
--- proto/dri2proto/create-2.8-ti-glsdk-patch/file.list	(nonexistent)
+++ proto/dri2proto/create-2.8-ti-glsdk-patch/file.list	(revision 5)
@@ -0,0 +1,3 @@
+dri2proto-2.8/dri2proto.h
+dri2proto-2.8/dri2proto.txt
+dri2proto-2.8/dri2tokens.h
Index: proto/dri2proto/create-2.8-ti-glsdk-patch
===================================================================
--- proto/dri2proto/create-2.8-ti-glsdk-patch	(nonexistent)
+++ proto/dri2proto/create-2.8-ti-glsdk-patch	(revision 5)

Property changes on: proto/dri2proto/create-2.8-ti-glsdk-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/dri2proto/patches/README
===================================================================
--- proto/dri2proto/patches/README	(nonexistent)
+++ proto/dri2proto/patches/README	(revision 5)
@@ -0,0 +1,6 @@
+
+/* begin *
+
+   TODO: Leave some comment here.
+
+ * end */
Index: proto/dri2proto/patches
===================================================================
--- proto/dri2proto/patches	(nonexistent)
+++ proto/dri2proto/patches	(revision 5)

Property changes on: proto/dri2proto/patches
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/dri2proto
===================================================================
--- proto/dri2proto	(nonexistent)
+++ proto/dri2proto	(revision 5)

Property changes on: proto/dri2proto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/dri3proto/Makefile
===================================================================
--- proto/dri3proto/Makefile	(nonexistent)
+++ proto/dri3proto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/dri3proto
+
+versions    = 1.0
+pkgname     = dri3proto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/dri3proto
===================================================================
--- proto/dri3proto	(nonexistent)
+++ proto/dri3proto	(revision 5)

Property changes on: proto/dri3proto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/evieext/Makefile
===================================================================
--- proto/evieext/Makefile	(nonexistent)
+++ proto/evieext/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/evieext
+
+versions    = 1.1.1
+pkgname     = evieext
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/evieext
===================================================================
--- proto/evieext	(nonexistent)
+++ proto/evieext	(revision 5)

Property changes on: proto/evieext
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/fixesproto/Makefile
===================================================================
--- proto/fixesproto/Makefile	(nonexistent)
+++ proto/fixesproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/fixesproto
+
+versions    = 5.0
+pkgname     = fixesproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/fixesproto
===================================================================
--- proto/fixesproto	(nonexistent)
+++ proto/fixesproto	(revision 5)

Property changes on: proto/fixesproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/fontcacheproto/Makefile
===================================================================
--- proto/fontcacheproto/Makefile	(nonexistent)
+++ proto/fontcacheproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/fontcacheproto
+
+versions    = 0.1.3
+pkgname     = fontcacheproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/fontcacheproto
===================================================================
--- proto/fontcacheproto	(nonexistent)
+++ proto/fontcacheproto	(revision 5)

Property changes on: proto/fontcacheproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/fontsproto/Makefile
===================================================================
--- proto/fontsproto/Makefile	(nonexistent)
+++ proto/fontsproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/fontsproto
+
+versions    = 2.1.3
+pkgname     = fontsproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/fontsproto
===================================================================
--- proto/fontsproto	(nonexistent)
+++ proto/fontsproto	(revision 5)

Property changes on: proto/fontsproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/glproto/Makefile
===================================================================
--- proto/glproto/Makefile	(nonexistent)
+++ proto/glproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/glproto
+
+versions    = 1.4.17
+pkgname     = glproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/glproto
===================================================================
--- proto/glproto	(nonexistent)
+++ proto/glproto	(revision 5)

Property changes on: proto/glproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/inputproto/Makefile
===================================================================
--- proto/inputproto/Makefile	(nonexistent)
+++ proto/inputproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/inputproto
+
+versions    = 2.3.2
+pkgname     = inputproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/inputproto
===================================================================
--- proto/inputproto	(nonexistent)
+++ proto/inputproto	(revision 5)

Property changes on: proto/inputproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/kbproto/Makefile
===================================================================
--- proto/kbproto/Makefile	(nonexistent)
+++ proto/kbproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/kbproto
+
+versions    = 1.0.7
+pkgname     = kbproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/kbproto
===================================================================
--- proto/kbproto	(nonexistent)
+++ proto/kbproto	(revision 5)

Property changes on: proto/kbproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/presentproto/Makefile
===================================================================
--- proto/presentproto/Makefile	(nonexistent)
+++ proto/presentproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/presentproto
+
+versions    = 1.1
+pkgname     = presentproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/presentproto
===================================================================
--- proto/presentproto	(nonexistent)
+++ proto/presentproto	(revision 5)

Property changes on: proto/presentproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/printproto/Makefile
===================================================================
--- proto/printproto/Makefile	(nonexistent)
+++ proto/printproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/printproto
+
+versions    = 1.0.5
+pkgname     = printproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/printproto
===================================================================
--- proto/printproto	(nonexistent)
+++ proto/printproto	(revision 5)

Property changes on: proto/printproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/randrproto/Makefile
===================================================================
--- proto/randrproto/Makefile	(nonexistent)
+++ proto/randrproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/randrproto
+
+versions    = 1.5.0
+pkgname     = randrproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/randrproto
===================================================================
--- proto/randrproto	(nonexistent)
+++ proto/randrproto	(revision 5)

Property changes on: proto/randrproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/recordproto/Makefile
===================================================================
--- proto/recordproto/Makefile	(nonexistent)
+++ proto/recordproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/recordproto
+
+versions    = 1.14.2
+pkgname     = recordproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/recordproto
===================================================================
--- proto/recordproto	(nonexistent)
+++ proto/recordproto	(revision 5)

Property changes on: proto/recordproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/renderproto/Makefile
===================================================================
--- proto/renderproto/Makefile	(nonexistent)
+++ proto/renderproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/renderproto
+
+versions    = 0.11.1
+pkgname     = renderproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/renderproto
===================================================================
--- proto/renderproto	(nonexistent)
+++ proto/renderproto	(revision 5)

Property changes on: proto/renderproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/resourceproto/Makefile
===================================================================
--- proto/resourceproto/Makefile	(nonexistent)
+++ proto/resourceproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/resourceproto
+
+versions    = 1.2.0
+pkgname     = resourceproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/resourceproto
===================================================================
--- proto/resourceproto	(nonexistent)
+++ proto/resourceproto	(revision 5)

Property changes on: proto/resourceproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/scrnsaverproto/Makefile
===================================================================
--- proto/scrnsaverproto/Makefile	(nonexistent)
+++ proto/scrnsaverproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/scrnsaverproto
+
+versions    = 1.2.2
+pkgname     = scrnsaverproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/scrnsaverproto
===================================================================
--- proto/scrnsaverproto	(nonexistent)
+++ proto/scrnsaverproto	(revision 5)

Property changes on: proto/scrnsaverproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/videoproto/Makefile
===================================================================
--- proto/videoproto/Makefile	(nonexistent)
+++ proto/videoproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/videoproto
+
+versions    = 2.3.3
+pkgname     = videoproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/videoproto
===================================================================
--- proto/videoproto	(nonexistent)
+++ proto/videoproto	(revision 5)

Property changes on: proto/videoproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/windowswmproto/Makefile
===================================================================
--- proto/windowswmproto/Makefile	(nonexistent)
+++ proto/windowswmproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/windowswmproto
+
+versions    = 1.0.4
+pkgname     = windowswmproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/windowswmproto
===================================================================
--- proto/windowswmproto	(nonexistent)
+++ proto/windowswmproto	(revision 5)

Property changes on: proto/windowswmproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/xcmiscproto/Makefile
===================================================================
--- proto/xcmiscproto/Makefile	(nonexistent)
+++ proto/xcmiscproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/xcmiscproto
+
+versions    = 1.2.2
+pkgname     = xcmiscproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/xcmiscproto
===================================================================
--- proto/xcmiscproto	(nonexistent)
+++ proto/xcmiscproto	(revision 5)

Property changes on: proto/xcmiscproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/xextproto/Makefile
===================================================================
--- proto/xextproto/Makefile	(nonexistent)
+++ proto/xextproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/xextproto
+
+versions    = 7.3.0
+pkgname     = xextproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/xextproto
===================================================================
--- proto/xextproto	(nonexistent)
+++ proto/xextproto	(revision 5)

Property changes on: proto/xextproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/xf86bigfontproto/Makefile
===================================================================
--- proto/xf86bigfontproto/Makefile	(nonexistent)
+++ proto/xf86bigfontproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/xf86bigfontproto
+
+versions    = 1.2.0
+pkgname     = xf86bigfontproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/xf86bigfontproto
===================================================================
--- proto/xf86bigfontproto	(nonexistent)
+++ proto/xf86bigfontproto	(revision 5)

Property changes on: proto/xf86bigfontproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/xf86dgaproto/Makefile
===================================================================
--- proto/xf86dgaproto/Makefile	(nonexistent)
+++ proto/xf86dgaproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/xf86dgaproto
+
+versions    = 2.1
+pkgname     = xf86dgaproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/xf86dgaproto
===================================================================
--- proto/xf86dgaproto	(nonexistent)
+++ proto/xf86dgaproto	(revision 5)

Property changes on: proto/xf86dgaproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/xf86driproto/Makefile
===================================================================
--- proto/xf86driproto/Makefile	(nonexistent)
+++ proto/xf86driproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/xf86driproto
+
+versions    = 2.1.1
+pkgname     = xf86driproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/xf86driproto
===================================================================
--- proto/xf86driproto	(nonexistent)
+++ proto/xf86driproto	(revision 5)

Property changes on: proto/xf86driproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/xf86miscproto/Makefile
===================================================================
--- proto/xf86miscproto/Makefile	(nonexistent)
+++ proto/xf86miscproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/xf86miscproto
+
+versions    = 0.9.3
+pkgname     = xf86miscproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/xf86miscproto
===================================================================
--- proto/xf86miscproto	(nonexistent)
+++ proto/xf86miscproto	(revision 5)

Property changes on: proto/xf86miscproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/xf86vidmodeproto/Makefile
===================================================================
--- proto/xf86vidmodeproto/Makefile	(nonexistent)
+++ proto/xf86vidmodeproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/xf86vidmodeproto
+
+versions    = 2.3.1
+pkgname     = xf86vidmodeproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/xf86vidmodeproto
===================================================================
--- proto/xf86vidmodeproto	(nonexistent)
+++ proto/xf86vidmodeproto	(revision 5)

Property changes on: proto/xf86vidmodeproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/xineramaproto/Makefile
===================================================================
--- proto/xineramaproto/Makefile	(nonexistent)
+++ proto/xineramaproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/xineramaproto
+
+versions    = 1.2.1
+pkgname     = xineramaproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/xineramaproto
===================================================================
--- proto/xineramaproto	(nonexistent)
+++ proto/xineramaproto	(revision 5)

Property changes on: proto/xineramaproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/xorgproto/Makefile
===================================================================
--- proto/xorgproto/Makefile	(nonexistent)
+++ proto/xorgproto/Makefile	(revision 5)
@@ -0,0 +1,56 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/xorgproto
+
+versions    = 2022.2
+pkgname     = xorgproto
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+patches     = $(CURDIR)/patches/xorgproto-2022.2-docbook.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-2022.2-docbook-patch ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s) $(patches)
Index: proto/xorgproto/create-2022.2-docbook-patch/create.patch.sh
===================================================================
--- proto/xorgproto/create-2022.2-docbook-patch/create.patch.sh	(nonexistent)
+++ proto/xorgproto/create-2022.2-docbook-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=2022.2
+
+tar --files-from=file.list -xJvf ../xorgproto-$VERSION.tar.xz
+mv xorgproto-$VERSION xorgproto-$VERSION-orig
+
+cp -rf ./xorgproto-$VERSION-new ./xorgproto-$VERSION
+
+diff --unified -Nr  xorgproto-$VERSION-orig  xorgproto-$VERSION > xorgproto-$VERSION-docbook.patch
+
+mv xorgproto-$VERSION-docbook.patch ../patches
+
+rm -rf ./xorgproto-$VERSION
+rm -rf ./xorgproto-$VERSION-orig

Property changes on: proto/xorgproto/create-2022.2-docbook-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: proto/xorgproto/create-2022.2-docbook-patch/file.list
===================================================================
--- proto/xorgproto/create-2022.2-docbook-patch/file.list	(nonexistent)
+++ proto/xorgproto/create-2022.2-docbook-patch/file.list	(revision 5)
@@ -0,0 +1,5 @@
+xorgproto-2022.2/specs/bigreqsproto/bigreq.xml
+xorgproto-2022.2/specs/fontsproto/fsproto.xml
+xorgproto-2022.2/specs/scrnsaverproto/saver.xml
+xorgproto-2022.2/specs/xextproto/dpms.xml
+xorgproto-2022.2/specs/xextproto/xtest.xml
Index: proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/bigreqsproto/bigreq.xml
===================================================================
--- proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/bigreqsproto/bigreq.xml	(nonexistent)
+++ proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/bigreqsproto/bigreq.xml	(revision 5)
@@ -0,0 +1,323 @@
+<?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"
+[
+<!ENTITY % defs SYSTEM "defs.ent"> %defs;
+]>
+
+<!-- lifted from troff+ms+XMan by doclifter -->
+<book id="bigreq">
+
+<bookinfo>
+   <title>Big Requests Extension</title>
+   <subtitle>X Consortium Standard</subtitle>
+   <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
+   <releaseinfo>Version 2.0</releaseinfo>
+   <authorgroup>
+      <author>
+         <firstname>Bob</firstname><surname>Scheifler</surname>
+         <affiliation><orgname>X Consortium</orgname></affiliation>
+      </author>
+   </authorgroup>
+   <copyright><year>1993</year><year>1994</year><holder>X Consortium</holder></copyright>
+
+<legalnotice>
+<para>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &ldquo;Software&rdquo;), 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>
+
+<para>X Window System is a trademark of The Open Group.</para>
+</legalnotice>
+
+</bookinfo>
+
+<chapter id='Overview'>
+<title>Overview</title>
+
+<para>This extension enables the use of protocol requests that exceed 262140 bytes in length.</para>
+
+<para>The core protocol restricts the maximum length of a protocol request to 262140 bytes, in that it uses a 16-bit length field specifying the number of 4-byte units in the request.  This is a problem in the core protocol when joining large numbers of lines (<symbol role='Pn'>PolyLine</symbol>) or arcs (<symbol role='Pn'>PolyArc</symbol>), since these requests cannot be broken up into smaller requests without disturbing the rendering of the join points.  It is also much more of a problem for protocol extensions, such as the PEX extension for 3D graphics and the XIE extension for imaging, that need to send long data lists in output commands.</para>
+
+<para>This extension defines a mechanism for extending the length field beyond 16 bits.  If the normal 16-bit length field of the protocol request is zero, then an additional 32-bit field containing the actual length (in 4-byte units) is inserted into the request, immediately following the 16-bit length field.</para>
+
+<para>For example, a normal <function>PolyLine</function> encoding is:</para>
+
+<informaltable id='PolyLine' frame='none'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='4' align='left' colsep='0' rowsep='0'>
+    <colspec colname='c1' colwidth='1.0*'/>
+    <colspec colname='c2' colwidth='3.0*'/>
+    <colspec colname='c3' colwidth='2.0*'/>
+    <colspec colname='c4' colwidth='11.0*'/>
+    <thead>
+      <row>
+        <entry namest="c1" nameend="c4"><function>PolyLine</function></entry>
+      </row>
+    </thead>
+    <tbody>
+      <row>
+        <entry>1</entry>
+        <entry>65</entry>
+        <entry></entry>
+        <entry>opcode</entry>
+      </row>
+      <row>
+        <entry>1</entry>
+        <entry></entry>
+        <entry></entry>
+        <entry>coordinate-mode</entry>
+      </row>
+      <row>
+        <entry></entry>
+        <entry>0</entry>
+        <entry>Origin</entry>
+        <entry></entry>
+      </row>
+      <row>
+        <entry></entry>
+        <entry>1</entry>
+        <entry>Previous</entry>
+        <entry></entry>
+      </row>
+      <row>
+        <entry>2</entry>
+        <entry>3+n</entry>
+        <entry></entry>
+        <entry></entry>
+      </row>
+      <row>
+        <entry>4</entry>
+        <entry>DRAWABLE</entry>
+        <entry></entry>
+        <entry>drawable</entry>
+      </row>
+      <row>
+        <entry>4</entry>
+        <entry>GCONTEXT</entry>
+        <entry></entry>
+        <entry>gc</entry>
+      </row>
+      <row>
+        <entry>4n</entry>
+        <entry>LISTofPOINT</entry>
+        <entry></entry>
+        <entry>points</entry>
+      </row>
+     </tbody>
+  </tgroup>
+</informaltable>
+
+<para>An extended-length <function>PolyLine</function> encoding is:</para>
+
+<informaltable frame='none'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='4' align='left' colsep='0' rowsep='0'>
+    <colspec colname='c1' colwidth='1.0*'/>
+    <colspec colname='c2' colwidth='3.0*'/>
+    <colspec colname='c3' colwidth='2.0*'/>
+    <colspec colname='c4' colwidth='11.0*'/>
+    <thead>
+      <row>
+        <entry namest="c1" nameend="c4"><function>PolyLine</function></entry>
+      </row>
+    </thead>
+    <tbody>
+      <row>
+        <entry>1</entry>
+        <entry>65</entry>
+        <entry></entry>
+        <entry>opcode</entry>
+      </row>
+      <row>
+        <entry>1</entry>
+        <entry></entry>
+        <entry></entry>
+        <entry>coordinate-mode</entry>
+      </row>
+      <row>
+        <entry></entry>
+        <entry>0</entry>
+        <entry>Origin</entry>
+        <entry></entry>
+      </row>
+      <row>
+        <entry></entry>
+        <entry>1</entry>
+        <entry>Previous</entry>
+        <entry></entry>
+      </row>
+      <row>
+        <entry>2</entry>
+        <entry>0</entry>
+        <entry></entry>
+        <entry>extended length flag</entry>
+      </row>
+      <row>
+        <entry>4</entry>
+        <entry>4+n</entry>
+        <entry></entry>
+        <entry>request length</entry>
+      </row>
+      <row>
+        <entry>4</entry>
+        <entry>DRAWABLE</entry>
+        <entry></entry>
+        <entry>drawable</entry>
+      </row>
+      <row>
+        <entry>4</entry>
+        <entry>GCONTEXT</entry>
+        <entry></entry>
+        <entry>gc</entry>
+      </row>
+      <row>
+        <entry>4n</entry>
+        <entry>LISTofPOINT</entry>
+        <entry></entry>
+        <entry>points</entry>
+      </row>
+     </tbody>
+  </tgroup>
+</informaltable>
+
+<para>Extended-length protocol encodings, once enabled, can be used on all protocol requests, including all extensions.</para>
+</chapter>
+
+<chapter id='Requests'>
+<title>Requests</title>
+
+<para><function>BigReqEnable</function></para>
+
+<para>   =&gt;</para>
+
+<para><emphasis remap='I'>maximum-request-length</emphasis>: CARD32</para>
+
+<para>This request enables extended-length protocol requests for the requesting client.  It also returns the maximum length of a request, in 4-byte units, that can be used in extended-length protocol requests.  This value will always be greater than the maximum-request-length returned in the connection setup information.</para>
+</chapter>
+
+<chapter id='Events_and_Errors'>
+<title>Events and Errors</title>
+
+<para>No new events or errors are defined by this extension.</para>
+</chapter>
+
+<chapter 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 &ldquo;BIG-REQUESTS&rdquo;.</para>
+
+<informaltable frame='none'>
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+    <colspec colname='c1' colwidth='1.0*'/>
+    <colspec colname='c2' colwidth='2.0*'/>
+    <colspec colname='c3' colwidth='15.0*'/>
+    <thead>
+      <row>
+        <entry namest="c1" nameend="c3">BigReqEnable</entry>
+      </row>
+    </thead>
+    <tbody>
+      <row>
+        <entry>1</entry>
+        <entry>Card8</entry>
+        <entry>opcode</entry>
+      </row>
+      <row>
+        <entry>1</entry>
+        <entry>0</entry>
+        <entry>bigreq opcode</entry>
+      </row>
+      <row>
+        <entry>2</entry>
+        <entry>1</entry>
+        <entry>request length</entry>
+      </row>
+     </tbody>
+  </tgroup>
+  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+    <colspec colname='c1' colwidth='1.0*'/>
+    <colspec colname='c2' colwidth='2.0*'/>
+    <colspec colname='c3' colwidth='15.0*'/>
+    <thead>
+      <row>
+        <entry namest="c1" nameend="c3">=&gt;</entry>
+      </row>
+    </thead>
+    <tbody>
+      <row>
+        <entry>1</entry>
+        <entry>1</entry>
+        <entry>Reply</entry>
+      </row>
+      <row>
+        <entry>1</entry>
+        <entry></entry>
+        <entry>unused</entry>
+      </row>
+      <row>
+        <entry>2</entry>
+        <entry>CARD16</entry>
+        <entry>sequence number</entry>
+      </row>
+      <row>
+        <entry>4</entry>
+        <entry>0</entry>
+        <entry>length</entry>
+      </row>
+      <row>
+        <entry>4</entry>
+        <entry>CARD32</entry>
+        <entry>maximum-request-length</entry>
+      </row>
+      <row>
+        <entry>20</entry>
+        <entry></entry>
+        <entry>unused</entry>
+      </row>
+     </tbody>
+  </tgroup>
+</informaltable>
+
+</chapter>
+
+<chapter id='C_Language_Binding'>
+<title>C language binding</title>
+
+<para>It is desirable for core Xlib, and other extensions, to use this extension internally when necessary.
+It is also desirable to make the use of this extension as transparent as possible to the X client.
+For example, if enabling of the extension were delayed until the first time it was needed, an application that used
+<function>XNextRequest</function> to determine the sequence number of a request would no longer get the correct sequence number.  As such,
+<function>XOpenDisplay</function> will determine if the extension is supported by the server and, if it is, enable extended-length
+encodings.</para>
+
+<para>The core Xlib functions <function>XDrawLines</function>, <function>XDrawArcs</function>, <function>XFillPolygon</function>, <function>XChangeProperty</function>, <function>XSetClipRectangles</function>, and <function>XSetRegion</function>
+are required to use extended-length encodings when necessary, if supported by the server.  Use of extended-length encodings
+in other core Xlib functions (<function>XDrawPoints</function>, <function>XDrawRectangles</function>, <function>XDrawSegments</function>). <function>XFillArcs</function>, <function>XFillRectangles</function>, <function>XPutImage</function>
+is permitted but not required; an Xlib implementation may choose to split the data across multiple smaller requests
+instead.</para>
+
+<para>To permit clients to know what the maximum-request-length for extended-length encodings is, the following function is added to Xlib:
+
+<funcsynopsis id='XExtendedMaxRequestSize'>
+<funcprototype>
+  <funcdef>long <function>XExtendedMaxRequestSize</function></funcdef>
+    <paramdef>Display <parameter> *display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+Returns zero (0) if the specified display does not support this extension, otherwise returns the maximum-request-length (in 4-byte units) supported by the server through the extended-length encoding.</para>
+</chapter>
+
+<chapter id='Acknowledgements'>
+<title>Acknowledgements</title>
+
+<para>Clive Feather (IXI) originated the extended-length encoding used in this extension proposal.</para>
+</chapter>
+</book>
Index: proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/bigreqsproto
===================================================================
--- proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/bigreqsproto	(nonexistent)
+++ proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/bigreqsproto	(revision 5)

Property changes on: proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/bigreqsproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/fontsproto/fsproto.xml
===================================================================
--- proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/fontsproto/fsproto.xml	(nonexistent)
+++ proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/fontsproto/fsproto.xml	(revision 5)
@@ -0,0 +1,4414 @@
+<?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"
+[
+<!ENTITY % defs SYSTEM "defs.ent"> %defs;
+]>
+
+
+<book id="fsproto">
+
+<bookinfo>
+   <title>The X Font Service Protocol</title>
+   <subtitle>X Consortium Standard</subtitle>
+   <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
+   <releaseinfo>Version 2.0</releaseinfo>
+   <authorgroup>
+      <author>
+         <firstname>Jim</firstname><surname>Fulton</surname>
+         <affiliation><orgname>Network Computing Devices, Inc.</orgname></affiliation>
+      </author>
+   </authorgroup>
+   <edition>Revised May 2, 1994</edition>
+   <copyright><year>1991</year><holder>Network Computing Devices, Inc.</holder></copyright>
+
+<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.  Network Computing Devices, Inc.
+makes no representations about the suitability for any purpose
+of the information in this document.  This documentation is
+provided &ldquo;as is&rdquo; without express or implied warranty.
+</para>
+</legalnotice>
+
+<legalnotice>
+<para role="multiLicensing">Copyright © 1994 X Consortium</para>
+<para>
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the &ldquo;Software&rdquo;), 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='Introduction'>
+<title>Introduction</title>
+<para>
+The management of fonts in large, heterogeneous environments is one of the
+hardest aspects of using the X Window System
+<footnote id='footnote1'><para>
+<firstterm><trademark>X Window System</trademark></firstterm>
+is a trademark of The Open Group.
+</para></footnote>
+.  Multiple formats and the lack of
+a consistent mechanism for exporting font data to all displays on a network
+prevent the transparent use of applications across different display platforms.
+The X Font Service protocol is designed to address this and other issues, with
+specific emphasis on the needs of the core X protocol.  Upward-compatible
+changes (typically in the form of new requests) are expected as consensus is
+reached on new features (particularly outline font support).
+</para>
+<para>
+Currently, most X displays use network file protocols such as
+<acronym>NFS</acronym> and <acronym>TFTP</acronym> to
+obtain raw font data which they parse directly.  Since a common binary format
+for this data doesn't exist, displays must be able to interpret a variety of
+formats if they are to be used with different application hosts.  This leads to
+wasted code and data space and a loss of interoperability as displays are used
+in unforeseen environments.
+</para>
+<para>
+By moving the interpretation of font data out of the X server into a separate
+service on the network, these problems can be greatly reduced.  In addition,
+new technologies, such as dynamically generating bitmaps from scaled or outline
+fonts, can be provided to all displays transparently.  For horizontal text,
+caching techniques and increased processor power can potentially make
+rasterization more efficient on large, centralized hosts than on individual
+displays.
+</para>
+<para>
+Each font server provides sets of fonts that may be listed and queried for
+header, property, glyph extents, and bitmap information.  This data is
+transmitted over the network using a binary format (with variations to support
+different bit- and byte-orders) designed to minimize the amount of processing
+required by the display.  Since the font server, rather than the display, is
+responsible for parsing the raw font data, new formats can be used by all
+displays by modifying a single font server.
+</para>
+<para>
+From the user's point of view, font servers are simply a new type of name in
+the X font path.  Network name services allow descriptive names (such as
+DEPARTMENT-FONTS or APPLICATION-FONTS) to be translated into proper network
+addresses.  X displays send requests to and read replies from the font server
+rather than reading directly from files.  Since the X Font Service protocol is
+designed to allow subsets of the font data to be requested, displays may easily
+implement a variety of strategies for fine-grained demand-loading of glyphs.
+</para>
+</chapter>
+
+<chapter id='Architectural_Model'>
+<title>Architectural Model</title>
+<!-- .XS -->
+<!-- (SN Architectural Model -->
+<!-- .XE -->
+<para>
+In this document, the words <firstterm>client</firstterm> and
+<firstterm>server</firstterm> refer to the consumer and
+provider of a font, respectively, unless otherwise indicated.  It is important
+to note that in this context, the X server is also a font client.
+</para>
+<para>
+The X Font Service protocol does not require any changes to the core X protocol
+or to any applications.  To the user, font servers are simply additional types
+of font path elements.  As such, X servers may connect to multiple font
+servers, as shown in Figure 2.1.  Although the font protocol is geared towards
+the X Window System, it may be also used by other consumers of font data (such
+as printer drivers).
+</para>
+
+<figure id="figure2.1" label="2.1"><title>Connecting to a Font Server</title>
+<literallayout class="monospaced">
+ ┌────────┐              ┌───────────────┐
+ │   X1   ├──────────────┤               │
+ │ Server │              │  Font Server  │
+ └────────┘      ┌───────┤      1        │
+                 │       └───────────────┘
+ ┌────────┐      │
+ │   X2   ├──────┘       ┌───────────────┐
+ │ Server ├──────────────┤               │
+ └────────┘              │  Font Server  │
+                 ┌───────┤      2        │
+┌─────────┐      │       └───────────────┘
+│  other  │      │
+│ clients ├──────┘
+└─────────┘
+</literallayout>
+</figure>
+
+<para>
+Clients communicate with the font server using the request/reply/event model
+over any mutually-understood virtual stream connection (such as
+<acronym>TCP/IP</acronym>, DECnet,
+<footnote id='footnote2'><para>
+<firstterm><trademark>DECnet</trademark></firstterm> is a trademark
+of Digital Equipment Corporation.
+</para></footnote>
+etc.).  Font servers are responsible for providing data in the bit and byte
+orders requested by the client.  The set of requests and events provided in the
+first version of the X Font Service protocol is limited to supporting the needs
+of the bitmap-oriented core X Window System protocol.  Extensions are expected
+as new needs evolve.
+</para>
+<para>
+A font server reads raw font data from a variety of sources (possibly
+including other font servers) and converts it into a common format that is
+transmitted to the client using the protocol described in
+<link linkend='Protocol'>Section 4</link>.  New font
+formats are handled by adding new converters to a font server, as shown in
+Figure 2.2.
+</para>
+
+<figure id="figure2.2" label="2.2"><title>Where Font Data Comes From</title>
+<literallayout class="monospaced">
+                ┌────────────┐
+                │   client   │
+                │ (X server) │
+                └─────┬──────┘
+                      │
+                   network
+                      │
+┌─────────────────────┴──────────────────────┐
+│                                            │
+│                font server 1               │
+│                                            │
+├─────┬─────┬─────┬─────┬────┬─────┬───┬─────┤
+│ bdf │ snf │ pcf │ atm │ f3 │ dwf │ │ │ ... │
+└─────┴─────┴─────┴─────┴────┴─────┴─│─┴─────┘
+                                     │
+                                  network
+                                     │
+                               ┌─────┴────┐
+                               │   font   │
+                               │ server 2 │
+                               └──────────┘
+</literallayout>
+</figure>
+
+<para>
+The server may choose to provide named sets of fonts called
+<firstterm>catalogues</firstterm>.
+Clients may specify which of the sets should be used in listing or opening a
+font.
+</para>
+
+<para>
+An event mechanism similar to that used in the X protocol is provided for
+asynchronous notification of clients by the server.
+</para>
+
+<para>
+Clients may provide authorization data for the server to be used in determining
+(according to the server's licensing policy) whether or not access should be
+granted to particular fonts.  This is particularly useful for clients whose
+authorization changes over time (such as an X server that can verify the
+identity of the user).
+</para>
+<para>
+Implementations that wish to provide additional requests or events may use the
+extension mechanism.  Adding to the core font service protocol (with the
+accompanying change in the major or minor version numbers) is reserved to the X
+Consortium.
+</para>
+</chapter>
+
+<chapter id='Font_Server_Naming'>
+<title>Font Server Naming</title>
+<!-- .XS -->
+<!-- (SN Font Server Naming -->
+<!-- .XE -->
+<para>
+Font clients that expose font server names to the user are encouraged to
+provide ways of naming font servers symbolically (e.g. DEPARTMENT-FONTS).
+However, for environments that lack appropriate name services
+transport-specific names are necessary.  Since these names do occur in the
+protocol, clients and servers should support at least the applicable formats
+described below.  Formats for additional transports may be registered with the
+X Consortium.
+</para>
+
+<section id='TCPIP_Names'>
+<title>TCP/IP Names</title>
+<!-- .XS -->
+<!-- (SN TCP/IP Names -->
+<!-- .XE -->
+<para>
+The following syntax should be used for TCP/IP names:
+
+<literallayout class="monospaced">
+    <replaceable>TCP name</replaceable>  ::=  <literal>tcp/</literal> <replaceable>hostname</replaceable> <literal>:</literal> <replaceable>ipportnumber</replaceable> <optional><literal>/</literal> <replaceable>cataloguelist</replaceable></optional>
+</literallayout>
+
+where <replaceable>hostname</replaceable> is either symbolic (such as
+<systemitem class="systemname">expo.lcs.mit.edu</systemitem>) or numeric
+decimal (such as <systemitem class="ipaddress">18.30.0.212</systemitem>).
+The <replaceable>ipportnumber</replaceable> is the port on which the
+font server is listening for connections.
+The <replaceable>cataloguelist</replaceable> string at
+the end is optional and specifies a plus-separated list of catalogues
+that may be requested.  For example:
+<literallayout class="monospaced">
+     tcp/expo.lcs.mit.edu:8012/available+special
+     tcp/18.30.0.212:7890
+</literallayout>
+</para>
+</section>
+
+<section id='DECnet_Names'>
+<title>DECnet Names</title>
+<!-- .XS -->
+<!-- (SN DECnet Names -->
+<!-- .XE -->
+<para>
+The following syntax should be used for DECnet names:
+
+<literallayout class="monospaced">
+    <replaceable>DECnet name</replaceable>  ::=  <literal>decnet/</literal> <replaceable>nodename</replaceable> <literal>::font$</literal> <replaceable>objname</replaceable> <optional><literal>/</literal> <replaceable>cataloguelist</replaceable></optional>
+</literallayout>
+
+where <replaceable>nodename</replaceable> is either symbolic (such as
+<systemitem class="systemname">SRVNOD</systemitem>) or the
+numeric decimal form of the DECnet address (such as
+<systemitem class="ipaddress">44.70</systemitem>).
+The <replaceable>objname</replaceable> is normal, case-insensitive DECnet
+object name.  The <replaceable>cataloguelist</replaceable> string
+at the end is
+optional and specifies a plus-separated list of catalogues that may be
+requested.  For example:
+
+<literallayout class="monospaced">
+     DECNET/SRVNOD::FONT$DEFAULT/AVAILABLE
+     decnet/44.70::font$other
+</literallayout>
+</para>
+</section>
+</chapter>
+
+<chapter id='Protocol'>
+<title>Protocol</title>
+<!-- .XS -->
+<!-- (SN Protocol -->
+<!-- .XE -->
+<para>
+The protocol described below uses the request/reply/error model and is
+specified using the same conventions outlined in
+Section 2 of the core X Window System protocol
+<xref linkend="References:x11proto"/>:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+<!-- .IP \(bu 5 -->
+Data type names are spelled in upper case with no word separators,
+as in:  <link linkend="Data_Types:FONTID"><type>FONTID</type></link>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<!-- .IP \(bu 5 -->
+Alternate values are capitalized with no word separators,
+as in:  <constant>MaxWidth</constant>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<!-- .IP \(bu 5 -->
+Structure element declarations are in lower case with hyphens
+as word separators, as in:  <structfield>byte-order-msb</structfield>
+    </para>
+    <note>
+      <para>
+Structure element names are referred to in
+upper case (e.g. <structfield>BYTE-ORDER-MSB</structfield>) when used in
+descriptions to set them off from the surrounding
+text.  When this document is typeset they will be
+printed in lower case in a distinct font.
+      </para>
+    </note>
+  </listitem>
+  <listitem>
+    <para>
+Type declarations have the form <quote><type>name</type>: type</quote>,
+as in:  <type>CARD8</type>: 8-bit byte
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Comma-separated lists of alternate values are enclosed in
+braces, as in:  { <constant>Min</constant>, <constant>MaxWidth</constant>,
+<constant>Max</constant> }
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Comma-separated lists of structure elements are enclosed in
+brackets, as in:  [ <structfield>byte1</structfield>: <type>CARD8</type>,
+<structfield>byte2</structfield>: <type>CARD8</type> ]
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+A type with a prefix <quote>LISTof</quote> represents a counted list of
+elements of that type, as in:  <type>LISTofCARD8</type>
+</para>
+
+<section id='Data_Types'>
+<title>Data Types</title>
+<!-- .XS -->
+<!-- (SN Data Types -->
+<!-- .XE -->
+<para>
+The following data types are used in the core X Font Server protocol:
+</para>
+
+<section id="Data_Types:ACCESSCONTEXT">
+  <title><type>ACCESSCONTEXT</type></title>
+  <indexterm zone="Data_Types:ACCESSCONTEXT" significance="preferred"><primary>ACCESSCONTEXT</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><type>ACCESSCONTEXT</type>:</entry><entry><link linkend="Data_Types:ID"><type>ID</type></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+<para>
+This value is specified in the CreateAC request as the identifier
+to be used when referring to a particular AccessContext resource
+within the server.  These resources are used by the server to
+store client-specified authorization information.  This
+information may be used by the server to determine whether or not
+the client should be granted access to particular font data.
+</para>
+<para>
+In order to preserve the integrity of font licensing being performed by
+the font server, care must be taken by a client to properly represent the
+identity of the true user of the font.  Some font clients will in fact
+be servers (for example, X servers) requesting fonts for their own clients.
+Other font clients may be doing work on behalf of a number of different
+users over time (for example, print spoolers).
+</para>
+<para>
+<type>AccessContext</type>s
+must be created (with
+<link linkend="Requests:CreateAC"><function>CreateAC</function></link>)
+and switched among (with
+<link linkend="Requests:SetAuthorization"><function>SetAuthorization</function></link>)
+to represent all of these <quote>font users</quote> properly.
+    </para>
+</section>
+
+<section id="Data_Types:ALTERNATESERVER">
+  <title><type>ALTERNATESERVER</type></title>
+  <indexterm zone="Data_Types:ALTERNATESERVER" significance="preferred"><primary>ALTERNATESERVER</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry morerows="1"><type>ALTERNATESERVER</type>:</entry>
+          <entry> [ <structfield>name</structfield>:</entry><entry>  <link linkend="Data_Types:STRING8"><type>STRING8</type></link>,</entry></row>
+          <row><entry>&emsp;<structfield>subset</structfield>:</entry><entry>  <link linkend="Data_Types:BOOL"><type>BOOL</type></link> ]</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+
+    <para>
+This structure specifies the <structfield>NAME</structfield>,
+encoded in <acronym>ISO</acronym> 8859-1 according
+to <link linkend='Font_Server_Naming'>Section 3</link>,
+of another font server that may be useful as a
+substitute for this font server.
+The <structfield>SUBSET</structfield> field indicates
+whether or not the alternate server is likely to only contain a
+subset of the fonts available from this font server.  This
+information is returned during the initial connection setup and
+may be used by the client to find a backup server in case of
+failure.
+    </para>
+</section>
+
+<section id="Data_Types:AUTH">
+  <title><type>AUTH</type></title>
+  <indexterm zone="Data_Types:AUTH" significance="preferred"><primary>AUTH</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry morerows="1"><type>AUTH</type>:</entry><entry>[ <structfield>name</structfield>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link>,</entry></row>
+          <row><entry>&emsp;<structfield>data</structfield>:</entry><entry><link linkend="Data_Types:BYTE"><type>LISTofBYTE</type></link> ]</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+
+<para>
+This structure specifies the name of an authorization protocol and
+initial data for that protocol.  It is used in the authorization
+negotiation in the initial connection setup and in the CreateAC
+request.
+</para>
+</section>
+
+<section id="Data_Types:BITMAPFORMAT">
+  <title><type>BITMAPFORMAT</type></title>
+  <indexterm zone="Data_Types:BITMAPFORMAT" significance="preferred"><primary>BITMAPFORMAT</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><type>BITMAPFORMAT</type>:</entry><entry><type>CARD32</type></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+
+    <para>
+   <type>CARD32</type> containing the following fields defined by the
+   sets of values given further below
+    </para>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+        <row><entry>[</entry></row>
+          <row><entry>&emsp;<structfield>byte-order-msb</structfield>:</entry><entry>      1 bit,</entry></row>
+          <row><entry>&emsp;<structfield>bit-order-msb</structfield>:</entry><entry>       1 bit,</entry></row>
+          <row><entry>&emsp;<structfield>image-rect</structfield>:</entry><entry>          2 bits</entry><entry>{ <constant>Min</constant>,
+                          <constant>MaxWidth</constant>,
+                          <constant>Max</constant> },</entry></row>
+          <row><entry>&emsp;<structfield>zero-pad</structfield>:</entry><entry>            4 bits,</entry></row>
+          <row><entry>&emsp;<structfield>scanline-pad</structfield>:</entry><entry>        2 bits</entry><entry>{ <constant>ScanlinePad8</constant>,
+                          <constant>ScanlinePad16</constant>,
+                          <constant>ScanlinePad32</constant>,
+                          <constant>ScanlinePad64</constant> },</entry></row>
+          <row><entry>&emsp;<structfield>zero-pad</structfield>:</entry><entry>            2 bits,</entry></row>
+          <row><entry>&emsp;<structfield>scanline-unit</structfield>:</entry><entry>       2 bits</entry><entry>{ <constant>ScanlineUnit8</constant>,
+                          <constant>ScanlineUnit16</constant>,
+                          <constant>ScanlineUnit32</constant>,
+                          <constant>ScanlineUnit64</constant> },</entry></row>
+          <row><entry>&emsp;<structfield>zero-pad</structfield>:</entry><entry>            2 bits,</entry></row>
+          <row><entry>&emsp;<structfield>zero-pad</structfield>:</entry><entry>            16 bits,</entry></row>
+          <row><entry>]</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+
+<para>
+This structure specifies how glyph images are transmitted in
+response to
+<link linkend="Requests:QueryXBitmaps8"><function>QueryXBitmaps8</function></link>
+and
+<link linkend="Requests:QueryXBitmaps16"><function>QueryXBitmaps16</function></link>
+requests.
+</para>
+<para>
+If the <structfield>BYTE-ORDER-MSB</structfield> bit
+<literal>(1 &lt;&lt; 0)</literal> is set, the Most Significant
+Byte of each scanline unit is returned first.  Otherwise, the
+Least Significant Byte is returned first.
+</para>
+<para>
+If the <structfield>BIT-ORDER-MSB</structfield> bit
+<literal>(1 &lt;&lt; 1)</literal> is set, the left-most bit in
+each glyph scanline unit is stored in the Most Significant Bit of
+each transmitted scanline unit.  Otherwise, the left-most bit is
+stored in the Least Significant Bit.
+</para>
+<para>
+The <structfield>IMAGE-RECT</structfield> field specifies a rectangle of
+pixels within the
+glyph image.  It contains one of the following alternate values:
+
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><constant>ImageRectMin</constant></entry><entry><literal>(0 &lt;&lt; 2)</literal></entry></row>
+          <row><entry><constant>ImageRectMaxWidth</constant></entry><entry><literal>(1 &lt;&lt; 2)</literal></entry></row>
+          <row><entry><constant>ImageRectMax</constant></entry><entry><literal>(2 &lt;&lt; 2)</literal></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+</para>
+<para>
+For a glyph with extents <link linkend="Data_Types:XCHARINFO"><type>XCHARINFO</type></link> in a font with header
+information <link linkend="Data_Types:XFONTINFO"><type>XFONTINFO</type></link>, the <structfield>IMAGE-RECT</structfield>
+values have the following meanings:
+<variablelist>
+  <varlistentry id="Constant:ImageRectMin">
+    <term><constant>ImageRectMin</constant></term>
+    <listitem>
+      <indexterm zone="Constant:ImageRectMin" significance="preferred"><primary>ImageRectMin</primary></indexterm>
+      <para>
+This refers to the minimal bounding rectangle
+surrounding the inked pixels in the glyph.  This is the
+most compact representation.  The edges of the rectangle
+are:
+<literallayout class="monospaced">
+         left:     <structfield>XCHARINFO.LBEARING</structfield>
+         right:    <structfield>XCHARINFO.RBEARING</structfield>
+         top:      <structfield>XCHARINFO.ASCENT</structfield>
+         bottom:   <structfield>XCHARINFO.DESCENT</structfield>
+</literallayout>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry id="Constant:ImageRectMaxWidth">
+    <term><constant>ImageRectMaxWidth</constant></term>
+    <listitem>
+      <indexterm zone="Constant:ImageRectMaxWidth" significance="preferred"><primary>ImageRectMaxWidth</primary></indexterm>
+      <para>
+This refers to the scanlines between the
+glyph's ascent and descent, padded on the left to the minimum
+left-bearing (or 0, whichever is less) and on the right to
+the maximum right-bearing (or logical-width, whichever is
+greater).  All glyph images share a common horizontal
+origin.  This is a combination of <constant>ImageRectMax</constant> in the
+horizontal direction and <constant>ImageRectMin</constant> in the vertical
+direction.  The edges of the rectangle are:
+
+<literallayout class="monospaced">
+left:         min (<structfield>XFONTINFO.MIN-BOUNDS.LBEARING</structfield>, 0)
+right:        max (<structfield>XFONTINFO.MAX-BOUNDS.RBEARING</structfield>,
+                   <structfield>XFONTINFO.MAX-BOUNDS.WIDTH</structfield>)
+top:               <structfield>XCHARINFO.ASCENT</structfield>
+bottom:            <structfield>XCHARINFO.DESCENT</structfield>
+</literallayout>
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry id="Constant:ImageRectMax">
+    <term><constant>ImageRectMax</constant></term>
+    <listitem>
+      <indexterm zone="Constant:ImageRectMax" significance="preferred"><primary>ImageRectMax</primary></indexterm>
+      <para>
+This refers to all scanlines, from the maximum
+ascent (or the font ascent, whichever is greater) to the
+maximum descent (or the font descent, whichever is greater),
+padded to the same horizontal extents as <constant>MaxWidth</constant>.
+All glyph images have the same sized bitmap and share a
+common origin.  This is the least compact representation,
+but may be the easiest or most efficient (particularly for
+character cell fonts) for some clients to use.  The edges of
+the rectangle are:
+
+<literallayout class="monospaced">
+left:         min (<structfield>XFONTINFO.MIN-BOUNDS.LBEARING</structfield>, 0)
+right:        max (<structfield>XFONTINFO.MAX-BOUNDS.RBEARING</structfield>,
+                   <structfield>XFONTINFO.MAX-BOUNDS.WIDTH</structfield>)
+top:          max (<structfield>XFONTINFO.FONT-ASCENT</structfield>,
+                   <structfield>XFONTINFO.MAX-BOUNDS.ASCENT</structfield>)
+bottom:       max (<structfield>XFONTINFO.FONT-DESCENT</structfield>,
+                   <structfield>XFONTINFO.MAX-BOUNDS.DESCENT</structfield>)
+</literallayout>
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para>
+The <structfield>SCANLINE-PAD</structfield> field specifies the number of
+bits (8, 16, 32,
+or 64) to which each glyph scanline is padded before transmitting.
+It contains one of the following alternate values:
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><constant>ScanlinePad8</constant></entry><entry><literal>(0 &lt;&lt; 8)</literal></entry></row>
+          <row><entry><constant>ScanlinePad16</constant></entry><entry><literal>(1 &lt;&lt; 8)</literal></entry></row>
+          <row><entry><constant>ScanlinePad32</constant></entry><entry><literal>(2 &lt;&lt; 8)</literal></entry></row>
+          <row><entry><constant>ScanlinePad64</constant></entry><entry><literal>(3 &lt;&lt; 8)</literal></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+</para>
+<para>
+The <structfield>SCANLINE-UNIT</structfield> field specifies the number of
+bits (8, 16, 32, or 64) that should be treated as a unit for swapping.
+This value must be less than or equal to the number of bits specified by the
+<structfield>SCANLINE-PAD</structfield>.  It contains one of the following
+alternate values:
+
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><constant>ScanlineUnit8</constant></entry><entry><literal>(0 &lt;&lt; 12)</literal></entry></row>
+          <row><entry><constant>ScanlineUnit16</constant></entry><entry><literal>(1 &lt;&lt; 12)</literal></entry></row>
+          <row><entry><constant>ScanlineUnit32</constant></entry><entry><literal>(2 &lt;&lt; 12)</literal></entry></row>
+          <row><entry><constant>ScanlineUnit64</constant></entry><entry><literal>(3 &lt;&lt; 12)</literal></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+</para>
+<para>
+<link linkend="Data_Types:BITMAPFORMAT"><type>BITMAPFORMAT</type></link>s are byte-swapped as <type>CARD32</type>s.
+All unspecified bits must be zero.
+</para>
+<para>
+Use of an invalid <link linkend="Data_Types:BITMAPFORMAT"><type>BITMAPFORMAT</type></link> causes a
+<link linkend="Errors:Format"><errorname>Format</errorname></link> error to be returned.
+</para>
+</section>
+
+<section id="Data_Types:BITMAPFORMATMASK">
+  <title><type>BITMAPFORMATMASK</type></title>
+  <indexterm zone="Data_Types:BITMAPFORMATMASK" significance="preferred"><primary>BITMAPFORMATMASK</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><type>BITMAPFORMATMASK</type>:</entry><entry>     <type>CARD32</type> mask</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+<para>
+This is a mask of bits representing the fields in a <link linkend="Data_Types:BITMAPFORMAT"><type>BITMAPFORMAT</type></link>:
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><constant>ByteOrderMask</constant></entry><entry><literal>(1 &lt;&lt; 0)</literal></entry></row>
+          <row><entry><constant>BitOrderMask</constant></entry><entry><literal>(1 &lt;&lt; 1)</literal></entry></row>
+          <row><entry><constant>ImageRectMask</constant></entry><entry><literal>(1 &lt;&lt; 2)</literal></entry></row>
+          <row><entry><constant>ScanlinePadMask</constant></entry><entry><literal>(1 &lt;&lt; 3)</literal></entry></row>
+          <row><entry><constant>ScanlineUnitMask</constant></entry><entry><literal>(1 &lt;&lt; 4)</literal></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+</para>
+<para>
+Unspecified bits are required to be zero or else a
+<link linkend="Errors:Format"><errorname>Format</errorname></link> error is returned.
+</para>
+</section>
+
+<section id="Data_Types:BOOL">
+  <title><type>BOOL</type></title>
+  <indexterm zone="Data_Types:BOOL" significance="preferred"><primary>BOOL</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><type>BOOL</type>:</entry><entry>  <type>CARD8</type></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+<para>
+This is a boolean value containing one of the following alternate
+values:
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><constant>False</constant></entry><entry><literal>0</literal></entry></row>
+          <row><entry><constant>True</constant></entry><entry><literal>1</literal></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+</para>
+</section>
+
+<section id="Data_Types:BYTE">
+  <title><type>BYTE</type></title>
+  <indexterm zone="Data_Types:BYTE" significance="preferred"><primary>BYTE</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><type>BYTE</type>:</entry><entry>  8-bit value</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+
+<para>
+This is an unsigned byte of data whose encoding
+is determined by the context in which it is used.
+</para>
+
+</section>
+
+<section id="Data_Types:CARDn">
+  <title><type>CARD8</type>, <type>CARD16</type>, <type>CARD32</type></title>
+  <indexterm zone="Data_Types:CARDn" significance="preferred"><primary>CARD8</primary></indexterm>
+  <indexterm zone="Data_Types:CARDn" significance="preferred"><primary>CARD16</primary></indexterm>
+  <indexterm zone="Data_Types:CARDn" significance="preferred"><primary>CARD32</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><type>CARD8</type>:</entry><entry>  8-bit unsigned integer</entry></row>
+          <row><entry><type>CARD16</type>:</entry><entry>  16-bit unsigned integer</entry></row>
+          <row><entry><type>CARD32</type>:</entry><entry>  32-bit unsigned integer</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+
+<para>
+These are unsigned numbers.  The latter two are byte-swapped when
+the server and client have different byte orders.
+</para>
+
+</section>
+
+<section id="Data_Types:CHAR2B">
+  <title><type>CHAR2B</type></title>
+  <indexterm zone="Data_Types:CHAR2B" significance="preferred"><primary>CHAR2B</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><type>CHAR2B</type>:</entry><entry>[ <structfield>byte1</structfield>, <structfield>byte2</structfield>:</entry><entry><type>CARD8</type> ]</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+<para>
+This structure specifies an individual character code within
+either a 2-dimensional matrix (using <structfield>BYTE1</structfield>
+and <structfield>BYTE2</structfield> as the row and column indices,
+respectively) or a vector (using <structfield>BYTE1</structfield> and
+<structfield>BYTE2</structfield> as most- and least-significant bytes,
+respectively).  This data type is treated as a pair of 8-bit values and
+is never byte-swapped.  Therefore, the client should always transmit
+<structfield>BYTE1</structfield> first.
+</para>
+
+</section>
+
+<section id="Data_Types:EVENTMASK">
+  <title><type>EVENTMASK</type></title>
+  <indexterm zone="Data_Types:EVENTMASK" significance="preferred"><primary>EVENTMASK</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><type>EVENTMASK</type>:</entry><entry>  <type>CARD32</type> mask</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+
+<para>
+This is a mask of bits indicating which of an extension's (or the
+core's) maskable events the client would like to receive.  Each
+bit indicates one or more events, and a bit value of one indicates
+interest in a corresponding set of events.  The following bits are
+defined for event masks specified for the core protocol (i.e. an
+<parameter>EXTENSION-OPCODE</parameter> of zero in
+<link linkend="Requests:SetEventMask"><function>SetEventMask</function></link>
+and
+<link linkend="Requests:GetEventMask"><function>GetEventMask</function></link>
+requests):
+
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><constant>CatalogueListChangeMask</constant></entry><entry><literal>(1 &lt;&lt; 0)</literal></entry></row>
+          <row><entry><constant>FontListChangeMask</constant></entry><entry><literal>(1 &lt;&lt; 1)</literal></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+</para>
+
+<para>
+If
+<constant>CatalogueListChangeMask</constant>
+is set, client is interested in
+receiving
+<link linkend="Events:CatalogueListNotify"><function>CatalogueListNotify</function></link>
+events.  If
+<constant>FontListChangeMask</constant>
+is set, the client is interested in
+receiving
+<link linkend="Events:FontListNotify"><function>FontListNotify</function></link>
+events.
+</para>
+<para>
+Extensions that provide additional events may define their own
+event masks.  These event masks have their own scope and may use
+the same bit values as the core or other extensions.
+    </para>
+    <para>
+All unused bits must be set to zero.  In
+<link linkend="Requests:SetEventMask"><function>SetEventMask</function></link>
+requests, if
+any bits are set that are not defined for the extension (or core)
+for which this <type>EVENTMASK</type> is intended (according to the
+<parameter>EXTENSION-OPCODE</parameter> given in the
+<link linkend="Requests:SetEventMask"><function>SetEventMask</function></link>
+request), an
+<link linkend="Errors:EventMask"><errorname>EventMask</errorname></link>
+error is generated.
+    </para>
+    <para>
+This value is swapped as a <type>CARD32</type>.
+    </para>
+
+</section>
+
+<section id="Data_Types:FONTID">
+  <title><type>FONTID</type></title>
+  <indexterm zone="Data_Types:FONTID" significance="preferred"><primary>FONTID</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><type>FONTID</type>:</entry><entry>     <link linkend="Data_Types:ID"><type>ID</type></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+
+<para>
+This is specified by the client in the request
+<link linkend="Requests:OpenBitmapFont"><function>OpenBitmapFont</function></link>
+as the identifier to be used when referring to a particular open
+font.
+</para>
+
+</section>
+
+<section id="Data_Types:ID">
+  <title><type>ID</type></title>
+  <indexterm zone="Data_Types:ID" significance="preferred"><primary>ID</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><type>ID</type>:</entry><entry>  <type>CARD32</type></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+
+<para>
+This is a 32-bit value in which the top 3 bits must be clear, and
+at least 1 other bit must be set (yielding a range of 1 through
+2<superscript>29</superscript>-1).
+It is specified by the client to represent objects in
+the server.  Identifiers are scoped according to their type are
+private to the client; thus, the same identifier may be used for
+both a <link linkend="Data_Types:FONTID"><type>FONTID</type></link> and an <link linkend="Data_Types:ACCESSCONTEXT"><type>ACCESSCONTEXT</type></link>
+as well as by multiple clients.
+</para>
+<para>
+An <type>ID</type> of zero is referred to as <constant>None</constant>.
+</para>
+</section>
+
+<section id="Data_Types:INTn">
+  <title><type>INT8</type>, <type>INT16</type>, <type>INT32</type></title>
+  <indexterm zone="Data_Types:INTn" significance="preferred"><primary>INT8</primary></indexterm>
+  <indexterm zone="Data_Types:INTn" significance="preferred"><primary>INT16</primary></indexterm>
+  <indexterm zone="Data_Types:INTn" significance="preferred"><primary>INT32</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><type>INT8</type>:</entry><entry>  8-bit signed integer</entry></row>
+          <row><entry><type>INT16</type>:</entry><entry>  16-bit signed integer</entry></row>
+          <row><entry><type>INT32</type>:</entry><entry>  32-bit signed integer</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+
+<para>
+These are signed numbers.  The latter two are byte-swapped when
+the client and server have different byte orders.
+</para>
+</section>
+
+<section id="Data_Types:OFFSET32">
+  <title><type>OFFSET32</type></title>
+  <indexterm zone="Data_Types:OFFSET32" significance="preferred"><primary>OFFSET32</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry morerows='1'><type>OFFSET32</type>:</entry>
+          <entry>[ <structfield>position</structfield>:</entry><entry><type>CARD32</type>,</entry></row>
+          <row><entry>&emsp;<structfield>length</structfield>:</entry><entry><type>CARD32</type> ]</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This structure indicates a position and length within a block of
+data.
+    </para>
+</section>
+
+<section id="Data_Types:PROPINFO">
+  <title><type>PROPINFO</type></title>
+  <indexterm zone="Data_Types:PROPINFO" significance="preferred"><primary>PROPINFO</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry morerows='1'><type>PROPINFO</type>:</entry>
+          <entry>[ <structfield>offsets</structfield>:</entry><entry><link linkend="Data_Types:PROPOFFSET"><type>LISTofPROPOFFSET</type></link>,</entry></row>
+          <row><entry>&emsp;<structfield>data</structfield>:</entry><entry><link linkend="Data_Types:BYTE"><type>LISTofBYTE</type></link> ]</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+
+    <para>
+This structure describes the list of properties provided by a
+font.  Strings for all of the properties names and values are
+stored within the data block and are located using a table of
+offsets and lengths.
+    </para>
+    <para>
+This structure is padded to 32-bit alignment.
+    </para>
+
+</section>
+
+<section id="Data_Types:PROPOFFSET">
+  <title><type>PROPOFFSET</type></title>
+  <indexterm zone="Data_Types:PROPOFFSET" significance="preferred"><primary>PROPOFFSET</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry morerows='3'><type>PROPOFFSET</type>:</entry>
+          <entry>[ <structfield>name</structfield>:</entry><entry><link linkend="Data_Types:OFFSET32"><type>OFFSET32</type></link>,</entry></row>
+          <row><entry>&emsp;<structfield>value</structfield>:</entry><entry><link linkend="Data_Types:OFFSET32"><type>OFFSET32</type></link>,</entry></row>
+          <row><entry>&emsp;<structfield>type</structfield>:</entry><entry><type>CARD8</type>,</entry></row>
+          <row><entry>&emsp;<structfield>zero-pad3</structfield>:</entry><entry><link linkend="Data_Types:BYTE"><type>BYTE</type></link>, <link linkend="Data_Types:BYTE"><type>BYTE</type></link>, <link linkend="Data_Types:BYTE"><type>BYTE</type></link> ]</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+
+    <para>
+This structure specifies the position, length, and type of
+of data for a property.
+    </para>
+    <para>
+The <structfield>NAME</structfield> field specifies the position and length
+(which must be
+greater than zero) of the property name relative to the beginning
+of the <structfield>PROPINFO.DATA</structfield> block for this font.
+The interpretation of
+the position and length of the <structfield>VALUE</structfield> field is
+determined by the <structfield>TYPE</structfield> field, which contains
+one of the following alternate values:
+
+     <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><constant>String</constant></entry><entry><literal>0</literal></entry></row>
+          <row><entry><constant>Unsigned</constant></entry><entry><literal>1</literal></entry></row>
+          <row><entry><constant>Signed</constant></entry><entry><literal>2</literal></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+which have the following meanings:
+<variablelist>
+  <varlistentry id="Constant:String">
+    <term><constant>String</constant></term>
+    <listitem>
+      <indexterm zone="Constant:String" significance="preferred"><primary>String</primary></indexterm>
+      <para>
+This property contains a counted string of bytes.  The
+data is stored in the <structfield>PROPINFO.DATA</structfield>
+block beginning at
+relative byte VALUE.POSITION (beginning with zero), extending
+for VALUE.LENGTH (at least zero) bytes.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry id="Constant:Unsigned">
+    <term><constant>Unsigned</constant></term>
+    <listitem>
+      <indexterm zone="Constant:Unsigned" significance="preferred"><primary>Unsigned</primary></indexterm>
+    <para>
+This property contains a unsigned, 32-bit number stored
+as a <type>CARD32</type> in VALUE.POSITION (VALUE.LENGTH is zero).
+    </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry id="Constant:Signed">
+    <term><constant>Signed</constant></term>
+    <listitem>
+      <indexterm zone="Constant:Signed" significance="preferred"><primary>Signed</primary></indexterm>
+      <para>
+This property contains a signed, 32-bit number stored as
+an <type>INT32</type> in VALUE.POSITION (VALUE.LENGTH is zero).
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+This structure is zero-padded to 32-bit alignment.
+</para>
+
+</section>
+
+<section id="Data_Types:RANGE">
+  <title><type>RANGE</type></title>
+  <indexterm zone="Data_Types:RANGE" significance="preferred"><primary>RANGE</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><type>RANGE</type>:</entry>
+          <entry>[ <structfield>min-char</structfield>, <structfield>max-char</structfield>:</entry><entry><link linkend="Data_Types:CHAR2B"><type>CHAR2B</type></link> ]</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+
+  <para>
+This structure specifies a range of character codes.  A single
+character is represented by <structfield>MIN-CHAR</structfield> equals
+<structfield>MAX-CHAR</structfield>.  If the linear interpretation of
+<structfield>MAX-CHAR</structfield> is less than that of
+<structfield>MIN-CHAR</structfield>, or if
+<structfield>MIN-CHAR</structfield> is less than the font's
+<structfield>XFONTINFO.CHAR-RANGE.MIN-CHAR</structfield>, or if
+<structfield>MAX-CHAR</structfield> is greater than the
+font's <structfield>XFONTINFO.CHAR-RANGE.MAX-CHAR</structfield>,
+the range is invalid.
+  </para>
+
+</section>
+
+<section id="Data_Types:RESOLUTION">
+  <title><type>RESOLUTION</type></title>
+  <indexterm zone="Data_Types:RESOLUTION" significance="preferred"><primary>RESOLUTION</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry morerows='2'><type>RESOLUTION</type>:</entry>
+          <entry>[ <structfield>x-resolution</structfield>:</entry><entry><type>CARD16</type>,</entry></row>
+          <row><entry>&emsp;<structfield>y-resolution</structfield>:</entry><entry><type>CARD16</type>,</entry></row>
+          <row><entry>&emsp;<structfield>decipoint-size</structfield>:</entry><entry><type>CARD16</type> ]</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+
+  <para>
+This structure specifies resolution and point size to be used in
+resolving partially-specified scaled font names.  The
+<structfield>X-RESOLUTION</structfield> and
+<structfield>Y-RESOLUTION</structfield> are measured in
+pixels-per-inch and must be greater than zero.
+The <structfield>DECIPOINT-SIZE</structfield> is the preferred font
+size, measured in tenths of a point, and must be greater than zero.
+  </para>
+
+</section>
+
+<section id="Data_Types:STRING8">
+  <title><type>STRING8</type></title>
+  <indexterm zone="Data_Types:STRING8" significance="preferred"><primary>STRING8</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><type>STRING8</type>:</entry><entry>          <type>LISTofCARD8</type></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+
+  <para>
+This is a counted list of 1-byte character codes, typically
+encoded in <acronym>ISO</acronym> 8859-1.  A character code
+<quote><literal>c</literal></quote> is equivalent to a
+<link linkend="Data_Types:CHAR2B"><type>CHAR2B</type></link> structure whose <structfield>BYTE1</structfield>
+is zero and whose <structfield>BYTE2</structfield> is
+<quote><literal>c</literal></quote>.
+  </para>
+
+</section>
+
+<section id="Data_Types:TIMESTAMP">
+  <title><type>TIMESTAMP</type></title>
+  <indexterm zone="Data_Types:TIMESTAMP" significance="preferred"><primary>TIMESTAMP</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><type>TIMESTAMP</type>:</entry><entry>     <type>CARD32</type></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+
+  <para>
+This is the number of milliseconds that have passed since a
+server-dependent origin.  It is provided in errors and events and is
+permitted to wrap.
+  </para>
+</section>
+
+<section id="Data_Types:XCHARINFO">
+  <title><type>XCHARINFO</type></title>
+  <indexterm zone="Data_Types:XCHARINFO" significance="preferred"><primary>XCHARINFO</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry morerows='3'><type>XCHARINFO</type>:</entry>
+          <entry>[ <structfield>lbearing</structfield>, <structfield>rbearing</structfield>:</entry><entry><type>INT16</type>,</entry></row>
+          <row><entry>&emsp;<structfield>width</structfield>:</entry><entry><type>INT16</type>,</entry></row>
+          <row><entry>&emsp;<structfield>ascent</structfield>, <structfield>descent</structfield>:</entry><entry><type>INT16</type>,</entry></row>
+          <row><entry>&emsp;<structfield>attributes</structfield>:</entry><entry><type>CARD16</type> ]</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+
+  <para>
+This structure specifies the ink extents and horizontal escapement
+(also known as the set- or logical width) of an individual
+character.  The first five values represent directed distances in
+a coordinate system whose origin is aligned with the lower-left
+edge of the left-most pixel of the glyph baseline (i.e. the
+baseline falls between two pixels as shown in Figure 3-1 of the
+<citetitle>Bitmap Distribution Format 2.1</citetitle> Consortium standard
+<xref linkend="References:bdf-spec"/>).
+  </para>
+  <para>
+The <structfield>LBEARING</structfield> field specifies the
+directed distance measured to the
+right from the origin to the left edge of the left-most inked
+pixel in the glyph.
+  </para>
+  <para>
+The <structfield>RBEARING</structfield> field specifies the
+directed distance (measured to
+the right) from the origin to the right edge of the right-most
+inked pixel in the glyph.
+  </para>
+  <para>
+The <structfield>WIDTH</structfield> field specifies the
+directed distance (measured to the
+right) from the origin to the position where the next character
+should appear (called the <firstterm>escapement point</firstterm>). This
+distance includes any whitespace used for intercharacter padding and is
+also referred to as the <firstterm>logical width</firstterm> or
+<firstterm>horizontal escapement</firstterm>.
+<indexterm zone="Data_Types:XCHARINFO" significance="preferred"><primary>horizontal escapement</primary></indexterm>
+  </para>
+  <para>
+The <structfield>ASCENT</structfield> field specifies the
+directed distance (measured up)
+from the baseline to the top edge of the top-most inked pixel
+in the glyph.
+  </para>
+  <para>
+The <structfield>DESCENT</structfield> field specifies the
+directed distance (measured
+down) from the baseline to the bottom edge of the bottom-most
+inked pixel.
+  </para>
+  <para>
+The <structfield>ATTRIBUTES</structfield> field specifies
+glyph-specific information that
+is passed through the application.  If this value is not being
+used, it should be zero.
+  </para>
+  <para>
+The ink bounding box of a glyph is defined to be the smallest
+rectangle that encloses all of the inked pixels.  This box has
+a width of
+<structfield>RBEARING</structfield> &minus; <structfield>LBEARING</structfield>
+pixels and a height of
+<structfield>ASCENT</structfield> + <structfield>DESCENT</structfield> pixels.
+  </para>
+</section>
+
+<section id="Data_Types:XFONTINFO">
+  <title><type>XFONTINFO</type></title>
+  <indexterm zone="Data_Types:XFONTINFO" significance="preferred"><primary>XFONTINFO</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry morerows='8'><type>XFONTINFO</type>:</entry>
+          <entry>[ <structfield>flags</structfield>:</entry><entry><type>CARD32</type>,</entry></row>
+          <row><entry>&emsp;<structfield>drawing-direction</structfield>:</entry><entry>{ <constant>LeftToRight</constant>, <constant>RightToLeft</constant> }</entry></row>
+          <row><entry>&emsp;<structfield>char-range</structfield>:</entry><entry><link linkend="Data_Types:RANGE"><type>RANGE</type></link>,</entry></row>
+          <row><entry>&emsp;<structfield>default-char</structfield>:</entry><entry><link linkend="Data_Types:CHAR2B"><type>CHAR2B</type></link>,</entry></row>
+          <row><entry>&emsp;<structfield>min-bounds</structfield>:</entry><entry><link linkend="Data_Types:XCHARINFO"><type>XCHARINFO</type></link>,</entry></row>
+          <row><entry>&emsp;<structfield>max-bounds</structfield>:</entry><entry><link linkend="Data_Types:XCHARINFO"><type>XCHARINFO</type></link>,</entry></row>
+          <row><entry>&emsp;<structfield>font-ascent</structfield>:</entry><entry><type>INT16</type>,</entry></row>
+          <row><entry>&emsp;<structfield>font-descent</structfield>:</entry><entry><type>INT16</type>,</entry></row>
+          <row><entry>&emsp;<structfield>properties</structfield>:</entry><entry><link linkend="Data_Types:PROPINFO"><type>PROPINFO</type></link> ]</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+  <para>
+This structure specifies attributes related to the font as a
+whole.
+  </para>
+  <para>
+The <structfield>FLAGS</structfield> field is a bit mask containing zero
+or more of the following boolean values (unspecified bits must be zero):
+
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><constant>AllCharactersExist</constant></entry><entry><literal>(1 &lt;&lt; 0)</literal></entry></row>
+          <row><entry><constant>InkInside</constant></entry><entry><literal>(1 &lt;&lt; 1)</literal></entry></row>
+          <row><entry><constant>HorizontalOverlap</constant></entry><entry><literal>(1 &lt;&lt; 2)</literal></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+
+which have the following meanings:
+<variablelist>
+  <varlistentry id="Constant:AllCharactersExist">
+    <term><constant>AllCharactersExist</constant></term>
+    <listitem>
+      <indexterm zone="Constant:AllCharactersExist" significance="preferred"><primary>AllCharactersExist</primary></indexterm>
+    <para>
+If this bit is set, all of the characters in the range given by
+<structfield>CHAR-RANGE</structfield> have glyphs encoded in
+the font.  If this bit is clear, some of the characters
+may not have encoded glyphs.
+    </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry id="Constant:InkInside">
+    <term><constant>InkInside</constant></term>
+    <listitem>
+      <indexterm zone="Constant:InkInside" significance="preferred"><primary>InkInside</primary></indexterm>
+    <para>
+If this bit is set, the inked pixels of each glyph
+fall within the rectangle described by the font's ascent,
+descent, origin, and the glyph's escapement point.  If
+this bit is clear, there may be glyphs whose ink extends
+outside this rectangle.
+    </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry id="Constant:HorizontalOverlap">
+    <term><constant>HorizontalOverlap</constant></term>
+    <listitem>
+      <indexterm zone="Constant:HorizontalOverlap" significance="preferred"><primary>HorizontalOverlap</primary></indexterm>
+    <para>
+If this bit is set, the two ink bounding
+boxes (smallest rectangle enclosing the inked pixels) of
+some pairs of glyphs in the font may overlap when displayed
+side-by-side (i.e. the second character is imaged at the
+escapement point of the first) on a common baseline.  If
+this bit is clear, there are no pairs of glyphs whose ink
+bounding boxes overlap.
+    </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+<para id="Data_Types:XFONTINFO.DRAWING-DIRECTION">
+  <indexterm zone="Data_Types:XFONTINFO.DRAWING-DIRECTION" significance="preferred"><primary>LeftToRight</primary></indexterm>
+  <indexterm zone="Data_Types:XFONTINFO.DRAWING-DIRECTION" significance="preferred"><primary>RightToLeft</primary></indexterm>
+The <structfield>DRAWING-DIRECTION</structfield> field contains a hint
+indicating whether most of the character metrics have a positive (or
+<quote><constant>LeftToRight</constant></quote>) logical width or a
+negative (<quote><constant>RightToLeft</constant></quote>) logical width.  It
+contains the following alternate values:
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><constant>LeftToRight</constant></entry><entry><literal>0</literal></entry></row>
+          <row><entry><constant>RightToLeft</constant></entry><entry><literal>1</literal></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+</para>
+<para>
+The <structfield>CHAR-RANGE.MIN-CHAR</structfield>
+and <structfield>CHAR-RANGE.MAX-CHAR</structfield> fields specify the
+first and last character codes that have glyphs encoded in this font.
+All fonts must have at least one encoded glyph (in which case the
+<structfield>MIN-CHAR</structfield> and <structfield>MAX-CHAR</structfield>
+are equal), but are not required to have glyphs
+encoded at all positions between the first and last characters.
+</para>
+<para>
+The <structfield>DEFAULT-CHAR</structfield> field specifies
+the character code of the glyph
+that the client should substitute for unencoded characters.  Requests
+for extents or bitmaps for an unencoded character generate zero-filled
+metrics and a zero-length glyph bitmap, respectively.
+</para>
+<para>
+The <structfield>MIN-BOUNDS</structfield> and
+<structfield>MAX-BOUNDS</structfield> fields contain the minimum and maximum
+values of each of the extents field of all encoded characters in the
+font (i.e. non-existent characters are ignored).
+</para>
+<para>
+The <structfield>FONT-ASCENT</structfield> and
+<structfield>FONT-DESCENT</structfield> fields specify the font designer's
+logical height of the font, above and below the baseline,
+respectively.  The sum of the two values is often used as the
+vertical line spacing of the font.  Individual glyphs are permitted
+to have ascents and descents that are greater than these values.
+</para>
+<para>
+The <structfield>PROPERTIES</structfield> field contains the
+property data associated with this font.
+</para>
+<para>
+This structure is padded to 32-bit alignment.
+</para>
+</section>
+</section>
+
+<section id='Requests'>
+<title>Requests</title>
+<!-- .XS -->
+<!-- (SN Requests -->
+<!-- .XE -->
+<para>
+This section describes the requests that may be sent by the client and the
+replies or errors that are generated in response.  Versions of the protocol
+with the same major version are required to be upward-compatible.
+</para>
+<para>
+Every request on a given connection is implicitly assigned a sequence number,
+starting with 1, that is used in replies, error, and events.  Servers are
+required to generate replies and errors in the order in which the corresponding
+requests are received.  Servers are permitted to add or remove fonts to the
+list visible to the client between any two requests, but requests must be
+processed atomically.  Each request packet is at least 4 bytes long and
+contains the following fields:
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>major-opcode</parameter>:</entry><entry><type>CARD8</type></entry></row>
+          <row><entry><parameter>minor-opcode</parameter>:</entry><entry><type>CARD8</type></entry></row>
+          <row><entry><parameter>length</parameter>:</entry><entry><type>CARD16</type></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+</para>
+<para>
+
+The <parameter>MAJOR-OPCODE</parameter> specifies which core request or
+extension package this packet represents.  If the
+<parameter>MAJOR-OPCODE</parameter> corresponds to a core request, the
+<parameter>MINOR-OPCODE</parameter> contains 8 bits of request-specific data.
+Otherwise, the <parameter>MINOR-OPCODE</parameter> specifies which extension
+request this packet represents.  The <parameter>LENGTH</parameter> field
+specifies the number of 4-byte units contained within the packet
+and must be at least one.  If this field contains a value greater than one it
+is followed by (<parameter>LENGTH</parameter> - 1) * 4 bytes
+of request-specific data.  Unless
+otherwise specified, unused bytes are not required to be zero.
+</para>
+<para>
+If a request packet contains too little or too much data, the server returns
+a <link linkend="Errors:Length"><errorname>Length</errorname></link> error.
+If the server runs out of internal
+resources (such as memory) while processing a request, it returns an
+<link linkend="Errors:Alloc"><errorname>Alloc</errorname></link> error.
+If a server is deficient (and therefore non-compliant) and is unable to
+process a request, it may return an
+<link linkend="Errors:Implementation"><errorname>Implementation</errorname></link> error.
+If a client uses an extension request without previously having issued a
+<link linkend="Requests:QueryExtension"><function>QueryExtension</function></link>
+request for that extension, the server responds with a
+<link linkend="Errors:Request"><errorname>Request</errorname></link>
+error.  If the server encounters a request with an unknown
+<parameter>MAJOR-OPCODE</parameter> or <parameter>MINOR-OPCODE</parameter>,
+it responds with a
+<link linkend="Errors:Request"><errorname>Request</errorname></link>
+error.
+At most one error is generated per request.  If more than one error condition
+is encountered in processing a requests, the choice of which error is returned
+is server-dependent.
+</para>
+<para>
+Core requests have <parameter>MAJOR-OPCODE</parameter> values between 0 and
+127, inclusive.  Extension requests have <parameter>MAJOR-OPCODE</parameter>
+values between 128 and 255, inclusive, that are assigned by by the server.
+All <parameter>MINOR-OPCODE</parameter> values in extension requests are
+between 0 and 255, inclusive.
+</para>
+<para>
+Each reply is at least 8 bytes long and contains the following fields:
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>type</parameter>:</entry><entry><type>CARD8</type></entry><entry>value of 0</entry></row>
+          <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD8</type></entry></row>
+          <row><entry><parameter>sequence-number</parameter>:</entry><entry><type>CARD16</type></entry></row>
+          <row><entry><parameter>length</parameter>:</entry><entry><type>CARD32</type></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+</para>
+<para>
+The <parameter>TYPE</parameter> field has a value of zero.
+The <parameter>DATA-OR-UNUSED</parameter> field may be used to
+encode one byte of reply-specific data (see
+<link linkend="Encoding::Requests">Section 5.2 on request encoding</link>).
+The least-significant 16 bits of the sequence number of the request that
+generated the reply are stored in the <parameter>SEQUENCE-NUMBER</parameter>
+field.  The <parameter>LENGTH</parameter> field specifies the number of
+4-byte units in this reply packet, including the fields described above,
+and must be at least two.  If <parameter>LENGTH</parameter> is greater
+than two, the fields described above are followed by
+(<parameter>LENGTH</parameter> - 2) * 4 bytes of additional data.
+</para>
+<para>
+Requests that have replies are described using the following syntax:
+  <blockquote><para>
+    <emphasis role="bold"><function>RequestName</function></emphasis>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>arg1</parameter>:</entry><entry><type>type1</type></entry></row>
+          <row><entry><parameter>arg2</parameter>:</entry><entry><type>type2</type></entry></row>
+          <row><entry> ...</entry></row>
+          <row><entry><parameter>argN</parameter>:</entry><entry><type>typeN</type></entry></row>
+          <row><entry> ▶</entry></row>
+          <row><entry><parameter>result1</parameter>:</entry><entry><type>type1</type></entry></row>
+          <row><entry><parameter>result2</parameter>:</entry><entry><type>type2</type></entry></row>
+          <row><entry> ...</entry></row>
+          <row rowsep="1"><entry><parameter>resultM</parameter>:</entry><entry><type>typeM</type></entry></row>
+          <row><entry>Errors:</entry><entry><errorname>kind1</errorname>, <errorname>kind2</errorname> ..., <errorname>kindK</errorname></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    Description
+  </para></blockquote>
+</para>
+<para>
+If a request does not generate a reply, the ▶ and result lines are
+omitted.  If a request may generate multiple replies, the ▶ is replaced by
+a ▶+.  In the authorization data exchanges in the initial connection setup
+and the CreateAC request, ◀ indicates data sent by the client in response
+to data sent by the server.
+</para>
+<para>
+The protocol begins with the establishment of a connection over a
+mutually-understood virtual stream:
+</para>
+
+<section id="Requests:open_connection">
+    <title>open connection</title>
+    <indexterm zone="Requests:open_connection" significance="preferred"><primary>open connection</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='2.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>byte-order</parameter>:</entry><entry><link linkend="Data_Types:BYTE"><type>BYTE</type></link></entry></row>
+          <row><entry><parameter>client-major-protocol-version</parameter>:</entry><entry><type>CARD16</type></entry></row>
+          <row><entry><parameter>client-minor-protocol-version</parameter>:</entry><entry><type>CARD16</type></entry></row>
+          <row><entry><parameter>authorization-protocols</parameter>:</entry><entry><link linkend="Data_Types:AUTH"><type>LISTofAUTH</type></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+<para>
+The initial byte of the connection specifies the
+<parameter>BYTE-ORDER</parameter> in
+which subsequent 16-bit and 32-bit numeric values are to be
+transmitted.  The octal value <literal>102</literal>
+(<acronym>ASCII</acronym> uppercase <quote><literal>B</literal></quote>)
+indicates that the most-significant byte is to be transmitted
+first; the octal value <literal>154</literal>
+(<acronym>ASCII</acronym> lowercase <quote><literal>l</literal></quote>)
+indicates that the least-significant byte is to be transmitted first.
+If any other value is encountered the server closes the
+connection without any response.
+</para>
+  <para>
+The <parameter>CLIENT-MAJOR-PROTOCOL-VERSION</parameter> and
+<parameter>CLIENT-MINOR-PROTOCOL-VERSION</parameter> specify
+which version of the
+font service protocol the client would like to use.  If the
+client can support multiple versions, the highest version
+should be given.  This version of the protocol has a
+major version of 2 and a minor version of 0.
+  </para>
+  <para>
+The <parameter>AUTHORIZATION-PROTOCOLS</parameter>
+contains a list of protocol names and
+optional initial data for which the client can provide
+information.  The server may use this to determine which
+protocol to use or as part of the initial exchange of
+authorization data.
+  </para>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='2.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry>▶</entry></row>
+          <row><entry><parameter>status</parameter>:</entry><entry>{ <constant>Success</constant>, <constant>Continue</constant>,
+                                  <constant>Busy</constant>, <constant>Denied</constant> }</entry></row>
+          <row><entry><parameter>server-major-protocol-version</parameter>:</entry><entry><type>CARD16</type></entry></row>
+          <row><entry><parameter>server-minor-protocol-version</parameter>:</entry><entry><type>CARD16</type></entry></row>
+          <row><entry><parameter>alternate-servers-hint</parameter>:</entry><entry><link linkend="Data_Types:ALTERNATESERVER"><type>LISTofALTERNATESERVER</type></link></entry></row>
+          <row><entry><parameter>authorization-index</parameter>:</entry><entry><type>CARD8</type></entry></row>
+          <row><entry><parameter>authorization-data</parameter>:</entry><entry><link linkend="Data_Types:BYTE"><type>LISTofBYTE</type></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+  <para>
+The <parameter>SERVER-MAJOR-PROTOCOL-VERSION</parameter> and
+<parameter>SERVER-MINOR-PROTOCOL-VERSION</parameter> specify
+the version of the font
+service protocol that the server expects from the client.  If
+the server supports the version specified by the client, this
+version number should be returned.  If the client has
+requested a higher version than is supported by the server,
+the server's highest version should be returned.  Otherwise,
+if the client has requested a lower version than is supported
+by the server, the server's lowest version should be returned.
+It is the client's responsibility to decide whether or not it
+can match this version of the protocol.
+  </para>
+  <para>
+The <parameter>ALTERNATE-SERVERS-HINT</parameter>
+is a list of other font servers
+that may have related sets of fonts (determined by means
+outside this protocol, typically by the system administrator).
+Clients may choose to contact these font servers if the
+connection is rejected or lost.
+  </para>
+  <para>
+The <parameter>STATUS</parameter> field indicates whether the server accepted,
+rejected, or would like more information about the connection.
+It has one of the following alternate values:
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='2.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><constant>Success</constant></entry><entry><literal>0</literal></entry></row>
+          <row><entry><constant>Continue</constant></entry><entry><literal>1</literal></entry></row>
+          <row><entry><constant>Busy</constant></entry><entry><literal>2</literal></entry></row>
+          <row><entry><constant>Denied</constant></entry><entry><literal>3</literal></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+  </para>
+  <para>
+If <parameter>STATUS</parameter> is <constant>Denied</constant>,
+the server has rejected the client's authorization information.
+If <parameter>STATUS</parameter> is <constant>Busy</constant>, the server has
+simply decided that it cannot provide fonts to this client at
+this time (it may be able to at a later time).  In both cases,
+<parameter>AUTHORIZATION-INDEX</parameter> is set to zero,
+no authorization-data is
+returned, and the server closes the connection after sending
+the data described so far.
+  </para>
+  <para>
+Otherwise the <parameter>AUTHORIZATION-INDEX</parameter> is set to the index
+(beginning with 1) into the <parameter>AUTHORIZATION-PROTOCOLS</parameter>
+list of the protocol that the server will use for this connection.  If
+the server does not want to use any of the given protocols,
+this value is set to zero.  The <parameter>AUTHORIZATION-DATA</parameter>
+field is used to send back authorization protocol-dependent data to the
+client (such as a challenge, authentication of the server,
+etc.).
+  </para>
+<para>
+If <parameter>STATUS</parameter> is <constant>Success</constant>,
+the following section of protocol is omitted.  Otherwise, if
+<parameter>STATUS</parameter> is <constant>Continue</constant>,
+the server expects
+more authorization data from the client (i.e. the connection
+setup is not finished, so no requests or events may be sent):
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry>◀</entry></row>
+          <row><entry><parameter>more-authorization-data</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
+          <row><entry>▶</entry></row>
+          <row><entry><parameter>status</parameter>:</entry><entry>{ <constant>Success</constant>, <constant>Continue</constant>, <constant>Busy</constant>, <constant>Denied</constant> }</entry></row>
+          <row><entry><parameter>more-authorization-data</parameter>:</entry><entry><link linkend="Data_Types:BYTE"><type>LISTofBYTE</type></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+</para>
+<para>
+The values in <parameter>STATUS</parameter> have the same meanings as described
+above.  This section of protocol is repeated until the server
+either accepts (sets <parameter>STATUS</parameter> to
+<constant>Success</constant>) or rejects (sets <parameter>STATUS</parameter>
+to <constant>Denied</constant> or <constant>Busy</constant>) the connection.
+</para>
+<para>
+Once the connection has been accepted and <parameter>STATUS</parameter>
+is <constant>Success</constant>,
+an implicit AccessContext is created for the authorization
+data and the protocol continues with the following data sent
+from the server:
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry>▶</entry></row>
+          <row><entry><parameter>remaining-length</parameter>:</entry><entry><type>CARD32</type></entry></row>
+          <row><entry><parameter>maximum-request-length</parameter>:</entry><entry><type>CARD16</type></entry></row>
+          <row><entry><parameter>release-number</parameter>:</entry><entry><type>CARD32</type></entry></row>
+          <row><entry><parameter>vendor</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+</para>
+<para>
+The <parameter>REMAINING-LENGTH</parameter> specifies the length in 4-byte
+units of the remaining data to be transmitted to the client.  The
+<parameter>MAXIMUM-REQUEST-LENGTH</parameter> specifies the largest request
+size in 4-byte units that is accepted by the server and must have a
+value of at least 4096.  Requests with a length field larger
+than this value are ignored and a
+<link linkend="Errors:Length"><errorname>Length</errorname></link>
+error is returned.
+The <parameter>VENDOR</parameter> string specifies the name of the
+manufacturer of the font server.  The
+<parameter>RELEASE-NUMBER</parameter> specifies the particular
+release of the server in a manufacturer-dependent manner.
+</para>
+</section>
+<section><title />
+<para>
+After the connection is established and the setup information has been
+exchanged, the client may issue any of requests described below:
+</para>
+</section>
+<section id="Requests:NoOp">
+    <title><function>NoOp</function></title>
+    <indexterm zone="Requests:NoOp" significance="preferred"><primary>NoOp</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry>Errors:</entry><entry><link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This request does nothing.  It is typically used in response
+to a
+<link linkend="Events:KeepAlive"><function>KeepAlive</function></link>
+event.
+    </para>
+</section>
+
+<section id="Requests:ListExtensions">
+    <title><function>ListExtensions</function></title>
+    <indexterm zone="Requests:ListExtensions" significance="preferred"><primary>ListExtensions</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry>▶</entry></row>
+          <row rowsep='1'><entry><parameter>names</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>LISTofSTRING8</type></link></entry></row>
+          <row><entry>Errors:</entry><entry><link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+
+  <para>
+This request returns the names of the extension packages
+that are supported by the server.  Extension names are
+case-sensitive and are encoded in <acronym>ISO</acronym> 8859-1.
+  </para>
+
+</section>
+
+<section id="Requests:QueryExtension">
+    <title><function>QueryExtension</function></title>
+    <indexterm zone="Requests:QueryExtension" significance="preferred"><primary>QueryExtension</primary></indexterm>
+
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>name</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
+          <row><entry>▶</entry></row>
+          <row><entry><parameter>present</parameter>:</entry><entry><link linkend="Data_Types:BOOL"><type>BOOL</type></link></entry></row>
+          <row><entry><parameter>major-version</parameter>:</entry><entry><type>CARD16</type></entry></row>
+          <row><entry><parameter>minor-version</parameter>:</entry><entry><type>CARD16</type></entry></row>
+          <row><entry><parameter>major-opcode</parameter>:</entry><entry><type>CARD8</type></entry></row>
+          <row><entry><parameter>first-event</parameter>:</entry><entry><type>CARD8</type></entry></row>
+          <row><entry><parameter>number-events</parameter>:</entry><entry><type>CARD8</type></entry></row>
+          <row><entry><parameter>first-error</parameter>:</entry><entry><type>CARD8</type></entry></row>
+          <row rowsep='1'><entry><parameter>number-errors</parameter>:</entry><entry><type>CARD8</type></entry></row>
+          <row><entry>Errors:</entry><entry><link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+  <para>
+This request determines whether or not the extension package specified by
+<parameter>NAME</parameter> (encoded in <acronym>ISO</acronym> 8859-1) is
+supported by the server and that there is sufficient number of major opcode,
+event, and error codes available.  If so, then <parameter>PRESENT</parameter>
+is set to <constant>True</constant>, <parameter>MAJOR-VERSION</parameter>
+and <parameter>MINOR-VERSION</parameter> are set to the
+respective major and minor version numbers of the protocol
+that the server would prefer; <parameter>MAJOR-OPCODE</parameter> is set to
+the value to use in extension requests; <parameter>FIRST-EVENT</parameter>
+is set to the value of the first extension-specific event code or zero if the
+extension does not have any events; <parameter>NUMBER-EVENTS</parameter> is
+set to the number of new events that the event defines;
+<parameter>FIRST-ERROR</parameter>
+is set to the value of the first extension-specific error code
+or zero if the extension does not define any new errors; and
+<parameter>NUMBER-ERRORS</parameter> is set to the number of
+new errors the extension defines.
+  </para>
+  <para>
+Otherwise, <parameter>PRESENT</parameter> is set to
+<constant>False</constant> and the remaining fields are
+set to zero.
+  </para>
+  <para>
+The server is free to return different values to different
+clients.  Therefore, clients must use this request before
+issuing any of the requests in the named extension package or
+using the
+<link linkend="Requests:SetEventMask"><function>SetEventMask</function></link> request to express interest in any of
+this extension's events.  Otherwise, a
+<link linkend="Errors:Request"><errorname>Request</errorname></link>
+error is returned.
+  </para>
+</section>
+
+<section id="Requests:ListCatalogues">
+    <title><function>ListCatalogues</function></title>
+    <indexterm zone="Requests:ListCatalogues" significance="preferred"><primary>ListCatalogues</primary></indexterm>
+
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>pattern</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
+          <row><entry><parameter>max-names</parameter>:</entry><entry><type>CARD32</type></entry></row>
+          <row><entry>▶+</entry></row>
+          <row><entry><parameter>replies-following-hint</parameter>:</entry><entry><type>CARD32</type></entry></row>
+          <row rowsep='1'><entry><parameter>names</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>LISTofSTRING8</type></link></entry></row>
+          <row><entry>Errors:</entry><entry><link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This request returns a list of at most <parameter>MAX-NAMES</parameter> names
+of collections (called catalogues) of fonts that match
+the specified <parameter>PATTERN</parameter>.  In the pattern (which is encoded
+in <acronym>ISO</acronym> 8859-1), the
+<quote><literal>?</literal></quote> character (octal <literal>77</literal>)
+matches any single character; the
+<quote><literal>*</literal></quote> character (octal <literal>52</literal>)
+matches any series of zero or more characters; and alphabetic
+characters match either upper- or lowercase.  The
+returned <parameter>NAMES</parameter> are encoded in
+<acronym>ISO</acronym> 8859-1 and may contain
+mixed character cases.
+    </para>
+    <para>
+If <parameter>PATTERN</parameter> is of zero length or
+<parameter>MAX-NAMES</parameter> is equal to zero,
+one reply containing a zero-length list of names is returned.
+This may be used to synchronize the client with the server.
+    </para>
+    <para>
+Servers are free to add or remove catalogues to the set returned by
+<function>ListCatalogues</function>
+between any two requests.  This request is not
+cumulative; repeated uses are processed in isolation and do
+result in an iteration through the list.
+    </para>
+    <para>
+To reduce the amount of buffering needed by the server, the
+list of names may be split across several reply packets, so
+long as the names arrive in the same order that they would
+have appeared had they been in a single packet.  The
+<parameter>REPLIES-FOLLOWING-HINT</parameter> field in all but the last reply
+contains a positive value that specifies the number of
+replies that are likely, but not required, to follow.  In the
+last reply, which may contain zero or more names, this field
+is set to zero.
+    </para>
+</section>
+
+<section id="Requests:SetCatalogues">
+    <title><function>SetCatalogues</function></title>
+    <indexterm zone="Requests:SetCatalogues" significance="preferred"><primary>SetCatalogues</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row rowsep='1'><entry><parameter>names</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>LISTofSTRING8</type></link></entry></row>
+          <row><entry>Errors:</entry><entry><link linkend="Errors:Alloc"><errorname>Alloc</errorname></link>,
+<link linkend="Errors:Name"><errorname>Name</errorname></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This request sets the list of catalogues whose fonts should be
+visible to the client.  The union of the fonts provided by
+each of the named catalogues forms the set of fonts whose
+names match patterns in
+<link linkend="Requests:ListFonts"><function>ListFonts</function></link>,
+<link linkend="Requests:ListFontsWithXInfo"><function>ListFontsWithXInfo</function></link>,
+and
+<link linkend="Requests:OpenBitmapFont"><function>OpenBitmapFont</function></link>
+requests.  The catalogue names are
+case-insensitive and are encoded in <acronym>ISO</acronym> 8859-1.  A zero-length
+list resets the client's catalogue list to the
+server-dependent default.
+    </para>
+    <para>
+If any of the catalogue names are invalid, a
+<link linkend="Errors:Name"><errorname>Name</errorname></link>
+error is returned and the request is ignored.
+    </para>
+</section>
+
+<section id="Requests:GetCatalogues">
+    <title><function>GetCatalogues</function></title>
+    <indexterm zone="Requests:GetCatalogues" significance="preferred"><primary>GetCatalogues</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry>▶</entry></row>
+          <row rowsep='1'><entry><parameter>names</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>LISTofSTRING8</type></link></entry></row>
+          <row><entry>Errors:</entry><entry><link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This request returns the current list of catalogue names
+(encoded in <acronym>ISO</acronym> 8859-1) associated with the client.  These
+catalogues determine the set of fonts that are visible
+to
+<link linkend="Requests:ListFonts"><function>ListFonts</function></link>,
+<link linkend="Requests:ListFontsWithXInfo"><function>ListFontsWithXInfo</function></link>,
+and
+<link linkend="Requests:OpenBitmapFont"><function>OpenBitmapFont</function></link>.
+A zero-length list indicates the server's default set of
+fonts.  Catalogue names are case-insensitive and may be
+returned in mixed case.
+    </para>
+</section>
+
+<section id="Requests:SetEventMask">
+    <title><function>SetEventMask</function></title>
+    <indexterm zone="Requests:SetEventMask" significance="preferred"><primary>SetEventMask</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>extension-opcode</parameter>:</entry><entry><type>CARD8</type></entry></row>
+          <row rowsep='1'><entry><parameter>event-mask</parameter>:</entry><entry><link linkend="Data_Types:EVENTMASK"><type>EVENTMASK</type></link></entry></row>
+          <row><entry>Errors:</entry><entry><link linkend="Errors:EventMask"><errorname>EventMask</errorname></link>,
+<link linkend="Errors:Request"><errorname>Request</errorname></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This request specifies the set of maskable events that the
+extension indicated by <parameter>EXTENSION-OPCODE</parameter>
+(or zero for the core)
+should generate for the client.  Event masks are limited in
+scope to the extension (or core) for which they are defined,
+so expressing interest in events from one or more extensions
+requires multiple uses of this request.
+    </para>
+    <para>
+The default event mask if
+<function>SetEventMask</function>
+has not been called
+is zero, indicating no interest in any maskable events.
+Some events are not maskable and cannot be blocked.
+    </para>
+    <para>
+If <parameter>EXTENSION-OPCODE</parameter> is not a valid extension
+opcode previously returned by
+<link linkend="Requests:QueryExtension"><function>QueryExtension</function></link>
+or zero, a
+<link linkend="Errors:Request"><errorname>Request</errorname></link>
+error is
+returned.  If <parameter>EVENT-MASK</parameter> contains any bits that do not
+correspond to valid events for the specified extension (or
+core), an
+<link linkend="Errors:EventMask"><errorname>EventMask</errorname></link>
+error is returned and the request is
+ignored.
+    </para>
+</section>
+
+<section id="Requests:GetEventMask">
+    <title><function>GetEventMask</function></title>
+    <indexterm zone="Requests:GetEventMask" significance="preferred"><primary>GetEventMask</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>extension-opcode</parameter>:</entry><entry><type>CARD8</type></entry></row>
+          <row><entry>▶</entry></row>
+          <row rowsep='1'><entry><parameter>event-mask</parameter>:</entry><entry><link linkend="Data_Types:EVENTMASK"><type>EVENTMASK</type></link></entry></row>
+          <row><entry>Errors:</entry><entry><link linkend="Errors:Request"><errorname>Request</errorname></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This request returns the set of maskable core events the
+extension indicated by <parameter>EXTENSION-OPCODE</parameter>
+(or the core if zero)
+should generate for the client.  Non-maskable events are
+always sent to the client.
+    </para>
+    <para>
+If <parameter>EXTENSION-OPCODE</parameter> is not a valid extension opcode
+previously returned by
+<link linkend="Requests:QueryExtension"><function>QueryExtension</function></link>
+or zero, a
+<link linkend="Errors:Request"><errorname>Request</errorname></link>
+error is returned.
+    </para>
+</section>
+
+<section id="Requests:CreateAC">
+    <title><function>CreateAC</function></title>
+    <indexterm zone="Requests:CreateAC" significance="preferred"><primary>CreateAC</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>ac</parameter>:</entry><entry><link linkend="Data_Types:ACCESSCONTEXT"><type>ACCESSCONTEXT</type></link></entry></row>
+          <row><entry><parameter>authorization-protocols</parameter>:</entry><entry><link linkend="Data_Types:AUTH"><type>LISTofAUTH</type></link></entry></row>
+          <row><entry>▶</entry></row>
+          <row><entry><parameter>status</parameter>:</entry><entry>{ <constant>Success</constant>, <constant>Continue</constant>, <constant>Denied</constant> }</entry></row>
+          <row><entry><parameter>authorization-index</parameter>:</entry><entry><type>CARD8</type></entry></row>
+          <row rowsep='1'><entry><parameter>authorization-data</parameter>:</entry><entry><link linkend="Data_Types:BYTE"><type>LISTofBYTE</type></link></entry></row>
+          <row><entry>Errors:</entry><entry><link linkend="Errors:IDChoice"><errorname>IDChoice</errorname></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This request creates a new
+<type>AccessContext</type>
+object within the
+server containing the specified authorization data.  When
+this
+<type>AccessContext</type>
+is selected by the client using the
+<link linkend="Requests:SetAuthorization"><function>SetAuthorization</function></link>
+request, the data may be used by the server
+to determine whether or not the client should be granted
+access to particular font information.
+    </para>
+    <para>
+If <parameter>STATUS</parameter> is <constant>Denied</constant>, the server
+rejects the client's authorization information and does not associate
+<parameter>AC</parameter> with any valid <type>AccessContext</type>.
+In this case, <parameter>AUTHORIZATION-INDEX</parameter> is set
+to zero, and zero bytes of <parameter>AUTHORIZATION-DATA</parameter>
+is returned.
+    </para>
+    <para>
+Otherwise, <parameter>AUTHORIZATION-INDEX</parameter> is set to the index
+(beginning with 1) into the <parameter>AUTHORIZATION-PROTOCOLS</parameter>
+list of the protocol
+that the server will use for this connection.  If the server
+does not want to use any of the given protocols, this value is
+set to zero.  The <parameter>AUTHORIZATION-DATA</parameter> field is used
+to send back authorization protocol-dependent data to the client (such
+as a challenge, authentication of the server, etc.).
+    </para>
+    <para>
+If <parameter>STATUS</parameter> is <constant>Continue</constant>,
+the client is expected to continue
+the request by sending the following protocol and receiving
+the indicated response from the server.  This continues
+until <parameter>STATUS</parameter> is set to either
+<constant>Success</constant> or <constant>Denied</constant>.
+    </para>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry>     ◀</entry></row>
+          <row><entry><parameter>     more-authorization-data</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
+          <row><entry>     ▶</entry></row>
+          <row><entry><parameter>status</parameter>:</entry><entry>{ <constant>Success</constant>, <constant>Continue</constant>, <constant>Denied</constant> }</entry></row>
+          <row><entry><parameter>    more-authorization-data</parameter>:</entry><entry><link linkend="Data_Types:BYTE"><type>LISTofBYTE</type></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+Once the connection has been accepted and <parameter>STATUS</parameter>
+is <constant>Success</constant>, the request is complete.
+    </para>
+    <para>
+If <parameter>AC</parameter> is not in the range
+[1..2<superscript>29</superscript>-1] or is already associated
+with an access context, an <link linkend="Errors:IDChoice"><errorname>IDChoice</errorname></link> error is returned.
+    </para>
+</section>
+
+<section id="Requests:FreeAC">
+    <title><function>FreeAC</function></title>
+    <indexterm zone="Requests:FreeAC" significance="preferred"><primary>FreeAC</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>ac</parameter>:</entry><entry><link linkend="Data_Types:ACCESSCONTEXT"><type>ACCESSCONTEXT</type></link></entry></row>
+          <row rowsep='1'><entry>Errors:</entry><entry><link linkend="Errors:AccessContext"><errorname>AccessContext</errorname></link>,
+<link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This request indicates that the specified <parameter>AC</parameter> should
+no longer be associated with a valid access context.
+If <parameter>AC</parameter> is also the current
+<type>AccessContext</type>
+(as set by the
+<link linkend="Requests:SetAuthorization"><function>SetAuthorization</function></link>
+request), an implicit
+<link linkend="Requests:SetAuthorization"><function>SetAuthorization</function></link>
+of <constant>None</constant> is done to
+restore the
+<type>AccessContext</type>
+established for the initial
+connection setup.  Operations on fonts that were opened under
+<parameter>AC</parameter> are not affected.  The client may reuse the
+value of <parameter>AC</parameter> in a subsequent
+<link linkend="Requests:CreateAC"><function>CreateAC</function></link>
+request.
+    </para>
+    <para>
+If <parameter>AC</parameter> isn't associated with any valid authorization
+previously created by
+<link linkend="Requests:CreateAC"><function>CreateAC</function></link>, an
+<link linkend="Errors:AccessContext"><errorname>AccessContext</errorname></link>
+error is returned.
+    </para>
+</section>
+
+<section id="Requests:SetAuthorization">
+    <title><function>SetAuthorization</function></title>
+    <indexterm zone="Requests:SetAuthorization" significance="preferred"><primary>SetAuthorization</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>ac</parameter>:</entry><entry><link linkend="Data_Types:ACCESSCONTEXT"><type>ACCESSCONTEXT</type></link></entry></row>
+          <row rowsep='1'><entry>Errors:</entry><entry><link linkend="Errors:AccessContext"><errorname>AccessContext</errorname></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This request sets the
+<type>AccessContext</type>
+to be used for subsequent
+requests (except for
+<link linkend="Requests:QueryXInfo"><function>QueryXInfo</function></link>,
+<link linkend="Requests:QueryXExtents8"><function>QueryXExtents8</function></link>,
+<link linkend="Requests:QueryXExtents16"><function>QueryXExtents16</function></link>,
+<link linkend="Requests:QueryXBitmaps8"><function>QueryXBitmaps8</function></link>,
+<link linkend="Requests:QueryXBitmaps16"><function>QueryXBitmaps16</function></link>
+and
+<link linkend="Requests:CloseFont"><function>CloseFont</function></link>
+which are done under the
+<type>AccessContext</type>
+of the
+corresponding
+<link linkend="Requests:OpenBitmapFont"><function>OpenBitmapFont</function></link>
+).
+An <parameter>AC</parameter> of <constant>None</constant> restores the
+<type>AccessContext</type>
+established for the initial connection setup.
+    </para>
+    <para>
+If <parameter>AC</parameter> is neither <constant>None</constant>
+nor a value associated with a valid <type>AccessContext</type>
+previously created by
+<link linkend="Requests:CreateAC"><function>CreateAC</function></link>,
+an
+<link linkend="Errors:AccessContext"><errorname>AccessContext</errorname></link>
+error is returned.
+    </para>
+</section>
+
+<section id="Requests:SetResolution">
+    <title><function>SetResolution</function></title>
+    <indexterm zone="Requests:SetResolution" significance="preferred"><primary>SetResolution</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row rowsep='1'><entry><parameter>resolutions</parameter>:</entry><entry><link linkend="Data_Types:RESOLUTION"><type>LISTofRESOLUTION</type></link></entry></row>
+          <row><entry>Errors:</entry><entry><link linkend="Errors:Resolution"><errorname>Resolution</errorname></link>,
+<link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This request provides a hint as to the resolution and
+preferred point size of the drawing surfaces for which the
+client will be requesting fonts.  The server may use this
+information to set the RESOLUTION_X and RESOLUTION_Y fields
+of scalable <acronym>XLFD</acronym> font names, to order sets of names based on
+their resolutions, and to choose the server-dependent
+instance that is used when a partially-specified scalable
+fontname is opened.
+    </para>
+    <para>
+If a zero-length list of <link linkend="Data_Types:RESOLUTION"><type>RESOLUTION</type></link>s is given, the
+server-dependent default value is restored.  Otherwise, if
+elements of all of the specified <link linkend="Data_Types:RESOLUTION"><type>RESOLUTION</type></link>s are non-zero, the
+default resolutions for this client are changed.
+    </para>
+    <para>
+If a <link linkend="Data_Types:RESOLUTION"><type>RESOLUTION</type></link> entry contains a zero,
+a <link linkend="Errors:Resolution"><errorname>Resolution</errorname></link> error is
+returned and the default resolutions are not changed.
+    </para>
+</section>
+
+<section id="Requests:GetResolution">
+    <title><function>GetResolution</function></title>
+    <indexterm zone="Requests:GetResolution" significance="preferred"><primary>GetResolution</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry>▶</entry></row>
+          <row rowsep='1'><entry><parameter>resolutions</parameter>:</entry><entry><link linkend="Data_Types:RESOLUTION"><type>LISTofRESOLUTION</type></link></entry></row>
+          <row><entry>Errors:</entry><entry><link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This request returns the current list of default resolutions.
+If a client has not performed a
+<link linkend="Requests:SetResolution"><function>SetResolution</function></link>,
+a server-dependent default value is returned.
+    </para>
+</section>
+
+<section id="Requests:ListFonts">
+    <title><function>ListFonts</function></title>
+    <indexterm zone="Requests:ListFonts" significance="preferred"><primary>ListFonts</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>pattern</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
+          <row><entry><parameter>max-names</parameter>:</entry><entry><type>CARD32</type></entry></row>
+          <row><entry>▶+</entry></row>
+          <row><entry><parameter>replies-following-hint</parameter>:</entry><entry><type>CARD32</type></entry></row>
+          <row rowsep='1'><entry><parameter>names</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>LISTofSTRING8</type></link></entry></row>
+          <row><entry>Errors:</entry><entry><link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This request returns a list of at most <parameter>MAX-NAMES</parameter>
+font names that match the specified <parameter>PATTERN</parameter>,
+according to matching rules
+of the <citetitle>X Logical Font Description Conventions</citetitle>
+<xref linkend="References:xlfd-spec"/>.
+In the pattern (which is encoded in <acronym>ISO</acronym> 8859-1) the
+<quote><literal>?</literal></quote> character (octal <literal>77</literal>)
+matches any single character; the
+<quote><literal>*</literal></quote> character (octal <literal>52</literal>)
+matches any series of zero or more characters; and
+alphabetic characters match either upper- or lowercase.  The
+returned <parameter>NAMES</parameter> are encoded in
+<acronym>ISO</acronym> 8859-1 and may contain mixed
+character cases.  Font names are not required to be in <acronym>XLFD</acronym>
+format.
+    </para>
+    <para>
+If <parameter>PATTERN</parameter> is of zero length or
+<parameter>MAX-NAMES</parameter> is equal to zero,
+one reply containing a zero-length list of names is returned.
+This may be used to synchronize the client with the server.
+    </para>
+    <para>
+Servers are free to add or remove fonts to the set returned by
+<function>ListFonts</function>
+between any two requests.  This request is not
+cumulative; repeated uses are processed in isolation and do
+result in an iteration through the list.
+    </para>
+    <para>
+To reduce the amount of buffering needed by the server, the
+list of names may be split across several reply packets, so
+long as the names arrive in the same order that they would
+have appeared had they been in a single packet.  The
+<parameter>REPLIES-FOLLOWING-HINT</parameter> field in all but the last reply
+contains a positive value that specifies the number of
+replies that are likely, but not required, to follow.  In the
+last reply, which may contain zero or more names, this field
+is set to zero.
+    </para>
+</section>
+
+<section id="Requests:ListFontsWithXInfo">
+    <title><function>ListFontsWithXInfo</function></title>
+    <indexterm zone="Requests:ListFontsWithXInfo" significance="preferred"><primary>ListFontsWithXInfo</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>pattern</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
+          <row><entry><parameter>pattern</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
+          <row><entry><parameter>pattern</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
+          <row><entry><parameter>max-names</parameter>:</entry><entry><type>CARD32</type></entry></row>
+          <row><entry>▶+</entry></row>
+          <row><entry><parameter>replies-following-hint</parameter>:</entry><entry><type>CARD32</type></entry></row>
+          <row><entry><parameter>info</parameter>:</entry><entry><link linkend="Data_Types:XFONTINFO"><type>XFONTINFO</type></link></entry></row>
+          <row rowsep='1'><entry><parameter>name</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
+          <row><entry>Errors:</entry><entry><link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This request is similar to
+<link linkend="Requests:ListFonts"><function>ListFonts</function></link>
+except that a separate
+reply containing the name, header, and property data is
+generated for each matching font name.  Following these
+replies, if any, a final reply containing a zero-length
+<parameter>NAME</parameter> and no <parameter>INFO</parameter> is sent.
+    </para>
+    <para>
+The <parameter>REPLIES-FOLLOWING-HINT</parameter> field in all but the
+last reply contains a positive value that specifies the number of replies
+that are likely, but not required, to follow.  In the last
+reply, this field is set to zero.
+    </para>
+    <para>
+If <parameter>PATTERN</parameter> is of zero length or if
+<parameter>MAX-NAMES</parameter> is equal to zero, only the final reply
+containing a zero-length <parameter>NAME</parameter> and no
+<parameter>INFO</parameter> is returned. This may be used to synchronize the
+client with the server.
+    </para>
+</section>
+
+<section id="Requests:OpenBitmapFont">
+    <title><function>OpenBitmapFont</function></title>
+    <indexterm zone="Requests:OpenBitmapFont" significance="preferred"><primary>OpenBitmapFont</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>fontid</parameter>:</entry><entry><link linkend="Data_Types:FONTID"><type>FONTID</type></link></entry></row>
+          <row><entry><parameter>pattern</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
+          <row><entry><parameter>format-mask</parameter>:</entry><entry><link linkend="Data_Types:BITMAPFORMATMASK"><type>BITMAPFORMATMASK</type></link></entry></row>
+          <row><entry><parameter>format-hint</parameter>:</entry><entry><link linkend="Data_Types:BITMAPFORMAT"><type>BITMAPFORMAT</type></link></entry></row>
+          <row><entry>▶</entry></row>
+          <row><entry><parameter>otherid</parameter>:</entry><entry><link linkend="Data_Types:FONTID"><type>FONTID</type></link> or <constant>None</constant></entry></row>
+          <row><entry><parameter>otherid-valid</parameter>:</entry><entry><link linkend="Data_Types:BOOL"><type>BOOL</type></link></entry></row>
+          <row rowsep='1'><entry><parameter>cachable</parameter>:</entry><entry><link linkend="Data_Types:BOOL"><type>BOOL</type></link></entry></row>
+          <row><entry>Errors:</entry><entry>
+<link linkend="Errors:IDChoice"><errorname>IDChoice</errorname></link>,
+<link linkend="Errors:Name"><errorname>Name</errorname></link>,
+<link linkend="Errors:Format"><errorname>Format</errorname></link>,
+<link linkend="Errors:AccessContext"><errorname>AccessContext</errorname></link>,
+<link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This request looks for a server-dependent choice of the
+font names that match the specified <parameter>PATTERN</parameter>
+according to the rules described for
+<link linkend="Requests:ListFonts"><function>ListFonts</function></link>.
+If no matches are found, a
+<link linkend="Errors:Name"><errorname>Name</errorname></link>
+error is returned.  Otherwise, the server attempts to
+open the font associated with the chosen name.
+    </para>
+    <para>
+Permission to access the font is determined by the server
+according the licensing policy used for this font.  The server
+may use the client's current
+<type>AccessContext</type>
+(as set by the most
+recent
+<link linkend="Requests:SetAuthorization"><function>SetAuthorization</function></link>
+request or the original connection
+setup) to determine any client-specific sets of permissions.
+After the font has been opened, the client is allowed to
+specify a new
+<type>AccessContext</type>
+with
+<link linkend="Requests:SetAuthorization"><function>SetAuthorization</function></link>
+or release
+the
+<type>AccessContext</type>
+using
+<link linkend="Requests:FreeAC"><function>FreeAC</function></link>
+.  Subsequent
+<link linkend="Requests:QueryXInfo"><function>QueryXInfo</function></link>,
+<link linkend="Requests:QueryXExtents8"><function>QueryXExtents8</function></link>,
+<link linkend="Requests:QueryXExtents16"><function>QueryXExtents16</function></link>,
+<link linkend="Requests:QueryXBitmaps8"><function>QueryXBitmaps8</function></link>,
+<link linkend="Requests:QueryXBitmaps16"><function>QueryXBitmaps16</function></link>
+and
+<link linkend="Requests:CloseFont"><function>CloseFont</function></link>
+requests on this <link linkend="Data_Types:FONTID"><type>FONTID</type></link> are
+performed according to permissions granted at the time of the
+<function>OpenBitmapFont</function>
+request.
+    </para>
+    <para>
+If the server is willing and able to detect that the client
+has already opened the font successfully (possibly under a
+different name), the <parameter>OTHERID</parameter> field
+may be set to one of the
+identifiers previously used to open the font.  The
+<parameter>OTHERID-VALID</parameter> field indicates whether or not
+<parameter>OTHERID</parameter> is still associated with an open font:
+if it is <constant>True</constant>, the client may use
+<parameter>OTHERID</parameter> as an alternative to
+<parameter>FONTID</parameter>. Otherwise, if
+<parameter>OTHERID-VALID</parameter> is <constant>False</constant>,
+<parameter>OTHERID</parameter> is no longer
+open but has not been reused by a subsequent
+<function>OpenBitmapFont</function>
+request.
+    </para>
+    <para>
+If <parameter>OTHERID</parameter> is set to <constant>None</constant>,
+then <parameter>OTHERID-VALID</parameter> should be set
+to <constant>False</constant>.
+    </para>
+    <para>
+The <parameter>FORMAT-MASK</parameter> indicates which fields in
+<parameter>FORMAT-HINT</parameter>
+the client is likely to use in subsequent
+<function>GetXBitmaps8</function>
+and
+<function>GetXBitmaps16</function>
+requests.  Servers may wish to use
+this information to precompute certain values.
+    </para>
+    <para>
+If <parameter>CACHABLE</parameter> is set to <constant>True</constant>,
+the client may cache the font
+(so that redundant opens of the same font may be avoided)
+and use it with all
+<type>AccessContext</type>s
+during the life of the
+client without violating the font's licensing policy.  This
+flag is typically set whenever a font is unlicensed or is
+licensed on a per-display basis.  If <parameter>CACHABLE</parameter>
+is <constant>False</constant>, the
+client should reopen the font for each
+<type>AccessContext</type>.
+    </para>
+    <para>
+The server is permitted to add to or remove from the set of
+fonts returned by
+<link linkend="Requests:ListFonts"><function>ListFonts</function></link>
+between any two requests, though
+mechanisms outside the protocol.  Therefore, it is possible
+for this request (which is atomic) to return a different font
+than would result from separate a
+<link linkend="Requests:ListFonts"><function>ListFonts</function></link>
+followed by an
+<function>OpenBitmapFont</function>
+with a non-wildcarded font name.
+    </para>
+    <para>
+If <parameter>FONTID</parameter> is not in the range
+[1..2<superscript>29</superscript>-1] or if it is already
+associated with an open font, an
+<link linkend="Errors:IDChoice"><errorname>IDChoice</errorname></link>
+error is returned.
+If no font is available that matches the specified
+<parameter>PATTERN</parameter>, a
+<link linkend="Errors:Name"><errorname>Name</errorname></link>
+error is returned.  If the font is present but the client
+is not permitted access, an
+<link linkend="Errors:AccessContext"><errorname>AccessContext</errorname></link>
+error is returned.
+If <parameter>FORMAT-MASK</parameter> has any unspecified bits set or if any
+of the fields in <parameter>FORMAT-HINT</parameter> indicated by
+<parameter>FORMAT-MASK</parameter> are invalid, a
+<link linkend="Errors:Format"><errorname>Format</errorname></link>
+error is returned.
+    </para>
+</section>
+
+<section id="Requests:QueryXInfo">
+    <title><function>QueryXInfo</function></title>
+    <indexterm zone="Requests:QueryXInfo" significance="preferred"><primary>QueryXInfo</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>fontid</parameter>:</entry><entry><link linkend="Data_Types:FONTID"><type>FONTID</type></link></entry></row>
+          <row><entry>▶</entry></row>
+          <row rowsep='1'><entry><parameter>info</parameter>:</entry><entry><link linkend="Data_Types:XFONTINFO"><type>XFONTINFO</type></link></entry></row>
+          <row><entry>Errors:</entry><entry><link linkend="Errors:Font"><errorname>Font</errorname></link>,
+<link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This request returns the font header and property information
+for the open font associated with <parameter>FONTID</parameter>.
+    </para>
+    <para>
+If <parameter>FONTID</parameter> is not associated with any open fonts, a
+<link linkend="Errors:Font"><errorname>Font</errorname></link>
+error
+is returned.
+    </para>
+</section>
+
+<section id="Requests:QueryXExtents8">
+    <title><function>QueryXExtents8</function></title>
+    <indexterm zone="Requests:QueryXExtents8" significance="preferred"><primary>QueryXExtents8</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>fontid</parameter>:</entry><entry><link linkend="Data_Types:FONTID"><type>FONTID</type></link></entry></row>
+          <row><entry><parameter>range</parameter>:</entry><entry><link linkend="Data_Types:BOOL"><type>BOOL</type></link></entry></row>
+          <row><entry><parameter>chars</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
+          <row><entry>▶</entry></row>
+          <row rowsep='1'><entry><parameter>extents</parameter>:</entry><entry><link linkend="Data_Types:XCHARINFO"><type>LISTofXCHARINFO</type></link></entry></row>
+          <row><entry>Errors:</entry><entry><link linkend="Errors:Font"><errorname>Font</errorname></link>,
+<link linkend="Errors:Range"><errorname>Range</errorname></link>,
+<link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This request is equivalent to
+<link linkend="Requests:QueryXExtents16"><function>QueryXExtents16</function></link>
+except that it
+uses 1-byte character codes.
+    </para>
+</section>
+
+<section id="Requests:QueryXExtents16">
+    <title><function>QueryXExtents16</function></title>
+    <indexterm zone="Requests:QueryXExtents16" significance="preferred"><primary>QueryXExtents16</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>fontid</parameter>:</entry><entry><link linkend="Data_Types:FONTID"><type>FONTID</type></link></entry></row>
+          <row><entry><parameter>range</parameter>:</entry><entry><link linkend="Data_Types:BOOL"><type>BOOL</type></link></entry></row>
+          <row><entry><parameter>chars</parameter>:</entry><entry><link linkend="Data_Types:CHAR2B"><type>LISTofCHAR2B</type></link></entry></row>
+          <row><entry>▶</entry></row>
+          <row rowsep='1'><entry><parameter>extents</parameter>:</entry><entry><link linkend="Data_Types:XCHARINFO"><type>LISTofXCHARINFO</type></link></entry></row>
+          <row><entry>Errors:</entry><entry><link linkend="Errors:Font"><errorname>Font</errorname></link>,
+<link linkend="Errors:Range"><errorname>Range</errorname></link>,
+<link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This request returns a list of glyph extents from the open
+font associated with FONTID for the series of characters
+specified by <parameter>RANGE</parameter> and <parameter>CHARS</parameter>.
+    </para>
+    <para>
+If <parameter>RANGE</parameter> is <constant>True</constant>,
+each succeeding pair of elements in <parameter>CHARS</parameter> is
+treated as a range of characters for which extents should be
+returned.  If <parameter>CHARS</parameter> contains an odd number of elements,
+the font's <structfield>XFONTINFO.CHAR-RANGE.MAX-CHAR</structfield>
+is implicitly appended to
+the list.  If <parameter>CHARS</parameter> contains no elements, the list is
+implicitly replaced with the font's
+<structfield>XFONTINFO.CHAR-RANGE.</structfield>  If
+any of the resulting character ranges are invalid, a
+<link linkend="Errors:Range"><errorname>Range</errorname></link>
+error is returned.  Otherwise, the character ranges are
+concatenated in the order given by <parameter>CHARS</parameter> to produce
+a set of character codes for which extents are returned.
+    </para>
+    <para>
+If <parameter>RANGE</parameter> is <constant>False</constant>,
+then <parameter>CHARS</parameter> specifies the set of character
+codes for which extents are returned.  If <parameter>CHARS</parameter> is of
+zero length, then a zero-length list of extents is returned.
+    </para>
+    <para>
+The extents for each character code in the resulting set (which
+may contain duplicates) are returned in the order in
+which the character codes appear in the set.
+At least one metric for each character shall be non-zero
+unless the character is not encoded in the font, in which case
+all-zero metrics are returned.
+A blank, zero-width character can be encoded
+with non-zero but equal left and right bearings.
+    </para>
+    <para>
+If <parameter>FONTID</parameter> is not associated with any open fonts, a
+<link linkend="Errors:Font"><errorname>Font</errorname></link>
+error is
+returned.  If <parameter>RANGE</parameter> is <constant>True</constant>
+and <parameter>CHARS</parameter> contains any invalid ranges, a
+<link linkend="Errors:Range"><errorname>Range</errorname></link>
+error is returned.
+    </para>
+</section>
+
+<section id="Requests:QueryXBitmaps8">
+    <title><function>QueryXBitmaps8</function></title>
+    <indexterm zone="Requests:QueryXBitmaps8" significance="preferred"><primary>QueryXBitmaps8</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>fontid</parameter>:</entry><entry><link linkend="Data_Types:FONTID"><type>FONTID</type></link></entry></row>
+          <row><entry><parameter>range</parameter>:</entry><entry><link linkend="Data_Types:BOOL"><type>BOOL</type></link></entry></row>
+          <row><entry><parameter>chars</parameter>:</entry><entry><link linkend="Data_Types:STRING8"><type>STRING8</type></link></entry></row>
+          <row><entry><parameter>format</parameter>:</entry><entry><link linkend="Data_Types:BITMAPFORMAT"><type>BITMAPFORMAT</type></link></entry></row>
+          <row><entry>▶+</entry></row>
+          <row><entry><parameter>replies-following-hint</parameter>:</entry><entry><type>CARD32</type></entry></row>
+          <row><entry><parameter>offsets</parameter>:</entry><entry><link linkend="Data_Types:OFFSET32"><type>LISTofOFFSET32</type></link></entry></row>
+          <row><entry><parameter>bitmaps</parameter>:</entry><entry><link linkend="Data_Types:BYTE"><type>LISTofBYTE</type></link></entry></row>
+          <row rowsep='1'><entry>Errors:</entry><entry><link linkend="Errors:Font"><errorname>Font</errorname></link>,
+<link linkend="Errors:Range"><errorname>Range</errorname></link>,
+<link linkend="Errors:Format"><errorname>Format</errorname></link>,
+<link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This request is equivalent to
+<link linkend="Requests:QueryXBitmaps16"><function>QueryXBitmaps16</function></link>
+except that it
+uses 1-byte character codes.
+    </para>
+</section>
+
+<section id="Requests:QueryXBitmaps16">
+    <title><function>QueryXBitmaps16</function></title>
+    <indexterm zone="Requests:QueryXBitmaps16" significance="preferred"><primary>QueryXBitmaps16</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>fontid</parameter>:</entry><entry><link linkend="Data_Types:FONTID"><type>FONTID</type></link></entry></row>
+          <row><entry><parameter>range</parameter>:</entry><entry><link linkend="Data_Types:BOOL"><type>BOOL</type></link></entry></row>
+          <row><entry><parameter>chars</parameter>:</entry><entry><link linkend="Data_Types:CHAR2B"><type>LISTofCHAR2B</type></link></entry></row>
+          <row><entry><parameter>format</parameter>:</entry><entry><link linkend="Data_Types:BITMAPFORMAT"><type>BITMAPFORMAT</type></link></entry></row>
+          <row><entry>▶+</entry></row>
+          <row><entry><parameter>replies-following-hint</parameter>:</entry><entry><type>CARD32</type></entry></row>
+          <row><entry><parameter>offsets</parameter>:</entry><entry><link linkend="Data_Types:OFFSET32"><type>LISTofOFFSET32</type></link></entry></row>
+          <row rowsep='1'><entry><parameter>bitmaps</parameter>:</entry><entry><link linkend="Data_Types:BYTE"><type>LISTofBYTE</type></link></entry></row>
+          <row><entry>Errors:</entry><entry><link linkend="Errors:Font"><errorname>Font</errorname></link>,
+          <link linkend="Errors:Range"><errorname>Range</errorname></link>,
+          <link linkend="Errors:Format"><errorname>Format</errorname></link>,
+          <link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This request returns a list of glyph bitmaps from the open font associated
+with <parameter>FONTID</parameter> for the series of characters
+specified by <parameter>RANGE</parameter> and <parameter>CHARS</parameter>.
+    </para>
+    <para>
+If <parameter>RANGE</parameter> is <constant>True</constant>, each succeeding
+pair of elements in <parameter>CHARS</parameter> is
+treated as a range of characters for which bitmaps should be
+returned.  If <parameter>CHARS</parameter> contains an odd number of elements,
+the font's <structfield>XFONTINFO.CHAR-RANGE.MAX-CHAR</structfield>
+is implicitly appended to
+the list.  If <parameter>CHARS</parameter> contains no elements, the list is
+implicitly replaced with the font's
+<structfield>XFONTINFO.CHAR-RANGE.</structfield>  If
+any of the resulting character ranges are invalid, a <link linkend="Errors:Range"><errorname>Range</errorname></link>
+error is returned.  Otherwise, the character ranges are
+concatenated in the order given by <parameter>CHARS</parameter> to produce
+a set of character codes for which bitmaps are returned.
+    </para>
+    <para>
+If <parameter>RANGE</parameter> is <constant>False</constant>,
+then <parameter>CHARS</parameter> specifies the set of character
+codes for which bitmaps are returned.  If <parameter>CHARS</parameter>
+is of zero length, then a single reply containing a zero-length list of
+offsets and bitmaps is returned.
+    </para>
+    <para>
+If any of the resulting character ranges are invalid, a
+<link linkend="Errors:Range"><errorname>Range</errorname></link>
+error is returned.  Otherwise, the resulting character ranges
+are concatenated in the order given by <parameter>CHARS</parameter>
+to produce a set of character codes for which bitmaps are returned.
+    </para>
+    <para>
+The server is free to return the glyph bitmaps in multiple
+replies to reduce the amount of buffering that is necessary.
+In this situation, the set of characters obtained above is
+partitioned into an implementation-dependent number of
+ordered, non-overlapping subsets containing runs of one or
+more consecutive characters.  The global ordering of
+characters must be maintained such that concatenating the
+subsets in order that they were produced yields the original
+set.  A reply is generated for each subset, in the order that
+it was produced.
+    </para>
+    <para>
+For each character in a subset, an image of that character's
+glyph is described by a rectangle of bits corresponding to the
+pixels specified by FORMAT.IMAGE-RECT.  Within the image, set
+and clear bits represent inked and non-inked pixels,
+respectively.
+    </para>
+    <para>
+Each scanline of a glyph image, from top to bottom, is zero-padded
+on the right to a multiple of the number of bits specified by
+FORMAT.SCANLINE-PAD.  The scanline is then divided from left
+to right into a sequence of FORMAT.SCANLINE-UNIT bits.  The
+bits of each unit are then arranged such that the left-most
+pixel is stored in the most- or least-significant bit,
+according to FORMAT.BIT-ORDER-MSB.  The bytes of each unit are
+then arranged such that the most- or least-significant byte,
+according to FORMAT.BYTE-ORDER-MSB, is transmitted first.
+Finally, the units are arranged such that the left-most is
+transmitted first and the right-most is transmitted last.
+    </para>
+    <para>
+The individual images within a subset are then concatenated in
+a server-dependent order to form the <parameter>BITMAPS</parameter> data
+of the reply.  If a glyph image is duplicated within a reply, the
+server is free to return fewer (but at least one) copies of
+the image.  If a character is not encoded within the font, a
+zero-length bitmap is substituted for this character.  Each
+glyph image must begin at a bit position that is a multiple of
+the FORMAT.SCANLINE-UNIT.
+    </para>
+    <para>
+The <parameter>OFFSETS</parameter> array in a reply contains one entry
+for each character in the subset being returned, in the order that the
+characters appear in the subset.  Each entry specifies the
+starting location in bytes and size in bytes of the
+corresponding glyph image in the <parameter>BITMAPS</parameter> data of that
+reply (i.e. an offset may not refer to data in another reply).
+    </para>
+    <para>
+The <parameter>REPLIES-FOLLOWING-HINT</parameter> field in all but the
+last reply contains a positive value that specifies the number of replies
+that are likely, but not required, to follow.  In the last
+reply, which may contain data for zero or more characters,
+this field is set to zero.
+    </para>
+    <para>
+If <parameter>FONTID</parameter> is not associated with any open fonts,
+a <link linkend="Errors:Font"><errorname>Font</errorname></link>
+error is returned.  If <parameter>RANGE</parameter> is
+<constant>True</constant> and <parameter>CHARS</parameter> contains any
+invalid ranges, a
+<link linkend="Errors:Range"><errorname>Range</errorname></link> error
+is returned.  If <parameter>FORMAT</parameter> is invalid, a
+<link linkend="Errors:Format"><errorname>Format</errorname></link> error
+is returned.
+    </para>
+</section>
+
+<section id="Requests:CloseFont">
+    <title><function>CloseFont</function></title>
+    <indexterm zone="Requests:CloseFont" significance="preferred"><primary>CloseFont</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row rowsep='1'><entry><parameter>fontid</parameter>:</entry><entry><link linkend="Data_Types:FONTID"><type>FONTID</type></link></entry></row>
+          <row><entry>Errors:</entry><entry><link linkend="Errors:Font"><errorname>Font</errorname></link>, <link linkend="Errors:Alloc"><errorname>Alloc</errorname></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This request indicates that the specified <parameter>FONTID</parameter>
+should no longer be associated with an open font.  The server is free to
+release any client-specific storage or licenses allocated for
+the font.  The client may reuse the value of <parameter>FONTID</parameter>
+in a subsequent
+<link linkend="Requests:OpenBitmapFont"><function>OpenBitmapFont</function></link>
+request.
+    </para>
+    <para>
+If <parameter>FONTID</parameter> is not associated with any open fonts, a
+<link linkend="Errors:Font"><errorname>Font</errorname></link>
+error is returned.
+    </para>
+</section>
+
+<section id="Requests:close_connection">
+    <title>close connection</title>
+    <indexterm zone="Requests:close_connection" significance="preferred"><primary>close connection</primary></indexterm>
+
+    <para>
+When a connection is closed, a
+<link linkend="Requests:CloseFont"><function>CloseFont</function></link>
+is done on all fonts
+that are open on the connection.  In addition, the server is
+free to release any storage or licenses allocated on behalf of
+the client that made the connection.
+    </para>
+</section>
+</section>
+
+<section id='Errors'>
+<title>Errors</title>
+<!-- .XS -->
+<!-- (SN Errors -->
+<!-- .XE -->
+<para>
+All errors are at least 16 bytes long and contain the following fields:
+</para>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>type</parameter>:</entry><entry><type>CARD8</type></entry><entry>value of 1</entry></row>
+          <row><entry><parameter>error-code</parameter>:</entry><entry><type>CARD8</type></entry></row>
+          <row><entry><parameter>sequence-number</parameter>:</entry><entry><type>CARD16</type></entry></row>
+          <row><entry><parameter>length</parameter>:</entry><entry><type>CARD32</type></entry></row>
+          <row><entry><parameter>timestamp</parameter>:</entry><entry><link linkend="Data_Types:TIMESTAMP"><type>TIMESTAMP</type></link></entry></row>
+          <row><entry><parameter>major-opcode</parameter>:</entry><entry><type>CARD8</type></entry></row>
+          <row><entry><parameter>minor-opcode</parameter>:</entry><entry><type>CARD8</type></entry></row>
+          <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+<para>
+The TYPE field has a value of one.  The ERROR-CODE field specifies which error
+occurred.  Core errors codes are in the range 0 through 127, extension error
+codes are in the range 128 through 255.  The SEQUENCE-NUMBER field contains the
+least significant 16 bits of the sequence number of the request that caused the
+error.  The LENGTH field specifies the length of the error packet in 4-byte
+units and must have a value of at least 4.  The TIMESTAMP specifies the server
+time when the error occurred.  The MAJOR-OPCODE and MINOR-OPCODE (zero for core
+requests) fields specify the type of request that generated the error.  The
+DATA-OR-UNUSED field may be used for 16 bits of error-specific information.  If
+LENGTH is greater than four, these fields are followed by (LENGTH - 4) * 4
+bytes of extra data.
+</para>
+<para>
+The following errors are defined for the core protocol:
+</para>
+
+<section id="Errors:Request">
+    <title><errorname>Request</errorname></title>
+    <indexterm zone="Errors:Request" significance="preferred"><primary>Error Codes</primary><secondary><errorname>Request</errorname></secondary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>unused</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This error is generated by any request that has an unknown
+combination of major and minor request numbers, or by any
+extension request that is issued before a
+<link linkend="Requests:QueryExtension"><function>QueryExtension</function></link>
+of that extension.
+    </para>
+</section>
+
+<section id="Errors:Format">
+    <title><errorname>Format</errorname></title>
+    <indexterm zone="Errors:Format" significance="preferred"><primary>Error Codes</primary><secondary><errorname>Format</errorname></secondary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>unused</entry></row>
+          <row><entry><parameter>format</parameter>:</entry><entry><link linkend="Data_Types:BITMAPFORMAT"><type>BITMAPFORMAT</type></link></entry><entry>bad format value</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This error is generated by the use of an invalid <link linkend="Data_Types:BITMAPFORMAT"><type>BITMAPFORMAT</type></link>
+in the
+<link linkend="Requests:OpenBitmapFont"><function>OpenBitmapFont</function></link>,
+<link linkend="Requests:QueryXBitmaps8"><function>QueryXBitmaps8</function></link>, and
+<link linkend="Requests:QueryXBitmaps16"><function>QueryXBitmaps16</function></link>
+requests.
+The value that caused the error is included as extra data.
+    </para>
+</section>
+
+<section id="Errors:Font">
+    <title><errorname>Font</errorname></title>
+    <indexterm zone="Errors:Font" significance="preferred"><primary>Error Codes</primary><secondary><errorname>Font</errorname></secondary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>unused</entry></row>
+          <row><entry><parameter>fontid</parameter>:</entry><entry><link linkend="Data_Types:FONTID"><type>FONTID</type></link></entry><entry>bad font identifier</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This error is generated by an invalid <link linkend="Data_Types:FONTID"><type>FONTID</type></link> in the
+<link linkend="Requests:QueryXInfo"><function>QueryXInfo</function></link>,
+<link linkend="Requests:QueryXExtents8"><function>QueryXExtents8</function></link>,
+<link linkend="Requests:QueryXExtents16"><function>QueryXExtents16</function></link>,
+<link linkend="Requests:QueryXBitmaps8"><function>QueryXBitmaps8</function></link>,
+<link linkend="Requests:QueryXBitmaps16"><function>QueryXBitmaps16</function></link>
+and
+<link linkend="Requests:CloseFont"><function>CloseFont</function></link>
+requests.  The value that caused
+the error is included as extra data.
+    </para>
+</section>
+
+<section id="Errors:Range">
+    <title><errorname>Range</errorname></title>
+    <indexterm zone="Errors:Range" significance="preferred"><primary>Error Codes</primary><secondary><errorname>Range</errorname></secondary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>unused</entry></row>
+          <row><entry><parameter>range</parameter>:</entry><entry><link linkend="Data_Types:RANGE"><type>RANGE</type></link></entry><entry>bad range</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This error is generated by an invalid <link linkend="Data_Types:RANGE"><type>RANGE</type></link> in the
+<link linkend="Requests:QueryXExtents8"><function>QueryXExtents8</function></link>,
+<link linkend="Requests:QueryXExtents16"><function>QueryXExtents16</function></link>,
+<link linkend="Requests:QueryXBitmaps8"><function>QueryXBitmaps8</function></link>
+and
+<link linkend="Requests:QueryXBitmaps16"><function>QueryXBitmaps16</function></link>
+requests.  The
+value that caused the error is included as extra data.
+    </para>
+</section>
+
+<section id="Errors:EventMask">
+    <title><errorname>EventMask</errorname></title>
+    <indexterm zone="Errors:EventMask" significance="preferred"><primary>Error Codes</primary><secondary><errorname>EventMask</errorname></secondary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>unused</entry></row>
+          <row><entry><parameter>event-mask</parameter>:</entry><entry><link linkend="Data_Types:EVENTMASK"><type>EVENTMASK</type></link></entry><entry>bad event mask</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This error is generated by an invalid <link linkend="Data_Types:EVENTMASK"><type>EVENTMASK</type></link> in the
+<link linkend="Requests:SetEventMask"><function>SetEventMask</function></link>
+request.  The value that caused the error is
+included as extra data.
+    </para>
+</section>
+
+<section id="Errors:AccessContext">
+    <title><errorname>AccessContext</errorname></title>
+    <indexterm zone="Errors:AccessContext" significance="preferred"><primary>Error Codes</primary><secondary><errorname>AccessContext</errorname></secondary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>unused</entry></row>
+          <row><entry><parameter>ac</parameter>:</entry><entry><link linkend="Data_Types:ACCESSCONTEXT"><type>ACCESSCONTEXT</type></link></entry><entry>unaccepted <type>AccessContext</type></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This error is generated by an invalid <link linkend="Data_Types:ACCESSCONTEXT"><type>ACCESSCONTEXT</type></link> in the
+<link linkend="Requests:FreeAC"><function>FreeAC</function></link>
+or
+<link linkend="Requests:SetAuthorization"><function>SetAuthorization</function></link>
+request or by an
+<link linkend="Requests:OpenBitmapFont"><function>OpenBitmapFont</function></link>
+request performed without sufficient authorization.  In the
+first two cases, the <link linkend="Data_Types:ACCESSCONTEXT"><type>ACCESSCONTEXT</type></link> of the errant request is
+returned as extra data.  In the third case, the current
+<link linkend="Data_Types:ACCESSCONTEXT"><type>ACCESSCONTEXT</type></link> is returned as extra data.
+    </para>
+</section>
+
+<section id="Errors:IDChoice">
+    <title><errorname>IDChoice</errorname></title>
+    <indexterm zone="Errors:IDChoice" significance="preferred"><primary>Error Codes</primary><secondary><errorname>IDChoice</errorname></secondary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>unused</entry></row>
+          <row><entry><parameter>id</parameter>:</entry><entry><link linkend="Data_Types:ID"><type>ID</type></link></entry><entry>bad identifier</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This error is generated by an invalid or already associated
+<link linkend="Data_Types:ACCESSCONTEXT"><type>ACCESSCONTEXT</type></link> identifier in a
+<link linkend="Requests:CreateAC"><function>CreateAC</function></link>
+request or <link linkend="Data_Types:FONTID"><type>FONTID</type></link> identifier
+in an
+<link linkend="Requests:OpenBitmapFont"><function>OpenBitmapFont</function></link>
+request.  The value that caused the error
+is included as extra data.
+    </para>
+</section>
+
+<section id="Errors:Name">
+    <title><errorname>Name</errorname></title>
+    <indexterm zone="Errors:Name" significance="preferred"><primary>Error Codes</primary><secondary><errorname>Name</errorname></secondary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>unused</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This error is generated by a font name pattern that matches
+no fonts in an
+<link linkend="Requests:OpenBitmapFont"><function>OpenBitmapFont</function></link>
+request or no catalogue names in a
+<link linkend="Requests:SetCatalogues"><function>SetCatalogues</function></link>
+request.
+    </para>
+</section>
+
+<section id="Errors:Resolution">
+    <title><errorname>Resolution</errorname></title>
+    <indexterm zone="Errors:Resolution" significance="preferred"><primary>Error Codes</primary><secondary><errorname>Resolution</errorname></secondary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>X value of errant resolution</entry></row>
+          <row><entry><parameter>y-resolution</parameter>:</entry><entry><type>CARD16</type></entry><entry>Y value of errant resolution</entry></row>
+          <row><entry><parameter>point-size</parameter>:</entry><entry><type>CARD16</type></entry><entry>point size of errant resolution</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This error is generated in response to an invalid <link linkend="Data_Types:RESOLUTION"><type>RESOLUTION</type></link>
+structure in a
+<link linkend="Requests:SetResolution"><function>SetResolution</function></link>
+request.  The value that caused the
+error is included in the DATA-OR-UNUSED field and as extra data.
+    </para>
+</section>
+
+<section id="Errors:Alloc">
+    <title><errorname>Alloc</errorname></title>
+    <indexterm zone="Errors:Length" significance="preferred"><primary>Error Codes</primary><secondary><errorname>Alloc</errorname></secondary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>unused</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This error is generated by any request for which the server
+lacks sufficient resources (especially memory).
+    </para>
+</section>
+
+<section id="Errors:Length">
+    <title><errorname>Length</errorname></title>
+    <indexterm zone="Errors:Length" significance="preferred"><primary>Error Codes</primary><secondary><errorname>Length</errorname></secondary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>unused</entry></row>
+          <row><entry><parameter>length</parameter>:</entry><entry><type>CARD32</type></entry><entry>bad length value</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This error is generated by any request that has a length field
+greater than (MAXIMUM-REQUEST-LENGTH * 4) bytes.  The value that
+caused the error is included as extra data.
+    </para>
+</section>
+
+<section id="Errors:Implementation">
+    <title><errorname>Implementation</errorname></title>
+    <indexterm zone="Errors:Implementation" significance="preferred"><primary>Error Codes</primary><secondary><errorname>Implementation</errorname></secondary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>data-or-unused</parameter>:</entry><entry><type>CARD16</type></entry><entry>unused</entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This error may be generated in response to any request that
+the server is unable to process because it is deficient.  Use
+of this error is highly discouraged and indicates lack of
+conformance to the protocol.
+    </para>
+</section>
+<section id="Errors:Extensions">
+  <title>Extensions</title>
+    <para>
+Additional errors may be defined by extensions.
+    </para>
+</section>
+</section>
+
+<section id='Events'>
+<title>Events</title>
+<!-- .XS -->
+<!-- (SN Events -->
+<!-- .XE -->
+<para>
+Events may be generated in response to requests or at the server's discretion
+after the initial connection setup information has been exchanged.  Each event
+is at least 12 bytes long and contains the following fields:
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <colspec colname='c3' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>type</parameter>:</entry><entry><type>CARD8</type></entry><entry>value of 2</entry></row>
+          <row><entry><parameter>event-code</parameter>:</entry><entry><type>CARD8</type></entry></row>
+          <row><entry><parameter>sequence-number</parameter>:</entry><entry><type>CARD16</type></entry></row>
+          <row><entry><parameter>length</parameter>:</entry><entry><type>CARD32</type></entry></row>
+          <row><entry><parameter>timestamp</parameter>:</entry><entry><link linkend="Data_Types:TIMESTAMP"><type>TIMESTAMP</type></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+</para>
+<para>
+The TYPE field contains the value 2.  The EVENT-CODE field specifies the number
+of the event and is in the range 0-127 for core events or the range 128-255 for
+extensions.  The SEQUENCE-NUMBER field specifies the least significant 16 bits
+of the sequence number of the last request to have been processed by the
+server.  The LENGTH field specifies the number of 4-byte units in this event
+packet and must always have a value of at least 3.  The <link linkend="Data_Types:TIMESTAMP"><type>TIMESTAMP</type></link> field
+specifies the server time when the event occurred.  If LENGTH is greater than
+three, these fields are followed by (LENGTH - 3) * 4 bytes of additional data.
+</para>
+<para>
+Events are described using the following syntax:
+  <blockquote><para>
+    <emphasis role="bold"><function>EventName</function></emphasis>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>arg1</parameter>:</entry><entry><type>type1</type></entry></row>
+          <row><entry> ...</entry></row>
+          <row><entry><parameter>argN</parameter>:</entry><entry><type>typeN</type></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    Description
+  </para></blockquote>
+</para>
+<para>
+If an event does not provide any extra arguments, the
+<parameter>arg1</parameter>...<parameter>argN</parameter>
+lines are omitted from the description.
+</para>
+<para>
+The core X Font Service protocol defines the following events:
+</para>
+
+<section id="Events:KeepAlive">
+    <title><function>KeepAlive</function></title>
+    <indexterm zone="Events:KeepAlive" significance="preferred"><primary>KeepAlive</primary></indexterm>
+    <para>
+This unsolicited, nonmaskable event may be sent by the
+server to verify that the connection has not been broken
+(for transports that do not provide this information).
+Clients should acknowledge receipt of this request
+by sending any request (such as
+<link linkend="Requests:NoOp"><function>NoOp</function></link>
+).
+    </para>
+</section>
+
+<section id="Events:CatalogueListNotify">
+    <title><function>CatalogueListNotify</function></title>
+    <indexterm zone="Events:CatalogueListNotify" significance="preferred"><primary>CatalogueListNotify</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>added</parameter>:</entry><entry><link linkend="Data_Types:BOOL"><type>BOOL</type></link></entry></row>
+          <row><entry><parameter>deleted</parameter>:</entry><entry><link linkend="Data_Types:BOOL"><type>BOOL</type></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This event is sent to clients that have included
+<function><constant>CatalogueListChangeMask</constant></function>
+in their core event mask
+whenever the list of catalogues that are available has
+changed.  The ADDED field is <constant>True</constant> if new catalogues have
+been added to the server, otherwise it is <constant>False</constant>.  The
+DELETED field is <constant>True</constant> if any existing catalogues have
+been removed from the server, otherwise it is <constant>False</constant>.
+    </para>
+</section>
+
+<section id="Events:FontListNotify">
+    <title><function>FontListNotify</function></title>
+    <indexterm zone="Events:FontListNotify" significance="preferred"><primary>FontListNotify</primary></indexterm>
+    <informaltable frame='none'>
+      <?dbfo keep-together="always" ?>
+      <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+        <colspec colname='c1' colwidth='1.0*'/>
+        <colspec colname='c2' colwidth='1.0*'/>
+        <tbody>
+          <row><entry><parameter>added</parameter>:</entry><entry><link linkend="Data_Types:BOOL"><type>BOOL</type></link></entry></row>
+          <row><entry><parameter>deleted</parameter>:</entry><entry><link linkend="Data_Types:BOOL"><type>BOOL</type></link></entry></row>
+        </tbody>
+      </tgroup>
+    </informaltable>
+    <para>
+This event is sent to clients that have included
+<function><constant>FontListChangeMask</constant></function>
+in their event mask whenever the
+list of fonts that are provided by the currently selected
+catalogues has changed.  The ADDED field is <constant>True</constant> if new
+fonts have been added to any of the catalogues currently
+used by the client, otherwise it is <constant>False</constant>.  The DELETED
+field is <constant>True</constant> if any existing fonts have been removed
+from any of catalogues used by the client, otherwise it
+is <constant>False</constant>.
+    </para>
+</section>
+<section id="Events:Extensions">
+  <title>Extensions</title>
+    <para>
+Additional events may be defined by extensions.
+    </para>
+</section>
+</section>
+</chapter>
+
+<chapter id='Protocol_Encoding'>
+<title>Protocol Encoding</title>
+<!-- .XS -->
+<!-- (SN Protocol Encoding -->
+<!-- .XE -->
+<para>
+Numbers that are prefixed with <quote><literal>#x</literal></quote>
+are in hexadecimal (base 16).  All other
+numbers are in decimal.  Requests, replies, errors, events, and compound types
+are described using the syntax:
+</para>
+<!-- .RS -->
+<literallayout class="monospaced">
+
+    Name
+     <emphasis remap='I'>count</emphasis>          <emphasis remap='I'>contents</emphasis>     <emphasis remap='I'>name</emphasis>
+     ...
+     <emphasis remap='I'>count</emphasis>          <emphasis remap='I'>contents</emphasis>     <emphasis remap='I'>name</emphasis>
+</literallayout>
+
+<!-- .RE -->
+<para>
+where COUNT is the number of bytes in the data stream occupied by this
+field, CONTENTS is the name of the type as given in
+<link linkend='Data_Types'>Section 4</link> or the value if
+this field contains a constant, and NAME is a description of this field.
+</para>
+<para>
+Objects containing counted lists use a lowercase single-letter variable (whose
+scope is limited to the request, reply, event, or error in which it is found)
+to represent the number of objects in the list.  These variables, and any
+expressions in which they are used, should be treated as unsigned integers.
+Multiple copies of an object are indicated by CONTENTS prefix
+<quote>LISTof</quote>.
+</para>
+<para>
+Unused bytes (whose value is undefined) will have a blank CONTENTS field and a
+NAME field of <quote>unused</quote>.  Zeroed bytes (whose value must be zero)
+will have a blank CONTENTS field and a NAME field of <quote>zero</quote>.
+The expression pad(e) refers to the number of bytes
+needed to round a value <quote>e</quote> up to the closed
+multiple of four:
+</para>
+<!-- .RS -->
+<literallayout class="monospaced">
+
+     pad(e) = (4 - (e mod 4)) mod 4
+</literallayout>
+
+<section id='Encoding::Data_Types'>
+<title>Data Types</title>
+<!-- .XS -->
+<!-- (SN Data Types -->
+<!-- .XE -->
+<literallayout class="monospaced">
+<link linkend="Data_Types:ACCESSCONTEXT"><type>ACCESSCONTEXT</type></link>
+4     <type>CARD32</type>                 access context
+
+      with at least one of the following bits set:
+
+        #x1fffffff
+
+      but none of the following bits set:
+
+        #xe0000000        zero
+
+
+<link linkend="Data_Types:ALTERNATESERVER"><type>ALTERNATESERVER</type></link>
+1     <type>BOOL</type>                   subset
+1     n                      length of name
+n     <type>STRING8</type>                name
+p                            unused, p=pad(n+2)
+
+<link linkend="Data_Types:AUTH"><type>AUTH</type></link>
+2     n                      length of name
+2     d                      length of data
+n     <type>STRING8</type>                name
+p                            unused, p=pad(n)
+d     <type>STRING8</type>                data
+q                            unused, q=pad(d)
+
+
+<link linkend="Data_Types:BITMAPFORMAT"><type>BITMAPFORMAT</type></link>
+4     <type>CARD32</type>                 value, union of the following bits:
+
+        #x00000001        ByteOrderMSB
+        #x00000002        BitOrderMSB
+        #x00000000        <constant>ImageRectMin</constant>
+        #x00000004        <constant>ImageRectMaxWidth</constant>
+        #x00000008        <constant>ImageRectMax</constant>
+        #x00000000        <constant>ScanlinePad8</constant>
+        #x00000100        <constant>ScanlinePad16</constant>
+        #x00000200        <constant>ScanlinePad32</constant>
+        #x00000300        <constant>ScanlinePad64</constant>
+        #x00000000        <constant>ScanlineUnit8</constant>
+        #x00001000        <constant>ScanlineUnit16</constant>
+        #x00002000        <constant>ScanlineUnit32</constant>
+        #x00003000        <constant>ScanlineUnit64</constant>
+
+      except for the following bits which must be zero:
+
+        #xffffccf0        zero
+
+      and the following of which at most one bit may be set:
+
+        #x0000000c        at most one bit can be set
+
+
+<link linkend="Data_Types:BITMAPFORMATMASK"><type>BITMAPFORMATMASK</type></link>
+4     <type>CARD32</type>                 value, mask of the following bits:
+
+        #x00000001        <constant>ByteOrderMask</constant>
+        #x00000002        <constant>BitOrderMask</constant>
+        #x00000004        <constant>ImageRectMask</constant>
+        #x00000008        <constant>ScanlinePadMask</constant>
+        #x00000010        <constant>ScanlineUnitMask</constant>
+
+      except for the following bits which must be zero:
+
+        #xffffffe0        zero
+
+<link linkend="Data_Types:BOOL"><type>BOOL</type></link>
+1     <type>BOOL</type>                   boolean, one of the following values:
+        0                 <constant>False</constant>
+        1                 <constant>True</constant>
+
+<link linkend="Data_Types:BYTE"><type>BYTE</type></link>
+1     <type>BYTE</type>                   unsigned byte of data
+
+<type>CARD8</type>
+1     <type>CARD8</type>                  8-bit unsigned integer
+
+<type>CARD16</type>
+2     <type>CARD16</type>                 16-bit unsigned integer
+
+<type>CARD32</type>
+4     <type>CARD32</type>                 32-bit unsigned integer
+
+<link linkend="Data_Types:CHAR2B"><type>CHAR2B</type></link>
+1     <type>CARD8</type>                  byte1
+1     <type>CARD8</type>                  byte2
+
+<link linkend="Data_Types:EVENTMASK"><type>EVENTMASK</type></link>
+4     <type>CARD32</type>                 event mask
+
+      for core events, this is union of the following bits:
+
+        #00000001         <constant>CatalogueListChangeMask</constant>
+        #00000002         <constant>FontListChangeMask</constant>
+
+      but none of the following bits set:
+
+        #fffffffc
+
+      extensions define their own sets of bits
+
+<link linkend="Data_Types:FONTID"><type>FONTID</type></link>
+4     <type>CARD32</type>                 font identifier
+
+      with at least one of the following bits set:
+
+        #x1fffffff
+
+      but none of the following bits set:
+
+        #xe0000000        zero
+
+<type>INT8</type>
+1     <type>INT8</type>                   8-bit signed integer
+
+<type>INT16</type>
+2     <type>INT16</type>                  16-bit signed integer
+
+<type>INT32</type>
+4     <type>INT32</type>                  32-bit signed integer
+
+<link linkend="Data_Types:OFFSET32"><type>OFFSET32</type></link>
+4     <type>CARD32</type>                 position (or integer value)
+4     <type>CARD32</type>                 length
+
+<link linkend="Data_Types:PROPINFO"><type>PROPINFO</type></link>
+4     n                      number of <type>PROPOFFSET</type> components
+4     m                      number of bytes of property data
+20*n  <type>PROPOFFSET</type>             property offsets into data block
+m     <type>LISTofBYTE</type>             property data block
+
+<link linkend="Data_Types:PROPOFFSET"><type>PROPOFFSET</type></link>
+8     <type>OFFSET32</type>               name in data block
+8     <type>OFFSET32</type>               value in data block
+1     <type>CARD8</type>                  type, one of the following values:
+        0                 <constant>String</constant>
+        1                 <constant>Unsigned</constant>
+        2                 <constant>Signed</constant>
+        3                 zero
+
+<link linkend="Data_Types:RANGE"><type>RANGE</type></link>
+2     <type>CHAR2B</type>                 minimum character code
+2     <type>CHAR2B</type>                 maximum character code
+
+<link linkend="Data_Types:RESOLUTION"><type>RESOLUTION</type></link>
+2     <type>CARD16</type>                 x resolution in pixels per inch
+2     <type>CARD16</type>                 y resolution in pixels per inch
+2     <type>CARD16</type>                 point size in decipoints
+
+STRNAME
+1     n                      length of name
+n     <type>STRING8</type>                name
+
+<link linkend="Data_Types:STRING8"><type>STRING8</type></link>
+n     <type>LISTofBYTE</type>             array of 8-bit character values
+
+<link linkend="Data_Types:TIMESTAMP"><type>TIMESTAMP</type></link>
+4     <type>CARD32</type>                 milliseconds since server time origin
+
+<link linkend="Data_Types:XCHARINFO"><type>XCHARINFO</type></link>
+2     <type>INT16</type>                  left bearing
+2     <type>INT16</type>                  right bearing
+2     <type>INT16</type>                  width
+2     <type>INT16</type>                  ascent
+2     <type>INT16</type>                  descent
+2     <type>CARD16</type>                 attributes
+
+<link linkend="Data_Types:XFONTINFO"><type>XFONTINFO</type></link>
+4     <type>CARD32</type>                 flags, union of the following bits:
+
+        #x00000001        <constant>AllCharactersExist</constant>
+        #x00000002        <constant>InkInside</constant>
+        #x00000004        <constant>HorizontalOverlap</constant>
+
+      but none of the following bits set:
+
+        #xfffffff8        zero
+
+4     <type>RANGE</type>                  range of characters in font
+1     <type>CARD8</type>                  drawing direction
+        0                 <constant>LeftToRight</constant>
+        1                 <constant>RightToLeft</constant>
+1                            unused
+2     <type>CHAR2B</type>                 default character
+12    <type>XCHARINFO</type>              minimum bounds
+12    <type>XCHARINFO</type>              maximum bounds
+2     <type>INT16</type>                  font ascent
+2     <type>INT16</type>                  font descent
+n     <type>PROPINFO</type>               property data
+</literallayout>
+</section>
+
+<section id='Encoding::Requests'>
+<title>Requests</title>
+<para><link linkend="Requests:open_connection"><emphasis role="bold">open connection</emphasis></link></para>
+<literallayout class="monospaced">
+1     <type>BYTE</type>                   byteorder, one of the values:
+        #x42              MostSignificant Byte first
+        #x6c              LeastSignificant Byte first
+1     <type>CARD8</type>                  numberof auth in auth-data
+2     2                      client-major-protocol-version
+2     0                      client-minor-protocol-version
+2     a/4 lengthof           auth-data
+a     <type>LISTofAUTH</type>             auth-data
+▶
+2     <type>CARD16</type>                 status
+        0                 <constant>Success</constant>
+        1                 <constant>Continue</constant>
+        2                 <constant>Busy</constant>
+        3                 <constant>Denied</constant>
+2     2                      major version
+2     0                      version
+1     <type>CARD8</type>                  numberof alternate-servers-hint
+1     <type>CARD8</type>                  authorization-index
+2     a/4                    lengthof alternate-servers-hint
+2     (d+q)/4                lengthof authorization-data
+a     <type>LISTofALTERNATESERVER</type>  alternate-servers-hint
+d     <type>LISTofBYTE</type>             authorization-data
+q                            unused, q=pad(d)
+</literallayout>
+
+<para>
+If STATUS is <constant>Busy</constant> or <constant>Denied</constant>, the protocol stops and the connection is
+closed. If STATUS is <constant>Continue</constant>, the client is expected to respond with
+additional data, to which the server responds with
+a new status value and more data. This dialog continues until the status
+is set to <constant>Success</constant>, or until the server sets STATUS to <constant>Busy</constant> or <constant>Denied</constant>
+and closes the connection:
+</para>
+
+<literallayout class="monospaced">
+◀
+4     1+(d+q)/4              length
+d     <type>LISTofBYTE</type>             more-authorization-data
+q                            unused, q=pad(d)
+▶
+4     2+(d+q)/4              length
+2     <type>CARD16</type>                 status
+        0                 <constant>Success</constant>
+        1                 <constant>Continue</constant>
+        2                 <constant>Busy</constant>
+        3                 <constant>Denied</constant>
+2                            unused
+d     <type>LISTofBYTE</type>             more-authorization-data
+q                            unused, q=pad(d)
+</literallayout>
+<para>
+When STATUS is <constant>Success</constant>, the protocol resumes with the following
+sent by the server:
+</para>
+
+<literallayout class="monospaced">
+4     3+(v+w)/4              length of rest of data
+2     <type>CARD16</type>                 maximum-request-length
+2     v                      length of vendor string
+4     <type>CARD32</type>                 release-number
+v     <type>STRING8</type>                vendor-string
+w                            unused, w=pad(v)
+</literallayout>
+<para>
+Once the connection has been established, the client may send the
+following requests:
+</para>
+
+<literallayout class="monospaced">
+<link linkend="Requests:NoOp"><emphasis role="bold"><function>NoOp</function></emphasis></link>
+1   0                        major-opcode
+1                            unused
+2   1                        length
+
+<link linkend="Requests:ListExtensions"><emphasis role="bold"><function>ListExtensions</function></emphasis></link>
+1   1                        major-opcode
+1                            unused
+2   1                        length
+▶
+1   0                        type reply
+1   <type>CARD8</type>                    numberof names
+2   <type>CARD16</type>                   sequence-number
+4   2+(n+p)/4                length
+n   LISTofSTRNAME            names
+p                            unused, p=pad(n)
+
+<link linkend="Requests:QueryExtension"><emphasis role="bold"><function>QueryExtension</function></emphasis></link>
+1   2                        major-opcode
+1   n                        length of name
+2   1+(n+p)/4                length
+n   <type>STRING8</type>                  name
+p                            unused, p=pad(n)
+▶
+1   0                        type reply
+1   <type>BOOL</type>                     present
+2   <type>CARD16</type>                   sequence-number
+4   5                        length
+2   <type>CARD16</type>                   major-version
+2   <type>CARD16</type>                   minor-version
+1   <type>CARD8</type>                    major-opcode
+1   <type>CARD8</type>                    first-event
+1   <type>CARD8</type>                    number-events
+1   <type>CARD8</type>                    first-error
+1   <type>CARD8</type>                    number-errors
+3                            unused
+
+<link linkend="Requests:ListCatalogues"><emphasis role="bold"><function>ListCatalogues</function></emphasis></link>
+1   3                        major-opcode
+1                            unused
+2   3+(n+p)/4                length
+4   <type>CARD32</type>                   max-names
+2   n                        length of pattern
+2                            unused
+n   <type>STRING8</type>                  pattern
+p                            unused, p=pad(n)
+▶+
+1   0                        type reply
+1                            unused
+2   <type>CARD16</type>                   sequence-number
+4   4+(n+p)/4                length
+4   <type>CARD32</type>                   replies-following-hint
+4   <type>CARD32</type>                   numberof catalogue-names
+n   LISTofSTRNAME            catalogue-names
+p                            unused, p=pad(n)
+
+<link linkend="Requests:SetCatalogues"><emphasis role="bold"><function>SetCatalogues</function></emphasis></link>
+1   4                        major-opcode
+1   <type>CARD8</type>                    numberof catalogue-names
+2   1+(n+p)/4                length
+n   LISTofSTRNAME            catalogue-names
+p                            unused, p=pad(n)
+
+<link linkend="Requests:GetCatalogues"><emphasis role="bold"><function>GetCatalogues</function></emphasis></link>
+1   5                        major-opcode
+1                            unused
+2   1                        length
+▶
+1   0                        type reply
+1   <type>CARD8</type>                    numberof catalogue-names
+2   <type>CARD16</type>                   sequence-number
+4   2+(n+p)/4                length
+n   LISTofSTRNAME            catalogue-names
+p                            unused, p=pad(n)
+
+<link linkend="Requests:SetEventMask"><emphasis role="bold"><function>SetEventMask</function></emphasis></link>
+1   6                        major-opcode
+1   <type>CARD8</type>                    extension-opcode
+2   2                        length
+4   <type>EVENTMASK</type>                event-mask
+
+<link linkend="Requests:GetEventMask"><emphasis role="bold"><function>GetEventMask</function></emphasis></link>
+1   7                        major-opcode
+1   <type>CARD8</type>                    extension-opcode
+2   1                        length
+▶
+1   0                        type reply
+1                            unused
+2   <type>CARD16</type>                   sequence-number
+4   3                        length
+4   <type>EVENTMASK</type>                event-mask
+
+<link linkend="Requests:CreateAC"><emphasis role="bold"><function>CreateAC</function></emphasis></link>
+1   8                        major-opcode
+1   <type>CARD8</type>                    numberof authorization-protocols
+2   2+a/4                    length
+4   <type>ACCESSCONTEXT</type>            ac
+a   <type>LISTofAUTH</type>               authorization-protocols
+▶
+1   0                        type reply
+1   <type>CARD8</type>                    authorization-index
+2   <type>CARD16</type>                   sequence-number
+4   3+(d+q)/4                length
+2   <type>CARD16</type>                   status
+        0                    <constant>Success</constant>
+        1                    <constant>Continue</constant>
+        2                    <constant>Busy</constant>
+        3                    <constant>Denied</constant>
+2                            unused
+d   <type>LISTofBYTE</type>               authorization-data
+q                            unused, q=pad(d)
+</literallayout>
+
+<para>
+If STATUS is <constant>Continue</constant>, the client is expected to respond with additional
+data, to which the server
+responds with a new status value and more data. This dialog continues
+until the status is set to
+<constant>Success</constant>, <constant>Busy</constant>, or <constant>Denied</constant> at which point the request is finished.
+</para>
+
+<literallayout class="monospaced">
+◀
+4   1+(d+q)/4                length
+d   <type>LISTofBYTE</type>               more-authorization-data
+q                            unused, q=pad(d)
+▶
+4   2+(d+q)/4                length
+2   <type>CARD16</type>                   status
+        0                    <constant>Success</constant>
+        1                    <constant>Continue</constant>
+        2                    <constant>Busy</constant>
+        3                    <constant>Denied</constant>
+2                            unused
+d   <type>LISTofBYTE</type>               authorization-data
+q                            unused, q=pad(d)
+
+<link linkend="Requests:FreeAC"><emphasis role="bold"><function>FreeAC</function></emphasis></link>
+1   9                        major-opcode
+1                            unused
+2   2                        length
+4   <type>ACCESSCONTEXT</type>            ac
+
+<link linkend="Requests:SetAuthorization"><emphasis role="bold"><function>SetAuthorization</function></emphasis></link>
+1   10                       major-opcode
+1                            unused
+2   2                        length
+4   <type>ACCESSCONTEXT</type>            ac
+
+<link linkend="Requests:SetResolution"><emphasis role="bold"><function>SetResolution</function></emphasis></link>
+1   11                       major-opcode
+1   n                        number of resolutions
+2   1+(6*n+p)/4              length
+6*n <type>LISTofRESOLUTION</type>         resolutions
+p   p=pad(6*n)
+
+<link linkend="Requests:GetResolution"><emphasis role="bold"><function>GetResolution</function></emphasis></link>
+1   12                       major-opcode
+1                            unused
+2   1                        length
+▶
+1   0                        type reply
+1   n                        number of resolutions
+2   <type>CARD16</type>                   sequence-number
+4   2+(6*n+p)/4              length
+6*n <type>LISTofRESOLUTION</type>         resolutions
+p   p=pad(6*n)
+
+<link linkend="Requests:ListFonts"><emphasis role="bold"><function>ListFonts</function></emphasis></link>
+1   13                       major-opcode
+1                            unused
+2   3+(n+p)/4                length
+4   <type>CARD32</type>                   max-names
+2   n                        length of pattern
+2                            unused
+n   <type>STRING8</type>                  pattern
+p                            unused, p=pad(n)
+▶+
+1   0                        type reply
+1                            unused
+2   <type>CARD16</type>                   sequence-number
+4   4+(n+p)/4                length
+4   <type>CARD32</type>                   replies-following-hint
+4   <type>CARD32</type>                   numberof font-names
+n   LISTofSTRNAME            font-names
+p                            unused, p=pad(n)
+
+<link linkend="Requests:ListFontsWithXInfo"><emphasis role="bold"><function>ListFontsWithXInfo</function></emphasis></link>
+1   14                       major-opcode
+1                            unused
+2   3+(n+p)/4                length
+4   <type>CARD32</type>                   max-names
+2   n                        length of pattern
+2                            unused
+n   <type>STRING8</type>                  pattern
+p                            unused, p=pad(n)
+▶+ (except for last in series)
+1   0                        type reply
+1   n                        length of name
+2   <type>CARD16</type>                   sequence-number
+4   3+(n+p+f)/4              length
+4   <type>CARD32</type>                   replies-hint
+f   <type>XFONTINFO</type>                fontinfo
+n   <type>STRING8</type>                  name
+p                            unused, p=pad(n)
+▶ (last in series)
+1   0                        type reply
+1   0                        last-reply indicator
+2   <type>CARD16</type>                   sequence-number
+4   2                        reply length
+
+<link linkend="Requests:OpenBitmapFont"><emphasis role="bold"><function>OpenBitmapFont</function></emphasis></link>
+1   15                       major-opcode
+1                            unused
+2   4+(n+p)/4                length
+4   <type>FONTID</type>                   fontid
+4   <type>BITMAPFORMATMASK</type>         format-mask
+4   <type>BITMAPFORMAT</type>             format
+n   STRNAME                  pattern
+p                            unused, p=pad(n)
+▶
+1   0                        type reply
+1   <type>BOOL</type>                     otherid-valid
+2   <type>CARD16</type>                   sequence-number
+4   4                        length
+4   <type>FONTID</type>                   otherid
+1   <type>BOOL</type>                     cachable
+3                            unused
+
+<link linkend="Requests:QueryXInfo"><emphasis role="bold"><function>QueryXInfo</function></emphasis></link>
+1   16                       major-opcode
+1                            unused
+2   2                        length
+4   <type>FONTID</type>                   fontid
+▶
+1   0                        type reply
+1                            unused
+2   <type>CARD16</type>                   sequence-number
+4   2+f/4                    length
+f   <type>XFONTINFO</type>                fontinfo
+p                            unused, p=pad(f)
+
+<link linkend="Requests:QueryXExtents8"><emphasis role="bold"><function>QueryXExtents8</function></emphasis></link>
+1   17                       major-opcode
+1   <type>BOOL</type>                     range
+2   3+(n+p)/4                length
+4   <type>FONTID</type>                   fontid
+4   n                        number chars entries
+n   <type>STRING8</type>                  chars
+p                            unused, p=pad(n)
+▶
+1   0                        type reply
+1                            unused
+2   <type>CARD16</type>                   sequence-number
+4   3+3*n                    length
+4   n                        number of extents
+12*n <type>LISTofXCHARINFO</type>         extents
+
+<link linkend="Requests:QueryXExtents16"><emphasis role="bold"><function>QueryXExtents16</function></emphasis></link>
+1   18                       major-opcode
+1   <type>BOOL</type>                     range
+2   3+(2*n+p)/4              length
+4   <type>FONTID</type>                   fontid
+4   n                        number chars entries
+2*n                          <type>LISTofCHAR2B</type> chars
+p                            unused, p=pad(2*n)
+▶
+1   0                        type reply
+1                            unused
+2   <type>CARD16</type>                   sequence-number
+4   3+3*n                    length
+4   n                        number of extents
+12*n <type>LISTofXCHARINFO</type>         extents
+
+<link linkend="Requests:QueryXBitmaps8"><emphasis role="bold"><function>QueryXBitmaps8</function></emphasis></link>
+1   19                       major-opcode
+1   <type>BOOL</type>                     range
+2   4+(n+p)/4                length
+4   <type>FONTID</type>                   fontid
+4   <type>BITMAPFORMAT</type>             format
+4   n                        number of chars entries
+n   <type>STRING8</type>                  chars
+p                            unused, p=pad(n)
+▶+
+1   0                        type reply
+1                            unused
+2   <type>CARD16</type>                   sequence-number
+4   5+2*n+(m+p)/4            length
+4   <type>CARD32</type>                   replies-following-hint
+4   n                        number of offsets
+4   m                        number of bytes of glyph images
+8*n <type>LISTofOFFSET32</type>           offsets
+m   <type>LISTofBYTE</type>               glyphimages
+p                            unused, p=pad(m)
+
+<link linkend="Requests:QueryXBitmaps16"><emphasis role="bold"><function>QueryXBitmaps16</function></emphasis></link>
+1   20                       major-opcode
+1   <type>BOOL</type>                     range
+2   4+(2*n+p)/4              length
+4   <type>FONTID</type>                   fontid
+4   <type>BITMAPFORMAT</type>             format
+4   n                        number of chars entries
+2*n <type>LISTofCHAR2B</type>             chars
+p                            unused, p=pad(2*n)
+▶
+1   0                        type reply
+1                            unused
+2   <type>CARD16</type>                   sequence-number
+4   5+2*n+(m+p)/4            length
+4   <type>CARD32</type>                   replies-following-hint
+4   n                        number of offsets
+4   m                        number of bytes of glyph images
+8*n <type>LISTofOFFSET32</type>           offsets
+m   <type>LISTofBYTE</type>               glyphimages
+p                            unused, p=pad(m)
+
+<link linkend="Requests:CloseFont"><emphasis role="bold"><function>CloseFont</function></emphasis></link>
+1   21                       major-opcode
+1                            unused
+2   2                        length
+4   <type>FONTID</type>                   fontid
+</literallayout>
+</section>
+
+<section id='Encoding::Errors'>
+<title>Errors</title>
+<literallayout class="monospaced">
+
+<link linkend="Errors:Request"><emphasis role="bold"><errorname>Request</errorname></emphasis></link>
+1   1                        type error
+1   0                        <errorname>Request</errorname>
+2   <type>CARD16</type>                   sequence-number
+4   4                        length
+4   <type>TIMESTAMP</type>                timestamp
+1   <type>CARD8</type>                    major-opcode
+1   <type>CARD8</type>                    minor-opcode
+2                            unused
+
+<link linkend="Errors:Format"><emphasis role="bold"><errorname>Format</errorname></emphasis></link>
+1   1                        type error
+1   1                        <errorname>Format</errorname>
+2   <type>CARD16</type>                   sequence-number
+4   5                        length
+4   <type>TIMESTAMP</type>                timestamp
+1   <type>CARD8</type>                    major-opcode
+1   <type>CARD8</type>                    minor-opcode
+2                            unused
+4   <type>BITMAPFORMAT</type>             bad-format
+
+<link linkend="Errors:Font"><emphasis role="bold"><errorname>Font</errorname></emphasis></link>
+1   1                        type error
+1   2                        <errorname>Font</errorname>
+2   <type>CARD16</type>                   sequence-number
+4   5                        length
+4   <type>TIMESTAMP</type>                timestamp
+1   <type>CARD8</type>                    major-opcode
+1   <type>CARD8</type>                    minor-opcode
+2                            unused
+4   <type>FONTID</type>                   bad-fontid
+
+<link linkend="Errors:Range"><emphasis role="bold"><errorname>Range</errorname></emphasis></link>
+1   1                        type error
+1   3                        <errorname>Range</errorname>
+2   <type>CARD16</type>                   sequence-number
+4   5                        length
+4   <type>TIMESTAMP</type>                timestamp
+1   <type>CARD8</type>                    major-opcode
+1   <type>CARD8</type>                    minor-opcode
+2                            unused
+4   <type>RANGE</type>                    bad-range
+
+<link linkend="Errors:EventMask"><emphasis role="bold"><errorname>EventMask</errorname></emphasis></link>
+1   1                        type error
+1   4                        <errorname>EventMask</errorname>
+2   <type>CARD16</type>                   sequence-number
+4   5                        length
+4   <type>TIMESTAMP</type>                timestamp
+1   <type>CARD8</type>                    major-opcode
+1   <type>CARD8</type>                    minor-opcode
+2                            unused
+4   <type>EVENTMASK</type>                event-mask
+
+<link linkend="Errors:AccessContext"><emphasis role="bold"><errorname>AccessContext</errorname></emphasis></link>
+1   1                        type error
+1   5                        <errorname>AccessContext</errorname>
+2   <type>CARD16</type>                   sequence-number
+4   5                        length
+4   <type>TIMESTAMP</type>                timestamp
+1   <type>CARD8</type>                    major-opcode
+1   <type>CARD8</type>                    minor-opcode
+2                            unused
+4   <type>ACCESSCONTEXT</type>            access context
+
+<link linkend="Errors:IDChoice"><emphasis role="bold"><errorname>IDChoice</errorname></emphasis></link>
+1   1                        type error
+1   6                        <errorname>IDChoice</errorname>
+2   <type>CARD16</type>                   sequence-number
+4   5                        length
+4   <type>TIMESTAMP</type>                timestamp
+1   <type>CARD8</type>                    major-opcode
+1   <type>CARD8</type>                    minor-opcode
+2                            unused
+4   <type>FONTID</type>                   bad-fontid
+
+<link linkend="Errors:Name"><emphasis role="bold"><errorname>Name</errorname></emphasis></link>
+1   1                        type error
+1   7                        <errorname>Name</errorname>
+2   <type>CARD16</type>                   sequence-number
+4   4                        length
+4   <type>TIMESTAMP</type>                timestamp
+1   <type>CARD8</type>                    major-opcode
+1   <type>CARD8</type>                    minor-opcode
+2                            unused
+
+<link linkend="Errors:Resolution"><emphasis role="bold"><errorname>Resolution</errorname></emphasis></link>
+1   1                        type error
+1   8                        <errorname>Resolution</errorname>
+2   <type>CARD16</type>                   sequence-number
+4   5                        length
+4   <type>TIMESTAMP</type>                timestamp
+1   <type>CARD8</type>                    major-opcode
+1   <type>CARD8</type>                    minor-opcode
+6   <type>RESOLUTION</type>               resolution
+
+<link linkend="Errors:Alloc"><emphasis role="bold"><errorname>Alloc</errorname></emphasis></link>
+1   1                        type error
+1   9                        <errorname>Alloc</errorname>
+2   <type>CARD16</type>                   sequence-number
+4   4                        length
+4   <type>TIMESTAMP</type>                timestamp
+1   <type>CARD8</type>                    major-opcode
+1   <type>CARD8</type>                    minor-opcode
+2                            unused
+
+<link linkend="Errors:Length"><emphasis role="bold"><errorname>Length</errorname></emphasis></link>
+1   1                        type error
+1   10                       <errorname>Length</errorname>
+2   <type>CARD16</type>                   sequence-number
+4   5                        length
+4   <type>TIMESTAMP</type>                timestamp
+1   <type>CARD8</type>                    major-opcode
+1   <type>CARD8</type>                    minor-opcode
+2                            unused
+4   <type>CARD32</type>                   bad-length
+
+<link linkend="Errors:Implementation"><emphasis role="bold"><errorname>Implementation</errorname></emphasis></link>
+1   1                        type error
+1   11                       <errorname>Implementation</errorname>
+2   <type>CARD16</type>                   sequence-number
+4   4                        length
+4   <type>TIMESTAMP</type>                timestamp
+1   <type>CARD8</type>                    major-opcode
+1   <type>CARD8</type>                    minor-opcode
+2                            unused
+
+</literallayout>
+</section>
+
+<section id='Encoding::Events'>
+<title>Events</title>
+<literallayout class="monospaced">
+<link linkend="Events:KeepAlive"><emphasis role="bold"><function>KeepAlive</function></emphasis></link>
+1   2                        type event
+1   0                        event KeepAlive
+2   <type>CARD16</type>                   sequence-number
+4   3                        length
+4   <type>TIMESTAMP</type>                timestamp
+
+<link linkend="Events:CatalogueListNotify"><emphasis role="bold"><function>CatalogueListNotify</function></emphasis></link>
+1   2                        type event
+1   1                        event CatalogueListNotify
+2   <type>CARD16</type>                   sequence-number
+4   4                        length
+4   <type>TIMESTAMP</type>                timestamp
+1   <type>BOOL</type>                     added
+1   <type>BOOL</type>                     deleted
+2                            unused
+
+<link linkend="Events:FontListNotify"><emphasis role="bold"><function>FontListNotify</function></emphasis></link>
+1   2                        type event
+1   2                        event FontListNotify
+2   <type>CARD16</type>                   sequence-number
+4   4                        length
+4   <type>TIMESTAMP</type>                timestamp
+1   <type>BOOL</type>                     added
+1   <type>BOOL</type>                     deleted
+2                            unused
+
+</literallayout>
+</section>
+</chapter>
+
+<chapter id='Acknowledgements'>
+<title>Acknowledgements</title>
+<!-- .XS -->
+<!-- (SN Acknowledgements -->
+<!-- .XE -->
+<para>
+This document represents the culmination of several years of debate and
+experiments done under the auspices of the
+<orgname class="consortium">MIT X Consortium</orgname> font working group.
+Although this was a group effort, the author remains responsible for any errors
+or omissions.  The protocol presented here was primarily designed by
+<personname><firstname>Jim</firstname><surname>Fulton</surname></personname>,
+<personname><firstname>Keith</firstname><surname>Packard</surname></personname>,
+and
+<personname><firstname>Bob</firstname><surname>Scheifler</surname></personname>.
+Special thanks goes to
+<personname><firstname>Ned</firstname><surname>Batchelder</surname></personname>,
+<personname><firstname>Jim</firstname><surname>Flowers</surname></personname>,
+and
+<personname><firstname>Axel</firstname><surname>Deininger</surname></personname>
+for their invigorating comments
+which never failed to make this a better document.
+<personname><firstname>Stephen</firstname><surname>Gildea</surname></personname>
+edited version 2 of this document.  Finally,
+<personname><firstname>David</firstname><surname>Lemke</surname></personname>
+deserves great credit for designing and coding the sample implementation.
+</para>
+</chapter>
+
+<bibliography id='References'>
+<title>References</title>
+<para>
+All of the following documents are X Consortium standards available from
+the X Consortium.
+</para>
+<biblioentry id='References:x11proto'>
+  <abbrev>1</abbrev>
+  <title>X Window System Protocol Version 11</title>
+  <author><firstname>Robert W.</firstname><surname>Scheifler</surname></author>
+</biblioentry>
+
+<biblioentry id='References:bdf-spec'>
+  <abbrev>2</abbrev>
+  <corpauthor>Adobe Systems</corpauthor>
+  <title>Bitmap Distribution Format 2.1</title>
+</biblioentry>
+
+<biblioentry id='References:xlfd-spec'>
+  <abbrev>3</abbrev>
+  <corpauthor>X Consortium</corpauthor>
+  <title>X Logical Font Description Conventions, Version 1.5</title>
+</biblioentry>
+
+</bibliography>
+
+<appendix id="suggested_licensing_policies">
+<title>Suggested Licensing Policies</title>
+<para>
+The authorization data passed by the client in the initial connection
+setup information may be used by the font server to implement restrictions
+on which fonts may be accessed.  Furthermore, the font server is free to
+refuse new connections at any time.
+</para>
+<para>
+Configuration or management of the license restrictions is outside the scope of
+the font service protocol and is done in a server-dependent manner.  Possible
+policies might include, but are not limited to, combinations of the following:
+
+<variablelist>
+  <?dbhtml list-presentation="list"?>
+  <varlistentry>
+    <term>No restrictions</term>
+  <listitem>
+    <para>
+anyone may access any fonts.  The server neither refuses any connections
+nor generates <link linkend="Errors:AccessContext"><errorname>AccessContext</errorname></link> errors on any
+fonts.  For environments without specially-licensed fonts, this is
+sufficient.
+    </para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Per-machine</term>
+  <listitem>
+    <para>
+only those clients connecting from a known set of
+machines are permitted access.  The server could get the address
+of the connection and look in a list of allowed machines.
+    </para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Per-user</term>
+  <listitem>
+    <para>
+only a known set of users may access the fonts.  The
+server can use the authorization data (such as a Kerberos ticket
+or a Secure RPC credential) to verify the identity of the user
+and then look in a list of allowed users.
+    </para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Simultaneous Use</term>
+  <listitem>
+    <para>
+only a certain number of clients may use a given font at any one time.
+Additional clients would receive <link linkend="Errors:AccessContext"><errorname>AccessContext</errorname></link>
+errors if they attempt to open the font.  This is only effective if
+the initial clients keep the font open for the entire time that it
+is being used (even if all of the data has been transmitted and is
+being cached).
+    </para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Postage Meter</term>
+  <listitem>
+    <para>
+a particular font may only be accessed a limited
+number of times before its license must be renewed.  Each time
+the font is opened, the server decrements a counter.  When the
+counter reaches zero, all further attempts to open the font
+return an <link linkend="Errors:AccessContext"><errorname>AccessContext</errorname></link> error.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</para>
+
+<para>
+It should be noted that chaining of font servers (obtaining font data from
+other font servers) may conflict with certain license policies.
+</para>
+</appendix>
+
+<appendix id="implementation_suggestions">
+<title>Implementation Suggestions</title>
+<para>
+Font server implementations will probably wish to use techniques such as the
+following to avoid limits on the number of simultaneous connections:
+</para>
+<itemizedlist>
+  <listitem>
+    <para>
+The initial connection information returned by the font
+server contains the names of other font servers that
+may be used as substitutes.  A font server may refuse to
+accept a connection, indicating that the client should
+try one of the alternatives instead.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+On operating systems that support processing forking, font
+servers might choose to fork so that the child can continue
+processing the existing connections and the parent can accept
+new connections.  Such implementations are encouraged to use
+shared memory so that in-memory font databases can be shared.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+On operating systems that support passing stream file descriptors
+between processes, cooperating font servers could collect
+connections in a single process when there are few connections
+and spread them among several processes as the load increases.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If a font client is unable to connect to a server (as opposed
+to having the connection terminated), it should retry for an
+implementation-dependent length of time (see Xlib's
+handling of ECONNREFUSED in XConnDis.c).
+    </para>
+  </listitem>
+</itemizedlist>
+</appendix>
+<index id="index" />
+</book>
Index: proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/fontsproto
===================================================================
--- proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/fontsproto	(nonexistent)
+++ proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/fontsproto	(revision 5)

Property changes on: proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/fontsproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/scrnsaverproto/saver.xml
===================================================================
--- proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/scrnsaverproto/saver.xml	(nonexistent)
+++ proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/scrnsaverproto/saver.xml	(revision 5)
@@ -0,0 +1,943 @@
+<?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"
+[
+<!ENTITY % defs SYSTEM "defs.ent"> %defs;
+]>
+
+<book id="saver">
+
+<bookinfo>
+   <title>X11 Screen Saver Extension</title>
+   <subtitle>MIT X Consortium Proposed Standard</subtitle>
+   <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
+   <releaseinfo>Version 1.0</releaseinfo>
+   <authorgroup>
+     <author>
+      <firstname>Jim</firstname><surname>Fulton</surname>
+      <affiliation><orgname>Network Computing Devices, Inc</orgname></affiliation>
+     </author>
+     <author>
+      <firstname>Keith</firstname><surname>Packard</surname>
+      <affiliation><orgname>
+X Consortium, Laboratory for Computer Science, Massachusetts Institute of Technology
+      </orgname></affiliation>
+     </author>
+   </authorgroup>
+
+   <copyright><year>1992</year>
+     <holder>Massachusetts Institute of Technology</holder>
+     <holder>Network Computing Devices, Inc</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.  MIT and
+Network Computing Devices, Inc. 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 X Window System provides support for changing the image on a display screen
+after a user-settable period of inactivity to avoid burning the cathode ray
+tube phosphors.  However, no interfaces are provided for the user to control
+the image that is drawn.  This extension allows an external "screen saver"
+client to detect when the alternate image is to be displayed and to provide the
+graphics.
+</para>
+<para>
+Current X server implementations typically provide at least one form of
+"screen saver" image.  Historically, this has been a copy of the X logo
+drawn against the root background pattern.  However, many users have asked
+for the mechanism to allow them to write screen saver programs that provide
+capabilities similar to those provided by other window systems.  In
+particular, such users often wish to be able to display corporate logos,
+instructions on how to reactivate the screen, and automatic screen-locking
+utilities.  This extension provides a means for writing such clients.
+</para>
+</chapter>
+
+<chapter id="Assumptions">
+<title>Assumptions</title>
+<para>
+This extension exports the notion of a special screen saver window that is
+mapped above all other windows on a display.  This window has the
+<emphasis remap='I'>override-redirect</emphasis> attribute set so that it is not subject to manipulation by
+the window manager.  Furthermore, the X identifier for the window is never
+returned by <function>QueryTree</function> requests on the root window, so it is typically
+not visible to other clients.
+</para>
+</chapter>
+
+<chapter id="Overview">
+<title>Overview</title>
+<para>
+The core
+<function>SetScreenSaver</function>
+request can be used to set the length of time without
+activity on any input devices after which the screen saver should "activate"
+and alter the image on the screen.  This image periodically "cycles" to
+reduce
+the length of time that any particular pixel is illuminated.  Finally, the
+screen saver is "deactivated" in response to activity on any of the input
+devices
+or particular X requests.
+</para>
+
+<para>
+Screen saving is typically done by disabling video output to the display tube
+or by drawing a changing pattern onto the display.  If the server chooses the
+latter approach, a window with a special identifier is created and mapped at
+the top of the stacking order where it remains until the screen saver
+deactivates.  At this time, the window is unmapped and is not accessible to any
+client requests.
+</para>
+<para>
+The server's default mechanism is referred to as the <emphasis remap='I'>internal</emphasis> screen
+saver.  An <emphasis remap='I'>external</emphasis>
+screen saver client requires a means of determining the window
+id for the screen saver window and setting the attributes (e.g. size,
+location, visual, colormap) to be used when the window is mapped.  These
+requirements form the basis of this extension.
+</para>
+</chapter>
+
+<chapter id="Issues">
+<title>Issues</title>
+<para>
+This extension raises several interesting issues.  First is the question of
+what should be done if some other client has the server grabbed when the screen
+saver is supposed to activate?  This commonly occurs with window managers that
+automatically ask the user to position a window when it is first mapped by
+grabbing the server and drawing XORed lines on the root window.
+</para>
+<para>
+Second, a screen saver program must control the actual RGB values sent to the
+display tube to ensure that the values change periodically to avoid phosphor
+burn in.  Thus, the client must have a known colormap installed whenever the
+screen saver window is displayed.  To prevent screen flashing, the visual type
+of the screen saver window should also be controllable.
+</para>
+<para>
+Third, some implementations may wish to destroy the screen saver window when
+it is not mapped so that it need not be avoided during event delivery.  Thus,
+screen saver clients may find that the requests that reference the screen
+saver window may fail when the window is not displayed.
+</para>
+</chapter>
+
+<chapter id="Protocol">
+<title>Protocol</title>
+<para>
+The Screen Saver extension is as follows:
+</para>
+
+<sect1 id="Types">
+<title>Types</title>
+<para>
+In addition to the common types described in the core protocol, the following
+type is used in the request and event definitions in subsequent sections.
+</para>
+
+<informaltable frame="topbot">
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth="1.0*"/>
+  <colspec colname='c2' colwidth="1.5*"/>
+  <thead>
+    <row rowsep='1'>
+      <entry>Name</entry>
+      <entry>Value</entry>
+    </row>
+  </thead>
+  <tbody>
+    <row>
+      <entry>SCREENSAVEREVENT</entry>
+      <entry><emphasis role="bold">ScreenSaverNotify</emphasis>,
+      <emphasis role="bold">ScreenSaverCycle</emphasis></entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+</sect1>
+
+<sect1 id="Errors">
+<title>Errors</title>
+<para>
+The Screen Saver extension adds no errors beyond the core protocol.
+</para>
+</sect1>
+
+<sect1 id="Requests">
+<title>Requests</title>
+<para>
+The Screen Saver extension adds the following requests:
+</para>
+
+<literallayout>
+<emphasis role="bold">ScreenSaverQueryVersion</emphasis>
+     client-major-version: CARD8
+     client-minor-version: CARD8
+->
+     server-major-version: CARD8
+     server-minor-version: CARD8
+</literallayout>
+
+<para>
+This request allows the client and server to determine which version of
+the protocol should be used.  The client sends the version that it
+prefers; if the server understands that
+version, it returns the same values and interprets subsequent requests
+for this extension according to the specified version.  Otherwise,
+the server returns the closest version of the protocol that it can
+support and interprets subsequent requests according to that version.
+This document describes major version 1, minor version 0; the major
+and minor revision numbers should only be incremented in response to
+incompatible and compatible changes, respectively.
+</para>
+
+<literallayout>
+<emphasis role="bold">ScreenSaverQueryInfo</emphasis>
+<emphasis>drawable</emphasis> DRAWABLE
+
+saver-window: WINDOW
+state: {<emphasis role="bold">Disabled</emphasis>, <emphasis role="bold">Off</emphasis>, <emphasis role="bold">On</emphasis>}
+kind: {<emphasis role="bold">Blanked</emphasis>, <emphasis role="bold">Internal</emphasis>, <emphasis role="bold">External</emphasis>}
+til-or-since: CARD32
+idle: CARD32
+event-mask: SETofSCREENSAVEREVENT
+
+Errors: <emphasis role="bold">Drawable</emphasis>
+</literallayout>
+
+<para>
+This request returns information about the state of the screen
+saver on the screen associated with <emphasis remap='I'>drawable</emphasis>.  The <emphasis remap='I'>saver-window</emphasis>
+is the XID that is associated with the screen saver window.  This
+window is not guaranteed to exist
+except when external screen saver is active.  Although it is a
+child of the root, this window is not returned by
+<function>QueryTree</function>
+requests on the root.  Whenever this window is mapped, it is always above
+any of its siblings in the stacking order.  XXX - TranslateCoords?
+</para>
+<para>
+The <emphasis remap='I'>state</emphasis> field specifies whether or not the screen saver is currently
+active and how the <emphasis remap='I'>til-or-since</emphasis> value should be interpreted:
+</para>
+
+<informaltable frame="none">
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth="1.0*"/>
+  <colspec colname='c2' colwidth="5.0*"/>
+  <tbody>
+    <row>
+      <entry><emphasis role="bold">Off</emphasis></entry>
+      <entry>
+The screen is not currently being saved;
+<emphasis remap='I'>til-or-since</emphasis>
+specifies the number of milliseconds until the screen saver is expected to
+activate.
+      </entry>
+    </row>
+    <row>
+      <entry><emphasis role="bold">On</emphasis></entry>
+      <entry>
+The screen is currently being saved;
+<emphasis remap='I'>til-or-since</emphasis> specifies
+the number of milliseconds since the screen saver activated.
+      </entry>
+    </row>
+    <row>
+      <entry><emphasis role="bold">Disabled</emphasis></entry>
+      <entry>
+The screen saver is currently disabled;
+<emphasis remap='I'>til-or-since</emphasis> is zero.
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The <emphasis remap='I'>kind</emphasis> field specifies the mechanism that either is currently being
+used or would have been were the screen being saved:
+</para>
+
+<informaltable frame="none">
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth="1.0*"/>
+  <colspec colname='c2' colwidth="5.0*"/>
+  <tbody>
+    <row>
+      <entry><emphasis role="bold">Blanked</emphasis></entry>
+      <entry>The video signal to the display monitor was disabled.</entry>
+    </row>
+    <row>
+      <entry><emphasis role="bold">Internal</emphasis></entry>
+      <entry>A server-dependent, built-in screen saver image was displayed; either no
+      client had set the screen saver window attributes or a different client
+      had the server grabbed when the screen saver activated.</entry>
+    </row>
+    <row>
+      <entry><emphasis role="bold">External</emphasis></entry>
+      <entry>The screen saver window was mapped with attributes set by a
+      client using the <function>ScreenSaverSetAttributes</function> request.</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The <emphasis remap='I'>idle</emphasis> field specifies the number of milliseconds since the last
+input was received from the user on any of the input devices.
+</para>
+
+<para>
+The <emphasis remap='I'>event-mask</emphasis> field specifies which, if any, screen saver
+events this client has requested using <function>ScreenSaverSelectInput</function>.
+</para>
+
+<para>
+If <emphasis remap='I'>drawable</emphasis> is not a valid drawable identifier, a Drawable
+error is returned and the request is ignored.
+</para>
+
+<literallayout>
+<emphasis role="bold">ScreenSaverSelectInput</emphasis>
+drawable: DRAWABLE
+event-mask: SETofSCREENSAVEREVENT
+</literallayout>
+
+<para>
+Errors:
+<emphasis role="bold">Drawable</emphasis>,
+<emphasis role="bold">Match</emphasis>
+</para>
+
+<para>
+This request specifies which Screen Saver extension events on the screen
+associated with <emphasis remap='I'>drawable</emphasis> should be generated for this client.  If
+no bits are set in <emphasis remap='I'>event-mask</emphasis>, then no events will be generated.
+Otherwise, any combination of the following bits may be set:
+</para>
+
+<informaltable frame="none">
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth="1.0*"/>
+  <colspec colname='c2' colwidth="3.0*"/>
+  <tbody>
+    <row>
+      <entry><emphasis role="bold">ScreenSaverNotify</emphasis></entry>
+      <entry>
+If this bit is set, <emphasis role="bold">ScreenSaverNotify</emphasis> events are generated whenever
+the screen saver is activated or deactivated.
+      </entry>
+    </row>
+    <row>
+      <entry><emphasis role="bold">ScreenSaverCycle</emphasis></entry>
+      <entry>
+If this bit is set, <emphasis role="bold">ScreenSaverNotify</emphasis> events are generated whenever
+the screen saver cycle interval passes.
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+If <emphasis remap='I'>drawable</emphasis> is not a valid drawable identifier, a Drawable
+error is returned.  If any undefined bits are set in <emphasis remap='I'>event-mask</emphasis>,
+a Value error is returned.  If an error is returned,
+the request is ignored.
+</para>
+
+<para>
+<emphasis role="bold">ScreenSaverSetAttributes</emphasis>
+</para>
+<literallayout>
+drawable: DRAWABLE
+class:
+{<emphasis role="bold">InputOutput</emphasis>, <emphasis role="bold">InputOnly</emphasis>, <emphasis role="bold">CopyFromParent</emphasis>}
+depth: CARD8
+visual: VISUALID or <emphasis role="bold">CopyFromParent</emphasis>
+x, y: INT16
+width, height, border-width: CARD16
+value-mask: BITMASK
+value-list: LISTofVALUE
+
+<emphasis role="bold">Access</emphasis>, <emphasis role="bold">Window</emphasis>, <emphasis role="bold">Pixmap</emphasis>, <emphasis role="bold">Colormap</emphasis>, <emphasis role="bold">Cursor</emphasis>, <emphasis role="bold">Match</emphasis>, <emphasis role="bold">Value</emphasis>, <emphasis role="bold">Alloc</emphasis>
+</literallayout>
+
+<para>
+This request sets the attributes that this client would like to see
+used in creating the screen saver window on the screen associated
+with <emphasis remap='I'>drawable</emphasis>.  If another client currently has the attributes set,
+an Access error is generated and the request is ignored.
+</para>
+
+<para>
+Otherwise, the specified window attributes are checked as if
+they were used in a core <function>CreateWindow</function> request whose
+parent is the root.  The <emphasis remap='I'>override-redirect</emphasis> field is ignored as
+it is implicitly set to True.  If the window attributes result in an
+error according to the rules for <function>CreateWindow</function>, the request is ignored.
+</para>
+<para>
+Otherwise, the attributes are stored and will take effect on the next
+activation that occurs when the server is not grabbed by another client.
+Any resources specified for the
+<emphasis remap='I'>background-pixmap</emphasis> or <emphasis remap='I'>cursor</emphasis> attributes may be
+freed immediately.  The server is free to copy the <emphasis remap='I'>background-pixmap</emphasis>
+or <emphasis remap='I'>cursor</emphasis> resources or to use them in place; therefore, the effect of
+changing the contents of those resources is undefined.  If the
+specified <emphasis remap='I'>colormap</emphasis> no longer exists when the screen saver activates,
+the parent's colormap is used instead.  If no errors are generated by this
+request, any previous
+screen saver window attributes set by this client are released.
+</para>
+<para>
+When the screen saver next activates and the server is not grabbed by
+another client, the screen saver window is
+created, if necessary, and set to the specified attributes and events
+are generated as usual.  The colormap
+associated with the screen saver window is
+installed.  Finally, the screen saver window is mapped.
+</para>
+<para>
+The window remains mapped and at the top of the stacking order
+until the screen saver is deactivated in response to activity on
+any of the user input devices, a <function>ForceScreenSaver</function> request with
+a value of Reset, or any request that would cause the window to be
+unmapped.
+</para>
+<para>
+If the screen saver activates while the server is grabbed by another
+client, the internal saver mechanism is used.  The <function>ForceScreenSaver</function>
+request may be used with a value of Active to
+deactivate the internal saver and activate the external saver.
+</para>
+<para>
+If the screen saver client's connection to the server is broken
+while the screen saver is activated and the client's close down mode has not
+been RetainPermanent or RetainTemporary, the current screen saver
+is deactivated and the internal screen saver is immediately activated.
+</para>
+<para>
+When the screen saver deactivates, the screen saver window's colormap
+is uninstalled and the window is unmapped (except as described below).
+The screen saver XID is disassociated
+with the window and the server may, but is not required to,
+destroy the window along with any children.
+</para>
+<para>
+When the screen saver is being deactivated and then immediately
+reactivated (such as when switching screen savers), the server
+may leave the screen saver window mapped (typically to avoid
+generating exposures).
+</para>
+
+<para>
+<emphasis role="bold">ScreenSaverUnsetAttributes</emphasis>
+</para>
+
+<literallayout>
+<emphasis>drawble</emphasis>: <emphasis role="bold">DRAWABLE</emphasis>
+
+Errors: <emphasis role="bold">Drawable</emphasis>
+</literallayout>
+
+<para>
+This request notifies the server that this client no longer
+wishes to control the screen saver window.  Any screen saver
+attributes set by this client and any descendents of the screen
+saver window created by this client should be released
+immediately if the screen saver is not active, else upon
+deactivation.
+</para>
+<para>
+This request is ignored if the client has not previously set the screen saver
+window attributes.
+</para>
+</sect1>
+
+<sect1 id="Events">
+<title>Events</title>
+<para>
+The Screen Saver extension adds one event:
+</para>
+<para>
+<emphasis role="bold">ScreenSaverNotify</emphasis>
+</para>
+
+<literallayout>
+<emphasis role="bold">root</emphasis>: WINDOW
+<emphasis role="bold">window</emphasis>: WINDOW
+<emphasis role="bold">state</emphasis>: {<emphasis role="bold">Off</emphasis>, <emphasis role="bold">On</emphasis>, <emphasis role="bold">Cycle</emphasis>}
+<emphasis role="bold">kind</emphasis>: { <emphasis role="bold">Blanked</emphasis>, <emphasis role="bold">Internal</emphasis> , <emphasis role="bold">External</emphasis> }
+<emphasis role="bold">forced</emphasis>: BOOL
+<emphasis role="bold">time</emphasis>: TIMESTAMP
+</literallayout>
+<para>
+This event is delivered to clients that have requested
+ScreenSaverNotify events using the <function>ScreenSaverSelectInput</function> request
+whenever the screen saver activates or deactivates.
+</para>
+<para>
+The <emphasis remap='I'>root</emphasis> field specifies root window of the screen for
+which the event was generated.  The <emphasis remap='I'>window</emphasis> field specifies
+the value that is returned by <function>ScreenSaverQueryInfo</function> as
+the identifier for the screen saver window.  This window is not
+required to exist if the external screen saver is not active.
+</para>
+<para>
+The <emphasis remap='I'>state</emphasis> field specifies the cause of the event:
+</para>
+
+<informaltable frame="none">
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth="1.0*"/>
+  <colspec colname='c2' colwidth="5.0*"/>
+  <tbody>
+    <row>
+      <entry><emphasis role="bold">Off</emphasis></entry>
+      <entry>
+The screen saver deactivated; this event is sent if the client has set the
+ScreenSaverNotify bit in its event mask.
+      </entry>
+    </row>
+    <row>
+      <entry><emphasis role="bold">On</emphasis></entry>
+      <entry>
+The screen saver activated.  This event is sent if the client has set the
+ScreenSaverNotify bit in its event mask.
+      </entry>
+    </row>
+    <row>
+      <entry><emphasis role="bold">Cycle</emphasis></entry>
+      <entry>
+The cycle interval passed and the client is expected to change the image on
+the screen.  This event is sent if the client has set the
+ScreenSaverCycle bit in its event mask.
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+If <emphasis remap='I'>state</emphasis> is set to
+<emphasis role="bold">On </emphasis> or
+<emphasis role="bold">Off</emphasis>
+then <emphasis remap='I'>forced</emphasis> indicates whether or not
+activation or deactivation was caused by a core
+<function>ForceScreenSaver</function>
+request; otherwise, <emphasis remap='I'>forced</emphasis> is set to False.
+</para>
+
+<para>
+The <emphasis remap='I'>kind</emphasis> field specifies mechanism that was used to save the screen
+when the screen saver was activated, as described in
+<function>ScreenSaverQueryInfo</function>.
+</para>
+
+<para>
+The <emphasis remap='I'>time</emphasis> field indicates the server time
+when the event was generated.
+</para>
+</sect1>
+</chapter>
+
+<chapter 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 "SCREEN-SAVER".
+</para>
+
+<sect1 id="Common_Types">
+<title>Common Types</title>
+<literallayout class="monospaced">
+SETofSCREENSAVEREVENT
+     #x00000001     ScreenSaverNotifyMask
+     #x00000002     ScreenSaverCycleMask
+</literallayout>
+</sect1>
+
+<sect1 id="Requests_2">
+<title>Requests</title>
+<literallayout class="monospaced">
+<emphasis role="bold">ScreenSaverQueryVersion</emphasis>
+1     CARD8                   screen saver opcode
+1     0                       minor opcode
+2     2                       request length
+1     CARD8                   client major version
+1     CARD8                   client minor version
+2                             unused
+->
+1     1                       Reply
+1                             unused
+2     CARD16                  sequence number
+4     0                       reply length
+1     CARD8                   server major version
+1     CARD8                   server minor version
+22                            unused
+
+<emphasis role="bold">ScreenSaverQueryInfo</emphasis>
+1     CARD8                   screen saver opcode
+1     1                       minor opcode
+2     2                       request length
+4     DRAWABLE                drawable associated with screen
+->
+1     1                       Reply
+1     CARD8                   state
+      0          Off
+      1          On
+      3          Disabled
+2     CARD16                  sequence number
+4     0                       reply length
+4     WINDOW                  saver window
+4     CARD32                  milliseconds until saver or since saver
+4     CARD32                  milliseconds since last user device input
+4     SETofSCREENSAVEREVENT   event mask
+1     CARD8                   kind
+      0          Blanked
+      1          Internal
+      2          External
+10               unused
+
+<emphasis role="bold">ScreenSaverSelectInput</emphasis>
+1     CARD8                   screen saver opcode
+1     2                       minor opcode
+2     3                       request length
+4     DRAWABLE                drawable associated with screen
+4     SETofSCREENSAVEREVENT   event mask
+
+<emphasis role="bold">ScreenSaverSetAttributes</emphasis>
+1     CARD8                   screen saver opcode
+1     3                       minor opcode
+2     6+n                     request length
+4     DRAWABLE                drawable associated with screen
+2     INT16                   x
+2     INT16                   y
+2     CARD16                  width
+2     CARD16                  height
+2     CARD16                  border-width
+1                             class
+      0          CopyFromParent
+      1          InputOutput
+      2          InputOnly
+1     CARD8                   depth
+4     VISUALID                visual
+      0          CopyFromParent
+4     BITMASK                 value-mask (has n bits set to 1)
+      encodings are the same as for core CreateWindow
+4n    LISTofVALUE             value-list
+      encodings are the same as for core CreateWindow
+
+<emphasis role="bold">ScreenSaverUnsetAttributes</emphasis>
+1     CARD8                   screen saver opcode
+1     4                       minor opcode
+2     3                       request length
+4     DRAWABLE                drawable associated with screen
+</literallayout>
+</sect1>
+
+<sect1 id="Events_2">
+<title>Events</title>
+
+<literallayout class="monospaced">
+<emphasis role="bold">ScreenSaverNotify</emphasis>
+1     CARD8                   code assigned by core
+1     CARD8                   state
+      0          Off
+      1          On
+      2          Cycle
+2     CARD16                  sequence number
+4     TIMESTAMP               time
+4     WINDOW                  root
+4     WINDOW                  screen saver window
+1     CARD8                   kind
+      0          Blanked
+      1          Internal
+      2          External
+1     BOOL                    forced
+14                            unused
+</literallayout>
+</sect1>
+</chapter>
+
+<chapter id='Inter_Client_Communications_Conventions'>
+<title>Inter-Client Communications Conventions</title>
+<para>
+Screen saver clients should create at least one resource value whose
+identifier can be stored in a property named
+<emphasis role="bold">_SCREEN_SAVER_ID</emphasis>
+on the root of each screen it is managing.
+This property should have one 32-bit value corresponding to the resource
+identifier; the type of the property should indicate the type of the
+resource and should be one of the following:
+<emphasis role="bold">WINDOW</emphasis>,
+<emphasis role="bold">PIXMAP</emphasis>,
+<emphasis role="bold">CURSOR</emphasis>,
+<emphasis role="bold">FONT</emphasis>, or
+<emphasis role="bold">COLORMAP</emphasis>.
+</para>
+</chapter>
+
+<chapter id="C_language_binding">
+<title>C language binding</title>
+
+<para>
+The C binding for this extension simply provide access to the protocol; they
+add no semantics beyond what is described above.
+</para>
+
+<para>
+The include file for this extension is
+<emphasis role="bold">&lt;X11/extensions/scrnsaver.h&gt;</emphasis>.
+</para>
+
+
+<funcsynopsis id='XScreenSaverQueryExtension'>
+<funcprototype>
+  <funcdef>Bool <function>XScreenSaverQueryExtension</function></funcdef>
+    <paramdef>Display <parameter>*display</parameter></paramdef>
+    <paramdef>int <parameter>*event_base</parameter></paramdef>
+    <paramdef>int <parameter>*error_base</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+This routine returns
+<emphasis role="bold">True</emphasis>
+if the specified <emphasis remap='I'>display</emphasis> supports the
+SCREEN-SAVER extension; otherwise it returns
+<emphasis role="bold">False</emphasis>.
+If the extension is supported, the event number for
+<function>ScreenSaverNotify</function>
+events is returned in the value pointed to by
+<emphasis remap='I'>event_base</emphasis>.  Since
+no additional errors are defined by this extension, the results
+of <emphasis remap='I'>error_base</emphasis> are not defined.
+</para>
+
+<funcsynopsis id='XScreenSaverQueryVersion'>
+<funcprototype>
+  <funcdef>Status <function>XScreenSaverQueryVersion</function></funcdef>
+    <paramdef>Display <parameter>*display</parameter></paramdef>
+    <paramdef>int <parameter>*major</parameter></paramdef>
+    <paramdef>int <parameter>*minor</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+If the specified <emphasis remap='I'>display</emphasis> supports the
+extension, the version numbers of the protocol
+expected by the server are returned in
+<emphasis remap='I'>major</emphasis> and
+<emphasis remap='I'>minor</emphasis> and
+a non-zero value is returned.  Otherwise, the arguments are not
+set and 0 is returned.
+</para>
+
+<para>XScreenSaverInfo *</para>
+<para>XScreenSaverAllocInfo()</para>
+
+<para>
+This routine allocates and returns an
+<emphasis role="bold">XScreenSaverInfo</emphasis> structure
+for use in calls to <xref linkend='XScreenSaverQueryInfo' xrefstyle='select: title'/>.
+All fields in the
+structure are initialized to zero.  If insufficient memory is available,
+NULL is returned.  The results of this routine can be released
+using <function>XFree</function>.
+</para>
+
+<funcsynopsis id='XScreenSaverQueryInfo'>
+<funcprototype>
+  <funcdef>Status <function>XScreenSaverQueryInfo</function></funcdef>
+    <paramdef>Display <parameter>*display</parameter></paramdef>
+    <paramdef>Drawable <parameter>drawable</parameter></paramdef>
+    <paramdef>XScreenSaverInfo <parameter>*saver_info</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+If the specified <emphasis remap='I'>display</emphasis> supports the extension,
+information about the current state of the
+screen server is returned in <emphasis remap='I'>saver_info</emphasis> and a non-zero value is
+returned.  The <function>XScreenSaverInfo</function> structure is
+defined as follows:
+</para>
+
+<literallayout class="monospaced">
+typedef struct {
+    Window window;                /* screen saver window */
+    int state;                    /* ScreenSaver{Off,On,Disabled} */
+    int kind;                     /* ScreenSaver{Blanked,Internal,External} */
+    unsigned long til_or_since;   /* milliseconds */
+    unsigned long idle;           /* milliseconds */
+    unsigned long event_mask;     /* events */
+} XScreenSaverInfo;
+</literallayout>
+
+<para>
+See the <function>ScreenSaverQueryInfo</function> request for a
+description of the fields.  If the extension is not supported,
+<emphasis remap='I'>saver_info</emphasis> is not changed and 0
+is returned.
+</para>
+
+<funcsynopsis id='XScreenSaverSelectInput'>
+<funcprototype>
+  <funcdef>void <function>XScreenSaverSelectInput</function></funcdef>
+    <paramdef>Display <parameter>*display</parameter></paramdef>
+    <paramdef>Drawable <parameter>drawable</parameter></paramdef>
+    <paramdef>unsigned long <parameter>event_mask</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+If the specified <emphasis remap='I'>display</emphasis> supports the extension,
+this routine asks that events related to
+the screen saver be generated for this client.
+The format of the events generated is:
+</para>
+
+<literallayout class="monospaced">
+typedef struct {
+    int type;               /* of event */
+    unsigned long serial;   /* # of last request processed by server */
+    Bool send_event;        /* true if this came from a SendEvent request */
+    Display *display;       /* Display the event was read from */
+    Window window;          /* screen saver window */
+    Window root;            /* root window of event screen */
+    int state;              /* ScreenSaver{Off,On,Cycle} */
+    int kind;               /* ScreenSaver{Blanked,Internal,External} */
+    Bool forced;            /* extents of new region */
+    Time time;              /* event timestamp */
+} XScreenSaverNotifyEvent;
+</literallayout>
+
+<para>
+See the definition of the
+<function>ScreenSaverSelectInput</function> request for descriptions
+of the allowed event masks.   <!-- xref ? -->
+</para>
+
+<funcsynopsis id='XScreenSaverSetAttributes'>
+<funcprototype>
+  <funcdef>void <function>XScreenSaverSetAttributes</function></funcdef>
+    <paramdef>Display <parameter>*dpy</parameter></paramdef>
+    <paramdef>Drawable <parameter>drawable</parameter></paramdef>
+    <paramdef>int <parameter>x</parameter></paramdef>
+    <paramdef>int <parameter>y</parameter></paramdef>
+    <paramdef>unsigned int <parameter>width</parameter></paramdef>
+    <paramdef>unsigned int <parameter>height</parameter></paramdef>
+    <paramdef>unsigned int <parameter>border_width</parameter></paramdef>
+    <paramdef>int <parameter>depth</parameter></paramdef>
+    <paramdef>unsigned int <parameter>class</parameter></paramdef>
+    <paramdef>Visual <parameter>*visual</parameter></paramdef>
+    <paramdef>unsigned long <parameter>valuemask</parameter></paramdef>
+    <paramdef>XSetWindowAttributes <parameter>*attributes</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+If the specified <emphasis remap='I'>display</emphasis> supports the
+extension, this routine sets the attributes to be used
+the next time the external screen saver is activated.  See the definition
+of the <function>ScreenSaverSetAttributes</function> request for a
+description of each of the arguments.
+</para>
+
+<funcsynopsis id='XScreenSaverUnsetAttributes'>
+<funcprototype>
+  <funcdef>void <function>XScreenSaverUnsetAttributes</function></funcdef>
+    <paramdef>Display <parameter>*display</parameter></paramdef>
+    <paramdef>Drawable <parameter>drawable</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+If the specified <emphasis remap='I'>display</emphasis> supports the
+extension, this routine instructs the server to discard
+any previous screen saver window attributes set by this client.
+</para>
+
+<funcsynopsis id='XScreenSaverRegister'>
+<funcprototype>
+  <funcdef>Status <function>XScreenSaverRegister</function></funcdef>
+    <paramdef>Display <parameter>*display</parameter></paramdef>
+    <paramdef>int <parameter>screen</parameter></paramdef>
+    <paramdef>XID <parameter>xid</parameter></paramdef>
+    <paramdef>Atom <parameter>type</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+This routine stores the given <emphasis remap='I'>XID</emphasis> in the
+<emphasis role="bold">_SCREEN_SAVER_ID</emphasis> property (of the given
+<emphasis remap='I'>type</emphasis>) on the root window of the specified
+<emphasis remap='I'>screen</emphasis>.  It returns zero if an error
+is encountered and the property is not changed, otherwise it returns
+non-zero.
+</para>
+
+<funcsynopsis id='XScreenSaverUnregister'>
+<funcprototype>
+  <funcdef>Status <function>XScreenSaverUnregister</function></funcdef>
+    <paramdef>Display <parameter>*display</parameter></paramdef>
+    <paramdef>int <parameter>screen</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+This routine removes any <function>_SCREEN_SAVER_ID</function> from the
+root window of the specified <emphasis remap='I'>screen</emphasis>.
+It returns zero if an error is encountered and the property is changed,
+otherwise it returns non-zero.
+</para>
+
+<funcsynopsis id='XScreenSaverGetRegistered'>
+<funcprototype>
+  <funcdef>Status <function>XScreenSaverGetRegistered</function></funcdef>
+    <paramdef>Display <parameter>*display</parameter></paramdef>
+    <paramdef>int <parameter>screen</parameter></paramdef>
+    <paramdef>XID <parameter>*xid</parameter></paramdef>
+    <paramdef>ATOM <parameter>*type</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+
+<para>
+This routine returns the
+<emphasis remap='I'>XID</emphasis> and
+<emphasis remap='I'>type</emphasis> stored in the
+<emphasis role="bold">_SCREEN_SAVER_ID</emphasis> property on the
+root window of the specified <emphasis remap='I'>screen</emphasis>.
+It returns zero if an error
+is encountered or if the property does not exist or is not of the correct
+format; otherwise it returns non-zero.
+</para>
+
+</chapter>
+</book>
Index: proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/scrnsaverproto
===================================================================
--- proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/scrnsaverproto	(nonexistent)
+++ proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/scrnsaverproto	(revision 5)

Property changes on: proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/scrnsaverproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/xextproto/dpms.xml
===================================================================
--- proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/xextproto/dpms.xml	(nonexistent)
+++ proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/xextproto/dpms.xml	(revision 5)
@@ -0,0 +1,663 @@
+<?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"
+[
+<!ENTITY % defs SYSTEM "defs.ent"> %defs;
+]>
+
+<book id="dpms">
+
+<bookinfo>
+   <title>X Display Power Management Signaling (DPMS) Extension Protocol Specification</title>
+   <subtitle>X Project Team Standard</subtitle>
+   <authorgroup>
+      <author>
+         <firstname>Rob </firstname><surname>Lembree</surname>
+         <affiliation><orgname>Digital Equipment Corporation</orgname></affiliation>
+         <email>lembree@zk3.dec.com</email>
+      </author>
+   </authorgroup>
+   <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
+   <releaseinfo>Version 1.0</releaseinfo>
+   <copyright><year>1996</year><holder>Digital Equipment Corporation</holder></copyright>
+
+<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 &ldquo;as is&rdquo; without express or implied warranty.
+</para>
+
+</legalnotice>
+</bookinfo>
+
+<chapter 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 conscious 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>
+</chapter>
+
+<chapter id="Requests">
+<title>Requests</title>
+<para>
+<function>DPMSGetVersion</function>
+</para>
+
+<informaltable frame="none">
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='1' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth="1.0*"/>
+  <tbody>
+    <row>
+      <entry>
+<emphasis remap='I'>client_major_version</emphasis>: CARD16
+      </entry>
+    </row>
+    <row>
+      <entry>
+<emphasis remap='I'>client_minor_version</emphasis>: CARD16
+      </entry>
+    </row>
+    <row>
+      <entry>=&gt;</entry>
+    </row>
+    <row>
+      <entry>
+<emphasis remap='I'>server_major_version</emphasis>: CARD16
+      </entry>
+    </row>
+    <row>
+      <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 two (2).
+</para>
+
+<para>
+<function>DPMSCapable</function>
+</para>
+
+<informaltable frame="none">
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='1' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth="1.0*"/>
+  <tbody>
+    <row>
+      <entry>=&gt;</entry>
+    </row>
+    <row>
+      <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">
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='1' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth="1.0*"/>
+  <tbody>
+    <row>
+      <entry>=&gt;</entry>
+    </row>
+    <row>
+      <entry>
+<emphasis remap='I'>standby_timeout</emphasis>: CARD16
+      </entry>
+    </row>
+    <row>
+      <entry>
+<emphasis remap='I'>suspend_timeout</emphasis>: CARD16
+      </entry>
+    </row>
+    <row>
+      <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
+dependent, 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">
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='1' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth="1.0*"/>
+  <tbody>
+    <row>
+      <entry>
+<emphasis remap='I'>standby_timeout</emphasis>: CARD16
+      </entry>
+    </row>
+    <row>
+      <entry>
+<emphasis remap='I'>suspend_timeout</emphasis>: CARD16
+      </entry>
+    </row>
+    <row>
+      <entry>
+<emphasis remap='I'>off_timeout</emphasis>: CARD16
+      </entry>
+    </row>
+    <row>
+      <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">
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='1' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth="1.0*"/>
+  <tbody>
+    <row>
+      <entry>
+<emphasis remap='I'>power_level</emphasis>: CARD16
+      </entry>
+    </row>
+    <row>
+      <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">
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='1' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth="1.0*"/>
+  <tbody>
+    <row>
+      <entry>=&gt;</entry>
+    </row>
+    <row>
+      <entry>
+<emphasis remap='I'>power_level</emphasis>: CARD16
+      </entry>
+    </row>
+    <row>
+      <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>
+
+<para>
+<function>DPMSSelectInput</function>
+</para>
+
+<informaltable frame="none">
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='1' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth="1.0*"/>
+  <tbody>
+    <row>
+      <entry>
+<emphasis remap='I'>event_mask</emphasis>: CARD32
+      </entry>
+    </row>
+    <row>
+      <entry>=&gt;</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+This request specifies whether DPMS extension events should be generated for this client.
+If DPMSInfoNotifyMask is set in <emphasis remap='I'>event-mask</emphasis>, then DPMSInfoNotifyEvent
+events will be generated whenever the current DPMS on/off state or power level changes.
+If no bits are set, then no events will be generated.
+</para>
+
+</chapter>
+
+<chapter id="Events">
+
+<title>Events</title>
+<para>
+The DPMS extension adds one event:
+</para>
+<para>
+<function>DPMSInfoNotifyEvent</function>
+</para>
+
+<informaltable frame="none">
+  <?dbfo keep-together="always" ?>
+  <tgroup cols='1' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth="1.0*"/>
+  <tbody>
+    <row>
+      <entry>
+<emphasis remap='I'>timestamp</emphasis>: TIMESTAMP
+      </entry>
+    </row>
+    <row>
+      <entry>
+<emphasis remap='I'>power_level</emphasis>: CARD16
+      </entry>
+    </row>
+    <row>
+      <entry>
+<emphasis remap='I'>state</emphasis>: BOOL
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+This event is delivered to clients that have requested
+DPMSInfoNotifyMask events using the <function>DPMSSelectInput</function> request
+whenever the current DPMS on/off state or power level changes.
+<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 one
+of DPMSModeOn, DPMSModeStandby, DPMSModeSuspend or DPMSModeOff, otherwise
+it is undefined.
+</para>
+
+</chapter>
+
+<chapter 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>
+
+<literallayout class="monospaced">
+<function>DPMSSelectInput</function>
+     1     CARD8         opcode
+     1     8             DPMS opcode
+     2     2             request length
+     4                   event mask
+           0     no events
+           1     DPMSInfoNotifyMask
+</literallayout>
+
+<literallayout class="monospaced">
+<function>DPMSInfoNotifyEvent</function>
+     1     GenericEvent    type
+     1     CARD8           DPMS extension offset
+     2     CARD16          sequence number
+     4     0               length
+     2     DPMSInfoNotify  evtype
+     2                     unused
+     4     TIMESTAMP       timestamp
+     2                     power_level
+           0     DPMSModeOn
+           1     DPMSModeStandby
+           2     DPMSModeSuspend
+           3     DPMSModeOff
+     1     BOOL            state
+     13                    unused
+</literallayout>
+</chapter>
+</book>
Index: proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/xextproto/xtest.xml
===================================================================
--- proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/xextproto/xtest.xml	(nonexistent)
+++ proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/xextproto/xtest.xml	(revision 5)
@@ -0,0 +1,723 @@
+<?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"
+[
+<!ENTITY % defs SYSTEM "defs.ent"> %defs;
+]>
+
+<book id="xtest">
+
+<bookinfo>
+   <title>XTEST Extension Protocol</title>
+   <subtitle>X Consortium Standard</subtitle>
+   <authorgroup>
+      <author>
+         <firstname>Kieron</firstname><surname>Drake</surname>
+         <affiliation><orgname>UniSoft Ltd.</orgname></affiliation>
+      </author>
+   </authorgroup>
+   <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
+   <releaseinfo>Version 2.2</releaseinfo>
+   <copyright><year>1992</year><holder>UniSoft Group Ltd.</holder></copyright>
+   <copyright><year>1992</year><year>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 &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="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>
+</chapter>
+
+<chapter 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>
+
+</chapter>
+
+<chapter 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' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth="1.0*"/>
+  <colspec colname='c2' colwidth="3.0*"/>
+  <tbody>
+    <row>
+      <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>
+      <entry></entry>
+    </row>
+    <row>
+      <entry>FAKE_EVENT</entry>
+      <entry>[type: FAKE_EVENT_TYPE,</entry>
+    </row>
+    <row>
+      <entry></entry>
+      <entry>detail: BYTE,</entry>
+    </row>
+    <row>
+      <entry></entry>
+      <entry>time: TIME,</entry>
+    </row>
+    <row>
+      <entry></entry>
+      <entry>root: WINDOW,</entry>
+    </row>
+    <row>
+      <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>
+
+</chapter>
+
+<chapter 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' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth="1.0*"/>
+  <tbody>
+    <row>
+      <entry>
+<emphasis remap='I'>gc</emphasis>: "GC"
+      </entry>
+    </row>
+    <row>
+      <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' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth="1.0*"/>
+  <tbody>
+    <row>
+      <entry>
+<emphasis remap='I'>visual</emphasis>: "VISUAL"
+      </entry>
+    </row>
+    <row>
+      <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' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth="1.0*"/>
+  <tbody>
+    <row>
+      <entry>
+<emphasis remap='I'>dpy</emphasis>: "CONNECTION"
+      </entry>
+    </row>
+    <row>
+      <entry>
+=&gt;
+      </entry>
+    </row>
+    <row>
+      <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>
+</chapter>
+
+<chapter id="Server_Requests">
+<title>Server Requests</title>
+<para>
+<function>XTestGetVersion</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth="1.0*"/>
+  <tbody>
+    <row>
+      <entry>
+<emphasis remap='I'>clientMajorVersion</emphasis>: CARD16
+      </entry>
+    </row>
+    <row>
+      <entry>
+<emphasis remap='I'>clientMinorVersion</emphasis>: CARD16
+      </entry>
+    </row>
+    <row>
+      <entry>
+   =&gt;
+      </entry>
+    </row>
+    <row>
+      <entry>
+serverMajorVersion: CARD16
+      </entry>
+    </row>
+    <row>
+      <entry>
+serverMinorVersion: CARD16
+      </entry>
+    </row>
+    <row>
+      <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' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth="1.0*"/>
+  <tbody>
+    <row>
+      <entry>
+<emphasis remap='I'>window</emphasis>: WINDOW
+      </entry>
+    </row>
+    <row>
+      <entry>
+<emphasis remap='I'>cursor-id</emphasis>: CURSOR or
+<function>CurrentCursor</function>
+or
+<function>None</function>
+      </entry>
+    </row>
+    <row>
+      <entry>
+=&gt;
+      </entry>
+    </row>
+    <row>
+      <entry>
+same: BOOL
+      </entry>
+    </row>
+    <row>
+      <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' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth="1.0*"/>
+  <tbody>
+    <row>
+      <entry>
+<emphasis remap='I'>events</emphasis>: LISTofFAKE_EVENT
+      </entry>
+    </row>
+    <row>
+      <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' colsep='0' rowsep='0'>
+  <colspec colname='c1' colwidth="1.0*"/>
+  <tbody>
+    <row>
+      <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>
+</chapter>
+
+<chapter 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>
+
+<sect1 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>
+</sect1>
+
+<sect1 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>
+</sect1>
+</chapter>
+
+<chapter 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>
+</chapter>
+
+</book>
Index: proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/xextproto
===================================================================
--- proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/xextproto	(nonexistent)
+++ proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/xextproto	(revision 5)

Property changes on: proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs/xextproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs
===================================================================
--- proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs	(nonexistent)
+++ proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs	(revision 5)

Property changes on: proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new/specs
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new
===================================================================
--- proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new	(nonexistent)
+++ proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new	(revision 5)

Property changes on: proto/xorgproto/create-2022.2-docbook-patch/xorgproto-2022.2-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/xorgproto/create-2022.2-docbook-patch
===================================================================
--- proto/xorgproto/create-2022.2-docbook-patch	(nonexistent)
+++ proto/xorgproto/create-2022.2-docbook-patch	(revision 5)

Property changes on: proto/xorgproto/create-2022.2-docbook-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/xorgproto/patches/README
===================================================================
--- proto/xorgproto/patches/README	(nonexistent)
+++ proto/xorgproto/patches/README	(revision 5)
@@ -0,0 +1,6 @@
+
+/* begin *
+
+   TODO: Leave some comment here.
+
+ * end */
Index: proto/xorgproto/patches
===================================================================
--- proto/xorgproto/patches	(nonexistent)
+++ proto/xorgproto/patches	(revision 5)

Property changes on: proto/xorgproto/patches
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/xorgproto
===================================================================
--- proto/xorgproto	(nonexistent)
+++ proto/xorgproto	(revision 5)

Property changes on: proto/xorgproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto/xproto/Makefile
===================================================================
--- proto/xproto/Makefile	(nonexistent)
+++ proto/xproto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/proto/xproto
+
+versions    = 7.0.31
+pkgname     = xproto
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: proto/xproto
===================================================================
--- proto/xproto	(nonexistent)
+++ proto/xproto	(revision 5)

Property changes on: proto/xproto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: proto
===================================================================
--- proto	(nonexistent)
+++ proto	(revision 5)

Property changes on: proto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: test/Makefile
===================================================================
--- test/Makefile	(nonexistent)
+++ test/Makefile	(revision 5)
@@ -0,0 +1,13 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+SOURCE_REQUIRES += ALL_DIRS
+
+
+include ../../../build-system/core.mk
+
+
+download_clean:
+	@true
+
+.PHONY: download_clean
Index: test/x11perf/Makefile
===================================================================
--- test/x11perf/Makefile	(nonexistent)
+++ test/x11perf/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/test/x11perf
+
+versions    = 1.6.2
+pkgname     = x11perf
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: test/x11perf
===================================================================
--- test/x11perf	(nonexistent)
+++ test/x11perf	(revision 5)

Property changes on: test/x11perf
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: test
===================================================================
--- test	(nonexistent)
+++ test	(revision 5)

Property changes on: test
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: util/Makefile
===================================================================
--- util/Makefile	(nonexistent)
+++ util/Makefile	(revision 5)
@@ -0,0 +1,13 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+SOURCE_REQUIRES += ALL_DIRS
+
+
+include ../../../build-system/core.mk
+
+
+download_clean:
+	@true
+
+.PHONY: download_clean
Index: util/bdftopcf/Makefile
===================================================================
--- util/bdftopcf/Makefile	(nonexistent)
+++ util/bdftopcf/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/util/bdftopcf
+
+versions    = 1.1.1
+pkgname     = bdftopcf
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: util/bdftopcf
===================================================================
--- util/bdftopcf	(nonexistent)
+++ util/bdftopcf	(revision 5)

Property changes on: util/bdftopcf
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: util/gccmakedep/Makefile
===================================================================
--- util/gccmakedep/Makefile	(nonexistent)
+++ util/gccmakedep/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/util/gccmakedep
+
+versions    = 1.0.3
+pkgname     = gccmakedep
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: util/gccmakedep
===================================================================
--- util/gccmakedep	(nonexistent)
+++ util/gccmakedep	(revision 5)

Property changes on: util/gccmakedep
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: util/imake/Makefile
===================================================================
--- util/imake/Makefile	(nonexistent)
+++ util/imake/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/util/imake
+
+versions    = 1.0.9
+pkgname     = imake
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: util/imake
===================================================================
--- util/imake	(nonexistent)
+++ util/imake	(revision 5)

Property changes on: util/imake
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: util/lndir/Makefile
===================================================================
--- util/lndir/Makefile	(nonexistent)
+++ util/lndir/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/util/lndir
+
+versions    = 1.0.4
+pkgname     = lndir
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: util/lndir
===================================================================
--- util/lndir	(nonexistent)
+++ util/lndir	(revision 5)

Property changes on: util/lndir
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: util/makedepend/Makefile
===================================================================
--- util/makedepend/Makefile	(nonexistent)
+++ util/makedepend/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/util/makedepend
+
+versions    = 1.0.8
+pkgname     = makedepend
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: util/makedepend
===================================================================
--- util/makedepend	(nonexistent)
+++ util/makedepend	(revision 5)

Property changes on: util/makedepend
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: util/util-macros/Makefile
===================================================================
--- util/util-macros/Makefile	(nonexistent)
+++ util/util-macros/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/util/util-macros
+
+versions    = 1.19.3
+pkgname     = util-macros
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: util/util-macros
===================================================================
--- util/util-macros	(nonexistent)
+++ util/util-macros	(revision 5)

Property changes on: util/util-macros
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: util/xorg-cf-files/Makefile
===================================================================
--- util/xorg-cf-files/Makefile	(nonexistent)
+++ util/xorg-cf-files/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/util/xorg-cf-files
+
+versions    = 1.0.7
+pkgname     = xorg-cf-files
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: util/xorg-cf-files
===================================================================
--- util/xorg-cf-files	(nonexistent)
+++ util/xorg-cf-files	(revision 5)

Property changes on: util/xorg-cf-files
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: util
===================================================================
--- util	(nonexistent)
+++ util	(revision 5)

Property changes on: util
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xcb/Makefile
===================================================================
--- xcb/Makefile	(nonexistent)
+++ xcb/Makefile	(revision 5)
@@ -0,0 +1,13 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+SOURCE_REQUIRES += ALL_DIRS
+
+
+include ../../../build-system/core.mk
+
+
+download_clean:
+	@true
+
+.PHONY: download_clean
Index: xcb/libpthread-stubs/Makefile
===================================================================
--- xcb/libpthread-stubs/Makefile	(nonexistent)
+++ xcb/libpthread-stubs/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/xcb/libpthread-stubs
+
+versions    = 0.4
+pkgname     = libpthread-stubs
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: xcb/libpthread-stubs
===================================================================
--- xcb/libpthread-stubs	(nonexistent)
+++ xcb/libpthread-stubs	(revision 5)

Property changes on: xcb/libpthread-stubs
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xcb/libxcb/Makefile
===================================================================
--- xcb/libxcb/Makefile	(nonexistent)
+++ xcb/libxcb/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/xcb/libxcb
+
+versions    = 1.15
+pkgname     = libxcb
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: xcb/libxcb
===================================================================
--- xcb/libxcb	(nonexistent)
+++ xcb/libxcb	(revision 5)

Property changes on: xcb/libxcb
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xcb/xcb-proto/Makefile
===================================================================
--- xcb/xcb-proto/Makefile	(nonexistent)
+++ xcb/xcb-proto/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/xcb/xcb-proto
+
+versions    = 1.15
+pkgname     = xcb-proto
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: xcb/xcb-proto
===================================================================
--- xcb/xcb-proto	(nonexistent)
+++ xcb/xcb-proto	(revision 5)

Property changes on: xcb/xcb-proto
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xcb/xcb-util/Makefile
===================================================================
--- xcb/xcb-util/Makefile	(nonexistent)
+++ xcb/xcb-util/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/xcb/xcb-util
+
+versions    = 0.4.1
+pkgname     = xcb-util
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: xcb/xcb-util
===================================================================
--- xcb/xcb-util	(nonexistent)
+++ xcb/xcb-util	(revision 5)

Property changes on: xcb/xcb-util
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xcb/xcb-util-cursor/Makefile
===================================================================
--- xcb/xcb-util-cursor/Makefile	(nonexistent)
+++ xcb/xcb-util-cursor/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/xcb/xcb-util-cursor
+
+versions    = 0.1.4
+pkgname     = xcb-util-cursor
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: xcb/xcb-util-cursor
===================================================================
--- xcb/xcb-util-cursor	(nonexistent)
+++ xcb/xcb-util-cursor	(revision 5)

Property changes on: xcb/xcb-util-cursor
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xcb/xcb-util-errors/Makefile
===================================================================
--- xcb/xcb-util-errors/Makefile	(nonexistent)
+++ xcb/xcb-util-errors/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/xcb/xcb-util-errors
+
+versions    = 1.0.1
+pkgname     = xcb-util-errors
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: xcb/xcb-util-errors
===================================================================
--- xcb/xcb-util-errors	(nonexistent)
+++ xcb/xcb-util-errors	(revision 5)

Property changes on: xcb/xcb-util-errors
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xcb/xcb-util-image/Makefile
===================================================================
--- xcb/xcb-util-image/Makefile	(nonexistent)
+++ xcb/xcb-util-image/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/xcb/xcb-util-image
+
+versions    = 0.4.1
+pkgname     = xcb-util-image
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: xcb/xcb-util-image
===================================================================
--- xcb/xcb-util-image	(nonexistent)
+++ xcb/xcb-util-image	(revision 5)

Property changes on: xcb/xcb-util-image
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xcb/xcb-util-keysyms/Makefile
===================================================================
--- xcb/xcb-util-keysyms/Makefile	(nonexistent)
+++ xcb/xcb-util-keysyms/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/xcb/xcb-util-keysyms
+
+versions    = 0.4.1
+pkgname     = xcb-util-keysyms
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: xcb/xcb-util-keysyms
===================================================================
--- xcb/xcb-util-keysyms	(nonexistent)
+++ xcb/xcb-util-keysyms	(revision 5)

Property changes on: xcb/xcb-util-keysyms
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xcb/xcb-util-renderutil/Makefile
===================================================================
--- xcb/xcb-util-renderutil/Makefile	(nonexistent)
+++ xcb/xcb-util-renderutil/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/xcb/xcb-util-renderutil
+
+versions    = 0.3.10
+pkgname     = xcb-util-renderutil
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: xcb/xcb-util-renderutil
===================================================================
--- xcb/xcb-util-renderutil	(nonexistent)
+++ xcb/xcb-util-renderutil	(revision 5)

Property changes on: xcb/xcb-util-renderutil
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xcb/xcb-util-wm/Makefile
===================================================================
--- xcb/xcb-util-wm/Makefile	(nonexistent)
+++ xcb/xcb-util-wm/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/xcb/xcb-util-wm
+
+versions    = 0.4.2
+pkgname     = xcb-util-wm
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: xcb/xcb-util-wm
===================================================================
--- xcb/xcb-util-wm	(nonexistent)
+++ xcb/xcb-util-wm	(revision 5)

Property changes on: xcb/xcb-util-wm
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xcb/xpyb/Makefile
===================================================================
--- xcb/xpyb/Makefile	(nonexistent)
+++ xcb/xpyb/Makefile	(revision 5)
@@ -0,0 +1,56 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/xcb/xpyb
+
+versions    = 1.3.1
+pkgname     = xpyb
+suffix      = tar.bz2
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+patches     = $(CURDIR)/patches/xpyb-1.3.1-xcbproto.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-1.3.1-xcbproto-patch ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s) $(patches)
Index: xcb/xpyb/create-1.3.1-xcbproto-patch/create.patch.sh
===================================================================
--- xcb/xpyb/create-1.3.1-xcbproto-patch/create.patch.sh	(nonexistent)
+++ xcb/xpyb/create-1.3.1-xcbproto-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=1.3.1
+
+tar --files-from=file.list -xjvf ../xpyb-$VERSION.tar.bz2
+mv xpyb-$VERSION xpyb-$VERSION-orig
+
+cp -rf ./xpyb-$VERSION-new ./xpyb-$VERSION
+
+diff -b --unified -Nr  xpyb-$VERSION-orig  xpyb-$VERSION > xpyb-$VERSION-xcbproto.patch
+
+mv xpyb-$VERSION-xcbproto.patch ../patches
+
+rm -rf ./xpyb-$VERSION
+rm -rf ./xpyb-$VERSION-orig

Property changes on: xcb/xpyb/create-1.3.1-xcbproto-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: xcb/xpyb/create-1.3.1-xcbproto-patch/file.list
===================================================================
--- xcb/xpyb/create-1.3.1-xcbproto-patch/file.list	(nonexistent)
+++ xcb/xpyb/create-1.3.1-xcbproto-patch/file.list	(revision 5)
@@ -0,0 +1 @@
+xpyb-1.3.1/src/py_client.py
Index: xcb/xpyb/create-1.3.1-xcbproto-patch/xpyb-1.3.1-new/src/py_client.py
===================================================================
--- xcb/xpyb/create-1.3.1-xcbproto-patch/xpyb-1.3.1-new/src/py_client.py	(nonexistent)
+++ xcb/xpyb/create-1.3.1-xcbproto-patch/xpyb-1.3.1-new/src/py_client.py	(revision 5)
@@ -0,0 +1,627 @@
+#!/usr/bin/env python
+#from xml.etree.cElementTree import *
+#from os.path import basename
+import getopt
+import sys
+import re
+
+# Jump to the bottom of this file for the main routine
+
+# Some hacks to make the API more readable, and to keep backwards compability
+_pyname_re = re.compile('^\d')
+_pyname_except_re = re.compile('^Bad')
+
+_py_reserved_words = [ 'None', 'def', 'class', 'and', 'or' ]
+
+_cardinal_types = {'CARD8':  'B', 'uint8_t': 'B',
+                   'CARD16': 'H','uint16_t': 'H',
+                   'CARD32': 'I','uint32_t': 'I',
+                   'INT8':   'b', 'int8_t':  'b',
+                   'INT16':  'h', 'int16_t': 'h',
+                   'INT32':  'i', 'int32_t': 'i',
+                   'BYTE': 'B',
+                   'BOOL': 'B',
+                   'char': 'b',
+                   'void': 'B',
+                   'float': 'f',
+                   'double' : 'd'}
+_pylines = []
+_pylevel = 0
+_ns = None
+
+_py_fmt_fmt = ''
+_py_fmt_size = 0
+_py_fmt_list = []
+
+def _py(fmt, *args):
+    '''
+    Writes the given line to the header file.
+    '''
+    _pylines[_pylevel].append(fmt % args)
+
+def _py_popline():
+    _pylines[_pylevel][-1:] = ()
+
+def _py_setlevel(idx):
+    '''
+    Changes the array that source lines are written to.
+    Supports writing different sections of the source file.
+    '''
+    global _pylevel
+    while len(_pylines) <= idx:
+        _pylines.append([])
+    _pylevel = idx
+    
+def _t(str):
+    '''
+    Does Python-name conversion on a type tuple of strings.
+    '''
+    return str[-1]
+
+def _n(str):
+    '''
+    Does Python-name conversion on a single string fragment.
+    Handles some number-only names and reserved words.
+    '''
+    if _pyname_re.match(str) or str in _py_reserved_words:
+        return '_' + str
+    return str
+
+def _b(bool):
+    '''
+    Boolean to string
+    '''
+
+    return 'True' if bool else 'False'
+
+
+def _py_push_format(field, prefix=''):
+    global _py_fmt_fmt, _py_fmt_size, _py_fmt_list
+
+    _py_fmt_fmt += field.type.py_format_str
+    _py_fmt_size += field.type.size
+    _py_fmt_list.append(prefix + _n(field.field_name))
+
+def _py_push_pad(nmemb):
+    global _py_fmt_fmt, _py_fmt_size, _py_fmt_list
+
+    num = '' if nmemb == 1 else str(nmemb)
+    _py_fmt_fmt += num + 'x'
+    _py_fmt_size += nmemb
+
+def _py_flush_format():
+    global _py_fmt_fmt, _py_fmt_size, _py_fmt_list
+
+    joined = ', '.join(_py_fmt_list)
+    retval = [ _py_fmt_fmt, _py_fmt_size, joined ]
+    _py_fmt_fmt = ''
+    _py_fmt_size = 0
+    _py_fmt_list = []
+    return retval
+    
+def py_open(self):
+    '''
+    Exported function that handles module open.
+    Opens the files and writes out the auto-generated comment, header file includes, etc.
+    '''
+    global _ns
+    _ns = self.namespace
+
+    _py_setlevel(0)
+    _py('#')
+    _py('# This file generated automatically from %s by py_client.py.', _ns.file)
+    _py('# Edit at your peril.')
+    _py('#')
+    _py('')
+
+    _py('import xcb')
+    _py('import cStringIO')
+    _py('from struct import pack, unpack_from')
+    _py('from array import array')
+        
+    if _ns.is_ext:
+        for (n, h) in self.imports:
+            _py('import %s', h)
+
+        _py('')
+        _py('MAJOR_VERSION = %s', _ns.major_version)
+        _py('MINOR_VERSION = %s', _ns.minor_version)
+        _py('')
+        _py('key = xcb.ExtensionKey(\'%s\')', _ns.ext_xname)
+
+    _py_setlevel(1)
+    _py('')
+    _py('class %sExtension(xcb.Extension):', _ns.header)
+
+    _py_setlevel(2)
+    _py('')
+    _py('_events = {')
+
+    _py_setlevel(3)
+    _py('}')
+    _py('')
+    _py('_errors = {')
+
+    _py_setlevel(4)
+    _py('}')
+    _py('')
+    if _ns.is_ext:
+        _py('xcb._add_ext(key, %sExtension, _events, _errors)', _ns.header)
+    else:
+        _py('xcb._add_core(%sExtension, Setup, _events, _errors)', _ns.header)
+    
+
+def py_close(self):
+    '''
+    Exported function that handles module close.
+    Writes out all the stored content lines, then closes the file.
+    '''
+    pyfile = open('%s.py' % _ns.header, 'w')
+    for list in _pylines:
+        for line in list:
+            pyfile.write(line)
+            pyfile.write('\n')
+    pyfile.close()
+
+def py_enum(self, name):
+    '''
+    Exported function that handles enum declarations.
+    '''
+    _py_setlevel(0)
+    _py('')
+    _py('class %s:', _t(name))
+
+    count = 0
+
+    for (enam, eval) in self.values:
+        _py('    %s = %s', _n(enam), eval if eval != '' else count)
+        if eval != '':
+            count = int(eval) + 1
+        else:
+            count += 1
+
+def _py_type_setup(self, name, postfix=''):
+    '''
+    Sets up all the C-related state by adding additional data fields to
+    all Field and Type objects.  Here is where we figure out most of our
+    variable and function names.
+
+    Recurses into child fields and list member types.
+    '''
+    # Do all the various names in advance
+    self.py_type = _t(name) + postfix
+
+    self.py_request_name = _t(name)
+    self.py_checked_name = _t(name) + 'Checked'
+    self.py_unchecked_name = _t(name) + 'Unchecked'
+    self.py_reply_name = _t(name) + 'Reply'
+    self.py_event_name = _t(name) + 'Event'
+    self.py_cookie_name = _t(name) + 'Cookie'
+
+    if _pyname_except_re.match(_t(name)):
+        self.py_error_name = re.sub('Bad', '', _t(name), 1) + 'Error'
+        self.py_except_name = _t(name)
+    else:
+        self.py_error_name = _t(name) + 'Error'
+        self.py_except_name = 'Bad' + _t(name)
+
+    if self.is_pad:
+        self.py_format_str = ('' if self.nmemb == 1 else str(self.nmemb)) + 'x'
+        self.py_format_len = 0
+
+    elif self.is_simple or self.is_expr:
+        self.py_format_str = _cardinal_types[_t(self.name)]
+        self.py_format_len = 1
+
+    elif self.is_list:
+        if self.fixed_size():
+            self.py_format_str = str(self.nmemb) + _cardinal_types[_t(self.member.name)]
+            self.py_format_len = self.nmemb
+        else:
+            self.py_format_str = None
+            self.py_format_len = -1
+
+    elif self.is_container:
+
+        self.py_format_str = ''
+        self.py_format_len = 0
+        self.py_fixed_size = 0
+
+        for field in self.fields:
+            _py_type_setup(field.type, field.field_type)
+
+            field.py_type = _t(field.field_type)
+
+            if field.type.py_format_len < 0:
+                self.py_format_str = None
+                self.py_format_len = -1
+            elif self.py_format_len >= 0:
+                self.py_format_str += field.type.py_format_str
+                self.py_format_len += field.type.py_format_len
+
+            if field.type.is_list:
+                _py_type_setup(field.type.member, field.field_type)
+
+                field.py_listtype = _t(field.type.member.name)
+                if field.type.member.is_simple:
+                    field.py_listtype = "'" + field.type.member.py_format_str + "'"
+
+                field.py_listsize = -1
+                if field.type.member.fixed_size():
+                    field.py_listsize = field.type.member.size
+
+            if field.type.fixed_size():
+                self.py_fixed_size += field.type.size
+
+def _py_get_length_field(expr):
+    '''
+    Figures out what C code is needed to get a length field.
+    For fields that follow a variable-length field, use the accessor.
+    Otherwise, just reference the structure field directly.
+    '''
+    if expr.lenfield_name is not None:
+        for grandparent in expr.parent.parents:
+            # This would be nicer if Request had an is_request attribute...
+            if hasattr(grandparent, "opcode"):
+                return expr.lenfield_name
+        return 'self.%s' % expr.lenfield_name
+    else:
+        return str(expr.nmemb)
+
+def _py_get_expr(expr):
+    '''
+    Figures out what C code is needed to get the length of a list field.
+    Recurses for math operations.
+    Returns bitcount for value-mask fields.
+    Otherwise, uses the value of the length field.
+    '''
+    lenexp = _py_get_length_field(expr)
+
+    if expr.op != None:
+        return '(' + _py_get_expr(expr.lhs) + ' ' + expr.op + ' ' + _py_get_expr(expr.rhs) + ')'
+    elif expr.bitfield:
+        return 'xcb.popcount(' + lenexp + ')'
+    else:
+        return lenexp
+
+def py_simple(self, name):
+    '''
+    Exported function that handles cardinal declarations.
+    These are types which are typedef'd to one of the CARDx's char, float, etc.
+    '''
+    _py_type_setup(self, name, '')
+
+def _py_type_alignsize(field):
+    if field.type.is_list:
+        return field.type.member.size if field.type.member.fixed_size() else 4
+    if field.type.is_container:
+        return field.type.size if field.type.fixed_size() else 4
+    return field.type.size
+        
+def _py_complex(self, name):
+    need_alignment = False
+
+    for field in self.fields:
+        if field.auto:
+            _py_push_pad(field.type.size)
+            continue
+        if field.type.is_simple:
+            _py_push_format(field, 'self.')
+            continue
+        if field.type.is_pad:
+            _py_push_pad(field.type.nmemb)
+            continue
+
+        (format, size, list) = _py_flush_format()
+        if len(list) > 0:
+            _py('        (%s,) = unpack_from(\'%s\', parent, offset)', list, format)
+        if size > 0:
+            _py('        offset += %d', size)
+
+        if need_alignment:
+            _py('        offset += xcb.type_pad(%d, offset)', _py_type_alignsize(field))
+        need_alignment = True
+
+        if field.type.is_list:
+            _py('        self.%s = xcb.List(parent, offset, %s, %s, %d)', _n(field.field_name), _py_get_expr(field.type.expr), field.py_listtype, field.py_listsize)
+            _py('        offset += len(self.%s.buf())', _n(field.field_name))
+        elif field.type.is_container and field.type.fixed_size():
+            _py('        self.%s = %s(parent, offset, %s)', _n(field.field_name), field.py_type, field.type.size)
+            _py('        offset += %s', field.type.size)
+        else:
+            _py('        self.%s = %s(parent, offset)', _n(field.field_name), field.py_type)
+            _py('        offset += len(self.%s)', _n(field.field_name))
+
+    (format, size, list) = _py_flush_format()
+    if len(list) > 0:
+        if need_alignment:
+            _py('        offset += xcb.type_pad(4, offset)')
+        _py('        (%s,) = unpack_from(\'%s\', parent, offset)', list, format)
+        _py('        offset += %d', size)
+
+    if self.fixed_size() or self.is_reply:
+        if self.fields and not all(field.auto or field.type.is_pad for field in self.fields):
+            _py_popline()
+
+def py_struct(self, name):
+    '''
+    Exported function that handles structure declarations.
+    '''
+    _py_type_setup(self, name)
+
+    _py_setlevel(0)
+    _py('')
+    _py('class %s(xcb.Struct):', self.py_type)
+    if self.fixed_size():
+        _py('    def __init__(self, parent, offset, size):')
+        _py('        xcb.Struct.__init__(self, parent, offset, size)')
+    else:
+        _py('    def __init__(self, parent, offset):')
+        _py('        xcb.Struct.__init__(self, parent, offset)')
+        _py('        base = offset')
+
+    _py_complex(self, name)
+
+    if not self.fixed_size():
+        _py('        xcb._resize_obj(self, offset - base)')
+
+def py_union(self, name):
+    '''
+    Exported function that handles union declarations.
+    '''
+    _py_type_setup(self, name)
+
+    _py_setlevel(0)
+    _py('')
+    _py('class %s(xcb.Union):', self.py_type)
+    if self.fixed_size():
+        _py('    def __init__(self, parent, offset, size):')
+        _py('        xcb.Union.__init__(self, parent, offset, size)')
+    else:
+        _py('    def __init__(self, parent, offset):')
+        _py('        xcb.Union.__init__(self, parent, offset)')
+        _py('        size = 0')
+
+    for field in self.fields:
+        if field.type.is_simple:
+            _py('        self.%s = unpack_from(\'%s\', parent, offset)', _n(field.field_name), field.type.py_format_str)
+            if not self.fixed_size():
+                _py('        size = max(size, %s)', field.type.size)
+        elif field.type.is_list:
+            _py('        self.%s = xcb.List(parent, offset, %s, %s, %s)', _n(field.field_name), _py_get_expr(field.type.expr), field.py_listtype, field.py_listsize)
+            if not self.fixed_size():
+                _py('        size = max(size, len(self.%s.buf()))', _n(field.field_name))
+        elif field.type.is_container and field.type.fixed_size():
+            _py('        self.%s = %s(parent, offset, %s)', _n(field.field_name), field.py_type, field.type.size)
+            if not self.fixed_size():
+                _py('        size = max(size, %s)', field.type.size)
+        else:
+            _py('        self.%s = %s(parent, offset)', _n(field.field_name), field.py_type)
+            if not self.fixed_size():
+                _py('        size = max(size, len(self.%s))', _n(field.field_name))
+
+    if not self.fixed_size():
+        _py('        xcb._resize_obj(self, size)')
+
+def _py_reply(self, name):
+    '''
+    Handles reply declarations.
+    '''
+    _py_type_setup(self, name, 'Reply')
+
+    _py_setlevel(0)
+    _py('')
+    _py('class %s(xcb.Reply):', self.py_reply_name)
+    _py('    def __init__(self, parent, offset=0):')
+    _py('        xcb.Reply.__init__(self, parent, offset)')
+
+    _py_complex(self, name)
+    
+def _py_request_helper(self, name, void, regular):
+    '''
+    Declares a request function.
+    '''
+
+    # Four stunningly confusing possibilities here:
+    #
+    #   Void            Non-void
+    # ------------------------------
+    # "req"            "req"
+    # 0 flag           CHECKED flag   Normal Mode
+    # void_cookie      req_cookie
+    # ------------------------------
+    # "req_checked"    "req_unchecked"
+    # CHECKED flag     0 flag         Abnormal Mode
+    # void_cookie      req_cookie
+    # ------------------------------
+
+
+    # Whether we are _checked or _unchecked
+    checked = void and not regular
+    unchecked = not void and not regular
+
+    # What kind of cookie we return
+    func_cookie = 'xcb.VoidCookie' if void else self.py_cookie_name
+
+    # What flag is passed to xcb_request
+    func_flags = checked or (not void and regular)
+
+    # What our function name is
+    func_name = self.py_request_name
+    if checked:
+        func_name = self.py_checked_name
+    if unchecked:
+        func_name = self.py_unchecked_name
+
+    param_fields = []
+    wire_fields = []
+
+    for field in self.fields:
+        if field.visible:
+            # The field should appear as a call parameter
+            param_fields.append(field)
+        if field.wire:
+            # We need to set the field up in the structure
+            wire_fields.append(field)
+
+    _py_setlevel(1)
+    _py('')
+    _py('    def %s(self, %s):', func_name, ', '.join([_n(x.field_name) for x in param_fields]))
+    _py('        buf = cStringIO.StringIO()')
+
+    for field in wire_fields:
+        if field.auto:
+            _py_push_pad(field.type.size)
+            continue
+        if field.type.is_simple:
+            _py_push_format(field)
+            continue
+        if field.type.is_pad:
+            _py_push_pad(field.type.nmemb)
+            continue
+
+        (format, size, list) = _py_flush_format()
+        if size > 0:
+            _py('        buf.write(pack(\'=%s\', %s))', format, list)
+
+        if field.type.is_expr:
+            _py('        buf.write(pack(\'=%s\', %s))', field.type.py_format_str, _py_get_expr(field.type.expr))
+        elif field.type.is_pad:
+            _py('        buf.write(pack(\'%sx\'))', field.type.nmemb)
+        elif field.type.is_container:
+            _py('        for elt in xcb.Iterator(%s, %d, \'%s\', False):', _n(field.field_name), field.type.py_format_len, _n(field.field_name))
+            _py('            buf.write(pack(\'=%s\', *elt))', field.type.py_format_str)
+        elif field.type.is_list and field.type.member.is_simple:
+            _py('        buf.write(str(buffer(array(\'%s\', %s))))', field.type.member.py_format_str, _n(field.field_name))
+        else:
+            _py('        for elt in xcb.Iterator(%s, %d, \'%s\', True):', _n(field.field_name), field.type.member.py_format_len, _n(field.field_name))
+            _py('            buf.write(pack(\'=%s\', *elt))', field.type.member.py_format_str)
+
+    (format, size, list) = _py_flush_format()
+    if size > 0:
+        _py('        buf.write(pack(\'=%s\', %s))', format, list)
+
+    _py('        return self.send_request(xcb.Request(buf.getvalue(), %s, %s, %s),', self.opcode, _b(void), _b(func_flags))
+    _py('                                 %s()%s', func_cookie, ')' if void else ',')
+    if not void:
+        _py('                                 %s)', self.py_reply_name)
+
+def py_request(self, name):
+    '''
+    Exported function that handles request declarations.
+    '''
+    _py_type_setup(self, name, 'Request')
+    _py_setlevel(0)
+
+    if self.reply:
+        # Cookie class declaration
+        _py('')
+        _py('class %s(xcb.Cookie):', self.py_cookie_name)
+        _py('    pass')
+
+    if self.reply:
+        # Reply class definition
+        _py_reply(self.reply, name)
+        # Request prototypes
+        _py_request_helper(self, name, False, True)
+        _py_request_helper(self, name, False, False)
+    else:
+        # Request prototypes
+        _py_request_helper(self, name, True, False)
+        _py_request_helper(self, name, True, True)
+
+def py_event(self, name):
+    '''
+    Exported function that handles event declarations.
+    '''
+    _py_type_setup(self, name, 'Event')
+
+    # Structure definition
+    _py_setlevel(0)
+    _py('')
+    _py('class %s(xcb.Event):', self.py_event_name)
+    _py('    def __init__(self, parent, offset=0):')
+    _py('        xcb.Event.__init__(self, parent, offset)')
+
+    _py_complex(self, name)
+
+    # Opcode define
+    _py_setlevel(2)
+    _py('    %s : %s,', self.opcodes[name], self.py_event_name)
+
+def py_error(self, name):
+    '''
+    Exported function that handles error declarations.
+    '''
+    _py_type_setup(self, name, 'Error')
+
+    # Structure definition
+    _py_setlevel(0)
+    _py('')
+    _py('class %s(xcb.Error):', self.py_error_name)
+    _py('    def __init__(self, parent, offset=0):')
+    _py('        xcb.Error.__init__(self, parent, offset)')
+
+    _py_complex(self, name)
+
+    # Exception definition
+    _py('')
+    _py('class %s(xcb.ProtocolException):', self.py_except_name)
+    _py('    pass')
+
+    # Opcode define
+    _py_setlevel(3)
+    _py('    %s : (%s, %s),', self.opcodes[name], self.py_error_name, self.py_except_name)
+
+
+# Main routine starts here
+
+# Must create an "output" dictionary before any xcbgen imports.
+output = {'open'    : py_open,
+          'close'   : py_close,
+          'simple'  : py_simple,
+          'enum'    : py_enum,
+          'struct'  : py_struct,
+          'union'   : py_union,
+          'request' : py_request,
+          'event'   : py_event,
+          'error'   : py_error,
+          'eventstruct' : lambda *a, **k: None
+          }
+
+# Boilerplate below this point
+
+# Check for the argument that specifies path to the xcbgen python package.
+try:
+    opts, args = getopt.getopt(sys.argv[1:], 'p:')
+except getopt.GetoptError, err:
+    print str(err)
+    print 'Usage: py_client.py [-p path] file.xml'
+    sys.exit(1)
+
+for (opt, arg) in opts:
+    if opt == '-p':
+        sys.path.append(arg)
+
+# Import the module class
+try:
+    from xcbgen.state import Module
+except ImportError:
+    print ''
+    print 'Failed to load the xcbgen Python package!'
+    print 'Make sure that xcb/proto installed it on your Python path.'
+    print 'If not, you will need to create a .pth file or define $PYTHONPATH'
+    print 'to extend the path.'
+    print 'Refer to the README file in xcb/proto for more info.'
+    print ''
+    raise
+
+# Parse the xml header
+module = Module(args[0], output)
+
+# Build type-registry and resolve type dependencies
+module.register()
+module.resolve()
+
+# Output the code
+module.generate()

Property changes on: xcb/xpyb/create-1.3.1-xcbproto-patch/xpyb-1.3.1-new/src/py_client.py
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: xcb/xpyb/create-1.3.1-xcbproto-patch/xpyb-1.3.1-new/src
===================================================================
--- xcb/xpyb/create-1.3.1-xcbproto-patch/xpyb-1.3.1-new/src	(nonexistent)
+++ xcb/xpyb/create-1.3.1-xcbproto-patch/xpyb-1.3.1-new/src	(revision 5)

Property changes on: xcb/xpyb/create-1.3.1-xcbproto-patch/xpyb-1.3.1-new/src
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xcb/xpyb/create-1.3.1-xcbproto-patch/xpyb-1.3.1-new
===================================================================
--- xcb/xpyb/create-1.3.1-xcbproto-patch/xpyb-1.3.1-new	(nonexistent)
+++ xcb/xpyb/create-1.3.1-xcbproto-patch/xpyb-1.3.1-new	(revision 5)

Property changes on: xcb/xpyb/create-1.3.1-xcbproto-patch/xpyb-1.3.1-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xcb/xpyb/create-1.3.1-xcbproto-patch
===================================================================
--- xcb/xpyb/create-1.3.1-xcbproto-patch	(nonexistent)
+++ xcb/xpyb/create-1.3.1-xcbproto-patch	(revision 5)

Property changes on: xcb/xpyb/create-1.3.1-xcbproto-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xcb/xpyb/patches/README
===================================================================
--- xcb/xpyb/patches/README	(nonexistent)
+++ xcb/xpyb/patches/README	(revision 5)
@@ -0,0 +1,6 @@
+
+/* begin *
+
+   TODO: Leave some comment here.
+
+ * end */
Index: xcb/xpyb/patches
===================================================================
--- xcb/xpyb/patches	(nonexistent)
+++ xcb/xpyb/patches	(revision 5)

Property changes on: xcb/xpyb/patches
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xcb/xpyb
===================================================================
--- xcb/xpyb	(nonexistent)
+++ xcb/xpyb	(revision 5)

Property changes on: xcb/xpyb
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xcb
===================================================================
--- xcb	(nonexistent)
+++ xcb	(revision 5)

Property changes on: xcb
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/Makefile
===================================================================
--- xserver/Makefile	(nonexistent)
+++ xserver/Makefile	(revision 5)
@@ -0,0 +1,13 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+SOURCE_REQUIRES += ALL_DIRS
+
+
+include ../../../build-system/core.mk
+
+
+download_clean:
+	@true
+
+.PHONY: download_clean
Index: xserver/xorg-server/Makefile
===================================================================
--- xserver/xorg-server/Makefile	(nonexistent)
+++ xserver/xorg-server/Makefile	(revision 5)
@@ -0,0 +1,66 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/xserver/xorg-server
+
+versions    = 21.1.7
+pkgname     = xorg-server
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+patches     = $(CURDIR)/patches/xorg-server-21.1.7-black.patch
+patches    += $(CURDIR)/patches/xorg-server-21.1.7-dont-check-SeatId.patch
+patches    += $(CURDIR)/patches/xorg-server-21.1.7-mouse-kbd-layout.patch
+patches    += $(CURDIR)/patches/xorg-server-21.1.7-modesetting-on-GeForce.patch
+patches    += $(CURDIR)/patches/xorg-server-21.1.7-intel-ddx-only-on-pre-gen4.patch
+patches    += $(CURDIR)/patches/xorg-server-21.1.7-nouveau-segfault.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-21.1.7-black-patch                       ; ./create.patch.sh ) ; \
+	 ( cd create-21.1.7-dont-check-SeatId-patch           ; ./create.patch.sh ) ; \
+	 ( cd create-21.1.7-mouse-kbd-layout-patch            ; ./create.patch.sh ) ; \
+	 ( cd create-21.1.7-modesetting-on-GeForce-patch      ; ./create.patch.sh ) ; \
+	 ( cd create-21.1.7-intel-ddx-only-on-pre-gen4-patch  ; ./create.patch.sh ) ; \
+	 ( cd create-21.1.7-nouveau-segfault-patch            ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s) $(patches)
Index: xserver/xorg-server/create-21.1.7-black-patch/create.patch.sh
===================================================================
--- xserver/xorg-server/create-21.1.7-black-patch/create.patch.sh	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-black-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=21.1.7
+
+tar --files-from=file.list -xJvf ../xorg-server-$VERSION.tar.xz
+mv xorg-server-$VERSION xorg-server-$VERSION-orig
+
+cp -rf ./xorg-server-$VERSION-new ./xorg-server-$VERSION
+
+diff --unified -Nr  xorg-server-$VERSION-orig  xorg-server-$VERSION > xorg-server-$VERSION-black.patch
+
+mv xorg-server-$VERSION-black.patch ../patches
+
+rm -rf ./xorg-server-$VERSION
+rm -rf ./xorg-server-$VERSION-orig

Property changes on: xserver/xorg-server/create-21.1.7-black-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: xserver/xorg-server/create-21.1.7-black-patch/file.list
===================================================================
--- xserver/xorg-server/create-21.1.7-black-patch/file.list	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-black-patch/file.list	(revision 5)
@@ -0,0 +1 @@
+xorg-server-21.1.7/dix/window.c
Index: xserver/xorg-server/create-21.1.7-black-patch/xorg-server-21.1.7-new/dix/window.c
===================================================================
--- xserver/xorg-server/create-21.1.7-black-patch/xorg-server-21.1.7-new/dix/window.c	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-black-patch/xorg-server-21.1.7-new/dix/window.c	(revision 5)
@@ -0,0 +1,3733 @@
+/*
+
+Copyright (c) 2006, Red Hat, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+Copyright 1987, 1998  The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
+
+			All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+*/
+
+/* The panoramix components contained the following notice */
+/*****************************************************************
+
+Copyright (c) 1991, 1997 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.
+
+******************************************************************/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "misc.h"
+#include "scrnintstr.h"
+#include "os.h"
+#include "regionstr.h"
+#include "validate.h"
+#include "windowstr.h"
+#include "propertyst.h"
+#include "input.h"
+#include "inputstr.h"
+#include "resource.h"
+#include "colormapst.h"
+#include "cursorstr.h"
+#include "dixstruct.h"
+#include "gcstruct.h"
+#include "servermd.h"
+#include "mivalidate.h"
+#ifdef PANORAMIX
+#include "panoramiX.h"
+#include "panoramiXsrv.h"
+#endif
+#include "dixevents.h"
+#include "globals.h"
+#include "mi.h"                 /* miPaintWindow */
+#ifdef COMPOSITE
+#include "compint.h"
+#endif
+#include "selection.h"
+#include "inpututils.h"
+
+#include "privates.h"
+#include "xace.h"
+#include "exevents.h"
+
+#include <X11/Xatom.h>          /* must come after server includes */
+
+/******
+ * Window stuff for server
+ *
+ *    CreateRootWindow, CreateWindow, ChangeWindowAttributes,
+ *    GetWindowAttributes, DeleteWindow, DestroySubWindows,
+ *    HandleSaveSet, ReparentWindow, MapWindow, MapSubWindows,
+ *    UnmapWindow, UnmapSubWindows, ConfigureWindow, CirculateWindow,
+ *    ChangeWindowDeviceCursor
+ ******/
+
+Bool bgNoneRoot = FALSE;
+
+static unsigned char _back_lsb[4] = { 0x00, 0x00, 0x00, 0x00 };
+static unsigned char _back_msb[4] = { 0x00, 0x00, 0x00, 0x00 };
+
+static Bool WindowParentHasDeviceCursor(WindowPtr pWin,
+                                        DeviceIntPtr pDev, CursorPtr pCurs);
+static Bool
+
+WindowSeekDeviceCursor(WindowPtr pWin,
+                       DeviceIntPtr pDev,
+                       DevCursNodePtr * pNode, DevCursNodePtr * pPrev);
+
+int screenIsSaved = SCREEN_SAVER_OFF;
+
+static Bool TileScreenSaver(ScreenPtr pScreen, int kind);
+
+#define INPUTONLY_LEGAL_MASK (CWWinGravity | CWEventMask | \
+			      CWDontPropagate | CWOverrideRedirect | CWCursor )
+
+#define BOXES_OVERLAP(b1, b2) \
+      (!( ((b1)->x2 <= (b2)->x1)  || \
+	( ((b1)->x1 >= (b2)->x2)) || \
+	( ((b1)->y2 <= (b2)->y1)) || \
+	( ((b1)->y1 >= (b2)->y2)) ) )
+
+#define RedirectSend(pWin) \
+    ((pWin->eventMask|wOtherEventMasks(pWin)) & SubstructureRedirectMask)
+
+#define SubSend(pWin) \
+    ((pWin->eventMask|wOtherEventMasks(pWin)) & SubstructureNotifyMask)
+
+#define StrSend(pWin) \
+    ((pWin->eventMask|wOtherEventMasks(pWin)) & StructureNotifyMask)
+
+#define SubStrSend(pWin,pParent) (StrSend(pWin) || SubSend(pParent))
+
+#ifdef COMPOSITE
+static const char *overlay_win_name = "<composite overlay>";
+#endif
+
+static const char *
+get_window_name(WindowPtr pWin)
+{
+#define WINDOW_NAME_BUF_LEN 512
+    PropertyPtr prop;
+    static char buf[WINDOW_NAME_BUF_LEN];
+    int len;
+
+#ifdef COMPOSITE
+    CompScreenPtr comp_screen = GetCompScreen(pWin->drawable.pScreen);
+
+    if (comp_screen && pWin == comp_screen->pOverlayWin)
+        return overlay_win_name;
+#endif
+
+    for (prop = wUserProps(pWin); prop; prop = prop->next) {
+        if (prop->propertyName == XA_WM_NAME && prop->type == XA_STRING &&
+            prop->data) {
+            len = min(prop->size, WINDOW_NAME_BUF_LEN - 1);
+            memcpy(buf, prop->data, len);
+            buf[len] = '\0';
+            return buf;
+        }
+    }
+
+    return NULL;
+#undef WINDOW_NAME_BUF_LEN
+}
+
+static void
+log_window_info(WindowPtr pWin, int depth)
+{
+    int i;
+    const char *win_name, *visibility;
+    BoxPtr rects;
+
+    for (i = 0; i < (depth << 2); i++)
+        ErrorF(" ");
+
+    win_name = get_window_name(pWin);
+    ErrorF("win 0x%.8x (%s), [%d, %d] to [%d, %d]",
+           (unsigned) pWin->drawable.id,
+           win_name ? win_name : "no name",
+           pWin->drawable.x, pWin->drawable.y,
+           pWin->drawable.x + pWin->drawable.width,
+           pWin->drawable.y + pWin->drawable.height);
+
+    if (pWin->overrideRedirect)
+        ErrorF(" (override redirect)");
+#ifdef COMPOSITE
+    if (pWin->redirectDraw)
+        ErrorF(" (%s compositing: pixmap %x)",
+               (pWin->redirectDraw == RedirectDrawAutomatic) ?
+               "automatic" : "manual",
+               (unsigned) pWin->drawable.pScreen->GetWindowPixmap(pWin)->drawable.id);
+#endif
+
+    switch (pWin->visibility) {
+    case VisibilityUnobscured:
+        visibility = "unobscured";
+        break;
+    case VisibilityPartiallyObscured:
+        visibility = "partially obscured";
+        break;
+    case VisibilityFullyObscured:
+        visibility = "fully obscured";
+        break;
+    case VisibilityNotViewable:
+        visibility = "unviewable";
+        break;
+    }
+    ErrorF(", %s", visibility);
+
+    if (RegionNotEmpty(&pWin->clipList)) {
+        ErrorF(", clip list:");
+        rects = RegionRects(&pWin->clipList);
+        for (i = 0; i < RegionNumRects(&pWin->clipList); i++)
+            ErrorF(" [(%d, %d) to (%d, %d)]",
+                   rects[i].x1, rects[i].y1, rects[i].x2, rects[i].y2);
+        ErrorF("; extents [(%d, %d) to (%d, %d)]",
+               pWin->clipList.extents.x1, pWin->clipList.extents.y1,
+               pWin->clipList.extents.x2, pWin->clipList.extents.y2);
+    }
+
+    ErrorF("\n");
+}
+
+static const char*
+grab_grabtype_to_text(GrabPtr pGrab)
+{
+    switch (pGrab->grabtype) {
+        case XI2:
+            return "xi2";
+        case CORE:
+            return "core";
+        default:
+            return "xi1";
+    }
+}
+
+static const char*
+grab_type_to_text(GrabPtr pGrab)
+{
+    switch (pGrab->type) {
+        case ButtonPress:
+            return "ButtonPress";
+        case KeyPress:
+            return "KeyPress";
+        case XI_Enter:
+            return "XI_Enter";
+        case XI_FocusIn:
+            return "XI_FocusIn";
+        default:
+            return "unknown?!";
+    }
+}
+
+static void
+log_grab_info(void *value, XID id, void *cdata)
+{
+    int i, j;
+    GrabPtr pGrab = (GrabPtr)value;
+
+    ErrorF("  grab 0x%lx (%s), type '%s' on window 0x%lx\n",
+           (unsigned long) pGrab->resource,
+           grab_grabtype_to_text(pGrab),
+           grab_type_to_text(pGrab),
+           (unsigned long) pGrab->window->drawable.id);
+    ErrorF("    detail %d (mask %lu), modifiersDetail %d (mask %lu)\n",
+           pGrab->detail.exact,
+           pGrab->detail.pMask ? (unsigned long) *(pGrab->detail.pMask) : 0,
+           pGrab->modifiersDetail.exact,
+           pGrab->modifiersDetail.pMask ?
+           (unsigned long) *(pGrab->modifiersDetail.pMask) :
+           (unsigned long) 0);
+    ErrorF("    device '%s' (%d), modifierDevice '%s' (%d)\n",
+           pGrab->device->name, pGrab->device->id,
+           pGrab->modifierDevice->name, pGrab->modifierDevice->id);
+    if (pGrab->grabtype == CORE) {
+        ErrorF("    core event mask 0x%lx\n",
+               (unsigned long) pGrab->eventMask);
+    }
+    else if (pGrab->grabtype == XI) {
+        ErrorF("    xi1 event mask 0x%lx\n",
+               (unsigned long) pGrab->eventMask);
+    }
+    else if (pGrab->grabtype == XI2) {
+        for (i = 0; i < xi2mask_num_masks(pGrab->xi2mask); i++) {
+            const unsigned char *mask;
+            int print;
+
+            print = 0;
+            for (j = 0; j < XI2MASKSIZE; j++) {
+                mask = xi2mask_get_one_mask(pGrab->xi2mask, i);
+                if (mask[j]) {
+                    print = 1;
+                    break;
+                }
+            }
+            if (!print)
+                continue;
+            ErrorF("      xi2 event mask 0x");
+            for (j = 0; j < xi2mask_mask_size(pGrab->xi2mask); j++)
+                ErrorF("%x ", mask[j]);
+            ErrorF("\n");
+        }
+    }
+    ErrorF("    owner-events %s, kb %d ptr %d, confine 0x%lx, cursor 0x%lx\n",
+           pGrab->ownerEvents ? "true" : "false",
+           pGrab->keyboardMode, pGrab->pointerMode,
+           pGrab->confineTo ? (unsigned long) pGrab->confineTo->drawable.id : 0,
+           pGrab->cursor ? (unsigned long) pGrab->cursor->id : 0);
+}
+
+void
+PrintPassiveGrabs(void)
+{
+    int i;
+    LocalClientCredRec *lcc;
+    pid_t clientpid;
+    const char *cmdname;
+    const char *cmdargs;
+
+    ErrorF("Printing all currently registered grabs\n");
+
+    for (i = 1; i < currentMaxClients; i++) {
+        if (!clients[i] || clients[i]->clientState != ClientStateRunning)
+            continue;
+
+        clientpid = GetClientPid(clients[i]);
+        cmdname = GetClientCmdName(clients[i]);
+        cmdargs = GetClientCmdArgs(clients[i]);
+        if ((clientpid > 0) && (cmdname != NULL)) {
+            ErrorF("  Printing all registered grabs of client pid %ld %s %s\n",
+                   (long) clientpid, cmdname, cmdargs ? cmdargs : "");
+        } else {
+            if (GetLocalClientCreds(clients[i], &lcc) == -1) {
+                ErrorF("  GetLocalClientCreds() failed\n");
+                continue;
+            }
+            ErrorF("  Printing all registered grabs of client pid %ld uid %ld gid %ld\n",
+                   (lcc->fieldsSet & LCC_PID_SET) ? (long) lcc->pid : 0,
+                   (lcc->fieldsSet & LCC_UID_SET) ? (long) lcc->euid : 0,
+                   (lcc->fieldsSet & LCC_GID_SET) ? (long) lcc->egid : 0);
+            FreeLocalClientCreds(lcc);
+        }
+
+        FindClientResourcesByType(clients[i], RT_PASSIVEGRAB, log_grab_info, NULL);
+    }
+    ErrorF("End list of registered passive grabs\n");
+}
+
+void
+PrintWindowTree(void)
+{
+    int scrnum, depth;
+    ScreenPtr pScreen;
+    WindowPtr pWin;
+
+    for (scrnum = 0; scrnum < screenInfo.numScreens; scrnum++) {
+        pScreen = screenInfo.screens[scrnum];
+        ErrorF("[dix] Dumping windows for screen %d (pixmap %x):\n", scrnum,
+               (unsigned) pScreen->GetScreenPixmap(pScreen)->drawable.id);
+        pWin = pScreen->root;
+        depth = 1;
+        while (pWin) {
+            log_window_info(pWin, depth);
+            if (pWin->firstChild) {
+                pWin = pWin->firstChild;
+                depth++;
+                continue;
+            }
+            while (pWin && !pWin->nextSib) {
+                pWin = pWin->parent;
+                depth--;
+            }
+            if (!pWin)
+                break;
+            pWin = pWin->nextSib;
+        }
+    }
+}
+
+int
+TraverseTree(WindowPtr pWin, VisitWindowProcPtr func, void *data)
+{
+    int result;
+    WindowPtr pChild;
+
+    if (!(pChild = pWin))
+        return WT_NOMATCH;
+    while (1) {
+        result = (*func) (pChild, data);
+        if (result == WT_STOPWALKING)
+            return WT_STOPWALKING;
+        if ((result == WT_WALKCHILDREN) && pChild->firstChild) {
+            pChild = pChild->firstChild;
+            continue;
+        }
+        while (!pChild->nextSib && (pChild != pWin))
+            pChild = pChild->parent;
+        if (pChild == pWin)
+            break;
+        pChild = pChild->nextSib;
+    }
+    return WT_NOMATCH;
+}
+
+/*****
+ * WalkTree
+ *   Walk the window tree, for SCREEN, performing FUNC(pWin, data) on
+ *   each window.  If FUNC returns WT_WALKCHILDREN, traverse the children,
+ *   if it returns WT_DONTWALKCHILDREN, don't.  If it returns WT_STOPWALKING,
+ *   exit WalkTree.  Does depth-first traverse.
+ *****/
+
+int
+WalkTree(ScreenPtr pScreen, VisitWindowProcPtr func, void *data)
+{
+    return (TraverseTree(pScreen->root, func, data));
+}
+
+/* hack to force no backing store */
+Bool disableBackingStore = FALSE;
+Bool enableBackingStore = FALSE;
+
+static void
+SetWindowToDefaults(WindowPtr pWin)
+{
+    pWin->prevSib = NullWindow;
+    pWin->firstChild = NullWindow;
+    pWin->lastChild = NullWindow;
+
+    pWin->valdata = NULL;
+    pWin->optional = NULL;
+    pWin->cursorIsNone = TRUE;
+
+    pWin->backingStore = NotUseful;
+
+    pWin->mapped = FALSE;       /* off */
+    pWin->realized = FALSE;     /* off */
+    pWin->viewable = FALSE;
+    pWin->visibility = VisibilityNotViewable;
+    pWin->overrideRedirect = FALSE;
+    pWin->saveUnder = FALSE;
+
+    pWin->bitGravity = ForgetGravity;
+    pWin->winGravity = NorthWestGravity;
+
+    pWin->eventMask = 0;
+    pWin->deliverableEvents = 0;
+    pWin->dontPropagate = 0;
+    pWin->redirectDraw = RedirectDrawNone;
+    pWin->forcedBG = FALSE;
+    pWin->unhittable = FALSE;
+
+#ifdef COMPOSITE
+    pWin->damagedDescendants = FALSE;
+#endif
+}
+
+static void
+MakeRootTile(WindowPtr pWin)
+{
+    ScreenPtr pScreen = pWin->drawable.pScreen;
+    GCPtr pGC;
+    unsigned char back[128];
+    int len = BitmapBytePad(sizeof(long));
+    unsigned char *from, *to;
+    int i, j;
+
+    pWin->background.pixmap = (*pScreen->CreatePixmap) (pScreen, 4, 4,
+                                                        pScreen->rootDepth, 0);
+
+    pWin->backgroundState = BackgroundPixmap;
+    pGC = GetScratchGC(pScreen->rootDepth, pScreen);
+    if (!pWin->background.pixmap || !pGC)
+        FatalError("could not create root tile");
+
+    {
+        ChangeGCVal attributes[2];
+
+        attributes[0].val = pScreen->whitePixel;
+        attributes[1].val = pScreen->blackPixel;
+
+        (void) ChangeGC(NullClient, pGC, GCForeground | GCBackground,
+                        attributes);
+    }
+
+    ValidateGC((DrawablePtr) pWin->background.pixmap, pGC);
+
+    from = (screenInfo.bitmapBitOrder == LSBFirst) ? _back_lsb : _back_msb;
+    to = back;
+
+    for (i = 4; i > 0; i--, from++)
+        for (j = len; j > 0; j--)
+            *to++ = *from;
+
+    (*pGC->ops->PutImage) ((DrawablePtr) pWin->background.pixmap, pGC, 1,
+                           0, 0, len, 4, 0, XYBitmap, (char *) back);
+
+    FreeScratchGC(pGC);
+
+}
+
+/*****
+ * CreateRootWindow
+ *    Makes a window at initialization time for specified screen
+ *****/
+
+Bool
+CreateRootWindow(ScreenPtr pScreen)
+{
+    WindowPtr pWin;
+    BoxRec box;
+    PixmapFormatRec *format;
+
+    pWin = dixAllocateScreenObjectWithPrivates(pScreen, WindowRec, PRIVATE_WINDOW);
+    if (!pWin)
+        return FALSE;
+
+    pScreen->screensaver.pWindow = NULL;
+    pScreen->screensaver.wid = FakeClientID(0);
+    pScreen->screensaver.ExternalScreenSaver = NULL;
+    screenIsSaved = SCREEN_SAVER_OFF;
+
+    pScreen->root = pWin;
+
+    pWin->drawable.pScreen = pScreen;
+    pWin->drawable.type = DRAWABLE_WINDOW;
+
+    pWin->drawable.depth = pScreen->rootDepth;
+    for (format = screenInfo.formats;
+         format->depth != pScreen->rootDepth; format++);
+    pWin->drawable.bitsPerPixel = format->bitsPerPixel;
+
+    pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+
+    pWin->parent = NullWindow;
+    SetWindowToDefaults(pWin);
+
+    pWin->optional = malloc(sizeof(WindowOptRec));
+    if (!pWin->optional)
+        return FALSE;
+
+    pWin->optional->dontPropagateMask = 0;
+    pWin->optional->otherEventMasks = 0;
+    pWin->optional->otherClients = NULL;
+    pWin->optional->passiveGrabs = NULL;
+    pWin->optional->userProps = NULL;
+    pWin->optional->backingBitPlanes = ~0L;
+    pWin->optional->backingPixel = 0;
+    pWin->optional->boundingShape = NULL;
+    pWin->optional->clipShape = NULL;
+    pWin->optional->inputShape = NULL;
+    pWin->optional->inputMasks = NULL;
+    pWin->optional->deviceCursors = NULL;
+    pWin->optional->colormap = pScreen->defColormap;
+    pWin->optional->visual = pScreen->rootVisual;
+
+    pWin->nextSib = NullWindow;
+
+    pWin->drawable.id = FakeClientID(0);
+
+    pWin->origin.x = pWin->origin.y = 0;
+    pWin->drawable.height = pScreen->height;
+    pWin->drawable.width = pScreen->width;
+    pWin->drawable.x = pWin->drawable.y = 0;
+
+    box.x1 = 0;
+    box.y1 = 0;
+    box.x2 = pScreen->width;
+    box.y2 = pScreen->height;
+    RegionInit(&pWin->clipList, &box, 1);
+    RegionInit(&pWin->winSize, &box, 1);
+    RegionInit(&pWin->borderSize, &box, 1);
+    RegionInit(&pWin->borderClip, &box, 1);
+
+    pWin->drawable.class = InputOutput;
+    pWin->optional->visual = pScreen->rootVisual;
+
+    pWin->backgroundState = BackgroundPixel;
+    pWin->background.pixel = pScreen->whitePixel;
+
+    pWin->borderIsPixel = TRUE;
+    pWin->border.pixel = pScreen->blackPixel;
+    pWin->borderWidth = 0;
+
+    /*  security creation/labeling check
+     */
+    if (XaceHook(XACE_RESOURCE_ACCESS, serverClient, pWin->drawable.id,
+                 RT_WINDOW, pWin, RT_NONE, NULL, DixCreateAccess))
+        return FALSE;
+
+    if (!AddResource(pWin->drawable.id, RT_WINDOW, (void *) pWin))
+        return FALSE;
+
+    if (disableBackingStore)
+        pScreen->backingStoreSupport = NotUseful;
+    if (enableBackingStore)
+        pScreen->backingStoreSupport = WhenMapped;
+#ifdef COMPOSITE
+    if (noCompositeExtension)
+        pScreen->backingStoreSupport = NotUseful;
+#endif
+
+    pScreen->saveUnderSupport = NotUseful;
+
+    return TRUE;
+}
+
+void
+InitRootWindow(WindowPtr pWin)
+{
+    ScreenPtr pScreen = pWin->drawable.pScreen;
+    int backFlag = CWBorderPixel | CWCursor | CWBackingStore;
+
+    if (!(*pScreen->CreateWindow) (pWin))
+        return;                 /* XXX */
+    (*pScreen->PositionWindow) (pWin, 0, 0);
+
+    pWin->cursorIsNone = FALSE;
+    pWin->optional->cursor = RefCursor(rootCursor);
+
+    if (party_like_its_1989) {
+        MakeRootTile(pWin);
+        backFlag |= CWBackPixmap;
+    }
+    else if (pScreen->canDoBGNoneRoot && bgNoneRoot) {
+        pWin->backgroundState = XaceBackgroundNoneState(pWin);
+        pWin->background.pixel = pScreen->whitePixel;
+        backFlag |= CWBackPixmap;
+    }
+    else {
+        pWin->backgroundState = BackgroundPixel;
+        if (whiteRoot)
+            pWin->background.pixel = pScreen->whitePixel;
+        else
+            pWin->background.pixel = pScreen->blackPixel;
+        backFlag |= CWBackPixel;
+    }
+
+    pWin->backingStore = NotUseful;
+    /* We SHOULD check for an error value here XXX */
+    (*pScreen->ChangeWindowAttributes) (pWin, backFlag);
+
+    MapWindow(pWin, serverClient);
+}
+
+/* Set the region to the intersection of the rectangle and the
+ * window's winSize.  The window is typically the parent of the
+ * window from which the region came.
+ */
+
+static void
+ClippedRegionFromBox(WindowPtr pWin, RegionPtr Rgn, int x, int y, int w, int h)
+{
+    BoxRec box = *RegionExtents(&pWin->winSize);
+
+    /* we do these calculations to avoid overflows */
+    if (x > box.x1)
+        box.x1 = x;
+    if (y > box.y1)
+        box.y1 = y;
+    x += w;
+    if (x < box.x2)
+        box.x2 = x;
+    y += h;
+    if (y < box.y2)
+        box.y2 = y;
+    if (box.x1 > box.x2)
+        box.x2 = box.x1;
+    if (box.y1 > box.y2)
+        box.y2 = box.y1;
+    RegionReset(Rgn, &box);
+    RegionIntersect(Rgn, Rgn, &pWin->winSize);
+}
+
+static RealChildHeadProc realChildHeadProc = NULL;
+
+void
+RegisterRealChildHeadProc(RealChildHeadProc proc)
+{
+    realChildHeadProc = proc;
+}
+
+WindowPtr
+RealChildHead(WindowPtr pWin)
+{
+    if (realChildHeadProc) {
+        return realChildHeadProc(pWin);
+    }
+
+    if (!pWin->parent &&
+        (screenIsSaved == SCREEN_SAVER_ON) &&
+        (HasSaverWindow(pWin->drawable.pScreen)))
+        return pWin->firstChild;
+    else
+        return NullWindow;
+}
+
+/*****
+ * CreateWindow
+ *    Makes a window in response to client request
+ *****/
+
+WindowPtr
+CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w,
+             unsigned h, unsigned bw, unsigned class, Mask vmask, XID *vlist,
+             int depth, ClientPtr client, VisualID visual, int *error)
+{
+    WindowPtr pWin;
+    WindowPtr pHead;
+    ScreenPtr pScreen;
+    int idepth, ivisual;
+    Bool fOK;
+    DepthPtr pDepth;
+    PixmapFormatRec *format;
+    WindowOptPtr ancwopt;
+
+    if (class == CopyFromParent)
+        class = pParent->drawable.class;
+
+    if ((class != InputOutput) && (class != InputOnly)) {
+        *error = BadValue;
+        client->errorValue = class;
+        return NullWindow;
+    }
+
+    if ((class != InputOnly) && (pParent->drawable.class == InputOnly)) {
+        *error = BadMatch;
+        return NullWindow;
+    }
+
+    if ((class == InputOnly) && ((bw != 0) || (depth != 0))) {
+        *error = BadMatch;
+        return NullWindow;
+    }
+
+    pScreen = pParent->drawable.pScreen;
+    if ((class == InputOutput) && (depth == 0))
+        depth = pParent->drawable.depth;
+    ancwopt = pParent->optional;
+    if (!ancwopt)
+        ancwopt = FindWindowWithOptional(pParent)->optional;
+    if (visual == CopyFromParent) {
+        visual = ancwopt->visual;
+    }
+
+    /* Find out if the depth and visual are acceptable for this Screen */
+    if ((visual != ancwopt->visual) || (depth != pParent->drawable.depth)) {
+        fOK = FALSE;
+        for (idepth = 0; idepth < pScreen->numDepths; idepth++) {
+            pDepth = (DepthPtr) &pScreen->allowedDepths[idepth];
+            if ((depth == pDepth->depth) || (depth == 0)) {
+                for (ivisual = 0; ivisual < pDepth->numVids; ivisual++) {
+                    if (visual == pDepth->vids[ivisual]) {
+                        fOK = TRUE;
+                        break;
+                    }
+                }
+            }
+        }
+        if (fOK == FALSE) {
+            *error = BadMatch;
+            return NullWindow;
+        }
+    }
+
+    if (((vmask & (CWBorderPixmap | CWBorderPixel)) == 0) &&
+        (class != InputOnly) && (depth != pParent->drawable.depth)) {
+        *error = BadMatch;
+        return NullWindow;
+    }
+
+    if (((vmask & CWColormap) == 0) &&
+        (class != InputOnly) &&
+        ((visual != ancwopt->visual) || (ancwopt->colormap == None))) {
+        *error = BadMatch;
+        return NullWindow;
+    }
+
+    pWin = dixAllocateScreenObjectWithPrivates(pScreen, WindowRec, PRIVATE_WINDOW);
+    if (!pWin) {
+        *error = BadAlloc;
+        return NullWindow;
+    }
+    pWin->drawable = pParent->drawable;
+    pWin->drawable.depth = depth;
+    if (depth == pParent->drawable.depth)
+        pWin->drawable.bitsPerPixel = pParent->drawable.bitsPerPixel;
+    else {
+        for (format = screenInfo.formats; format->depth != depth; format++);
+        pWin->drawable.bitsPerPixel = format->bitsPerPixel;
+    }
+    if (class == InputOnly)
+        pWin->drawable.type = (short) UNDRAWABLE_WINDOW;
+    pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+
+    pWin->drawable.id = wid;
+    pWin->drawable.class = class;
+
+    pWin->parent = pParent;
+    SetWindowToDefaults(pWin);
+
+    if (visual != ancwopt->visual) {
+        if (!MakeWindowOptional(pWin)) {
+            dixFreeObjectWithPrivates(pWin, PRIVATE_WINDOW);
+            *error = BadAlloc;
+            return NullWindow;
+        }
+        pWin->optional->visual = visual;
+        pWin->optional->colormap = None;
+    }
+
+    pWin->borderWidth = bw;
+
+    /*  security creation/labeling check
+     */
+    *error = XaceHook(XACE_RESOURCE_ACCESS, client, wid, RT_WINDOW, pWin,
+                      RT_WINDOW, pWin->parent,
+                      DixCreateAccess | DixSetAttrAccess);
+    if (*error != Success) {
+        dixFreeObjectWithPrivates(pWin, PRIVATE_WINDOW);
+        return NullWindow;
+    }
+
+    pWin->backgroundState = XaceBackgroundNoneState(pWin);
+    pWin->background.pixel = pScreen->whitePixel;
+
+    pWin->borderIsPixel = pParent->borderIsPixel;
+    pWin->border = pParent->border;
+    if (pWin->borderIsPixel == FALSE)
+        pWin->border.pixmap->refcnt++;
+
+    pWin->origin.x = x + (int) bw;
+    pWin->origin.y = y + (int) bw;
+    pWin->drawable.width = w;
+    pWin->drawable.height = h;
+    pWin->drawable.x = pParent->drawable.x + x + (int) bw;
+    pWin->drawable.y = pParent->drawable.y + y + (int) bw;
+
+    /* set up clip list correctly for unobscured WindowPtr */
+    RegionNull(&pWin->clipList);
+    RegionNull(&pWin->borderClip);
+    RegionNull(&pWin->winSize);
+    RegionNull(&pWin->borderSize);
+
+    pHead = RealChildHead(pParent);
+    if (pHead) {
+        pWin->nextSib = pHead->nextSib;
+        if (pHead->nextSib)
+            pHead->nextSib->prevSib = pWin;
+        else
+            pParent->lastChild = pWin;
+        pHead->nextSib = pWin;
+        pWin->prevSib = pHead;
+    }
+    else {
+        pWin->nextSib = pParent->firstChild;
+        if (pParent->firstChild)
+            pParent->firstChild->prevSib = pWin;
+        else
+            pParent->lastChild = pWin;
+        pParent->firstChild = pWin;
+    }
+
+    SetWinSize(pWin);
+    SetBorderSize(pWin);
+
+    /* We SHOULD check for an error value here XXX */
+    if (!(*pScreen->CreateWindow) (pWin)) {
+        *error = BadAlloc;
+        DeleteWindow(pWin, None);
+        return NullWindow;
+    }
+    /* We SHOULD check for an error value here XXX */
+    (*pScreen->PositionWindow) (pWin, pWin->drawable.x, pWin->drawable.y);
+
+    if (!(vmask & CWEventMask))
+        RecalculateDeliverableEvents(pWin);
+
+    if (vmask)
+        *error = ChangeWindowAttributes(pWin, vmask, vlist, wClient(pWin));
+    else
+        *error = Success;
+
+    if (*error != Success) {
+        DeleteWindow(pWin, None);
+        return NullWindow;
+    }
+
+    if (SubSend(pParent)) {
+        xEvent event = {
+            .u.createNotify.window = wid,
+            .u.createNotify.parent = pParent->drawable.id,
+            .u.createNotify.x = x,
+            .u.createNotify.y = y,
+            .u.createNotify.width = w,
+            .u.createNotify.height = h,
+            .u.createNotify.borderWidth = bw,
+            .u.createNotify.override = pWin->overrideRedirect
+        };
+        event.u.u.type = CreateNotify;
+        DeliverEvents(pParent, &event, 1, NullWindow);
+    }
+    return pWin;
+}
+
+static void
+DisposeWindowOptional(WindowPtr pWin)
+{
+    if (!pWin->optional)
+        return;
+    /*
+     * everything is peachy.  Delete the optional record
+     * and clean up
+     */
+    if (pWin->optional->cursor) {
+        FreeCursor(pWin->optional->cursor, (Cursor) 0);
+        pWin->cursorIsNone = FALSE;
+    }
+    else
+        pWin->cursorIsNone = TRUE;
+
+    if (pWin->optional->deviceCursors) {
+        DevCursorList pList;
+        DevCursorList pPrev;
+
+        pList = pWin->optional->deviceCursors;
+        while (pList) {
+            if (pList->cursor)
+                FreeCursor(pList->cursor, (XID) 0);
+            pPrev = pList;
+            pList = pList->next;
+            free(pPrev);
+        }
+        pWin->optional->deviceCursors = NULL;
+    }
+
+    free(pWin->optional);
+    pWin->optional = NULL;
+}
+
+static void
+FreeWindowResources(WindowPtr pWin)
+{
+    ScreenPtr pScreen = pWin->drawable.pScreen;
+
+    DeleteWindowFromAnySaveSet(pWin);
+    DeleteWindowFromAnySelections(pWin);
+    DeleteWindowFromAnyEvents(pWin, TRUE);
+    RegionUninit(&pWin->clipList);
+    RegionUninit(&pWin->winSize);
+    RegionUninit(&pWin->borderClip);
+    RegionUninit(&pWin->borderSize);
+    if (wBoundingShape(pWin))
+        RegionDestroy(wBoundingShape(pWin));
+    if (wClipShape(pWin))
+        RegionDestroy(wClipShape(pWin));
+    if (wInputShape(pWin))
+        RegionDestroy(wInputShape(pWin));
+    if (pWin->borderIsPixel == FALSE)
+        (*pScreen->DestroyPixmap) (pWin->border.pixmap);
+    if (pWin->backgroundState == BackgroundPixmap)
+        (*pScreen->DestroyPixmap) (pWin->background.pixmap);
+
+    DeleteAllWindowProperties(pWin);
+    /* We SHOULD check for an error value here XXX */
+    (*pScreen->DestroyWindow) (pWin);
+    DisposeWindowOptional(pWin);
+}
+
+static void
+CrushTree(WindowPtr pWin)
+{
+    WindowPtr pChild, pSib, pParent;
+    UnrealizeWindowProcPtr UnrealizeWindow;
+
+    if (!(pChild = pWin->firstChild))
+        return;
+    UnrealizeWindow = pWin->drawable.pScreen->UnrealizeWindow;
+    while (1) {
+        if (pChild->firstChild) {
+            pChild = pChild->firstChild;
+            continue;
+        }
+        while (1) {
+            pParent = pChild->parent;
+            if (SubStrSend(pChild, pParent)) {
+                xEvent event = { .u.u.type = DestroyNotify };
+                event.u.destroyNotify.window = pChild->drawable.id;
+                DeliverEvents(pChild, &event, 1, NullWindow);
+            }
+            FreeResource(pChild->drawable.id, RT_WINDOW);
+            pSib = pChild->nextSib;
+            pChild->viewable = FALSE;
+            if (pChild->realized) {
+                pChild->realized = FALSE;
+                (*UnrealizeWindow) (pChild);
+            }
+            FreeWindowResources(pChild);
+            dixFreeObjectWithPrivates(pChild, PRIVATE_WINDOW);
+            if ((pChild = pSib))
+                break;
+            pChild = pParent;
+            pChild->firstChild = NullWindow;
+            pChild->lastChild = NullWindow;
+            if (pChild == pWin)
+                return;
+        }
+    }
+}
+
+/*****
+ *  DeleteWindow
+ *	 Deletes child of window then window itself
+ *	 If wid is None, don't send any events
+ *****/
+
+int
+DeleteWindow(void *value, XID wid)
+{
+    WindowPtr pParent;
+    WindowPtr pWin = (WindowPtr) value;
+
+    UnmapWindow(pWin, FALSE);
+
+    CrushTree(pWin);
+
+    pParent = pWin->parent;
+    if (wid && pParent && SubStrSend(pWin, pParent)) {
+        xEvent event = { .u.u.type = DestroyNotify };
+        event.u.destroyNotify.window = pWin->drawable.id;
+        DeliverEvents(pWin, &event, 1, NullWindow);
+    }
+
+    FreeWindowResources(pWin);
+    if (pParent) {
+        if (pParent->firstChild == pWin)
+            pParent->firstChild = pWin->nextSib;
+        if (pParent->lastChild == pWin)
+            pParent->lastChild = pWin->prevSib;
+        if (pWin->nextSib)
+            pWin->nextSib->prevSib = pWin->prevSib;
+        if (pWin->prevSib)
+            pWin->prevSib->nextSib = pWin->nextSib;
+    }
+    else
+        pWin->drawable.pScreen->root = NULL;
+    dixFreeObjectWithPrivates(pWin, PRIVATE_WINDOW);
+    return Success;
+}
+
+int
+DestroySubwindows(WindowPtr pWin, ClientPtr client)
+{
+    /* XXX
+     * The protocol is quite clear that each window should be
+     * destroyed in turn, however, unmapping all of the first
+     * eliminates most of the calls to ValidateTree.  So,
+     * this implementation is incorrect in that all of the
+     * UnmapNotifies occur before all of the DestroyNotifies.
+     * If you care, simply delete the call to UnmapSubwindows.
+     */
+    UnmapSubwindows(pWin);
+    while (pWin->lastChild) {
+        int rc = XaceHook(XACE_RESOURCE_ACCESS, client,
+                          pWin->lastChild->drawable.id, RT_WINDOW,
+                          pWin->lastChild, RT_NONE, NULL, DixDestroyAccess);
+
+        if (rc != Success)
+            return rc;
+        FreeResource(pWin->lastChild->drawable.id, RT_NONE);
+    }
+    return Success;
+}
+
+static void
+SetRootWindowBackground(WindowPtr pWin, ScreenPtr pScreen, Mask *index2)
+{
+    /* following the protocol: "Changing the background of a root window to
+     * None or ParentRelative restores the default background pixmap" */
+    if (bgNoneRoot) {
+        pWin->backgroundState = XaceBackgroundNoneState(pWin);
+        pWin->background.pixel = pScreen->whitePixel;
+    }
+    else if (party_like_its_1989)
+        MakeRootTile(pWin);
+    else {
+        pWin->backgroundState = BackgroundPixel;
+        if (whiteRoot)
+            pWin->background.pixel = pScreen->whitePixel;
+        else
+            pWin->background.pixel = pScreen->blackPixel;
+        *index2 = CWBackPixel;
+    }
+}
+
+/*****
+ *  ChangeWindowAttributes
+ *
+ *  The value-mask specifies which attributes are to be changed; the
+ *  value-list contains one value for each one bit in the mask, from least
+ *  to most significant bit in the mask.
+ *****/
+
+int
+ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
+{
+    XID *pVlist;
+    PixmapPtr pPixmap;
+    Pixmap pixID;
+    CursorPtr pCursor, pOldCursor;
+    Cursor cursorID;
+    WindowPtr pChild;
+    Colormap cmap;
+    ColormapPtr pCmap;
+    xEvent xE;
+    int error, rc;
+    ScreenPtr pScreen;
+    Mask index2, tmask, vmaskCopy = 0;
+    unsigned int val;
+    Bool checkOptional = FALSE, borderRelative = FALSE;
+
+    if ((pWin->drawable.class == InputOnly) &&
+        (vmask & (~INPUTONLY_LEGAL_MASK)))
+        return BadMatch;
+
+    error = Success;
+    pScreen = pWin->drawable.pScreen;
+    pVlist = vlist;
+    tmask = vmask;
+    while (tmask) {
+        index2 = (Mask) lowbit(tmask);
+        tmask &= ~index2;
+        switch (index2) {
+        case CWBackPixmap:
+            pixID = (Pixmap) * pVlist;
+            pVlist++;
+            if (pWin->backgroundState == ParentRelative)
+                borderRelative = TRUE;
+            if (pixID == None) {
+                if (pWin->backgroundState == BackgroundPixmap)
+                    (*pScreen->DestroyPixmap) (pWin->background.pixmap);
+                if (!pWin->parent)
+                    SetRootWindowBackground(pWin, pScreen, &index2);
+                else {
+                    pWin->backgroundState = XaceBackgroundNoneState(pWin);
+                    pWin->background.pixel = pScreen->whitePixel;
+                }
+            }
+            else if (pixID == ParentRelative) {
+                if (pWin->parent &&
+                    pWin->drawable.depth != pWin->parent->drawable.depth) {
+                    error = BadMatch;
+                    goto PatchUp;
+                }
+                if (pWin->backgroundState == BackgroundPixmap)
+                    (*pScreen->DestroyPixmap) (pWin->background.pixmap);
+                if (!pWin->parent)
+                    SetRootWindowBackground(pWin, pScreen, &index2);
+                else
+                    pWin->backgroundState = ParentRelative;
+                borderRelative = TRUE;
+                /* Note that the parent's backgroundTile's refcnt is NOT
+                 * incremented. */
+            }
+            else {
+                rc = dixLookupResourceByType((void **) &pPixmap, pixID,
+                                             RT_PIXMAP, client, DixReadAccess);
+                if (rc == Success) {
+                    if ((pPixmap->drawable.depth != pWin->drawable.depth) ||
+                        (pPixmap->drawable.pScreen != pScreen)) {
+                        error = BadMatch;
+                        goto PatchUp;
+                    }
+                    if (pWin->backgroundState == BackgroundPixmap)
+                        (*pScreen->DestroyPixmap) (pWin->background.pixmap);
+                    pWin->backgroundState = BackgroundPixmap;
+                    pWin->background.pixmap = pPixmap;
+                    pPixmap->refcnt++;
+                }
+                else {
+                    error = rc;
+                    client->errorValue = pixID;
+                    goto PatchUp;
+                }
+            }
+            break;
+        case CWBackPixel:
+            if (pWin->backgroundState == ParentRelative)
+                borderRelative = TRUE;
+            if (pWin->backgroundState == BackgroundPixmap)
+                (*pScreen->DestroyPixmap) (pWin->background.pixmap);
+            pWin->backgroundState = BackgroundPixel;
+            pWin->background.pixel = (CARD32) *pVlist;
+            /* background pixel overrides background pixmap,
+               so don't let the ddx layer see both bits */
+            vmaskCopy &= ~CWBackPixmap;
+            pVlist++;
+            break;
+        case CWBorderPixmap:
+            pixID = (Pixmap) * pVlist;
+            pVlist++;
+            if (pixID == CopyFromParent) {
+                if (!pWin->parent ||
+                    (pWin->drawable.depth != pWin->parent->drawable.depth)) {
+                    error = BadMatch;
+                    goto PatchUp;
+                }
+                if (pWin->parent->borderIsPixel == TRUE) {
+                    if (pWin->borderIsPixel == FALSE)
+                        (*pScreen->DestroyPixmap) (pWin->border.pixmap);
+                    pWin->border = pWin->parent->border;
+                    pWin->borderIsPixel = TRUE;
+                    index2 = CWBorderPixel;
+                    break;
+                }
+                else {
+                    pixID = pWin->parent->border.pixmap->drawable.id;
+                }
+            }
+            rc = dixLookupResourceByType((void **) &pPixmap, pixID, RT_PIXMAP,
+                                         client, DixReadAccess);
+            if (rc == Success) {
+                if ((pPixmap->drawable.depth != pWin->drawable.depth) ||
+                    (pPixmap->drawable.pScreen != pScreen)) {
+                    error = BadMatch;
+                    goto PatchUp;
+                }
+                if (pWin->borderIsPixel == FALSE)
+                    (*pScreen->DestroyPixmap) (pWin->border.pixmap);
+                pWin->borderIsPixel = FALSE;
+                pWin->border.pixmap = pPixmap;
+                pPixmap->refcnt++;
+            }
+            else {
+                error = rc;
+                client->errorValue = pixID;
+                goto PatchUp;
+            }
+            break;
+        case CWBorderPixel:
+            if (pWin->borderIsPixel == FALSE)
+                (*pScreen->DestroyPixmap) (pWin->border.pixmap);
+            pWin->borderIsPixel = TRUE;
+            pWin->border.pixel = (CARD32) *pVlist;
+            /* border pixel overrides border pixmap,
+               so don't let the ddx layer see both bits */
+            vmaskCopy &= ~CWBorderPixmap;
+            pVlist++;
+            break;
+        case CWBitGravity:
+            val = (CARD8) *pVlist;
+            pVlist++;
+            if (val > StaticGravity) {
+                error = BadValue;
+                client->errorValue = val;
+                goto PatchUp;
+            }
+            pWin->bitGravity = val;
+            break;
+        case CWWinGravity:
+            val = (CARD8) *pVlist;
+            pVlist++;
+            if (val > StaticGravity) {
+                error = BadValue;
+                client->errorValue = val;
+                goto PatchUp;
+            }
+            pWin->winGravity = val;
+            break;
+        case CWBackingStore:
+            val = (CARD8) *pVlist;
+            pVlist++;
+            if ((val != NotUseful) && (val != WhenMapped) && (val != Always)) {
+                error = BadValue;
+                client->errorValue = val;
+                goto PatchUp;
+            }
+            /* if we're not actually changing the window's state, hide
+             * CWBackingStore from vmaskCopy so it doesn't get passed to
+             * ->ChangeWindowAttributes below
+             */
+            if (pWin->backingStore == val)
+                continue;
+            pWin->backingStore = val;
+            break;
+        case CWBackingPlanes:
+            if (pWin->optional || ((CARD32) *pVlist != (CARD32) ~0L)) {
+                if (!pWin->optional && !MakeWindowOptional(pWin)) {
+                    error = BadAlloc;
+                    goto PatchUp;
+                }
+                pWin->optional->backingBitPlanes = (CARD32) *pVlist;
+                if ((CARD32) *pVlist == (CARD32) ~0L)
+                    checkOptional = TRUE;
+            }
+            pVlist++;
+            break;
+        case CWBackingPixel:
+            if (pWin->optional || (CARD32) *pVlist) {
+                if (!pWin->optional && !MakeWindowOptional(pWin)) {
+                    error = BadAlloc;
+                    goto PatchUp;
+                }
+                pWin->optional->backingPixel = (CARD32) *pVlist;
+                if (!*pVlist)
+                    checkOptional = TRUE;
+            }
+            pVlist++;
+            break;
+        case CWSaveUnder:
+            val = (BOOL) * pVlist;
+            pVlist++;
+            if ((val != xTrue) && (val != xFalse)) {
+                error = BadValue;
+                client->errorValue = val;
+                goto PatchUp;
+            }
+            pWin->saveUnder = val;
+            break;
+        case CWEventMask:
+            rc = EventSelectForWindow(pWin, client, (Mask) *pVlist);
+            if (rc) {
+                error = rc;
+                goto PatchUp;
+            }
+            pVlist++;
+            break;
+        case CWDontPropagate:
+            rc = EventSuppressForWindow(pWin, client, (Mask) *pVlist,
+                                        &checkOptional);
+            if (rc) {
+                error = rc;
+                goto PatchUp;
+            }
+            pVlist++;
+            break;
+        case CWOverrideRedirect:
+            val = (BOOL) * pVlist;
+            pVlist++;
+            if ((val != xTrue) && (val != xFalse)) {
+                error = BadValue;
+                client->errorValue = val;
+                goto PatchUp;
+            }
+            if (val == xTrue) {
+                rc = XaceHook(XACE_RESOURCE_ACCESS, client, pWin->drawable.id,
+                              RT_WINDOW, pWin, RT_NONE, NULL, DixGrabAccess);
+                if (rc != Success) {
+                    error = rc;
+                    client->errorValue = pWin->drawable.id;
+                    goto PatchUp;
+                }
+            }
+            pWin->overrideRedirect = val;
+            break;
+        case CWColormap:
+            cmap = (Colormap) * pVlist;
+            pVlist++;
+            if (cmap == CopyFromParent) {
+                if (pWin->parent &&
+                    (!pWin->optional ||
+                     pWin->optional->visual == wVisual(pWin->parent))) {
+                    cmap = wColormap(pWin->parent);
+                }
+                else
+                    cmap = None;
+            }
+            if (cmap == None) {
+                error = BadMatch;
+                goto PatchUp;
+            }
+            rc = dixLookupResourceByType((void **) &pCmap, cmap, RT_COLORMAP,
+                                         client, DixUseAccess);
+            if (rc != Success) {
+                error = rc;
+                client->errorValue = cmap;
+                goto PatchUp;
+            }
+            if (pCmap->pVisual->vid != wVisual(pWin) ||
+                pCmap->pScreen != pScreen) {
+                error = BadMatch;
+                goto PatchUp;
+            }
+            if (cmap != wColormap(pWin)) {
+                if (!pWin->optional) {
+                    if (!MakeWindowOptional(pWin)) {
+                        error = BadAlloc;
+                        goto PatchUp;
+                    }
+                }
+                else if (pWin->parent && cmap == wColormap(pWin->parent))
+                    checkOptional = TRUE;
+
+                /*
+                 * propagate the original colormap to any children
+                 * inheriting it
+                 */
+
+                for (pChild = pWin->firstChild; pChild;
+                     pChild = pChild->nextSib) {
+                    if (!pChild->optional && !MakeWindowOptional(pChild)) {
+                        error = BadAlloc;
+                        goto PatchUp;
+                    }
+                }
+
+                pWin->optional->colormap = cmap;
+
+                /*
+                 * check on any children now matching the new colormap
+                 */
+
+                for (pChild = pWin->firstChild; pChild;
+                     pChild = pChild->nextSib) {
+                    if (pChild->optional->colormap == cmap)
+                        CheckWindowOptionalNeed(pChild);
+                }
+
+                xE = (xEvent) {
+                    .u.colormap.window = pWin->drawable.id,
+                    .u.colormap.colormap = cmap,
+                    .u.colormap.new = xTrue,
+                    .u.colormap.state = IsMapInstalled(cmap, pWin)
+                };
+                xE.u.u.type = ColormapNotify;
+                DeliverEvents(pWin, &xE, 1, NullWindow);
+            }
+            break;
+        case CWCursor:
+            cursorID = (Cursor) * pVlist;
+            pVlist++;
+            /*
+             * install the new
+             */
+            if (cursorID == None) {
+                if (pWin == pWin->drawable.pScreen->root)
+                    pCursor = rootCursor;
+                else
+                    pCursor = (CursorPtr) None;
+            }
+            else {
+                rc = dixLookupResourceByType((void **) &pCursor, cursorID,
+                                             RT_CURSOR, client, DixUseAccess);
+                if (rc != Success) {
+                    error = rc;
+                    client->errorValue = cursorID;
+                    goto PatchUp;
+                }
+            }
+
+            if (pCursor != wCursor(pWin)) {
+                /*
+                 * patch up child windows so they don't lose cursors.
+                 */
+
+                for (pChild = pWin->firstChild; pChild;
+                     pChild = pChild->nextSib) {
+                    if (!pChild->optional && !pChild->cursorIsNone &&
+                        !MakeWindowOptional(pChild)) {
+                        error = BadAlloc;
+                        goto PatchUp;
+                    }
+                }
+
+                pOldCursor = 0;
+                if (pCursor == (CursorPtr) None) {
+                    pWin->cursorIsNone = TRUE;
+                    if (pWin->optional) {
+                        pOldCursor = pWin->optional->cursor;
+                        pWin->optional->cursor = (CursorPtr) None;
+                        checkOptional = TRUE;
+                    }
+                }
+                else {
+                    if (!pWin->optional) {
+                        if (!MakeWindowOptional(pWin)) {
+                            error = BadAlloc;
+                            goto PatchUp;
+                        }
+                    }
+                    else if (pWin->parent && pCursor == wCursor(pWin->parent))
+                        checkOptional = TRUE;
+                    pOldCursor = pWin->optional->cursor;
+                    pWin->optional->cursor = RefCursor(pCursor);
+                    pWin->cursorIsNone = FALSE;
+                    /*
+                     * check on any children now matching the new cursor
+                     */
+
+                    for (pChild = pWin->firstChild; pChild;
+                         pChild = pChild->nextSib) {
+                        if (pChild->optional &&
+                            (pChild->optional->cursor == pCursor))
+                            CheckWindowOptionalNeed(pChild);
+                    }
+                }
+
+                CursorVisible = TRUE;
+
+                if (pWin->realized)
+                    WindowHasNewCursor(pWin);
+
+                /* Can't free cursor until here - old cursor
+                 * is needed in WindowHasNewCursor
+                 */
+                if (pOldCursor)
+                    FreeCursor(pOldCursor, (Cursor) 0);
+            }
+            break;
+        default:
+            error = BadValue;
+            client->errorValue = vmask;
+            goto PatchUp;
+        }
+        vmaskCopy |= index2;
+    }
+ PatchUp:
+    if (checkOptional)
+        CheckWindowOptionalNeed(pWin);
+
+    /* We SHOULD check for an error value here XXX */
+    (*pScreen->ChangeWindowAttributes) (pWin, vmaskCopy);
+
+    /*
+       If the border contents have changed, redraw the border.
+       Note that this has to be done AFTER pScreen->ChangeWindowAttributes
+       for the tile to be rotated, and the correct function selected.
+     */
+    if (((vmaskCopy & (CWBorderPixel | CWBorderPixmap)) || borderRelative)
+        && pWin->viewable && HasBorder(pWin)) {
+        RegionRec exposed;
+
+        RegionNull(&exposed);
+        RegionSubtract(&exposed, &pWin->borderClip, &pWin->winSize);
+        pWin->drawable.pScreen->PaintWindow(pWin, &exposed, PW_BORDER);
+        RegionUninit(&exposed);
+    }
+    return error;
+}
+
+/*****
+ * GetWindowAttributes
+ *    Notice that this is different than ChangeWindowAttributes
+ *****/
+
+void
+GetWindowAttributes(WindowPtr pWin, ClientPtr client,
+                    xGetWindowAttributesReply * wa)
+{
+    wa->type = X_Reply;
+    wa->bitGravity = pWin->bitGravity;
+    wa->winGravity = pWin->winGravity;
+    wa->backingStore = pWin->backingStore;
+    wa->length = bytes_to_int32(sizeof(xGetWindowAttributesReply) -
+                                sizeof(xGenericReply));
+    wa->sequenceNumber = client->sequence;
+    wa->backingBitPlanes = wBackingBitPlanes(pWin);
+    wa->backingPixel = wBackingPixel(pWin);
+    wa->saveUnder = (BOOL) pWin->saveUnder;
+    wa->override = pWin->overrideRedirect;
+    if (!pWin->mapped)
+        wa->mapState = IsUnmapped;
+    else if (pWin->realized)
+        wa->mapState = IsViewable;
+    else
+        wa->mapState = IsUnviewable;
+
+    wa->colormap = wColormap(pWin);
+    wa->mapInstalled = (wa->colormap == None) ? xFalse
+        : IsMapInstalled(wa->colormap, pWin);
+
+    wa->yourEventMask = EventMaskForClient(pWin, client);
+    wa->allEventMasks = pWin->eventMask | wOtherEventMasks(pWin);
+    wa->doNotPropagateMask = wDontPropagateMask(pWin);
+    wa->class = pWin->drawable.class;
+    wa->visualID = wVisual(pWin);
+}
+
+WindowPtr
+MoveWindowInStack(WindowPtr pWin, WindowPtr pNextSib)
+{
+    WindowPtr pParent = pWin->parent;
+    WindowPtr pFirstChange = pWin;      /* highest window where list changes */
+
+    if (pWin->nextSib != pNextSib) {
+        WindowPtr pOldNextSib = pWin->nextSib;
+
+        if (!pNextSib) {        /* move to bottom */
+            if (pParent->firstChild == pWin)
+                pParent->firstChild = pWin->nextSib;
+            /* if (pWin->nextSib) *//* is always True: pNextSib == NULL
+             * and pWin->nextSib != pNextSib
+             * therefore pWin->nextSib != NULL */
+            pFirstChange = pWin->nextSib;
+            pWin->nextSib->prevSib = pWin->prevSib;
+            if (pWin->prevSib)
+                pWin->prevSib->nextSib = pWin->nextSib;
+            pParent->lastChild->nextSib = pWin;
+            pWin->prevSib = pParent->lastChild;
+            pWin->nextSib = NullWindow;
+            pParent->lastChild = pWin;
+        }
+        else if (pParent->firstChild == pNextSib) {     /* move to top */
+            pFirstChange = pWin;
+            if (pParent->lastChild == pWin)
+                pParent->lastChild = pWin->prevSib;
+            if (pWin->nextSib)
+                pWin->nextSib->prevSib = pWin->prevSib;
+            if (pWin->prevSib)
+                pWin->prevSib->nextSib = pWin->nextSib;
+            pWin->nextSib = pParent->firstChild;
+            pWin->prevSib = NULL;
+            pNextSib->prevSib = pWin;
+            pParent->firstChild = pWin;
+        }
+        else {                  /* move in middle of list */
+
+            WindowPtr pOldNext = pWin->nextSib;
+
+            pFirstChange = NullWindow;
+            if (pParent->firstChild == pWin)
+                pFirstChange = pParent->firstChild = pWin->nextSib;
+            if (pParent->lastChild == pWin) {
+                pFirstChange = pWin;
+                pParent->lastChild = pWin->prevSib;
+            }
+            if (pWin->nextSib)
+                pWin->nextSib->prevSib = pWin->prevSib;
+            if (pWin->prevSib)
+                pWin->prevSib->nextSib = pWin->nextSib;
+            pWin->nextSib = pNextSib;
+            pWin->prevSib = pNextSib->prevSib;
+            if (pNextSib->prevSib)
+                pNextSib->prevSib->nextSib = pWin;
+            pNextSib->prevSib = pWin;
+            if (!pFirstChange) {        /* do we know it yet? */
+                pFirstChange = pParent->firstChild;     /* no, search from top */
+                while ((pFirstChange != pWin) && (pFirstChange != pOldNext))
+                    pFirstChange = pFirstChange->nextSib;
+            }
+        }
+        if (pWin->drawable.pScreen->RestackWindow)
+            (*pWin->drawable.pScreen->RestackWindow) (pWin, pOldNextSib);
+    }
+
+#ifdef ROOTLESS
+    /*
+     * In rootless mode we can't optimize away window restacks.
+     * There may be non-X windows around, so even if the window
+     * is in the correct position from X's point of view,
+     * the underlying window system may want to reorder it.
+     */
+    else if (pWin->drawable.pScreen->RestackWindow)
+        (*pWin->drawable.pScreen->RestackWindow) (pWin, pWin->nextSib);
+#endif
+
+    return pFirstChange;
+}
+
+void
+SetWinSize(WindowPtr pWin)
+{
+#ifdef COMPOSITE
+    if (pWin->redirectDraw != RedirectDrawNone) {
+        BoxRec box;
+
+        /*
+         * Redirected clients get clip list equal to their
+         * own geometry, not clipped to their parent
+         */
+        box.x1 = pWin->drawable.x;
+        box.y1 = pWin->drawable.y;
+        box.x2 = pWin->drawable.x + pWin->drawable.width;
+        box.y2 = pWin->drawable.y + pWin->drawable.height;
+        RegionReset(&pWin->winSize, &box);
+    }
+    else
+#endif
+        ClippedRegionFromBox(pWin->parent, &pWin->winSize,
+                             pWin->drawable.x, pWin->drawable.y,
+                             (int) pWin->drawable.width,
+                             (int) pWin->drawable.height);
+    if (wBoundingShape(pWin) || wClipShape(pWin)) {
+        RegionTranslate(&pWin->winSize, -pWin->drawable.x, -pWin->drawable.y);
+        if (wBoundingShape(pWin))
+            RegionIntersect(&pWin->winSize, &pWin->winSize,
+                            wBoundingShape(pWin));
+        if (wClipShape(pWin))
+            RegionIntersect(&pWin->winSize, &pWin->winSize, wClipShape(pWin));
+        RegionTranslate(&pWin->winSize, pWin->drawable.x, pWin->drawable.y);
+    }
+}
+
+void
+SetBorderSize(WindowPtr pWin)
+{
+    int bw;
+
+    if (HasBorder(pWin)) {
+        bw = wBorderWidth(pWin);
+#ifdef COMPOSITE
+        if (pWin->redirectDraw != RedirectDrawNone) {
+            BoxRec box;
+
+            /*
+             * Redirected clients get clip list equal to their
+             * own geometry, not clipped to their parent
+             */
+            box.x1 = pWin->drawable.x - bw;
+            box.y1 = pWin->drawable.y - bw;
+            box.x2 = pWin->drawable.x + pWin->drawable.width + bw;
+            box.y2 = pWin->drawable.y + pWin->drawable.height + bw;
+            RegionReset(&pWin->borderSize, &box);
+        }
+        else
+#endif
+            ClippedRegionFromBox(pWin->parent, &pWin->borderSize,
+                                 pWin->drawable.x - bw, pWin->drawable.y - bw,
+                                 (int) (pWin->drawable.width + (bw << 1)),
+                                 (int) (pWin->drawable.height + (bw << 1)));
+        if (wBoundingShape(pWin)) {
+            RegionTranslate(&pWin->borderSize, -pWin->drawable.x,
+                            -pWin->drawable.y);
+            RegionIntersect(&pWin->borderSize, &pWin->borderSize,
+                            wBoundingShape(pWin));
+            RegionTranslate(&pWin->borderSize, pWin->drawable.x,
+                            pWin->drawable.y);
+            RegionUnion(&pWin->borderSize, &pWin->borderSize, &pWin->winSize);
+        }
+    }
+    else {
+        RegionCopy(&pWin->borderSize, &pWin->winSize);
+    }
+}
+
+/**
+ *
+ *  \param x,y          new window position
+ *  \param oldx,oldy    old window position
+ *  \param destx,desty  position relative to gravity
+ */
+
+void
+GravityTranslate(int x, int y, int oldx, int oldy,
+                 int dw, int dh, unsigned gravity, int *destx, int *desty)
+{
+    switch (gravity) {
+    case NorthGravity:
+        *destx = x + dw / 2;
+        *desty = y;
+        break;
+    case NorthEastGravity:
+        *destx = x + dw;
+        *desty = y;
+        break;
+    case WestGravity:
+        *destx = x;
+        *desty = y + dh / 2;
+        break;
+    case CenterGravity:
+        *destx = x + dw / 2;
+        *desty = y + dh / 2;
+        break;
+    case EastGravity:
+        *destx = x + dw;
+        *desty = y + dh / 2;
+        break;
+    case SouthWestGravity:
+        *destx = x;
+        *desty = y + dh;
+        break;
+    case SouthGravity:
+        *destx = x + dw / 2;
+        *desty = y + dh;
+        break;
+    case SouthEastGravity:
+        *destx = x + dw;
+        *desty = y + dh;
+        break;
+    case StaticGravity:
+        *destx = oldx;
+        *desty = oldy;
+        break;
+    default:
+        *destx = x;
+        *desty = y;
+        break;
+    }
+}
+
+/* XXX need to retile border on each window with ParentRelative origin */
+void
+ResizeChildrenWinSize(WindowPtr pWin, int dx, int dy, int dw, int dh)
+{
+    ScreenPtr pScreen;
+    WindowPtr pSib, pChild;
+    Bool resized = (dw || dh);
+
+    pScreen = pWin->drawable.pScreen;
+
+    for (pSib = pWin->firstChild; pSib; pSib = pSib->nextSib) {
+        if (resized && (pSib->winGravity > NorthWestGravity)) {
+            int cwsx, cwsy;
+
+            cwsx = pSib->origin.x;
+            cwsy = pSib->origin.y;
+            GravityTranslate(cwsx, cwsy, cwsx - dx, cwsy - dy, dw, dh,
+                             pSib->winGravity, &cwsx, &cwsy);
+            if (cwsx != pSib->origin.x || cwsy != pSib->origin.y) {
+                xEvent event = {
+                    .u.gravity.window = pSib->drawable.id,
+                    .u.gravity.x = cwsx - wBorderWidth(pSib),
+                    .u.gravity.y = cwsy - wBorderWidth(pSib)
+                };
+                event.u.u.type = GravityNotify;
+                DeliverEvents(pSib, &event, 1, NullWindow);
+                pSib->origin.x = cwsx;
+                pSib->origin.y = cwsy;
+            }
+        }
+        pSib->drawable.x = pWin->drawable.x + pSib->origin.x;
+        pSib->drawable.y = pWin->drawable.y + pSib->origin.y;
+        SetWinSize(pSib);
+        SetBorderSize(pSib);
+        (*pScreen->PositionWindow) (pSib, pSib->drawable.x, pSib->drawable.y);
+
+        if ((pChild = pSib->firstChild)) {
+            while (1) {
+                pChild->drawable.x = pChild->parent->drawable.x +
+                    pChild->origin.x;
+                pChild->drawable.y = pChild->parent->drawable.y +
+                    pChild->origin.y;
+                SetWinSize(pChild);
+                SetBorderSize(pChild);
+                (*pScreen->PositionWindow) (pChild,
+                                            pChild->drawable.x,
+                                            pChild->drawable.y);
+                if (pChild->firstChild) {
+                    pChild = pChild->firstChild;
+                    continue;
+                }
+                while (!pChild->nextSib && (pChild != pSib))
+                    pChild = pChild->parent;
+                if (pChild == pSib)
+                    break;
+                pChild = pChild->nextSib;
+            }
+        }
+    }
+}
+
+#define GET_INT16(m, f) \
+	if (m & mask) \
+	  { \
+	     f = (INT16) *pVlist;\
+	    pVlist++; \
+	 }
+#define GET_CARD16(m, f) \
+	if (m & mask) \
+	 { \
+	    f = (CARD16) *pVlist;\
+	    pVlist++;\
+	 }
+
+#define GET_CARD8(m, f) \
+	if (m & mask) \
+	 { \
+	    f = (CARD8) *pVlist;\
+	    pVlist++;\
+	 }
+
+#define ChangeMask ((Mask)(CWX | CWY | CWWidth | CWHeight))
+
+/*
+ * IsSiblingAboveMe
+ *     returns Above if pSib above pMe in stack or Below otherwise
+ */
+
+static int
+IsSiblingAboveMe(WindowPtr pMe, WindowPtr pSib)
+{
+    WindowPtr pWin;
+
+    pWin = pMe->parent->firstChild;
+    while (pWin) {
+        if (pWin == pSib)
+            return Above;
+        else if (pWin == pMe)
+            return Below;
+        pWin = pWin->nextSib;
+    }
+    return Below;
+}
+
+static BoxPtr
+WindowExtents(WindowPtr pWin, BoxPtr pBox)
+{
+    pBox->x1 = pWin->drawable.x - wBorderWidth(pWin);
+    pBox->y1 = pWin->drawable.y - wBorderWidth(pWin);
+    pBox->x2 = pWin->drawable.x + (int) pWin->drawable.width
+        + wBorderWidth(pWin);
+    pBox->y2 = pWin->drawable.y + (int) pWin->drawable.height
+        + wBorderWidth(pWin);
+    return pBox;
+}
+
+#define IS_SHAPED(pWin)	(wBoundingShape (pWin) != NULL)
+
+static RegionPtr
+MakeBoundingRegion(WindowPtr pWin, BoxPtr pBox)
+{
+    RegionPtr pRgn = RegionCreate(pBox, 1);
+
+    if (wBoundingShape(pWin)) {
+        RegionTranslate(pRgn, -pWin->origin.x, -pWin->origin.y);
+        RegionIntersect(pRgn, pRgn, wBoundingShape(pWin));
+        RegionTranslate(pRgn, pWin->origin.x, pWin->origin.y);
+    }
+    return pRgn;
+}
+
+static Bool
+ShapeOverlap(WindowPtr pWin, BoxPtr pWinBox, WindowPtr pSib, BoxPtr pSibBox)
+{
+    RegionPtr pWinRgn, pSibRgn;
+    Bool ret;
+
+    if (!IS_SHAPED(pWin) && !IS_SHAPED(pSib))
+        return TRUE;
+    pWinRgn = MakeBoundingRegion(pWin, pWinBox);
+    pSibRgn = MakeBoundingRegion(pSib, pSibBox);
+    RegionIntersect(pWinRgn, pWinRgn, pSibRgn);
+    ret = RegionNotEmpty(pWinRgn);
+    RegionDestroy(pWinRgn);
+    RegionDestroy(pSibRgn);
+    return ret;
+}
+
+static Bool
+AnyWindowOverlapsMe(WindowPtr pWin, WindowPtr pHead, BoxPtr box)
+{
+    WindowPtr pSib;
+    BoxRec sboxrec;
+    BoxPtr sbox;
+
+    for (pSib = pWin->prevSib; pSib != pHead; pSib = pSib->prevSib) {
+        if (pSib->mapped) {
+            sbox = WindowExtents(pSib, &sboxrec);
+            if (BOXES_OVERLAP(sbox, box)
+                && ShapeOverlap(pWin, box, pSib, sbox))
+                return TRUE;
+        }
+    }
+    return FALSE;
+}
+
+static Bool
+IOverlapAnyWindow(WindowPtr pWin, BoxPtr box)
+{
+    WindowPtr pSib;
+    BoxRec sboxrec;
+    BoxPtr sbox;
+
+    for (pSib = pWin->nextSib; pSib; pSib = pSib->nextSib) {
+        if (pSib->mapped) {
+            sbox = WindowExtents(pSib, &sboxrec);
+            if (BOXES_OVERLAP(sbox, box)
+                && ShapeOverlap(pWin, box, pSib, sbox))
+                return TRUE;
+        }
+    }
+    return FALSE;
+}
+
+/*
+ *   WhereDoIGoInTheStack()
+ *	  Given pWin and pSib and the relationshipe smode, return
+ *	  the window that pWin should go ABOVE.
+ *	  If a pSib is specified:
+ *	      Above:  pWin is placed just above pSib
+ *	      Below:  pWin is placed just below pSib
+ *	      TopIf:  if pSib occludes pWin, then pWin is placed
+ *		      at the top of the stack
+ *	      BottomIf:	 if pWin occludes pSib, then pWin is
+ *			 placed at the bottom of the stack
+ *	      Opposite: if pSib occludes pWin, then pWin is placed at the
+ *			top of the stack, else if pWin occludes pSib, then
+ *			pWin is placed at the bottom of the stack
+ *
+ *	  If pSib is NULL:
+ *	      Above:  pWin is placed at the top of the stack
+ *	      Below:  pWin is placed at the bottom of the stack
+ *	      TopIf:  if any sibling occludes pWin, then pWin is placed at
+ *		      the top of the stack
+ *	      BottomIf: if pWin occludes any sibline, then pWin is placed at
+ *			the bottom of the stack
+ *	      Opposite: if any sibling occludes pWin, then pWin is placed at
+ *			the top of the stack, else if pWin occludes any
+ *			sibling, then pWin is placed at the bottom of the stack
+ *
+ */
+
+static WindowPtr
+WhereDoIGoInTheStack(WindowPtr pWin,
+                     WindowPtr pSib,
+                     short x,
+                     short y, unsigned short w, unsigned short h, int smode)
+{
+    BoxRec box;
+    WindowPtr pHead, pFirst;
+
+    if ((pWin == pWin->parent->firstChild) && (pWin == pWin->parent->lastChild))
+        return NULL;
+    pHead = RealChildHead(pWin->parent);
+    pFirst = pHead ? pHead->nextSib : pWin->parent->firstChild;
+    box.x1 = x;
+    box.y1 = y;
+    box.x2 = x + (int) w;
+    box.y2 = y + (int) h;
+    switch (smode) {
+    case Above:
+        if (pSib)
+            return pSib;
+        else if (pWin == pFirst)
+            return pWin->nextSib;
+        else
+            return pFirst;
+    case Below:
+        if (pSib)
+            if (pSib->nextSib != pWin)
+                return pSib->nextSib;
+            else
+                return pWin->nextSib;
+        else
+            return NullWindow;
+    case TopIf:
+        if ((!pWin->mapped || (pSib && !pSib->mapped)))
+            return pWin->nextSib;
+        else if (pSib) {
+            if ((IsSiblingAboveMe(pWin, pSib) == Above) &&
+                (RegionContainsRect(&pSib->borderSize, &box) != rgnOUT))
+                return pFirst;
+            else
+                return pWin->nextSib;
+        }
+        else if (AnyWindowOverlapsMe(pWin, pHead, &box))
+            return pFirst;
+        else
+            return pWin->nextSib;
+    case BottomIf:
+        if ((!pWin->mapped || (pSib && !pSib->mapped)))
+            return pWin->nextSib;
+        else if (pSib) {
+            if ((IsSiblingAboveMe(pWin, pSib) == Below) &&
+                (RegionContainsRect(&pSib->borderSize, &box) != rgnOUT))
+                return NullWindow;
+            else
+                return pWin->nextSib;
+        }
+        else if (IOverlapAnyWindow(pWin, &box))
+            return NullWindow;
+        else
+            return pWin->nextSib;
+    case Opposite:
+        if ((!pWin->mapped || (pSib && !pSib->mapped)))
+            return pWin->nextSib;
+        else if (pSib) {
+            if (RegionContainsRect(&pSib->borderSize, &box) != rgnOUT) {
+                if (IsSiblingAboveMe(pWin, pSib) == Above)
+                    return pFirst;
+                else
+                    return NullWindow;
+            }
+            else
+                return pWin->nextSib;
+        }
+        else if (AnyWindowOverlapsMe(pWin, pHead, &box)) {
+            /* If I'm occluded, I can't possibly be the first child
+             * if (pWin == pWin->parent->firstChild)
+             *    return pWin->nextSib;
+             */
+            return pFirst;
+        }
+        else if (IOverlapAnyWindow(pWin, &box))
+            return NullWindow;
+        else
+            return pWin->nextSib;
+    default:
+    {
+        /* should never happen; make something up. */
+        return pWin->nextSib;
+    }
+    }
+}
+
+static void
+ReflectStackChange(WindowPtr pWin, WindowPtr pSib, VTKind kind)
+{
+/* Note that pSib might be NULL */
+
+    Bool WasViewable = (Bool) pWin->viewable;
+    Bool anyMarked;
+    WindowPtr pFirstChange;
+    WindowPtr pLayerWin;
+    ScreenPtr pScreen = pWin->drawable.pScreen;
+
+    /* if this is a root window, can't be restacked */
+    if (!pWin->parent)
+        return;
+
+    pFirstChange = MoveWindowInStack(pWin, pSib);
+
+    if (WasViewable) {
+        anyMarked = (*pScreen->MarkOverlappedWindows) (pWin, pFirstChange,
+                                                       &pLayerWin);
+        if (pLayerWin != pWin)
+            pFirstChange = pLayerWin;
+        if (anyMarked) {
+            (*pScreen->ValidateTree) (pLayerWin->parent, pFirstChange, kind);
+            (*pScreen->HandleExposures) (pLayerWin->parent);
+            if (pWin->drawable.pScreen->PostValidateTree)
+                (*pScreen->PostValidateTree) (pLayerWin->parent, pFirstChange,
+                                              kind);
+        }
+    }
+    if (pWin->realized)
+        WindowsRestructured();
+}
+
+/*****
+ * ConfigureWindow
+ *****/
+
+int
+ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
+{
+#define RESTACK_WIN    0
+#define MOVE_WIN       1
+#define RESIZE_WIN     2
+#define REBORDER_WIN   3
+    WindowPtr pSib = NullWindow;
+    WindowPtr pParent = pWin->parent;
+    Window sibwid = 0;
+    Mask index2, tmask;
+    XID *pVlist;
+    short x, y, beforeX, beforeY;
+    unsigned short w = pWin->drawable.width,
+        h = pWin->drawable.height, bw = pWin->borderWidth;
+    int rc, action, smode = Above;
+
+    if ((pWin->drawable.class == InputOnly) && (mask & CWBorderWidth))
+        return BadMatch;
+
+    if ((mask & CWSibling) && !(mask & CWStackMode))
+        return BadMatch;
+
+    pVlist = vlist;
+
+    if (pParent) {
+        x = pWin->drawable.x - pParent->drawable.x - (int) bw;
+        y = pWin->drawable.y - pParent->drawable.y - (int) bw;
+    }
+    else {
+        x = pWin->drawable.x;
+        y = pWin->drawable.y;
+    }
+    beforeX = x;
+    beforeY = y;
+    action = RESTACK_WIN;
+    if ((mask & (CWX | CWY)) && (!(mask & (CWHeight | CWWidth)))) {
+        GET_INT16(CWX, x);
+        GET_INT16(CWY, y);
+        action = MOVE_WIN;
+    }
+    /* or should be resized */
+    else if (mask & (CWX | CWY | CWWidth | CWHeight)) {
+        GET_INT16(CWX, x);
+        GET_INT16(CWY, y);
+        GET_CARD16(CWWidth, w);
+        GET_CARD16(CWHeight, h);
+        if (!w || !h) {
+            client->errorValue = 0;
+            return BadValue;
+        }
+        action = RESIZE_WIN;
+    }
+    tmask = mask & ~ChangeMask;
+    while (tmask) {
+        index2 = (Mask) lowbit(tmask);
+        tmask &= ~index2;
+        switch (index2) {
+        case CWBorderWidth:
+            GET_CARD16(CWBorderWidth, bw);
+            break;
+        case CWSibling:
+            sibwid = (Window) *pVlist;
+            pVlist++;
+            rc = dixLookupWindow(&pSib, sibwid, client, DixGetAttrAccess);
+            if (rc != Success) {
+                client->errorValue = sibwid;
+                return rc;
+            }
+            if (pSib->parent != pParent)
+                return BadMatch;
+            if (pSib == pWin)
+                return BadMatch;
+            break;
+        case CWStackMode:
+            GET_CARD8(CWStackMode, smode);
+            if ((smode != TopIf) && (smode != BottomIf) &&
+                (smode != Opposite) && (smode != Above) && (smode != Below)) {
+                client->errorValue = smode;
+                return BadValue;
+            }
+            break;
+        default:
+            client->errorValue = mask;
+            return BadValue;
+        }
+    }
+    /* root really can't be reconfigured, so just return */
+    if (!pParent)
+        return Success;
+
+    /* Figure out if the window should be moved.  Doesn't
+       make the changes to the window if event sent. */
+
+    if (mask & CWStackMode)
+        pSib = WhereDoIGoInTheStack(pWin, pSib, pParent->drawable.x + x,
+                                    pParent->drawable.y + y,
+                                    w + (bw << 1), h + (bw << 1), smode);
+    else
+        pSib = pWin->nextSib;
+
+    if ((!pWin->overrideRedirect) && (RedirectSend(pParent))) {
+        xEvent event = {
+            .u.configureRequest.window = pWin->drawable.id,
+            .u.configureRequest.sibling = (mask & CWSibling) ? sibwid : None,
+            .u.configureRequest.x = x,
+            .u.configureRequest.y = y,
+            .u.configureRequest.width = w,
+            .u.configureRequest.height = h,
+            .u.configureRequest.borderWidth = bw,
+            .u.configureRequest.valueMask = mask,
+            .u.configureRequest.parent = pParent->drawable.id
+        };
+        event.u.u.type = ConfigureRequest;
+        event.u.u.detail = (mask & CWStackMode) ? smode : Above;
+#ifdef PANORAMIX
+        if (!noPanoramiXExtension && (!pParent || !pParent->parent)) {
+            event.u.configureRequest.x += screenInfo.screens[0]->x;
+            event.u.configureRequest.y += screenInfo.screens[0]->y;
+        }
+#endif
+        if (MaybeDeliverEventsToClient(pParent, &event, 1,
+                                       SubstructureRedirectMask, client) == 1)
+            return Success;
+    }
+    if (action == RESIZE_WIN) {
+        Bool size_change = (w != pWin->drawable.width)
+            || (h != pWin->drawable.height);
+
+        if (size_change &&
+            ((pWin->eventMask | wOtherEventMasks(pWin)) & ResizeRedirectMask)) {
+            xEvent eventT = {
+                .u.resizeRequest.window = pWin->drawable.id,
+                .u.resizeRequest.width = w,
+                .u.resizeRequest.height = h
+            };
+            eventT.u.u.type = ResizeRequest;
+            if (MaybeDeliverEventsToClient(pWin, &eventT, 1,
+                                           ResizeRedirectMask, client) == 1) {
+                /* if event is delivered, leave the actual size alone. */
+                w = pWin->drawable.width;
+                h = pWin->drawable.height;
+                size_change = FALSE;
+            }
+        }
+        if (!size_change) {
+            if (mask & (CWX | CWY))
+                action = MOVE_WIN;
+            else if (mask & (CWStackMode | CWBorderWidth))
+                action = RESTACK_WIN;
+            else                /* really nothing to do */
+                return (Success);
+        }
+    }
+
+    if (action == RESIZE_WIN)
+        /* we've already checked whether there's really a size change */
+        goto ActuallyDoSomething;
+    if ((mask & CWX) && (x != beforeX))
+        goto ActuallyDoSomething;
+    if ((mask & CWY) && (y != beforeY))
+        goto ActuallyDoSomething;
+    if ((mask & CWBorderWidth) && (bw != wBorderWidth(pWin)))
+        goto ActuallyDoSomething;
+    if (mask & CWStackMode) {
+#ifndef ROOTLESS
+        /* See above for why we always reorder in rootless mode. */
+        if (pWin->nextSib != pSib)
+#endif
+            goto ActuallyDoSomething;
+    }
+    return Success;
+
+ ActuallyDoSomething:
+    if (pWin->drawable.pScreen->ConfigNotify) {
+        int ret;
+
+        ret =
+            (*pWin->drawable.pScreen->ConfigNotify) (pWin, x, y, w, h, bw,
+                                                     pSib);
+        if (ret) {
+            client->errorValue = 0;
+            return ret;
+        }
+    }
+
+    if (SubStrSend(pWin, pParent)) {
+        xEvent event = {
+            .u.configureNotify.window = pWin->drawable.id,
+            .u.configureNotify.aboveSibling = pSib ? pSib->drawable.id : None,
+            .u.configureNotify.x = x,
+            .u.configureNotify.y = y,
+            .u.configureNotify.width = w,
+            .u.configureNotify.height = h,
+            .u.configureNotify.borderWidth = bw,
+            .u.configureNotify.override = pWin->overrideRedirect
+        };
+        event.u.u.type = ConfigureNotify;
+#ifdef PANORAMIX
+        if (!noPanoramiXExtension && (!pParent || !pParent->parent)) {
+            event.u.configureNotify.x += screenInfo.screens[0]->x;
+            event.u.configureNotify.y += screenInfo.screens[0]->y;
+        }
+#endif
+        DeliverEvents(pWin, &event, 1, NullWindow);
+    }
+    if (mask & CWBorderWidth) {
+        if (action == RESTACK_WIN) {
+            action = MOVE_WIN;
+            pWin->borderWidth = bw;
+        }
+        else if ((action == MOVE_WIN) &&
+                 (beforeX + wBorderWidth(pWin) == x + (int) bw) &&
+                 (beforeY + wBorderWidth(pWin) == y + (int) bw)) {
+            action = REBORDER_WIN;
+            (*pWin->drawable.pScreen->ChangeBorderWidth) (pWin, bw);
+        }
+        else
+            pWin->borderWidth = bw;
+    }
+    if (action == MOVE_WIN)
+        (*pWin->drawable.pScreen->MoveWindow) (pWin, x, y, pSib,
+                                               (mask & CWBorderWidth) ? VTOther
+                                               : VTMove);
+    else if (action == RESIZE_WIN)
+        (*pWin->drawable.pScreen->ResizeWindow) (pWin, x, y, w, h, pSib);
+    else if (mask & CWStackMode)
+        ReflectStackChange(pWin, pSib, VTOther);
+
+    if (action != RESTACK_WIN)
+        CheckCursorConfinement(pWin);
+    return Success;
+#undef RESTACK_WIN
+#undef MOVE_WIN
+#undef RESIZE_WIN
+#undef REBORDER_WIN
+}
+
+/******
+ *
+ * CirculateWindow
+ *    For RaiseLowest, raises the lowest mapped child (if any) that is
+ *    obscured by another child to the top of the stack.  For LowerHighest,
+ *    lowers the highest mapped child (if any) that is obscuring another
+ *    child to the bottom of the stack.	 Exposure processing is performed
+ *
+ ******/
+
+int
+CirculateWindow(WindowPtr pParent, int direction, ClientPtr client)
+{
+    WindowPtr pWin, pHead, pFirst;
+    xEvent event;
+    BoxRec box;
+
+    pHead = RealChildHead(pParent);
+    pFirst = pHead ? pHead->nextSib : pParent->firstChild;
+    if (direction == RaiseLowest) {
+        for (pWin = pParent->lastChild;
+             (pWin != pHead) &&
+             !(pWin->mapped &&
+               AnyWindowOverlapsMe(pWin, pHead, WindowExtents(pWin, &box)));
+             pWin = pWin->prevSib);
+        if (pWin == pHead)
+            return Success;
+    }
+    else {
+        for (pWin = pFirst;
+             pWin &&
+             !(pWin->mapped &&
+               IOverlapAnyWindow(pWin, WindowExtents(pWin, &box)));
+             pWin = pWin->nextSib);
+        if (!pWin)
+            return Success;
+    }
+
+    event = (xEvent) {
+        .u.circulate.window = pWin->drawable.id,
+        .u.circulate.parent = pParent->drawable.id,
+        .u.circulate.event = pParent->drawable.id,
+        .u.circulate.place = (direction == RaiseLowest) ?
+                              PlaceOnTop : PlaceOnBottom,
+    };
+
+    if (RedirectSend(pParent)) {
+        event.u.u.type = CirculateRequest;
+        if (MaybeDeliverEventsToClient(pParent, &event, 1,
+                                       SubstructureRedirectMask, client) == 1)
+            return Success;
+    }
+
+    event.u.u.type = CirculateNotify;
+    DeliverEvents(pWin, &event, 1, NullWindow);
+    ReflectStackChange(pWin,
+                       (direction == RaiseLowest) ? pFirst : NullWindow,
+                       VTStack);
+
+    return Success;
+}
+
+static int
+CompareWIDs(WindowPtr pWin, void *value)
+{                               /* must conform to VisitWindowProcPtr */
+    Window *wid = (Window *) value;
+
+    if (pWin->drawable.id == *wid)
+        return WT_STOPWALKING;
+    else
+        return WT_WALKCHILDREN;
+}
+
+/*****
+ *  ReparentWindow
+ *****/
+
+int
+ReparentWindow(WindowPtr pWin, WindowPtr pParent,
+               int x, int y, ClientPtr client)
+{
+    WindowPtr pPrev, pPriorParent;
+    Bool WasMapped = (Bool) (pWin->mapped);
+    xEvent event;
+    int bw = wBorderWidth(pWin);
+    ScreenPtr pScreen;
+
+    pScreen = pWin->drawable.pScreen;
+    if (TraverseTree(pWin, CompareWIDs, (void *) &pParent->drawable.id) ==
+        WT_STOPWALKING)
+        return BadMatch;
+    if (!MakeWindowOptional(pWin))
+        return BadAlloc;
+
+    if (WasMapped)
+        UnmapWindow(pWin, FALSE);
+
+    event = (xEvent) {
+        .u.reparent.window = pWin->drawable.id,
+        .u.reparent.parent = pParent->drawable.id,
+        .u.reparent.x = x,
+        .u.reparent.y = y,
+        .u.reparent.override = pWin->overrideRedirect
+    };
+    event.u.u.type = ReparentNotify;
+#ifdef PANORAMIX
+    if (!noPanoramiXExtension && !pParent->parent) {
+        event.u.reparent.x += screenInfo.screens[0]->x;
+        event.u.reparent.y += screenInfo.screens[0]->y;
+    }
+#endif
+    DeliverEvents(pWin, &event, 1, pParent);
+
+    /* take out of sibling chain */
+
+    pPriorParent = pPrev = pWin->parent;
+    if (pPrev->firstChild == pWin)
+        pPrev->firstChild = pWin->nextSib;
+    if (pPrev->lastChild == pWin)
+        pPrev->lastChild = pWin->prevSib;
+
+    if (pWin->nextSib)
+        pWin->nextSib->prevSib = pWin->prevSib;
+    if (pWin->prevSib)
+        pWin->prevSib->nextSib = pWin->nextSib;
+
+    /* insert at beginning of pParent */
+    pWin->parent = pParent;
+    pPrev = RealChildHead(pParent);
+    if (pPrev) {
+        pWin->nextSib = pPrev->nextSib;
+        if (pPrev->nextSib)
+            pPrev->nextSib->prevSib = pWin;
+        else
+            pParent->lastChild = pWin;
+        pPrev->nextSib = pWin;
+        pWin->prevSib = pPrev;
+    }
+    else {
+        pWin->nextSib = pParent->firstChild;
+        pWin->prevSib = NullWindow;
+        if (pParent->firstChild)
+            pParent->firstChild->prevSib = pWin;
+        else
+            pParent->lastChild = pWin;
+        pParent->firstChild = pWin;
+    }
+
+    pWin->origin.x = x + bw;
+    pWin->origin.y = y + bw;
+    pWin->drawable.x = x + bw + pParent->drawable.x;
+    pWin->drawable.y = y + bw + pParent->drawable.y;
+
+    /* clip to parent */
+    SetWinSize(pWin);
+    SetBorderSize(pWin);
+
+    if (pScreen->ReparentWindow)
+        (*pScreen->ReparentWindow) (pWin, pPriorParent);
+    (*pScreen->PositionWindow) (pWin, pWin->drawable.x, pWin->drawable.y);
+    ResizeChildrenWinSize(pWin, 0, 0, 0, 0);
+
+    CheckWindowOptionalNeed(pWin);
+
+    if (WasMapped)
+        MapWindow(pWin, client);
+    RecalculateDeliverableEvents(pWin);
+    return Success;
+}
+
+static void
+RealizeTree(WindowPtr pWin)
+{
+    WindowPtr pChild;
+    RealizeWindowProcPtr Realize;
+
+    Realize = pWin->drawable.pScreen->RealizeWindow;
+    pChild = pWin;
+    while (1) {
+        if (pChild->mapped) {
+            pChild->realized = TRUE;
+            pChild->viewable = (pChild->drawable.class == InputOutput);
+            (*Realize) (pChild);
+            if (pChild->firstChild) {
+                pChild = pChild->firstChild;
+                continue;
+            }
+        }
+        while (!pChild->nextSib && (pChild != pWin))
+            pChild = pChild->parent;
+        if (pChild == pWin)
+            return;
+        pChild = pChild->nextSib;
+    }
+}
+
+static Bool
+MaybeDeliverMapRequest(WindowPtr pWin, WindowPtr pParent, ClientPtr client)
+{
+    xEvent event = {
+        .u.mapRequest.window = pWin->drawable.id,
+        .u.mapRequest.parent = pParent->drawable.id
+    };
+    event.u.u.type = MapRequest;
+
+    return MaybeDeliverEventsToClient(pParent, &event, 1,
+                                      SubstructureRedirectMask,
+                                      client) == 1;
+}
+
+static void
+DeliverMapNotify(WindowPtr pWin)
+{
+    xEvent event = {
+        .u.mapNotify.window = pWin->drawable.id,
+        .u.mapNotify.override = pWin->overrideRedirect,
+    };
+    event.u.u.type = MapNotify;
+    DeliverEvents(pWin, &event, 1, NullWindow);
+}
+
+/*****
+ * MapWindow
+ *    If some other client has selected SubStructureReDirect on the parent
+ *    and override-redirect is xFalse, then a MapRequest event is generated,
+ *    but the window remains unmapped.	Otherwise, the window is mapped and a
+ *    MapNotify event is generated.
+ *****/
+
+int
+MapWindow(WindowPtr pWin, ClientPtr client)
+{
+    ScreenPtr pScreen;
+
+    WindowPtr pParent;
+    WindowPtr pLayerWin;
+
+    if (pWin->mapped)
+        return Success;
+
+    /* general check for permission to map window */
+    if (XaceHook(XACE_RESOURCE_ACCESS, client, pWin->drawable.id, RT_WINDOW,
+                 pWin, RT_NONE, NULL, DixShowAccess) != Success)
+        return Success;
+
+    pScreen = pWin->drawable.pScreen;
+    if ((pParent = pWin->parent)) {
+        Bool anyMarked;
+
+        if ((!pWin->overrideRedirect) && (RedirectSend(pParent)))
+            if (MaybeDeliverMapRequest(pWin, pParent, client))
+                return Success;
+
+        pWin->mapped = TRUE;
+        if (SubStrSend(pWin, pParent))
+            DeliverMapNotify(pWin);
+
+        if (!pParent->realized)
+            return Success;
+        RealizeTree(pWin);
+        if (pWin->viewable) {
+            anyMarked = (*pScreen->MarkOverlappedWindows) (pWin, pWin,
+                                                           &pLayerWin);
+            if (anyMarked) {
+                (*pScreen->ValidateTree) (pLayerWin->parent, pLayerWin, VTMap);
+                (*pScreen->HandleExposures) (pLayerWin->parent);
+                if (pScreen->PostValidateTree)
+                    (*pScreen->PostValidateTree) (pLayerWin->parent, pLayerWin,
+                                                  VTMap);
+            }
+        }
+        WindowsRestructured();
+    }
+    else {
+        RegionRec temp;
+
+        pWin->mapped = TRUE;
+        pWin->realized = TRUE;  /* for roots */
+        pWin->viewable = pWin->drawable.class == InputOutput;
+        /* We SHOULD check for an error value here XXX */
+        (*pScreen->RealizeWindow) (pWin);
+        if (pScreen->ClipNotify)
+            (*pScreen->ClipNotify) (pWin, 0, 0);
+        if (pScreen->PostValidateTree)
+            (*pScreen->PostValidateTree) (NullWindow, pWin, VTMap);
+        RegionNull(&temp);
+        RegionCopy(&temp, &pWin->clipList);
+        (*pScreen->WindowExposures) (pWin, &temp);
+        RegionUninit(&temp);
+    }
+
+    return Success;
+}
+
+/*****
+ * MapSubwindows
+ *    Performs a MapWindow all unmapped children of the window, in top
+ *    to bottom stacking order.
+ *****/
+
+void
+MapSubwindows(WindowPtr pParent, ClientPtr client)
+{
+    WindowPtr pWin;
+    WindowPtr pFirstMapped = NullWindow;
+    ScreenPtr pScreen;
+    Mask parentRedirect;
+    Mask parentNotify;
+    Bool anyMarked;
+    WindowPtr pLayerWin;
+
+    pScreen = pParent->drawable.pScreen;
+    parentRedirect = RedirectSend(pParent);
+    parentNotify = SubSend(pParent);
+    anyMarked = FALSE;
+    for (pWin = pParent->firstChild; pWin; pWin = pWin->nextSib) {
+        if (!pWin->mapped) {
+            if (parentRedirect && !pWin->overrideRedirect)
+                if (MaybeDeliverMapRequest(pWin, pParent, client))
+                    continue;
+
+            pWin->mapped = TRUE;
+            if (parentNotify || StrSend(pWin))
+                DeliverMapNotify(pWin);
+
+            if (!pFirstMapped)
+                pFirstMapped = pWin;
+            if (pParent->realized) {
+                RealizeTree(pWin);
+                if (pWin->viewable) {
+                    anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin, pWin,
+                                                                    NULL);
+                }
+            }
+        }
+    }
+
+    if (pFirstMapped) {
+        pLayerWin = (*pScreen->GetLayerWindow) (pParent);
+        if (pLayerWin->parent != pParent) {
+            anyMarked |= (*pScreen->MarkOverlappedWindows) (pLayerWin,
+                                                            pLayerWin, NULL);
+            pFirstMapped = pLayerWin;
+        }
+        if (anyMarked) {
+            (*pScreen->ValidateTree) (pLayerWin->parent, pFirstMapped, VTMap);
+            (*pScreen->HandleExposures) (pLayerWin->parent);
+            if (pScreen->PostValidateTree)
+                (*pScreen->PostValidateTree) (pLayerWin->parent, pFirstMapped,
+                                              VTMap);
+        }
+        WindowsRestructured();
+    }
+}
+
+static void
+UnrealizeTree(WindowPtr pWin, Bool fromConfigure)
+{
+    WindowPtr pChild;
+    UnrealizeWindowProcPtr Unrealize;
+    MarkUnrealizedWindowProcPtr MarkUnrealizedWindow;
+
+    Unrealize = pWin->drawable.pScreen->UnrealizeWindow;
+    MarkUnrealizedWindow = pWin->drawable.pScreen->MarkUnrealizedWindow;
+    pChild = pWin;
+    while (1) {
+        if (pChild->realized) {
+            pChild->realized = FALSE;
+            pChild->visibility = VisibilityNotViewable;
+#ifdef PANORAMIX
+            if (!noPanoramiXExtension && !pChild->drawable.pScreen->myNum) {
+                PanoramiXRes *win;
+                int rc = dixLookupResourceByType((void **) &win,
+                                                 pChild->drawable.id,
+                                                 XRT_WINDOW,
+                                                 serverClient, DixWriteAccess);
+
+                if (rc == Success)
+                    win->u.win.visibility = VisibilityNotViewable;
+            }
+#endif
+            (*Unrealize) (pChild);
+            DeleteWindowFromAnyEvents(pChild, FALSE);
+            if (pChild->viewable) {
+                pChild->viewable = FALSE;
+                (*MarkUnrealizedWindow) (pChild, pWin, fromConfigure);
+                pChild->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+            }
+            if (pChild->firstChild) {
+                pChild = pChild->firstChild;
+                continue;
+            }
+        }
+        while (!pChild->nextSib && (pChild != pWin))
+            pChild = pChild->parent;
+        if (pChild == pWin)
+            return;
+        pChild = pChild->nextSib;
+    }
+}
+
+static void
+DeliverUnmapNotify(WindowPtr pWin, Bool fromConfigure)
+{
+    xEvent event = {
+        .u.unmapNotify.window = pWin->drawable.id,
+        .u.unmapNotify.fromConfigure = fromConfigure
+    };
+    event.u.u.type = UnmapNotify;
+    DeliverEvents(pWin, &event, 1, NullWindow);
+}
+
+/*****
+ * UnmapWindow
+ *    If the window is already unmapped, this request has no effect.
+ *    Otherwise, the window is unmapped and an UnMapNotify event is
+ *    generated.  Cannot unmap a root window.
+ *****/
+
+int
+UnmapWindow(WindowPtr pWin, Bool fromConfigure)
+{
+    WindowPtr pParent;
+    Bool wasRealized = (Bool) pWin->realized;
+    Bool wasViewable = (Bool) pWin->viewable;
+    ScreenPtr pScreen = pWin->drawable.pScreen;
+    WindowPtr pLayerWin = pWin;
+
+    if ((!pWin->mapped) || (!(pParent = pWin->parent)))
+        return Success;
+    if (SubStrSend(pWin, pParent))
+        DeliverUnmapNotify(pWin, fromConfigure);
+    if (wasViewable && !fromConfigure) {
+        pWin->valdata = UnmapValData;
+        (*pScreen->MarkOverlappedWindows) (pWin, pWin->nextSib, &pLayerWin);
+        (*pScreen->MarkWindow) (pLayerWin->parent);
+    }
+    pWin->mapped = FALSE;
+    if (wasRealized)
+        UnrealizeTree(pWin, fromConfigure);
+    if (wasViewable && !fromConfigure) {
+        (*pScreen->ValidateTree) (pLayerWin->parent, pWin, VTUnmap);
+        (*pScreen->HandleExposures) (pLayerWin->parent);
+        if (pScreen->PostValidateTree)
+            (*pScreen->PostValidateTree) (pLayerWin->parent, pWin, VTUnmap);
+    }
+    if (wasRealized && !fromConfigure) {
+        WindowsRestructured();
+        WindowGone(pWin);
+    }
+    return Success;
+}
+
+/*****
+ * UnmapSubwindows
+ *    Performs an UnmapWindow request with the specified mode on all mapped
+ *    children of the window, in bottom to top stacking order.
+ *****/
+
+void
+UnmapSubwindows(WindowPtr pWin)
+{
+    WindowPtr pChild, pHead;
+    Bool wasRealized = (Bool) pWin->realized;
+    Bool wasViewable = (Bool) pWin->viewable;
+    Bool anyMarked = FALSE;
+    Mask parentNotify;
+    WindowPtr pLayerWin = NULL;
+    ScreenPtr pScreen = pWin->drawable.pScreen;
+
+    if (!pWin->firstChild)
+        return;
+    parentNotify = SubSend(pWin);
+    pHead = RealChildHead(pWin);
+
+    if (wasViewable)
+        pLayerWin = (*pScreen->GetLayerWindow) (pWin);
+
+    for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) {
+        if (pChild->mapped) {
+            if (parentNotify || StrSend(pChild))
+                DeliverUnmapNotify(pChild, xFalse);
+            if (pChild->viewable) {
+                pChild->valdata = UnmapValData;
+                anyMarked = TRUE;
+            }
+            pChild->mapped = FALSE;
+            if (pChild->realized)
+                UnrealizeTree(pChild, FALSE);
+        }
+    }
+    if (wasViewable && anyMarked) {
+        if (pLayerWin->parent == pWin)
+            (*pScreen->MarkWindow) (pWin);
+        else {
+            WindowPtr ptmp;
+
+            (*pScreen->MarkOverlappedWindows) (pWin, pLayerWin, NULL);
+            (*pScreen->MarkWindow) (pLayerWin->parent);
+
+            /* Windows between pWin and pLayerWin may not have been marked */
+            ptmp = pWin;
+
+            while (ptmp != pLayerWin->parent) {
+                (*pScreen->MarkWindow) (ptmp);
+                ptmp = ptmp->parent;
+            }
+            pHead = pWin->firstChild;
+        }
+        (*pScreen->ValidateTree) (pLayerWin->parent, pHead, VTUnmap);
+        (*pScreen->HandleExposures) (pLayerWin->parent);
+        if (pScreen->PostValidateTree)
+            (*pScreen->PostValidateTree) (pLayerWin->parent, pHead, VTUnmap);
+    }
+    if (wasRealized) {
+        WindowsRestructured();
+        WindowGone(pWin);
+    }
+}
+
+void
+HandleSaveSet(ClientPtr client)
+{
+    WindowPtr pParent, pWin;
+    int j;
+
+    for (j = 0; j < client->numSaved; j++) {
+        pWin = SaveSetWindow(client->saveSet[j]);
+        if (SaveSetToRoot(client->saveSet[j]))
+            pParent = pWin->drawable.pScreen->root;
+        else
+        {
+            pParent = pWin->parent;
+            while (pParent && (wClient(pParent) == client))
+                pParent = pParent->parent;
+        }
+        if (pParent) {
+            if (pParent != pWin->parent) {
+                /* unmap first so that ReparentWindow doesn't remap */
+                if (!SaveSetShouldMap(client->saveSet[j]))
+                    UnmapWindow(pWin, FALSE);
+                ReparentWindow(pWin, pParent,
+                               pWin->drawable.x - wBorderWidth(pWin) -
+                               pParent->drawable.x,
+                               pWin->drawable.y - wBorderWidth(pWin) -
+                               pParent->drawable.y, client);
+                if (!pWin->realized && pWin->mapped)
+                    pWin->mapped = FALSE;
+            }
+            if (SaveSetShouldMap(client->saveSet[j]))
+                MapWindow(pWin, client);
+        }
+    }
+    free(client->saveSet);
+    client->numSaved = 0;
+    client->saveSet = NULL;
+}
+
+/**
+ *
+ * \param x,y  in root
+ */
+Bool
+PointInWindowIsVisible(WindowPtr pWin, int x, int y)
+{
+    BoxRec box;
+
+    if (!pWin->realized)
+        return FALSE;
+    if (RegionContainsPoint(&pWin->borderClip, x, y, &box)
+        && (!wInputShape(pWin) ||
+            RegionContainsPoint(wInputShape(pWin),
+                                x - pWin->drawable.x,
+                                y - pWin->drawable.y, &box)))
+        return TRUE;
+    return FALSE;
+}
+
+RegionPtr
+NotClippedByChildren(WindowPtr pWin)
+{
+    RegionPtr pReg = RegionCreate(NullBox, 1);
+
+    if (pWin->parent ||
+        screenIsSaved != SCREEN_SAVER_ON ||
+        !HasSaverWindow(pWin->drawable.pScreen)) {
+        RegionIntersect(pReg, &pWin->borderClip, &pWin->winSize);
+    }
+    return pReg;
+}
+
+void
+SendVisibilityNotify(WindowPtr pWin)
+{
+    xEvent event;
+    unsigned int visibility = pWin->visibility;
+
+#ifdef PANORAMIX
+    /* This is not quite correct yet, but it's close */
+    if (!noPanoramiXExtension) {
+        PanoramiXRes *win;
+        WindowPtr pWin2;
+        int rc, i, Scrnum;
+
+        Scrnum = pWin->drawable.pScreen->myNum;
+
+        win = PanoramiXFindIDByScrnum(XRT_WINDOW, pWin->drawable.id, Scrnum);
+
+        if (!win || (win->u.win.visibility == visibility))
+            return;
+
+        switch (visibility) {
+        case VisibilityUnobscured:
+        FOR_NSCREENS(i) {
+            if (i == Scrnum)
+                continue;
+
+            rc = dixLookupWindow(&pWin2, win->info[i].id, serverClient,
+                                 DixWriteAccess);
+
+            if (rc == Success) {
+                if (pWin2->visibility == VisibilityPartiallyObscured)
+                    return;
+
+                if (!i)
+                    pWin = pWin2;
+            }
+        }
+            break;
+        case VisibilityPartiallyObscured:
+            if (Scrnum) {
+                rc = dixLookupWindow(&pWin2, win->info[0].id, serverClient,
+                                     DixWriteAccess);
+                if (rc == Success)
+                    pWin = pWin2;
+            }
+            break;
+        case VisibilityFullyObscured:
+        FOR_NSCREENS(i) {
+            if (i == Scrnum)
+                continue;
+
+            rc = dixLookupWindow(&pWin2, win->info[i].id, serverClient,
+                                 DixWriteAccess);
+
+            if (rc == Success) {
+                if (pWin2->visibility != VisibilityFullyObscured)
+                    return;
+
+                if (!i)
+                    pWin = pWin2;
+            }
+        }
+            break;
+        }
+
+        win->u.win.visibility = visibility;
+    }
+#endif
+
+    event = (xEvent) {
+        .u.visibility.window = pWin->drawable.id,
+        .u.visibility.state = visibility
+    };
+    event.u.u.type = VisibilityNotify;
+    DeliverEvents(pWin, &event, 1, NullWindow);
+}
+
+#define RANDOM_WIDTH 32
+int
+dixSaveScreens(ClientPtr client, int on, int mode)
+{
+    int rc, i, what, type;
+    XID vlist[2];
+
+    if (on == SCREEN_SAVER_FORCER) {
+        if (mode == ScreenSaverReset)
+            what = SCREEN_SAVER_OFF;
+        else
+            what = SCREEN_SAVER_ON;
+        type = what;
+    }
+    else {
+        what = on;
+        type = what;
+        if (what == screenIsSaved)
+            type = SCREEN_SAVER_CYCLE;
+    }
+
+    for (i = 0; i < screenInfo.numScreens; i++) {
+        rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, screenInfo.screens[i],
+                      DixShowAccess | DixHideAccess);
+        if (rc != Success)
+            return rc;
+    }
+    for (i = 0; i < screenInfo.numScreens; i++) {
+        ScreenPtr pScreen = screenInfo.screens[i];
+
+        if (on == SCREEN_SAVER_FORCER)
+            (*pScreen->SaveScreen) (pScreen, on);
+        if (pScreen->screensaver.ExternalScreenSaver) {
+            if ((*pScreen->screensaver.ExternalScreenSaver)
+                (pScreen, type, on == SCREEN_SAVER_FORCER))
+                continue;
+        }
+        if (type == screenIsSaved)
+            continue;
+        switch (type) {
+        case SCREEN_SAVER_OFF:
+            if (pScreen->screensaver.blanked == SCREEN_IS_BLANKED) {
+                (*pScreen->SaveScreen) (pScreen, what);
+            }
+            else if (HasSaverWindow(pScreen)) {
+                pScreen->screensaver.pWindow = NullWindow;
+                FreeResource(pScreen->screensaver.wid, RT_NONE);
+            }
+            break;
+        case SCREEN_SAVER_CYCLE:
+            if (pScreen->screensaver.blanked == SCREEN_IS_TILED) {
+                WindowPtr pWin = pScreen->screensaver.pWindow;
+
+                /* make it look like screen saver is off, so that
+                 * NotClippedByChildren will compute a clip list
+                 * for the root window, so PaintWindow works
+                 */
+                screenIsSaved = SCREEN_SAVER_OFF;
+
+                vlist[0] = -(rand() % RANDOM_WIDTH);
+                vlist[1] = -(rand() % RANDOM_WIDTH);
+                ConfigureWindow(pWin, CWX | CWY, vlist, client);
+
+                screenIsSaved = SCREEN_SAVER_ON;
+            }
+            /*
+             * Call the DDX saver in case it wants to do something
+             * at cycle time
+             */
+            else if (pScreen->screensaver.blanked == SCREEN_IS_BLANKED) {
+                (*pScreen->SaveScreen) (pScreen, type);
+            }
+            break;
+        case SCREEN_SAVER_ON:
+            if (ScreenSaverBlanking != DontPreferBlanking) {
+                if ((*pScreen->SaveScreen) (pScreen, what)) {
+                    pScreen->screensaver.blanked = SCREEN_IS_BLANKED;
+                    continue;
+                }
+                if ((ScreenSaverAllowExposures != DontAllowExposures) &&
+                    TileScreenSaver(pScreen, SCREEN_IS_BLACK)) {
+                    pScreen->screensaver.blanked = SCREEN_IS_BLACK;
+                    continue;
+                }
+            }
+            if ((ScreenSaverAllowExposures != DontAllowExposures) &&
+                TileScreenSaver(pScreen, SCREEN_IS_TILED)) {
+                pScreen->screensaver.blanked = SCREEN_IS_TILED;
+            }
+            else
+                pScreen->screensaver.blanked = SCREEN_ISNT_SAVED;
+            break;
+        }
+    }
+    screenIsSaved = what;
+    if (mode == ScreenSaverReset) {
+        if (on == SCREEN_SAVER_FORCER) {
+            DeviceIntPtr dev;
+            UpdateCurrentTimeIf();
+            nt_list_for_each_entry(dev, inputInfo.devices, next)
+                NoticeTime(dev, currentTime);
+        }
+        SetScreenSaverTimer();
+    }
+    return Success;
+}
+
+int
+SaveScreens(int on, int mode)
+{
+    return dixSaveScreens(serverClient, on, mode);
+}
+
+static Bool
+TileScreenSaver(ScreenPtr pScreen, int kind)
+{
+    int j;
+    int result;
+    XID attributes[3];
+    Mask mask;
+    WindowPtr pWin;
+    CursorMetricRec cm;
+    unsigned char *srcbits, *mskbits;
+    CursorPtr cursor;
+    XID cursorID = 0;
+    int attri;
+
+    mask = 0;
+    attri = 0;
+    switch (kind) {
+    case SCREEN_IS_TILED:
+        switch (pScreen->root->backgroundState) {
+        case BackgroundPixel:
+            attributes[attri++] = pScreen->root->background.pixel;
+            mask |= CWBackPixel;
+            break;
+        case BackgroundPixmap:
+            attributes[attri++] = None;
+            mask |= CWBackPixmap;
+            break;
+        default:
+            break;
+        }
+        break;
+    case SCREEN_IS_BLACK:
+        attributes[attri++] = pScreen->root->drawable.pScreen->blackPixel;
+        mask |= CWBackPixel;
+        break;
+    }
+    mask |= CWOverrideRedirect;
+    attributes[attri++] = xTrue;
+
+    /*
+     * create a blank cursor
+     */
+
+    cm.width = 16;
+    cm.height = 16;
+    cm.xhot = 8;
+    cm.yhot = 8;
+    srcbits = malloc(BitmapBytePad(32) * 16);
+    mskbits = malloc(BitmapBytePad(32) * 16);
+    if (!srcbits || !mskbits) {
+        free(srcbits);
+        free(mskbits);
+        cursor = 0;
+    }
+    else {
+        for (j = 0; j < BitmapBytePad(32) * 16; j++)
+            srcbits[j] = mskbits[j] = 0x0;
+        result = AllocARGBCursor(srcbits, mskbits, NULL, &cm, 0, 0, 0, 0, 0, 0,
+                                 &cursor, serverClient, (XID) 0);
+        if (cursor) {
+            cursorID = FakeClientID(0);
+            if (AddResource(cursorID, RT_CURSOR, (void *) cursor)) {
+                attributes[attri] = cursorID;
+                mask |= CWCursor;
+            }
+            else
+                cursor = 0;
+        }
+        else {
+            free(srcbits);
+            free(mskbits);
+        }
+    }
+
+    pWin = pScreen->screensaver.pWindow =
+        CreateWindow(pScreen->screensaver.wid,
+                     pScreen->root,
+                     -RANDOM_WIDTH, -RANDOM_WIDTH,
+                     (unsigned short) pScreen->width + RANDOM_WIDTH,
+                     (unsigned short) pScreen->height + RANDOM_WIDTH,
+                     0, InputOutput, mask, attributes, 0, serverClient,
+                     wVisual(pScreen->root), &result);
+
+    if (cursor)
+        FreeResource(cursorID, RT_NONE);
+
+    if (!pWin)
+        return FALSE;
+
+    if (!AddResource(pWin->drawable.id, RT_WINDOW,
+                     (void *) pScreen->screensaver.pWindow))
+        return FALSE;
+
+    if (mask & CWBackPixmap) {
+        MakeRootTile(pWin);
+        (*pWin->drawable.pScreen->ChangeWindowAttributes) (pWin, CWBackPixmap);
+    }
+    MapWindow(pWin, serverClient);
+    return TRUE;
+}
+
+/*
+ * FindWindowWithOptional
+ *
+ * search ancestors of the given window for an entry containing
+ * a WindowOpt structure.  Assumptions:	 some parent will
+ * contain the structure.
+ */
+
+WindowPtr
+FindWindowWithOptional(WindowPtr w)
+{
+    do
+        w = w->parent;
+    while (!w->optional);
+    return w;
+}
+
+/*
+ * CheckWindowOptionalNeed
+ *
+ * check each optional entry in the given window to see if
+ * the value is satisfied by the default rules.	 If so,
+ * release the optional record
+ */
+
+void
+CheckWindowOptionalNeed(WindowPtr w)
+{
+    WindowOptPtr optional;
+    WindowOptPtr parentOptional;
+
+    if (!w->parent || !w->optional)
+        return;
+    optional = w->optional;
+    if (optional->dontPropagateMask != DontPropagateMasks[w->dontPropagate])
+        return;
+    if (optional->otherEventMasks != 0)
+        return;
+    if (optional->otherClients != NULL)
+        return;
+    if (optional->passiveGrabs != NULL)
+        return;
+    if (optional->userProps != NULL)
+        return;
+    if (optional->backingBitPlanes != (CARD32)~0L)
+        return;
+    if (optional->backingPixel != 0)
+        return;
+    if (optional->boundingShape != NULL)
+        return;
+    if (optional->clipShape != NULL)
+        return;
+    if (optional->inputShape != NULL)
+        return;
+    if (optional->inputMasks != NULL)
+        return;
+    if (optional->deviceCursors != NULL) {
+        DevCursNodePtr pNode = optional->deviceCursors;
+
+        while (pNode) {
+            if (pNode->cursor != None)
+                return;
+            pNode = pNode->next;
+        }
+    }
+
+    parentOptional = FindWindowWithOptional(w)->optional;
+    if (optional->visual != parentOptional->visual)
+        return;
+    if (optional->cursor != None &&
+        (optional->cursor != parentOptional->cursor || w->parent->cursorIsNone))
+        return;
+    if (optional->colormap != parentOptional->colormap)
+        return;
+    DisposeWindowOptional(w);
+}
+
+/*
+ * MakeWindowOptional
+ *
+ * create an optional record and initialize it with the default
+ * values.
+ */
+
+Bool
+MakeWindowOptional(WindowPtr pWin)
+{
+    WindowOptPtr optional;
+    WindowOptPtr parentOptional;
+
+    if (pWin->optional)
+        return TRUE;
+    optional = malloc(sizeof(WindowOptRec));
+    if (!optional)
+        return FALSE;
+    optional->dontPropagateMask = DontPropagateMasks[pWin->dontPropagate];
+    optional->otherEventMasks = 0;
+    optional->otherClients = NULL;
+    optional->passiveGrabs = NULL;
+    optional->userProps = NULL;
+    optional->backingBitPlanes = ~0L;
+    optional->backingPixel = 0;
+    optional->boundingShape = NULL;
+    optional->clipShape = NULL;
+    optional->inputShape = NULL;
+    optional->inputMasks = NULL;
+    optional->deviceCursors = NULL;
+
+    parentOptional = FindWindowWithOptional(pWin)->optional;
+    optional->visual = parentOptional->visual;
+    if (!pWin->cursorIsNone) {
+        optional->cursor = RefCursor(parentOptional->cursor);
+    }
+    else {
+        optional->cursor = None;
+    }
+    optional->colormap = parentOptional->colormap;
+    pWin->optional = optional;
+    return TRUE;
+}
+
+/*
+ * Changes the cursor struct for the given device and the given window.
+ * A cursor that does not have a device cursor set will use whatever the
+ * standard cursor is for the window. If all devices have a cursor set,
+ * changing the window cursor (e.g. using XDefineCursor()) will not have any
+ * visible effect. Only when one of the device cursors is set to None again,
+ * this device's cursor will display the changed standard cursor.
+ *
+ * CursorIsNone of the window struct is NOT modified if you set a device
+ * cursor.
+ *
+ * Assumption: If there is a node for a device in the list, the device has a
+ * cursor. If the cursor is set to None, it is inherited by the parent.
+ */
+int
+ChangeWindowDeviceCursor(WindowPtr pWin, DeviceIntPtr pDev, CursorPtr pCursor)
+{
+    DevCursNodePtr pNode, pPrev;
+    CursorPtr pOldCursor = NULL;
+    ScreenPtr pScreen;
+    WindowPtr pChild;
+
+    if (!pWin->optional && !MakeWindowOptional(pWin))
+        return BadAlloc;
+
+    /* 1) Check if window has device cursor set
+     *  Yes: 1.1) swap cursor with given cursor if parent does not have same
+     *            cursor, free old cursor
+     *       1.2) free old cursor, use parent cursor
+     *  No: 1.1) add node to beginning of list.
+     *      1.2) add cursor to node if parent does not have same cursor
+     *      1.3) use parent cursor if parent does not have same cursor
+     *  2) Patch up children if child has a devcursor
+     *  2.1) if child has cursor None, it inherited from parent, set to old
+     *  cursor
+     *  2.2) if child has same cursor as new cursor, remove and set to None
+     */
+
+    pScreen = pWin->drawable.pScreen;
+
+    if (WindowSeekDeviceCursor(pWin, pDev, &pNode, &pPrev)) {
+        /* has device cursor */
+
+        if (pNode->cursor == pCursor)
+            return Success;
+
+        pOldCursor = pNode->cursor;
+
+        if (!pCursor) {         /* remove from list */
+            if (pPrev)
+                pPrev->next = pNode->next;
+            else
+                /* first item in list */
+                pWin->optional->deviceCursors = pNode->next;
+
+            free(pNode);
+            goto out;
+        }
+
+    }
+    else {
+        /* no device cursor yet */
+        DevCursNodePtr pNewNode;
+
+        if (!pCursor)
+            return Success;
+
+        pNewNode = malloc(sizeof(DevCursNodeRec));
+        pNewNode->dev = pDev;
+        pNewNode->next = pWin->optional->deviceCursors;
+        pWin->optional->deviceCursors = pNewNode;
+        pNode = pNewNode;
+
+    }
+
+    if (pCursor && WindowParentHasDeviceCursor(pWin, pDev, pCursor))
+        pNode->cursor = None;
+    else {
+        pNode->cursor = RefCursor(pCursor);
+    }
+
+    pNode = pPrev = NULL;
+    /* fix up children */
+    for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) {
+        if (WindowSeekDeviceCursor(pChild, pDev, &pNode, &pPrev)) {
+            if (pNode->cursor == None) {        /* inherited from parent */
+                pNode->cursor = RefCursor(pOldCursor);
+            }
+            else if (pNode->cursor == pCursor) {
+                pNode->cursor = None;
+                FreeCursor(pCursor, (Cursor) 0);        /* fix up refcnt */
+            }
+        }
+    }
+
+ out:
+    CursorVisible = TRUE;
+
+    if (pWin->realized)
+        WindowHasNewCursor(pWin);
+
+    if (pOldCursor)
+        FreeCursor(pOldCursor, (Cursor) 0);
+
+    /* FIXME: We SHOULD check for an error value here XXX
+       (comment taken from ChangeWindowAttributes) */
+    (*pScreen->ChangeWindowAttributes) (pWin, CWCursor);
+
+    return Success;
+}
+
+/* Get device cursor for given device or None if none is set */
+CursorPtr
+WindowGetDeviceCursor(WindowPtr pWin, DeviceIntPtr pDev)
+{
+    DevCursorList pList;
+
+    if (!pWin->optional || !pWin->optional->deviceCursors)
+        return NULL;
+
+    pList = pWin->optional->deviceCursors;
+
+    while (pList) {
+        if (pList->dev == pDev) {
+            if (pList->cursor == None)  /* inherited from parent */
+                return WindowGetDeviceCursor(pWin->parent, pDev);
+            else
+                return pList->cursor;
+        }
+        pList = pList->next;
+    }
+    return NULL;
+}
+
+/* Searches for a DevCursorNode for the given window and device. If one is
+ * found, return True and set pNode and pPrev to the node and to the node
+ * before the node respectively. Otherwise return False.
+ * If the device is the first in list, pPrev is set to NULL.
+ */
+static Bool
+WindowSeekDeviceCursor(WindowPtr pWin,
+                       DeviceIntPtr pDev,
+                       DevCursNodePtr * pNode, DevCursNodePtr * pPrev)
+{
+    DevCursorList pList;
+
+    if (!pWin->optional)
+        return FALSE;
+
+    pList = pWin->optional->deviceCursors;
+
+    if (pList && pList->dev == pDev) {
+        *pNode = pList;
+        *pPrev = NULL;
+        return TRUE;
+    }
+
+    while (pList) {
+        if (pList->next) {
+            if (pList->next->dev == pDev) {
+                *pNode = pList->next;
+                *pPrev = pList;
+                return TRUE;
+            }
+        }
+        pList = pList->next;
+    }
+    return FALSE;
+}
+
+/* Return True if a parent has the same device cursor set or False if
+ * otherwise
+ */
+static Bool
+WindowParentHasDeviceCursor(WindowPtr pWin,
+                            DeviceIntPtr pDev, CursorPtr pCursor)
+{
+    WindowPtr pParent;
+    DevCursNodePtr pParentNode, pParentPrev;
+
+    pParent = pWin->parent;
+    while (pParent) {
+        if (WindowSeekDeviceCursor(pParent, pDev, &pParentNode, &pParentPrev)) {
+            /* if there is a node in the list, the win has a dev cursor */
+            if (!pParentNode->cursor)   /* inherited. */
+                pParent = pParent->parent;
+            else if (pParentNode->cursor == pCursor)    /* inherit */
+                return TRUE;
+            else                /* different cursor */
+                return FALSE;
+        }
+        else
+            /* parent does not have a device cursor for our device */
+            return FALSE;
+    }
+    return FALSE;
+}
+
+/*
+ * SetRootClip --
+ *	Enable or disable rendering to the screen by
+ *	setting the root clip list and revalidating
+ *	all of the windows
+ */
+void
+SetRootClip(ScreenPtr pScreen, int enable)
+{
+    WindowPtr pWin = pScreen->root;
+    WindowPtr pChild;
+    Bool WasViewable;
+    Bool anyMarked = FALSE;
+    WindowPtr pLayerWin;
+    BoxRec box;
+    enum RootClipMode mode = enable;
+
+    if (!pWin)
+        return;
+    WasViewable = (Bool) (pWin->viewable);
+    if (WasViewable) {
+        for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) {
+            (void) (*pScreen->MarkOverlappedWindows) (pChild,
+                                                      pChild, &pLayerWin);
+        }
+        (*pScreen->MarkWindow) (pWin);
+        anyMarked = TRUE;
+        if (pWin->valdata) {
+            if (HasBorder(pWin)) {
+                RegionPtr borderVisible;
+
+                borderVisible = RegionCreate(NullBox, 1);
+                RegionSubtract(borderVisible,
+                               &pWin->borderClip, &pWin->winSize);
+                pWin->valdata->before.borderVisible = borderVisible;
+            }
+            pWin->valdata->before.resized = TRUE;
+        }
+    }
+
+    if (mode != ROOT_CLIP_NONE) {
+        pWin->drawable.width = pScreen->width;
+        pWin->drawable.height = pScreen->height;
+
+        box.x1 = 0;
+        box.y1 = 0;
+        box.x2 = pScreen->width;
+        box.y2 = pScreen->height;
+
+        RegionInit(&pWin->winSize, &box, 1);
+        RegionInit(&pWin->borderSize, &box, 1);
+
+        /*
+         * Use REGION_BREAK to avoid optimizations in ValidateTree
+         * that assume the root borderClip can't change well, normally
+         * it doesn't...)
+         */
+        RegionBreak(&pWin->clipList);
+
+	/* For INPUT_ONLY, empty the borderClip so no rendering will ever
+	 * be attempted to the screen pixmap (only redirected windows),
+	 * but we keep borderSize as full regardless. */
+        if (WasViewable && mode == ROOT_CLIP_FULL)
+            RegionReset(&pWin->borderClip, &box);
+        else
+            RegionEmpty(&pWin->borderClip);
+    }
+    else {
+        RegionEmpty(&pWin->borderClip);
+        RegionBreak(&pWin->clipList);
+    }
+
+    ResizeChildrenWinSize(pWin, 0, 0, 0, 0);
+
+    if (WasViewable) {
+        if (pWin->firstChild) {
+            anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin->firstChild,
+                                                            pWin->firstChild,
+                                                            NULL);
+        }
+        else {
+            (*pScreen->MarkWindow) (pWin);
+            anyMarked = TRUE;
+        }
+
+        if (anyMarked) {
+            (*pScreen->ValidateTree) (pWin, NullWindow, VTOther);
+            (*pScreen->HandleExposures) (pWin);
+            if (pScreen->PostValidateTree)
+                (*pScreen->PostValidateTree) (pWin, NullWindow, VTOther);
+        }
+    }
+    if (pWin->realized)
+        WindowsRestructured();
+    FlushAllOutput();
+}
+
+VisualPtr
+WindowGetVisual(WindowPtr pWin)
+{
+    ScreenPtr pScreen = pWin->drawable.pScreen;
+    VisualID vid = wVisual(pWin);
+    int i;
+
+    for (i = 0; i < pScreen->numVisuals; i++)
+        if (pScreen->visuals[i].vid == vid)
+            return &pScreen->visuals[i];
+    return 0;
+}
Index: xserver/xorg-server/create-21.1.7-black-patch/xorg-server-21.1.7-new/dix
===================================================================
--- xserver/xorg-server/create-21.1.7-black-patch/xorg-server-21.1.7-new/dix	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-black-patch/xorg-server-21.1.7-new/dix	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-black-patch/xorg-server-21.1.7-new/dix
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-black-patch/xorg-server-21.1.7-new
===================================================================
--- xserver/xorg-server/create-21.1.7-black-patch/xorg-server-21.1.7-new	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-black-patch/xorg-server-21.1.7-new	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-black-patch/xorg-server-21.1.7-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-black-patch
===================================================================
--- xserver/xorg-server/create-21.1.7-black-patch	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-black-patch	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-black-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/create.patch.sh
===================================================================
--- xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/create.patch.sh	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=21.1.7
+
+tar --files-from=file.list -xJvf ../xorg-server-$VERSION.tar.xz
+mv xorg-server-$VERSION xorg-server-$VERSION-orig
+
+cp -rf ./xorg-server-$VERSION-new ./xorg-server-$VERSION
+
+diff --unified -Nr  xorg-server-$VERSION-orig  xorg-server-$VERSION > xorg-server-$VERSION-dont-check-SeatId.patch
+
+mv xorg-server-$VERSION-dont-check-SeatId.patch ../patches
+
+rm -rf ./xorg-server-$VERSION
+rm -rf ./xorg-server-$VERSION-orig

Property changes on: xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/file.list
===================================================================
--- xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/file.list	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/file.list	(revision 5)
@@ -0,0 +1 @@
+xorg-server-21.1.7/hw/kdrive/ephyr/ephyrinit.c
Index: xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/xorg-server-21.1.7-new/hw/kdrive/ephyr/ephyrinit.c
===================================================================
--- xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/xorg-server-21.1.7-new/hw/kdrive/ephyr/ephyrinit.c	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/xorg-server-21.1.7-new/hw/kdrive/ephyr/ephyrinit.c	(revision 5)
@@ -0,0 +1,396 @@
+/*
+ * Xephyr - A kdrive X server that runs in a host X window.
+ *          Authored by Matthew Allum <mallum@o-hand.com>
+ *
+ * Copyright © 2004 Nokia
+ *
+ * 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 Nokia not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Nokia makes no
+ * representations about the suitability of this software for any purpose.  It
+ * is provided "as is" without express or implied warranty.
+ *
+ * NOKIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL NOKIA 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.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+#include "ephyr.h"
+#include "ephyrlog.h"
+#include "glx_extinit.h"
+
+extern Window EphyrPreExistingHostWin;
+extern Bool EphyrWantGrayScale;
+extern Bool EphyrWantResize;
+extern Bool EphyrWantNoHostGrab;
+extern Bool kdHasPointer;
+extern Bool kdHasKbd;
+extern Bool ephyr_glamor, ephyr_glamor_gles2, ephyr_glamor_skip_present;
+
+extern Bool ephyrNoXV;
+
+void processScreenOrOutputArg(const char *screen_size, const char *output, char *parent_id);
+void processOutputArg(const char *output, char *parent_id);
+void processScreenArg(const char *screen_size, char *parent_id);
+
+int
+main(int argc, char *argv[], char *envp[])
+{
+    hostx_use_resname(basename(argv[0]), 0);
+    return dix_main(argc, argv, envp);
+}
+
+void
+InitCard(char *name)
+{
+    EPHYR_DBG("mark");
+    KdCardInfoAdd(&ephyrFuncs, 0);
+}
+
+void
+InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
+{
+    KdInitOutput(pScreenInfo, argc, argv);
+}
+
+void
+InitInput(int argc, char **argv)
+{
+    KdKeyboardInfo *ki;
+    KdPointerInfo *pi;
+
+    KdAddKeyboardDriver(&EphyrKeyboardDriver);
+    KdAddPointerDriver(&EphyrMouseDriver);
+
+    if (!kdHasKbd) {
+        ki = KdNewKeyboard();
+        if (!ki)
+            FatalError("Couldn't create Xephyr keyboard\n");
+        ki->driver = &EphyrKeyboardDriver;
+        KdAddKeyboard(ki);
+    }
+
+    if (!kdHasPointer) {
+        pi = KdNewPointer();
+        if (!pi)
+            FatalError("Couldn't create Xephyr pointer\n");
+        pi->driver = &EphyrMouseDriver;
+        KdAddPointer(pi);
+    }
+
+    KdInitInput();
+}
+
+void
+CloseInput(void)
+{
+    KdCloseInput();
+}
+
+#if INPUTTHREAD
+/** This function is called in Xserver/os/inputthread.c when starting
+    the input thread. */
+void
+ddxInputThreadInit(void)
+{
+}
+#endif
+
+#ifdef DDXBEFORERESET
+void
+ddxBeforeReset(void)
+{
+}
+#endif
+
+void
+ddxUseMsg(void)
+{
+    KdUseMsg();
+
+    ErrorF("\nXephyr Option Usage:\n");
+    ErrorF("-parent <XID>        Use existing window as Xephyr root win\n");
+    ErrorF("-sw-cursor           Render cursors in software in Xephyr\n");
+    ErrorF("-fullscreen          Attempt to run Xephyr fullscreen\n");
+    ErrorF("-output <NAME>       Attempt to run Xephyr fullscreen (restricted to given output geometry)\n");
+    ErrorF("-grayscale           Simulate 8bit grayscale\n");
+    ErrorF("-resizeable          Make Xephyr windows resizeable\n");
+#ifdef GLAMOR
+    ErrorF("-glamor              Enable 2D acceleration using glamor\n");
+    ErrorF("-glamor_gles2        Enable 2D acceleration using glamor (with GLES2 only)\n");
+    ErrorF("-glamor-skip-present Skip presenting the output when using glamor (for internal testing optimization)\n");
+#endif
+    ErrorF
+        ("-fakexa              Simulate acceleration using software rendering\n");
+    ErrorF("-verbosity <level>   Set log verbosity level\n");
+    ErrorF("-noxv                do not use XV\n");
+    ErrorF("-name [name]         define the name in the WM_CLASS property\n");
+    ErrorF
+        ("-title [title]       set the window title in the WM_NAME property\n");
+    ErrorF("-no-host-grab        Disable grabbing the keyboard and mouse.\n");
+    ErrorF("\n");
+}
+
+void
+processScreenOrOutputArg(const char *screen_size, const char *output, char *parent_id)
+{
+    KdCardInfo *card;
+
+    InitCard(0);                /*Put each screen on a separate card */
+    card = KdCardInfoLast();
+
+    if (card) {
+        KdScreenInfo *screen;
+        unsigned long p_id = 0;
+        Bool use_geometry;
+
+        screen = KdScreenInfoAdd(card);
+        KdParseScreen(screen, screen_size);
+        screen->driver = calloc(1, sizeof(EphyrScrPriv));
+        if (!screen->driver)
+            FatalError("Couldn't alloc screen private\n");
+
+        if (parent_id) {
+            p_id = strtol(parent_id, NULL, 0);
+        }
+
+        use_geometry = (strchr(screen_size, '+') != NULL);
+        EPHYR_DBG("screen number:%d\n", screen->mynum);
+        hostx_add_screen(screen, p_id, screen->mynum, use_geometry, output);
+    }
+    else {
+        ErrorF("No matching card found!\n");
+    }
+}
+
+void
+processScreenArg(const char *screen_size, char *parent_id)
+{
+    processScreenOrOutputArg(screen_size, NULL, parent_id);
+}
+
+void
+processOutputArg(const char *output, char *parent_id)
+{
+    processScreenOrOutputArg("100x100+0+0", output, parent_id);
+}
+
+int
+ddxProcessArgument(int argc, char **argv, int i)
+{
+    static char *parent = NULL;
+
+    EPHYR_DBG("mark argv[%d]='%s'", i, argv[i]);
+
+    if (!strcmp(argv[i], "-parent")) {
+        if (i + 1 < argc) {
+            int j;
+
+            /* If parent is specified and a screen argument follows, don't do
+             * anything, let the -screen handling init the rest */
+            for (j = i; j < argc; j++) {
+                if (!strcmp(argv[j], "-screen")) {
+                    parent = argv[i + 1];
+                    return 2;
+                }
+            }
+
+            processScreenArg("100x100", argv[i + 1]);
+            return 2;
+        }
+
+        UseMsg();
+        exit(1);
+    }
+    else if (!strcmp(argv[i], "-screen")) {
+        if ((i + 1) < argc) {
+            processScreenArg(argv[i + 1], parent);
+            parent = NULL;
+            return 2;
+        }
+
+        UseMsg();
+        exit(1);
+    }
+    else if (!strcmp(argv[i], "-output")) {
+        if (i + 1 < argc) {
+            processOutputArg(argv[i + 1], NULL);
+            return 2;
+        }
+
+        UseMsg();
+        exit(1);
+    }
+    else if (!strcmp(argv[i], "-sw-cursor")) {
+        hostx_use_sw_cursor();
+        return 1;
+    }
+    else if (!strcmp(argv[i], "-host-cursor")) {
+        /* Compatibility with the old command line argument, now the default. */
+        return 1;
+    }
+    else if (!strcmp(argv[i], "-fullscreen")) {
+        hostx_use_fullscreen();
+        return 1;
+    }
+    else if (!strcmp(argv[i], "-grayscale")) {
+        EphyrWantGrayScale = 1;
+        return 1;
+    }
+    else if (!strcmp(argv[i], "-resizeable")) {
+        EphyrWantResize = 1;
+        return 1;
+    }
+#ifdef GLAMOR
+    else if (!strcmp (argv[i], "-glamor")) {
+        ephyr_glamor = TRUE;
+        ephyrFuncs.initAccel = ephyr_glamor_init;
+        ephyrFuncs.enableAccel = ephyr_glamor_enable;
+        ephyrFuncs.disableAccel = ephyr_glamor_disable;
+        ephyrFuncs.finiAccel = ephyr_glamor_fini;
+        return 1;
+    }
+    else if (!strcmp (argv[i], "-glamor_gles2")) {
+        ephyr_glamor = TRUE;
+        ephyr_glamor_gles2 = TRUE;
+        ephyrFuncs.initAccel = ephyr_glamor_init;
+        ephyrFuncs.enableAccel = ephyr_glamor_enable;
+        ephyrFuncs.disableAccel = ephyr_glamor_disable;
+        ephyrFuncs.finiAccel = ephyr_glamor_fini;
+        return 1;
+    }
+    else if (!strcmp (argv[i], "-glamor-skip-present")) {
+        ephyr_glamor_skip_present = TRUE;
+        return 1;
+    }
+#endif
+    else if (!strcmp(argv[i], "-fakexa")) {
+        ephyrFuncs.initAccel = ephyrDrawInit;
+        ephyrFuncs.enableAccel = ephyrDrawEnable;
+        ephyrFuncs.disableAccel = ephyrDrawDisable;
+        ephyrFuncs.finiAccel = ephyrDrawFini;
+        return 1;
+    }
+    else if (!strcmp(argv[i], "-verbosity")) {
+        if (i + 1 < argc && argv[i + 1][0] != '-') {
+            int verbosity = atoi(argv[i + 1]);
+
+            LogSetParameter(XLOG_VERBOSITY, verbosity);
+            EPHYR_LOG("set verbosiry to %d\n", verbosity);
+            return 2;
+        }
+        else {
+            UseMsg();
+            exit(1);
+        }
+    }
+    else if (!strcmp(argv[i], "-noxv")) {
+        ephyrNoXV = TRUE;
+        EPHYR_LOG("no XVideo enabled\n");
+        return 1;
+    }
+    else if (!strcmp(argv[i], "-name")) {
+        if (i + 1 < argc && argv[i + 1][0] != '-') {
+            hostx_use_resname(argv[i + 1], 1);
+            return 2;
+        }
+        else {
+            UseMsg();
+            return 0;
+        }
+    }
+    else if (!strcmp(argv[i], "-title")) {
+        if (i + 1 < argc && argv[i + 1][0] != '-') {
+            hostx_set_title(argv[i + 1]);
+            return 2;
+        }
+        else {
+            UseMsg();
+            return 0;
+        }
+    }
+    else if (argv[i][0] == ':') {
+        hostx_set_display_name(argv[i]);
+    }
+    /* Xnest compatibility */
+    else if (!strcmp(argv[i], "-display")) {
+        hostx_set_display_name(argv[i + 1]);
+        return 2;
+    }
+    else if (!strcmp(argv[i], "-sync") ||
+             !strcmp(argv[i], "-full") ||
+             !strcmp(argv[i], "-sss") || !strcmp(argv[i], "-install")) {
+        return 1;
+    }
+    else if (!strcmp(argv[i], "-bw") ||
+             !strcmp(argv[i], "-class") ||
+             !strcmp(argv[i], "-geometry") || !strcmp(argv[i], "-scrns")) {
+        return 2;
+    }
+    /* end Xnest compat */
+    else if (!strcmp(argv[i], "-no-host-grab")) {
+        EphyrWantNoHostGrab = 1;
+        return 1;
+    }
+    else if (!strcmp(argv[i], "-sharevts") ||
+             !strcmp(argv[i], "-novtswitch")) {
+        return 1;
+    }
+    else if (!strcmp(argv[i], "-layout")) {
+        return 2;
+    }
+
+    return KdProcessArgument(argc, argv, i);
+}
+
+void
+OsVendorInit(void)
+{
+    EPHYR_DBG("mark");
+
+    if (SeatId)
+        hostx_use_sw_cursor();
+
+    if (hostx_want_host_cursor())
+        ephyrFuncs.initCursor = &ephyrCursorInit;
+
+    if (serverGeneration == 1) {
+        if (!KdCardInfoLast()) {
+            processScreenArg("640x480", NULL);
+        }
+        hostx_init();
+    }
+}
+
+KdCardFuncs ephyrFuncs = {
+    ephyrCardInit,              /* cardinit */
+    ephyrScreenInitialize,      /* scrinit */
+    ephyrInitScreen,            /* initScreen */
+    ephyrFinishInitScreen,      /* finishInitScreen */
+    ephyrCreateResources,       /* createRes */
+    ephyrScreenFini,            /* scrfini */
+    ephyrCardFini,              /* cardfini */
+
+    0,                          /* initCursor */
+
+    0,                          /* initAccel */
+    0,                          /* enableAccel */
+    0,                          /* disableAccel */
+    0,                          /* finiAccel */
+
+    ephyrGetColors,             /* getColors */
+    ephyrPutColors,             /* putColors */
+
+    ephyrCloseScreen,           /* closeScreen */
+};
Index: xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/xorg-server-21.1.7-new/hw/kdrive/ephyr
===================================================================
--- xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/xorg-server-21.1.7-new/hw/kdrive/ephyr	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/xorg-server-21.1.7-new/hw/kdrive/ephyr	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/xorg-server-21.1.7-new/hw/kdrive/ephyr
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/xorg-server-21.1.7-new/hw/kdrive
===================================================================
--- xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/xorg-server-21.1.7-new/hw/kdrive	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/xorg-server-21.1.7-new/hw/kdrive	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/xorg-server-21.1.7-new/hw/kdrive
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/xorg-server-21.1.7-new/hw
===================================================================
--- xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/xorg-server-21.1.7-new/hw	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/xorg-server-21.1.7-new/hw	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/xorg-server-21.1.7-new/hw
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/xorg-server-21.1.7-new
===================================================================
--- xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/xorg-server-21.1.7-new	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/xorg-server-21.1.7-new	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch/xorg-server-21.1.7-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch
===================================================================
--- xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-dont-check-SeatId-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/create.patch.sh
===================================================================
--- xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/create.patch.sh	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+VERSION=21.1.7
+
+tar --files-from=file.list -xJvf ../xorg-server-$VERSION.tar.xz
+patch -p0 < ../patches/xorg-server-$VERSION-modesetting-on-GeForce.patch
+mv xorg-server-$VERSION xorg-server-$VERSION-orig
+
+cp -rf ./xorg-server-$VERSION-new ./xorg-server-$VERSION
+
+diff --unified -Nr  xorg-server-$VERSION-orig  xorg-server-$VERSION > xorg-server-$VERSION-intel-ddx-only-on-pre-gen4.patch
+
+mv xorg-server-$VERSION-intel-ddx-only-on-pre-gen4.patch ../patches
+
+rm -rf ./xorg-server-$VERSION
+rm -rf ./xorg-server-$VERSION-orig

Property changes on: xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/file.list
===================================================================
--- xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/file.list	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/file.list	(revision 5)
@@ -0,0 +1 @@
+xorg-server-21.1.7/hw/xfree86/common/xf86pciBus.c
Index: xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/xorg-server-21.1.7-new/hw/xfree86/common/xf86pciBus.c
===================================================================
--- xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/xorg-server-21.1.7-new/hw/xfree86/common/xf86pciBus.c	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/xorg-server-21.1.7-new/hw/xfree86/common/xf86pciBus.c	(revision 5)
@@ -0,0 +1,1491 @@
+/*
+ * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
+ * and author(s) 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 holder(s) and author(s).
+ */
+
+/*
+ * This file contains the interfaces to the bus-specific code
+ */
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <X11/X.h>
+#include <pciaccess.h>
+#include "os.h"
+#include "Pci.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "dirent.h"             /* DIR, FILE type definitions */
+
+/* Bus-specific headers */
+#include "xf86Bus.h"
+
+#define XF86_OS_PRIVS
+#include "xf86_OSproc.h"
+
+#define PCI_VENDOR_GENERIC		0x00FF
+
+/* Bus-specific globals */
+int pciSlotClaimed = 0;
+
+#define PCIINFOCLASSES(c) \
+    ( (((c) & 0x00ff0000) == (PCI_CLASS_PREHISTORIC << 16)) \
+      || (((c) & 0x00ff0000) == (PCI_CLASS_DISPLAY << 16)) \
+      || ((((c) & 0x00ffff00) \
+	   == ((PCI_CLASS_MULTIMEDIA << 16) | (PCI_SUBCLASS_MULTIMEDIA_VIDEO << 8)))) \
+      || ((((c) & 0x00ffff00) \
+	   == ((PCI_CLASS_PROCESSOR << 16) | (PCI_SUBCLASS_PROCESSOR_COPROC << 8)))) )
+
+/*
+ * PCI classes that have messages printed always.  The others are only
+ * have a message printed when the vendor/dev IDs are recognised.
+ */
+#define PCIALWAYSPRINTCLASSES(c) \
+    ( (((c) & 0x00ffff00) \
+       == ((PCI_CLASS_PREHISTORIC << 16) | (PCI_SUBCLASS_PREHISTORIC_VGA << 8))) \
+      || (((c) & 0x00ff0000) == (PCI_CLASS_DISPLAY << 16)) \
+      || ((((c) & 0x00ffff00) \
+	   == ((PCI_CLASS_MULTIMEDIA << 16) | (PCI_SUBCLASS_MULTIMEDIA_VIDEO << 8)))) )
+
+#define IS_VGA(c) \
+    (((c) & 0x00ffff00) \
+	 == ((PCI_CLASS_DISPLAY << 16) | (PCI_SUBCLASS_DISPLAY_VGA << 8)))
+
+static struct pci_slot_match xf86IsolateDevice = {
+    PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0
+};
+
+/*
+ * xf86Bus.c interface
+ */
+
+void
+xf86PciProbe(void)
+{
+    int i = 0, k;
+    int num = 0;
+    struct pci_device *info;
+    struct pci_device_iterator *iter;
+    struct pci_device **xf86PciVideoInfo = NULL;
+
+    if (!xf86scanpci()) {
+        xf86PciVideoInfo = NULL;
+        return;
+    }
+
+    iter = pci_slot_match_iterator_create(&xf86IsolateDevice);
+    while ((info = pci_device_next(iter)) != NULL) {
+        if (PCIINFOCLASSES(info->device_class)) {
+            num++;
+            xf86PciVideoInfo = xnfreallocarray(xf86PciVideoInfo,
+                                               num + 1,
+                                               sizeof(struct pci_device *));
+            xf86PciVideoInfo[num] = NULL;
+            xf86PciVideoInfo[num - 1] = info;
+
+            pci_device_probe(info);
+            if (primaryBus.type == BUS_NONE && pci_device_is_boot_vga(info)) {
+                primaryBus.type = BUS_PCI;
+                primaryBus.id.pci = info;
+            }
+            info->user_data = 0;
+        }
+    }
+    free(iter);
+
+    /* If we haven't found a primary device try a different heuristic */
+    if (primaryBus.type == BUS_NONE && num) {
+        for (i = 0; i < num; i++) {
+            uint16_t command;
+
+            info = xf86PciVideoInfo[i];
+            pci_device_cfg_read_u16(info, &command, 4);
+
+            if ((command & PCI_CMD_MEM_ENABLE)
+                && ((num == 1) || IS_VGA(info->device_class))) {
+                if (primaryBus.type == BUS_NONE) {
+                    primaryBus.type = BUS_PCI;
+                    primaryBus.id.pci = info;
+                }
+                else {
+                    xf86Msg(X_NOTICE,
+                            "More than one possible primary device found\n");
+                    primaryBus.type ^= (BusType) (-1);
+                }
+            }
+        }
+    }
+
+    /* Print a summary of the video devices found */
+    for (k = 0; k < num; k++) {
+        const char *prim = " ";
+        Bool memdone = FALSE, iodone = FALSE;
+
+        info = xf86PciVideoInfo[k];
+
+        if (!PCIALWAYSPRINTCLASSES(info->device_class))
+            continue;
+
+        if (xf86IsPrimaryPci(info))
+            prim = "*";
+
+        xf86Msg(X_PROBED, "PCI:%s(%u@%u:%u:%u) %04x:%04x:%04x:%04x ", prim,
+                info->bus, info->domain, info->dev, info->func,
+                info->vendor_id, info->device_id,
+                info->subvendor_id, info->subdevice_id);
+
+        xf86ErrorF("rev %d", info->revision);
+
+        for (i = 0; i < 6; i++) {
+            struct pci_mem_region *r = &info->regions[i];
+
+            if (r->size && !r->is_IO) {
+                if (!memdone) {
+                    xf86ErrorF(", Mem @ ");
+                    memdone = TRUE;
+                }
+                else
+                    xf86ErrorF(", ");
+                xf86ErrorF("0x%08lx/%ld", (long) r->base_addr, (long) r->size);
+            }
+        }
+
+        for (i = 0; i < 6; i++) {
+            struct pci_mem_region *r = &info->regions[i];
+
+            if (r->size && r->is_IO) {
+                if (!iodone) {
+                    xf86ErrorF(", I/O @ ");
+                    iodone = TRUE;
+                }
+                else
+                    xf86ErrorF(", ");
+                xf86ErrorF("0x%08lx/%ld", (long) r->base_addr, (long) r->size);
+            }
+        }
+
+        if (info->rom_size) {
+            xf86ErrorF(", BIOS @ 0x\?\?\?\?\?\?\?\?/%ld",
+                       (long) info->rom_size);
+        }
+
+        xf86ErrorF("\n");
+    }
+    free(xf86PciVideoInfo);
+}
+
+/*
+ * If the slot requested is already in use, return -1.
+ * Otherwise, claim the slot for the screen requesting it.
+ */
+
+int
+xf86ClaimPciSlot(struct pci_device *d, DriverPtr drvp,
+                 int chipset, GDevPtr dev, Bool active)
+{
+    EntityPtr p = NULL;
+    int num;
+
+    if (xf86CheckPciSlot(d)) {
+        num = xf86AllocateEntity();
+        p = xf86Entities[num];
+        p->driver = drvp;
+        p->chipset = chipset;
+        p->bus.type = BUS_PCI;
+        p->bus.id.pci = d;
+        p->active = active;
+        p->inUse = FALSE;
+        if (dev)
+            xf86AddDevToEntity(num, dev);
+        pciSlotClaimed++;
+
+        return num;
+    }
+    else
+        return -1;
+}
+
+/*
+ * Unclaim PCI slot, e.g. if probing failed, so that a different driver can claim.
+ */
+void
+xf86UnclaimPciSlot(struct pci_device *d, GDevPtr dev)
+{
+    int i;
+
+    for (i = 0; i < xf86NumEntities; i++) {
+        const EntityPtr p = xf86Entities[i];
+
+        if ((p->bus.type == BUS_PCI) && (p->bus.id.pci == d)) {
+            /* Probably the slot should be deallocated? */
+            xf86RemoveDevFromEntity(i, dev);
+            pciSlotClaimed--;
+            p->bus.type = BUS_NONE;
+            return;
+        }
+    }
+}
+
+/*
+ * Parse a BUS ID string, and return the PCI bus parameters if it was
+ * in the correct format for a PCI bus id.
+ */
+
+Bool
+xf86ParsePciBusString(const char *busID, int *bus, int *device, int *func)
+{
+    /*
+     * The format is assumed to be "bus[@domain]:device[:func]", where domain,
+     * bus, device and func are decimal integers.  domain and func may be
+     * omitted and assumed to be zero, although doing this isn't encouraged.
+     */
+
+    char *p, *s, *d;
+    const char *id;
+    int i;
+
+    if (StringToBusType(busID, &id) != BUS_PCI)
+        return FALSE;
+
+    s = xstrdup(id);
+    p = strtok(s, ":");
+    if (p == NULL || *p == 0) {
+        free(s);
+        return FALSE;
+    }
+    d = strpbrk(p, "@");
+    if (d != NULL) {
+        *(d++) = 0;
+        for (i = 0; d[i] != 0; i++) {
+            if (!isdigit(d[i])) {
+                free(s);
+                return FALSE;
+            }
+        }
+    }
+    for (i = 0; p[i] != 0; i++) {
+        if (!isdigit(p[i])) {
+            free(s);
+            return FALSE;
+        }
+    }
+    *bus = atoi(p);
+    if (d != NULL && *d != 0)
+        *bus += atoi(d) << 8;
+    p = strtok(NULL, ":");
+    if (p == NULL || *p == 0) {
+        free(s);
+        return FALSE;
+    }
+    for (i = 0; p[i] != 0; i++) {
+        if (!isdigit(p[i])) {
+            free(s);
+            return FALSE;
+        }
+    }
+    *device = atoi(p);
+    *func = 0;
+    p = strtok(NULL, ":");
+    if (p == NULL || *p == 0) {
+        free(s);
+        return TRUE;
+    }
+    for (i = 0; p[i] != 0; i++) {
+        if (!isdigit(p[i])) {
+            free(s);
+            return FALSE;
+        }
+    }
+    *func = atoi(p);
+    free(s);
+    return TRUE;
+}
+
+/*
+ * Compare a BUS ID string with a PCI bus id.  Return TRUE if they match.
+ */
+
+Bool
+xf86ComparePciBusString(const char *busID, int bus, int device, int func)
+{
+    int ibus, idevice, ifunc;
+
+    if (xf86ParsePciBusString(busID, &ibus, &idevice, &ifunc)) {
+        return bus == ibus && device == idevice && func == ifunc;
+    }
+    else {
+        return FALSE;
+    }
+}
+
+/*
+ * xf86IsPrimaryPci() -- return TRUE if primary device
+ * is PCI and bus, dev and func numbers match.
+ */
+
+Bool
+xf86IsPrimaryPci(struct pci_device *pPci)
+{
+    /* Add max. 1 screen for the IgnorePrimary fallback path */
+    if (xf86ProbeIgnorePrimary && xf86NumScreens == 0)
+        return TRUE;
+
+    if (primaryBus.type == BUS_PCI)
+        return pPci == primaryBus.id.pci;
+#ifdef XSERVER_PLATFORM_BUS
+    if (primaryBus.type == BUS_PLATFORM)
+        if (primaryBus.id.plat->pdev)
+            if (MATCH_PCI_DEVICES(primaryBus.id.plat->pdev, pPci))
+                return TRUE;
+#endif
+    return FALSE;
+}
+
+/*
+ * xf86GetPciInfoForEntity() -- Get the pciVideoRec of entity.
+ */
+struct pci_device *
+xf86GetPciInfoForEntity(int entityIndex)
+{
+    EntityPtr p;
+
+    if (entityIndex >= xf86NumEntities)
+        return NULL;
+
+    p = xf86Entities[entityIndex];
+    switch (p->bus.type) {
+    case BUS_PCI:
+        return p->bus.id.pci;
+    case BUS_PLATFORM:
+        return p->bus.id.plat->pdev;
+    default:
+        break;
+    }
+    return NULL;
+}
+
+/*
+ * xf86CheckPciMemBase() checks that the memory base value matches one of the
+ * PCI base address register values for the given PCI device.
+ */
+Bool
+xf86CheckPciMemBase(struct pci_device *pPci, memType base)
+{
+    int i;
+
+    for (i = 0; i < 6; i++)
+        if (base == pPci->regions[i].base_addr)
+            return TRUE;
+    return FALSE;
+}
+
+/*
+ * Check if the slot requested is free.  If it is already in use, return FALSE.
+ */
+
+Bool
+xf86CheckPciSlot(const struct pci_device *d)
+{
+    int i;
+
+    for (i = 0; i < xf86NumEntities; i++) {
+        const EntityPtr p = xf86Entities[i];
+
+        if ((p->bus.type == BUS_PCI) && (p->bus.id.pci == d)) {
+            return FALSE;
+        }
+#ifdef XSERVER_PLATFORM_BUS
+        if ((p->bus.type == BUS_PLATFORM) && (p->bus.id.plat->pdev)) {
+            struct pci_device *ud = p->bus.id.plat->pdev;
+            if (MATCH_PCI_DEVICES(ud, d))
+                return FALSE;
+        }
+#endif
+    }
+    return TRUE;
+}
+
+#define END_OF_MATCHES(m) \
+    (((m).vendor_id == 0) && ((m).device_id == 0) && ((m).subvendor_id == 0))
+
+Bool
+xf86PciAddMatchingDev(DriverPtr drvp)
+{
+    const struct pci_id_match *const devices = drvp->supported_devices;
+    int j;
+    struct pci_device *pPci;
+    struct pci_device_iterator *iter;
+    int numFound = 0;
+
+    iter = pci_id_match_iterator_create(NULL);
+    while ((pPci = pci_device_next(iter)) != NULL) {
+        /* Determine if this device is supported by the driver.  If it is,
+         * add it to the list of devices to configure.
+         */
+        for (j = 0; !END_OF_MATCHES(devices[j]); j++) {
+            if (PCI_ID_COMPARE(devices[j].vendor_id, pPci->vendor_id)
+                && PCI_ID_COMPARE(devices[j].device_id, pPci->device_id)
+                && ((devices[j].device_class_mask & pPci->device_class)
+                    == devices[j].device_class)) {
+                if (xf86CheckPciSlot(pPci)) {
+                    GDevPtr pGDev =
+                        xf86AddBusDeviceToConfigure(drvp->driverName, BUS_PCI,
+                                                    pPci, -1);
+                    if (pGDev != NULL) {
+                        /* After configure pass 1, chipID and chipRev are
+                         * treated as over-rides, so clobber them here.
+                         */
+                        pGDev->chipID = -1;
+                        pGDev->chipRev = -1;
+                    }
+
+                    numFound++;
+                }
+
+                break;
+            }
+        }
+    }
+
+    pci_iterator_destroy(iter);
+
+    return numFound != 0;
+}
+
+Bool
+xf86PciProbeDev(DriverPtr drvp)
+{
+    int i, j;
+    struct pci_device *pPci;
+    Bool foundScreen = FALSE;
+    const struct pci_id_match *const devices = drvp->supported_devices;
+    GDevPtr *devList;
+    const unsigned numDevs = xf86MatchDevice(drvp->driverName, &devList);
+
+    for (i = 0; i < numDevs; i++) {
+        struct pci_device_iterator *iter;
+        unsigned device_id;
+
+        /* Find the pciVideoRec associated with this device section.
+         */
+        iter = pci_id_match_iterator_create(NULL);
+        while ((pPci = pci_device_next(iter)) != NULL) {
+            if (devList[i]->busID && *devList[i]->busID) {
+                if (xf86ComparePciBusString(devList[i]->busID,
+                                            ((pPci->domain << 8)
+                                             | pPci->bus),
+                                            pPci->dev, pPci->func)) {
+                    break;
+                }
+            }
+            else if (xf86IsPrimaryPci(pPci)) {
+                break;
+            }
+        }
+
+        pci_iterator_destroy(iter);
+
+        if (pPci == NULL) {
+            continue;
+        }
+        device_id = (devList[i]->chipID > 0)
+            ? devList[i]->chipID : pPci->device_id;
+
+        /* Once the pciVideoRec is found, determine if the device is supported
+         * by the driver.  If it is, probe it!
+         */
+        for (j = 0; !END_OF_MATCHES(devices[j]); j++) {
+            if (PCI_ID_COMPARE(devices[j].vendor_id, pPci->vendor_id)
+                && PCI_ID_COMPARE(devices[j].device_id, device_id)
+                && ((devices[j].device_class_mask & pPci->device_class)
+                    == devices[j].device_class)) {
+                int entry;
+
+                /* Allow the same entity to be used more than once for
+                 * devices with multiple screens per entity.  This assumes
+                 * implicitly that there will be a screen == 0 instance.
+                 *
+                 * FIXME Need to make sure that two different drivers don't
+                 * FIXME claim the same screen > 0 instance.
+                 */
+                if ((devList[i]->screen == 0) && !xf86CheckPciSlot(pPci))
+                    continue;
+
+                DebugF("%s: card at %d:%d:%d is claimed by a Device section\n",
+                       drvp->driverName, pPci->bus, pPci->dev, pPci->func);
+
+                /* Allocate an entry in the lists to be returned */
+                entry = xf86ClaimPciSlot(pPci, drvp, device_id,
+                                         devList[i], devList[i]->active);
+
+                if ((entry == -1) && (devList[i]->screen > 0)) {
+                    unsigned k;
+
+                    for (k = 0; k < xf86NumEntities; k++) {
+                        EntityPtr pEnt = xf86Entities[k];
+
+                        if (pEnt->bus.type != BUS_PCI)
+                            continue;
+                        if (pEnt->bus.id.pci == pPci) {
+                            entry = k;
+                            xf86AddDevToEntity(k, devList[i]);
+                            break;
+                        }
+                    }
+                }
+
+                if (entry != -1) {
+                    if ((*drvp->PciProbe) (drvp, entry, pPci,
+                                           devices[j].match_data)) {
+                        foundScreen = TRUE;
+                    }
+                    else
+                        xf86UnclaimPciSlot(pPci, devList[i]);
+                }
+
+                break;
+            }
+        }
+    }
+    free(devList);
+
+    return foundScreen;
+}
+
+void
+xf86PciIsolateDevice(const char *argument)
+{
+    int bus, device, func;
+
+    if (sscanf(argument, "PCI:%d:%d:%d", &bus, &device, &func) == 3) {
+        xf86IsolateDevice.domain = PCI_DOM_FROM_BUS(bus);
+        xf86IsolateDevice.bus = PCI_BUS_NO_DOMAIN(bus);
+        xf86IsolateDevice.dev = device;
+        xf86IsolateDevice.func = func;
+    }
+    else
+        FatalError("Invalid isolated device specification\n");
+}
+
+static Bool
+pciDeviceHasBars(struct pci_device *pci)
+{
+    int i;
+
+    for (i = 0; i < 6; i++)
+        if (pci->regions[i].size)
+            return TRUE;
+
+    if (pci->rom_size)
+        return TRUE;
+
+    return FALSE;
+}
+
+struct Inst {
+    struct pci_device *pci;
+    GDevPtr dev;
+    Bool foundHW;               /* PCIid in list of supported chipsets */
+    Bool claimed;               /* BusID matches with a device section */
+    int chip;
+    int screen;
+};
+
+/**
+ * Find set of unclaimed devices matching a given vendor ID.
+ *
+ * Used by drivers to find as yet unclaimed devices matching the specified
+ * vendor ID.
+ *
+ * \param driverName     Name of the driver.  This is used to find Device
+ *                       sections in the config file.
+ * \param vendorID       PCI vendor ID of associated devices.  If zero, then
+ *                       the true vendor ID must be encoded in the \c PCIid
+ *                       fields of the \c PCIchipsets entries.
+ * \param chipsets       Symbol table used to associate chipset names with
+ *                       PCI IDs.
+ * \param devList        List of Device sections parsed from the config file.
+ * \param numDevs        Number of entries in \c devList.
+ * \param drvp           Pointer the driver's control structure.
+ * \param foundEntities  Returned list of entity indices associated with the
+ *                       driver.
+ *
+ * \returns
+ * The number of elements in returned in \c foundEntities on success or zero
+ * on failure.
+ *
+ * \todo
+ * This function does a bit more than short description says.  Fill in some
+ * more of the details of its operation.
+ *
+ * \todo
+ * The \c driverName parameter is redundant.  It is the same as
+ * \c DriverRec::driverName.  In a future version of this function, remove
+ * that parameter.
+ */
+int
+xf86MatchPciInstances(const char *driverName, int vendorID,
+                      SymTabPtr chipsets, PciChipsets * PCIchipsets,
+                      GDevPtr * devList, int numDevs, DriverPtr drvp,
+                      int **foundEntities)
+{
+    int i, j;
+    struct pci_device *pPci;
+    struct pci_device_iterator *iter;
+    struct Inst *instances = NULL;
+    int numClaimedInstances = 0;
+    int allocatedInstances = 0;
+    int numFound = 0;
+    SymTabRec *c;
+    PciChipsets *id;
+    int *retEntities = NULL;
+
+    *foundEntities = NULL;
+
+    /* Each PCI device will contribute at least one entry.  Each device
+     * section can contribute at most one entry.  The sum of the two is
+     * guaranteed to be larger than the maximum possible number of entries.
+     * Do this calculation and memory allocation once now to eliminate the
+     * need for realloc calls inside the loop.
+     */
+    if (!(xf86DoConfigure && xf86DoConfigurePass1)) {
+        unsigned max_entries = numDevs;
+
+        iter = pci_slot_match_iterator_create(NULL);
+        while ((pPci = pci_device_next(iter)) != NULL) {
+            max_entries++;
+        }
+
+        pci_iterator_destroy(iter);
+        instances = xnfallocarray(max_entries, sizeof(struct Inst));
+    }
+
+    iter = pci_slot_match_iterator_create(NULL);
+    while ((pPci = pci_device_next(iter)) != NULL) {
+        unsigned device_class = pPci->device_class;
+        Bool foundVendor = FALSE;
+
+        /* Convert the pre-PCI 2.0 device class for a VGA adapter to the
+         * 2.0 version of the same class.
+         */
+        if (device_class == 0x00000101) {
+            device_class = 0x00030000;
+        }
+
+        /* Find PCI devices that match the given vendor ID.  The vendor ID is
+         * either specified explicitly as a parameter to the function or
+         * implicitly encoded in the high bits of id->PCIid.
+         *
+         * The first device with a matching vendor is recorded, even if the
+         * device ID doesn't match.  This is done because the Device section
+         * in the xorg.conf file can over-ride the device ID.  A matching PCI
+         * ID might not be found now, but after the device ID over-ride is
+         * applied there /might/ be a match.
+         */
+        for (id = PCIchipsets; id->PCIid != -1; id++) {
+            const unsigned vendor_id = ((id->PCIid & 0xFFFF0000) >> 16)
+                | vendorID;
+            const unsigned device_id = (id->PCIid & 0x0000FFFF);
+            const unsigned match_class = 0x00030000 | id->PCIid;
+
+            if ((vendor_id == pPci->vendor_id)
+                || ((vendorID == PCI_VENDOR_GENERIC) &&
+                    (match_class == device_class))) {
+                if (!foundVendor && (instances != NULL)) {
+                    ++allocatedInstances;
+                    instances[allocatedInstances - 1].pci = pPci;
+                    instances[allocatedInstances - 1].dev = NULL;
+                    instances[allocatedInstances - 1].claimed = FALSE;
+                    instances[allocatedInstances - 1].foundHW = FALSE;
+                    instances[allocatedInstances - 1].screen = 0;
+                }
+
+                foundVendor = TRUE;
+
+                if ((device_id == pPci->device_id)
+                    || ((vendorID == PCI_VENDOR_GENERIC)
+                        && (match_class == device_class))) {
+                    if (instances != NULL) {
+                        instances[allocatedInstances - 1].foundHW = TRUE;
+                        instances[allocatedInstances - 1].chip = id->numChipset;
+                    }
+
+                    if (xf86DoConfigure && xf86DoConfigurePass1) {
+                        if (xf86CheckPciSlot(pPci)) {
+                            GDevPtr pGDev =
+                                xf86AddBusDeviceToConfigure(drvp->driverName,
+                                                            BUS_PCI, pPci, -1);
+
+                            if (pGDev) {
+                                /* After configure pass 1, chipID and chipRev
+                                 * are treated as over-rides, so clobber them
+                                 * here.
+                                 */
+                                pGDev->chipID = -1;
+                                pGDev->chipRev = -1;
+                            }
+
+                            numFound++;
+                        }
+                    }
+                    else {
+                        numFound++;
+                    }
+
+                    break;
+                }
+            }
+        }
+    }
+
+    pci_iterator_destroy(iter);
+
+    /* In "probe only" or "configure" mode (signaled by instances being NULL),
+     * our work is done.  Return the number of detected devices.
+     */
+    if (instances == NULL) {
+        return numFound;
+    }
+
+    /*
+     * This may be debatable, but if no PCI devices with a matching vendor
+     * type is found, return zero now.  It is probably not desirable to
+     * allow the config file to override this.
+     */
+    if (allocatedInstances <= 0) {
+        free(instances);
+        return 0;
+    }
+
+    DebugF("%s instances found: %d\n", driverName, allocatedInstances);
+
+    /*
+     * Check for devices that need duplicated instances.  This is required
+     * when there is more than one screen per entity.
+     *
+     * XXX This currently doesn't work for cases where the BusID isn't
+     * specified explicitly in the config file.
+     */
+
+    for (j = 0; j < numDevs; j++) {
+        if (devList[j]->screen > 0 && devList[j]->busID && *devList[j]->busID) {
+            for (i = 0; i < allocatedInstances; i++) {
+                pPci = instances[i].pci;
+                if (xf86ComparePciBusString(devList[j]->busID,
+                                            PCI_MAKE_BUS(pPci->domain,
+                                                         pPci->bus), pPci->dev,
+                                            pPci->func)) {
+                    allocatedInstances++;
+                    instances[allocatedInstances - 1] = instances[i];
+                    instances[allocatedInstances - 1].screen =
+                        devList[j]->screen;
+                    numFound++;
+                    break;
+                }
+            }
+        }
+    }
+
+    for (i = 0; i < allocatedInstances; i++) {
+        GDevPtr dev = NULL;
+        GDevPtr devBus = NULL;
+
+        pPci = instances[i].pci;
+        for (j = 0; j < numDevs; j++) {
+            if (devList[j]->busID && *devList[j]->busID) {
+                if (xf86ComparePciBusString(devList[j]->busID,
+                                            PCI_MAKE_BUS(pPci->domain,
+                                                         pPci->bus), pPci->dev,
+                                            pPci->func) &&
+                    devList[j]->screen == instances[i].screen) {
+
+                    if (devBus)
+                        xf86MsgVerb(X_WARNING, 0,
+                                    "%s: More than one matching Device section for "
+                                    "instances\n\t(BusID: %s) found: %s\n",
+                                    driverName, devList[j]->busID,
+                                    devList[j]->identifier);
+                    else
+                        devBus = devList[j];
+                }
+            }
+            else {
+                /*
+                 * if device section without BusID is found
+                 * only assign to it to the primary device.
+                 */
+                if (xf86IsPrimaryPci(pPci)) {
+                    xf86Msg(X_PROBED, "Assigning device section with no busID"
+                            " to primary device\n");
+                    if (dev || devBus)
+                        xf86MsgVerb(X_WARNING, 0,
+                                    "%s: More than one matching Device section "
+                                    "found: %s\n", driverName,
+                                    devList[j]->identifier);
+                    else
+                        dev = devList[j];
+                }
+            }
+        }
+        if (devBus)
+            dev = devBus;       /* busID preferred */
+        if (!dev) {
+            if (xf86CheckPciSlot(pPci) && pciDeviceHasBars(pPci)) {
+                xf86MsgVerb(X_WARNING, 0, "%s: No matching Device section "
+                            "for instance (BusID PCI:%u@%u:%u:%u) found\n",
+                            driverName, pPci->bus, pPci->domain, pPci->dev,
+                            pPci->func);
+            }
+        }
+        else {
+            numClaimedInstances++;
+            instances[i].claimed = TRUE;
+            instances[i].dev = dev;
+        }
+    }
+    DebugF("%s instances found: %d\n", driverName, numClaimedInstances);
+    /*
+     * Now check that a chipset or chipID override in the device section
+     * is valid.  Chipset has precedence over chipID.
+     * If chipset is not valid ignore BusSlot completely.
+     */
+    for (i = 0; i < allocatedInstances && numClaimedInstances > 0; i++) {
+        MessageType from = X_PROBED;
+
+        if (!instances[i].claimed) {
+            continue;
+        }
+        if (instances[i].dev->chipset) {
+            for (c = chipsets; c->token >= 0; c++) {
+                if (xf86NameCmp(c->name, instances[i].dev->chipset) == 0)
+                    break;
+            }
+            if (c->token == -1) {
+                instances[i].claimed = FALSE;
+                numClaimedInstances--;
+                xf86MsgVerb(X_WARNING, 0, "%s: Chipset \"%s\" in Device "
+                            "section \"%s\" isn't valid for this driver\n",
+                            driverName, instances[i].dev->chipset,
+                            instances[i].dev->identifier);
+            }
+            else {
+                instances[i].chip = c->token;
+
+                for (id = PCIchipsets; id->numChipset >= 0; id++) {
+                    if (id->numChipset == instances[i].chip)
+                        break;
+                }
+                if (id->numChipset >= 0) {
+                    xf86Msg(X_CONFIG, "Chipset override: %s\n",
+                            instances[i].dev->chipset);
+                    from = X_CONFIG;
+                }
+                else {
+                    instances[i].claimed = FALSE;
+                    numClaimedInstances--;
+                    xf86MsgVerb(X_WARNING, 0, "%s: Chipset \"%s\" in Device "
+                                "section \"%s\" isn't a valid PCI chipset\n",
+                                driverName, instances[i].dev->chipset,
+                                instances[i].dev->identifier);
+                }
+            }
+        }
+        else if (instances[i].dev->chipID > 0) {
+            for (id = PCIchipsets; id->numChipset >= 0; id++) {
+                if (id->PCIid == instances[i].dev->chipID)
+                    break;
+            }
+            if (id->numChipset == -1) {
+                instances[i].claimed = FALSE;
+                numClaimedInstances--;
+                xf86MsgVerb(X_WARNING, 0, "%s: ChipID 0x%04X in Device "
+                            "section \"%s\" isn't valid for this driver\n",
+                            driverName, instances[i].dev->chipID,
+                            instances[i].dev->identifier);
+            }
+            else {
+                instances[i].chip = id->numChipset;
+
+                xf86Msg(X_CONFIG, "ChipID override: 0x%04X\n",
+                        instances[i].dev->chipID);
+                from = X_CONFIG;
+            }
+        }
+        else if (!instances[i].foundHW) {
+            /*
+             * This means that there was no override and the PCI chipType
+             * doesn't match one that is supported
+             */
+            instances[i].claimed = FALSE;
+            numClaimedInstances--;
+        }
+        if (instances[i].claimed == TRUE) {
+            for (c = chipsets; c->token >= 0; c++) {
+                if (c->token == instances[i].chip)
+                    break;
+            }
+            xf86Msg(from, "Chipset %s found\n", c->name);
+        }
+    }
+
+    /*
+     * Of the claimed instances, check that another driver hasn't already
+     * claimed its slot.
+     */
+    numFound = 0;
+    for (i = 0; i < allocatedInstances && numClaimedInstances > 0; i++) {
+        if (!instances[i].claimed)
+            continue;
+        pPci = instances[i].pci;
+
+        /*
+         * Allow the same entity to be used more than once for devices with
+         * multiple screens per entity.  This assumes implicitly that there
+         * will be a screen == 0 instance.
+         *
+         * XXX Need to make sure that two different drivers don't claim
+         * the same screen > 0 instance.
+         */
+        if (instances[i].screen == 0 && !xf86CheckPciSlot(pPci))
+            continue;
+
+        DebugF("%s: card at %d:%d:%d is claimed by a Device section\n",
+               driverName, pPci->bus, pPci->dev, pPci->func);
+
+        /* Allocate an entry in the lists to be returned */
+        numFound++;
+        retEntities = xnfreallocarray(retEntities, numFound, sizeof(int));
+        retEntities[numFound - 1] = xf86ClaimPciSlot(pPci, drvp,
+                                                     instances[i].chip,
+                                                     instances[i].dev,
+                                                     instances[i].dev->active);
+        if (retEntities[numFound - 1] == -1 && instances[i].screen > 0) {
+            for (j = 0; j < xf86NumEntities; j++) {
+                EntityPtr pEnt = xf86Entities[j];
+
+                if (pEnt->bus.type != BUS_PCI)
+                    continue;
+                if (pEnt->bus.id.pci == pPci) {
+                    retEntities[numFound - 1] = j;
+                    xf86AddDevToEntity(j, instances[i].dev);
+                    break;
+                }
+            }
+        }
+    }
+    free(instances);
+    if (numFound > 0) {
+        *foundEntities = retEntities;
+    }
+
+    return numFound;
+}
+
+/*
+ * xf86ConfigPciEntityInactive() -- This function can be used
+ * to configure an inactive entity as well as to reconfigure an
+ * previously active entity inactive. If the entity has been
+ * assigned to a screen before it will be removed. If p_chip is
+ * non-NULL all static resources listed there will be registered.
+ */
+static void
+xf86ConfigPciEntityInactive(EntityInfoPtr pEnt, PciChipsets * p_chip,
+                            EntityProc init, EntityProc enter,
+                            EntityProc leave, void *private)
+{
+    ScrnInfoPtr pScrn;
+
+    if ((pScrn = xf86FindScreenForEntity(pEnt->index)))
+        xf86RemoveEntityFromScreen(pScrn, pEnt->index);
+}
+
+ScrnInfoPtr
+xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
+                    PciChipsets * p_chip, void *dummy, EntityProc init,
+                    EntityProc enter, EntityProc leave, void *private)
+{
+    EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
+
+    if (dummy || init || enter || leave)
+        FatalError("Legacy entity access functions are unsupported\n");
+
+    if (!pEnt)
+        return pScrn;
+
+    if (!(pEnt->location.type == BUS_PCI)
+        || !xf86GetPciInfoForEntity(entityIndex)) {
+        free(pEnt);
+        return pScrn;
+    }
+    if (!pEnt->active) {
+        xf86ConfigPciEntityInactive(pEnt, p_chip, init, enter, leave, private);
+        free(pEnt);
+        return pScrn;
+    }
+
+    if (!pScrn)
+        pScrn = xf86AllocateScreen(pEnt->driver, scrnFlag);
+    if (xf86IsEntitySharable(entityIndex)) {
+        xf86SetEntityShared(entityIndex);
+    }
+    xf86AddEntityToScreen(pScrn, entityIndex);
+    if (xf86IsEntityShared(entityIndex)) {
+        return pScrn;
+    }
+    free(pEnt);
+
+    return pScrn;
+}
+
+void
+xf86VideoPtrToDriverList(struct pci_device *dev, XF86MatchedDrivers *md)
+{
+    int i;
+
+    /* Add more entries here if we ever return more than 4 drivers for
+       any device */
+    const char *driverList[5] = { NULL, NULL, NULL, NULL, NULL };
+
+    switch (dev->vendor_id) {
+        /* AMD Geode LX */
+    case 0x1022:
+        if (dev->device_id == 0x2081)
+            driverList[0] = "geode";
+        break;
+        /* older Geode products acquired by AMD still carry an NSC vendor_id */
+    case 0x100b:
+        if (dev->device_id == 0x0030) {
+            /* NSC Geode GX2 specifically */
+            driverList[0] = "geode";
+            /* GX2 support started its life in the NSC tree and was later
+               forked by AMD for GEODE so we keep it as a backup */
+            driverList[1] = "nsc";
+        }
+        else
+            /* other NSC variant e.g. 0x0104 (SC1400), 0x0504 (SCx200) */
+            driverList[0] = "nsc";
+        break;
+        /* Cyrix Geode GX1 */
+    case 0x1078:
+        if (dev->device_id == 0x0104)
+            driverList[0] = "cyrix";
+        break;
+    case 0x1142:
+        driverList[0] = "apm";
+        break;
+    case 0xedd8:
+        driverList[0] = "ark";
+        break;
+    case 0x1a03:
+        driverList[0] = "ast";
+        break;
+    case 0x1002:
+        driverList[0] = "ati";
+        break;
+    case 0x102c:
+        driverList[0] = "chips";
+        break;
+    case 0x1013:
+        driverList[0] = "cirrus";
+        break;
+    case 0x3d3d:
+        driverList[0] = "glint";
+        break;
+    case 0x105d:
+        driverList[0] = "i128";
+        break;
+    case 0x8086:
+	switch (dev->device_id)
+	{
+		/* Intel i740 */
+		case 0x00d1:
+		case 0x7800:
+			driverList[0] = "i740";
+			break;
+		/* GMA500/Poulsbo */
+		case 0x8108:
+		case 0x8109:
+			/* Try psb driver on Poulsbo - if available */
+			driverList[0] = "psb";
+			driverList[1] = "psb_drv";
+			break;
+		/* GMA600/Oaktrail */
+		case 0x4100:
+		case 0x4101:
+		case 0x4102:
+		case 0x4103:
+		case 0x4104:
+		case 0x4105:
+		case 0x4106:
+		case 0x4107:
+		/* Atom E620/Oaktrail */
+		case 0x4108:
+		/* Medfield */
+		case 0x0130:
+		case 0x0131:
+		case 0x0132:
+		case 0x0133:
+		case 0x0134:
+		case 0x0135:
+		case 0x0136:
+		case 0x0137:
+		/* GMA 3600/CDV */
+		case 0x0be0:
+		case 0x0be1:
+		case 0x0be2:
+		case 0x0be3:
+		case 0x0be4:
+		case 0x0be5:
+		case 0x0be6:
+		case 0x0be7:
+		case 0x0be8:
+		case 0x0be9:
+		case 0x0bea:
+		case 0x0beb:
+		case 0x0bec:
+		case 0x0bed:
+		case 0x0bee:
+		case 0x0bef:
+			/* Use fbdev/vesa driver on Oaktrail, Medfield, CDV */
+			break;
+		/* Default to intel only on pre-gen4 chips */
+		case 0x3577:
+		case 0x2562:
+		case 0x3582:
+		case 0x358e:
+		case 0x2572:
+		case 0x2582:
+		case 0x258a:
+		case 0x2592:
+		case 0x2772:
+		case 0x27a2:
+		case 0x27ae:
+		case 0x29b2:
+		case 0x29c2:
+		case 0x29d2:
+		case 0xa001:
+		case 0xa011:
+			driverList[0] = "intel";
+			break;
+        }
+        break;
+    case 0x102b:
+        driverList[0] = "mga";
+        break;
+    case 0x10c8:
+        driverList[0] = "neomagic";
+        break;
+    case 0x10de:
+    case 0x12d2:
+    {
+        int idx = 0;
+
+#if defined(__linux__) || defined(__NetBSD__)
+        driverList[idx++] = "nouveau";
+#endif
+        driverList[idx++] = "nv";
+        break;
+    }
+    case 0x1106:
+        driverList[0] = "openchrome";
+        break;
+    case 0x1b36:
+        driverList[0] = "qxl";
+        break;
+    case 0x1163:
+        driverList[0] = "rendition";
+        break;
+    case 0x5333:
+        switch (dev->device_id) {
+        case 0x88d0:
+        case 0x88d1:
+        case 0x88f0:
+        case 0x8811:
+        case 0x8812:
+        case 0x8814:
+        case 0x8901:
+            driverList[0] = "s3";
+            break;
+        case 0x5631:
+        case 0x883d:
+        case 0x8a01:
+        case 0x8a10:
+        case 0x8c01:
+        case 0x8c03:
+        case 0x8904:
+        case 0x8a13:
+            driverList[0] = "s3virge";
+            break;
+        default:
+            driverList[0] = "savage";
+            break;
+        }
+        break;
+    case 0x1039:
+        driverList[0] = "sis";
+        break;
+    case 0x126f:
+        driverList[0] = "siliconmotion";
+        break;
+    case 0x121a:
+        if (dev->device_id < 0x0003)
+            driverList[0] = "voodoo";
+        else
+            driverList[0] = "tdfx";
+        break;
+    case 0x1011:
+        driverList[0] = "tga";
+        break;
+    case 0x1023:
+        driverList[0] = "trident";
+        break;
+    case 0x100c:
+        driverList[0] = "tseng";
+        break;
+    case 0x80ee:
+        driverList[0] = "vboxvideo";
+        break;
+    case 0x15ad:
+        driverList[0] = "vmware";
+        break;
+    case 0x18ca:
+        if (dev->device_id == 0x47)
+            driverList[0] = "xgixp";
+        else
+            driverList[0] = "xgi";
+        break;
+    default:
+        break;
+    }
+    for (i = 0; driverList[i] != NULL; i++) {
+        xf86AddMatchedDriver(md, driverList[i]);
+    }
+}
+
+#ifdef __linux__
+static int
+xchomp(char *line)
+{
+    size_t len = 0;
+
+    if (!line) {
+        return 1;
+    }
+
+    len = strlen(line);
+    if (line[len - 1] == '\n' && len > 0) {
+        line[len - 1] = '\0';
+    }
+    return 0;
+}
+
+/* This function is used to provide a workaround for binary drivers that
+ * don't export their PCI ID's properly. If distros don't end up using this
+ * feature it can and should be removed because the symbol-based resolution
+ * scheme should be the primary one */
+void
+xf86MatchDriverFromFiles(uint16_t match_vendor, uint16_t match_chip,
+                         XF86MatchedDrivers *md)
+{
+    DIR *idsdir;
+    FILE *fp;
+    struct dirent *direntry;
+    char *line = NULL, *tmpMatch;
+    size_t len;
+    ssize_t read;
+    char path_name[512], vendor_str[5], chip_str[5];
+    uint16_t vendor, chip;
+    int j;
+
+    idsdir = opendir(PCI_TXT_IDS_PATH);
+    if (!idsdir)
+        return;
+
+    xf86Msg(X_INFO,
+            "Scanning %s directory for additional PCI ID's supported by the drivers\n",
+            PCI_TXT_IDS_PATH);
+    direntry = readdir(idsdir);
+    /* Read the directory */
+    while (direntry) {
+        if (direntry->d_name[0] == '.') {
+            direntry = readdir(idsdir);
+            continue;
+        }
+        len = strlen(direntry->d_name);
+        /* A tiny bit of sanity checking. We should probably do better */
+        if (strncmp(&(direntry->d_name[len - 4]), ".ids", 4) == 0) {
+            /* We need the full path name to open the file */
+            snprintf(path_name, sizeof(path_name), "%s/%s",
+                     PCI_TXT_IDS_PATH, direntry->d_name);
+            fp = fopen(path_name, "r");
+            if (fp == NULL) {
+                xf86Msg(X_ERROR, "Could not open %s for reading. Exiting.\n",
+                        path_name);
+                goto end;
+            }
+            /* Read the file */
+#ifdef __GLIBC__
+            while ((read = getline(&line, &len, fp)) != -1) {
+#else
+            while ((line = fgetln(fp, &len)) != (char *) NULL) {
+#endif                          /* __GLIBC __ */
+                xchomp(line);
+                if (isdigit(line[0])) {
+                    strlcpy(vendor_str, line, sizeof(vendor_str));
+                    vendor = (int) strtol(vendor_str, NULL, 16);
+                    if ((strlen(&line[4])) == 0) {
+                        chip_str[0] = '\0';
+                        chip = -1;
+                    }
+                    else {
+                        /* Handle trailing whitespace */
+                        if (isspace(line[4])) {
+                            chip_str[0] = '\0';
+                            chip = -1;
+                        }
+                        else {
+                            /* Ok, it's a real ID */
+                            strlcpy(chip_str, &line[4], sizeof(chip_str));
+                            chip = (int) strtol(chip_str, NULL, 16);
+                        }
+                    }
+                    if (vendor == match_vendor && chip == match_chip) {
+                        tmpMatch =
+                            (char *) malloc(sizeof(char) *
+                                            strlen(direntry->d_name) - 3);
+                        if (!tmpMatch) {
+                            xf86Msg(X_ERROR,
+                                    "Could not allocate space for the module name. Exiting.\n");
+                            goto end;
+                        }
+                        /* hack off the .ids suffix. This should guard
+                         * against other problems, but it will end up
+                         * taking off anything after the first '.' */
+                        for (j = 0; j < (strlen(direntry->d_name) - 3); j++) {
+                            if (direntry->d_name[j] == '.') {
+                                tmpMatch[j] = '\0';
+                                break;
+                            }
+                            else {
+                                tmpMatch[j] = direntry->d_name[j];
+                            }
+                        }
+                        xf86AddMatchedDriver(md, tmpMatch);
+                        xf86Msg(X_INFO, "Matched %s from file name %s\n",
+                                tmpMatch, direntry->d_name);
+                        free(tmpMatch);
+                    }
+                }
+                else {
+                    /* TODO Handle driver overrides here */
+                }
+            }
+            fclose(fp);
+        }
+        direntry = readdir(idsdir);
+    }
+ end:
+    free(line);
+    closedir(idsdir);
+}
+#endif                          /* __linux__ */
+
+void
+xf86PciMatchDriver(XF86MatchedDrivers *md)
+{
+    struct pci_device *info = NULL;
+    struct pci_device_iterator *iter;
+
+    /* Find the primary device, and get some information about it. */
+    iter = pci_slot_match_iterator_create(NULL);
+    while ((info = pci_device_next(iter)) != NULL) {
+        if (xf86IsPrimaryPci(info)) {
+            break;
+        }
+    }
+
+    pci_iterator_destroy(iter);
+#ifdef __linux__
+    if (info)
+        xf86MatchDriverFromFiles(info->vendor_id, info->device_id, md);
+#endif
+
+    if (info != NULL) {
+        xf86VideoPtrToDriverList(info, md);
+    }
+}
+
+Bool
+xf86PciConfigure(void *busData, struct pci_device *pDev)
+{
+    struct pci_device *pVideo = NULL;
+
+    pVideo = (struct pci_device *) busData;
+    if (pDev &&
+        (pDev->domain == pVideo->domain) &&
+        (pDev->bus == pVideo->bus) &&
+        (pDev->dev == pVideo->dev) && (pDev->func == pVideo->func))
+        return 0;
+
+    return 1;
+}
+
+void
+xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo,
+                       GDevRec * GDev, int *chipset)
+{
+    char busnum[8];
+    char *tmp;
+
+    pVideo = (struct pci_device *) busData;
+
+    snprintf(busnum, sizeof(busnum), "%d", pVideo->bus);
+
+    XNFasprintf(&tmp, "PCI:%s:%d:%d",
+                busnum, pVideo->dev, pVideo->func);
+    GDev->busID = tmp;
+
+    GDev->chipID = pVideo->device_id;
+    GDev->chipRev = pVideo->revision;
+
+    if (*chipset < 0)
+        *chipset = (pVideo->vendor_id << 16) | pVideo->device_id;
+}
+
+char *
+DRICreatePCIBusID(const struct pci_device *dev)
+{
+    char *busID;
+
+    if (asprintf(&busID, "pci:%04x:%02x:%02x.%d",
+                 dev->domain, dev->bus, dev->dev, dev->func) == -1)
+        return NULL;
+
+    return busID;
+}
Index: xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/xorg-server-21.1.7-new/hw/xfree86/common
===================================================================
--- xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/xorg-server-21.1.7-new/hw/xfree86/common	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/xorg-server-21.1.7-new/hw/xfree86/common	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/xorg-server-21.1.7-new/hw/xfree86/common
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/xorg-server-21.1.7-new/hw/xfree86
===================================================================
--- xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/xorg-server-21.1.7-new/hw/xfree86	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/xorg-server-21.1.7-new/hw/xfree86	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/xorg-server-21.1.7-new/hw/xfree86
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/xorg-server-21.1.7-new/hw
===================================================================
--- xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/xorg-server-21.1.7-new/hw	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/xorg-server-21.1.7-new/hw	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/xorg-server-21.1.7-new/hw
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/xorg-server-21.1.7-new
===================================================================
--- xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/xorg-server-21.1.7-new	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/xorg-server-21.1.7-new	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch/xorg-server-21.1.7-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch
===================================================================
--- xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-intel-ddx-only-on-pre-gen4-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/create.patch.sh
===================================================================
--- xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/create.patch.sh	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=21.1.7
+
+tar --files-from=file.list -xJvf ../xorg-server-$VERSION.tar.xz
+mv xorg-server-$VERSION xorg-server-$VERSION-orig
+
+cp -rf ./xorg-server-$VERSION-new ./xorg-server-$VERSION
+
+diff --unified -Nr  xorg-server-$VERSION-orig  xorg-server-$VERSION > xorg-server-$VERSION-modesetting-on-GeForce.patch
+
+mv xorg-server-$VERSION-modesetting-on-GeForce.patch ../patches
+
+rm -rf ./xorg-server-$VERSION
+rm -rf ./xorg-server-$VERSION-orig

Property changes on: xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/file.list
===================================================================
--- xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/file.list	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/file.list	(revision 5)
@@ -0,0 +1 @@
+xorg-server-21.1.7/hw/xfree86/common/xf86pciBus.c
Index: xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/xorg-server-21.1.7-new/hw/xfree86/common/xf86pciBus.c
===================================================================
--- xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/xorg-server-21.1.7-new/hw/xfree86/common/xf86pciBus.c	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/xorg-server-21.1.7-new/hw/xfree86/common/xf86pciBus.c	(revision 5)
@@ -0,0 +1,1495 @@
+/*
+ * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
+ * and author(s) 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 holder(s) and author(s).
+ */
+
+/*
+ * This file contains the interfaces to the bus-specific code
+ */
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <X11/X.h>
+#include <pciaccess.h>
+#include <xf86drm.h>
+#include "os.h"
+#include "Pci.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "dirent.h"             /* DIR, FILE type definitions */
+
+/* Bus-specific headers */
+#include "xf86Bus.h"
+
+#define XF86_OS_PRIVS
+#include "xf86_OSproc.h"
+
+#define PCI_VENDOR_GENERIC		0x00FF
+
+/* Bus-specific globals */
+int pciSlotClaimed = 0;
+
+#define PCIINFOCLASSES(c) \
+    ( (((c) & 0x00ff0000) == (PCI_CLASS_PREHISTORIC << 16)) \
+      || (((c) & 0x00ff0000) == (PCI_CLASS_DISPLAY << 16)) \
+      || ((((c) & 0x00ffff00) \
+	   == ((PCI_CLASS_MULTIMEDIA << 16) | (PCI_SUBCLASS_MULTIMEDIA_VIDEO << 8)))) \
+      || ((((c) & 0x00ffff00) \
+	   == ((PCI_CLASS_PROCESSOR << 16) | (PCI_SUBCLASS_PROCESSOR_COPROC << 8)))) )
+
+/*
+ * PCI classes that have messages printed always.  The others are only
+ * have a message printed when the vendor/dev IDs are recognised.
+ */
+#define PCIALWAYSPRINTCLASSES(c) \
+    ( (((c) & 0x00ffff00) \
+       == ((PCI_CLASS_PREHISTORIC << 16) | (PCI_SUBCLASS_PREHISTORIC_VGA << 8))) \
+      || (((c) & 0x00ff0000) == (PCI_CLASS_DISPLAY << 16)) \
+      || ((((c) & 0x00ffff00) \
+	   == ((PCI_CLASS_MULTIMEDIA << 16) | (PCI_SUBCLASS_MULTIMEDIA_VIDEO << 8)))) )
+
+#define IS_VGA(c) \
+    (((c) & 0x00ffff00) \
+	 == ((PCI_CLASS_DISPLAY << 16) | (PCI_SUBCLASS_DISPLAY_VGA << 8)))
+
+static struct pci_slot_match xf86IsolateDevice = {
+    PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0
+};
+
+/*
+ * xf86Bus.c interface
+ */
+
+void
+xf86PciProbe(void)
+{
+    int i = 0, k;
+    int num = 0;
+    struct pci_device *info;
+    struct pci_device_iterator *iter;
+    struct pci_device **xf86PciVideoInfo = NULL;
+
+    if (!xf86scanpci()) {
+        xf86PciVideoInfo = NULL;
+        return;
+    }
+
+    iter = pci_slot_match_iterator_create(&xf86IsolateDevice);
+    while ((info = pci_device_next(iter)) != NULL) {
+        if (PCIINFOCLASSES(info->device_class)) {
+            num++;
+            xf86PciVideoInfo = xnfreallocarray(xf86PciVideoInfo,
+                                               num + 1,
+                                               sizeof(struct pci_device *));
+            xf86PciVideoInfo[num] = NULL;
+            xf86PciVideoInfo[num - 1] = info;
+
+            pci_device_probe(info);
+            if (primaryBus.type == BUS_NONE && pci_device_is_boot_vga(info)) {
+                primaryBus.type = BUS_PCI;
+                primaryBus.id.pci = info;
+            }
+            info->user_data = 0;
+        }
+    }
+    free(iter);
+
+    /* If we haven't found a primary device try a different heuristic */
+    if (primaryBus.type == BUS_NONE && num) {
+        for (i = 0; i < num; i++) {
+            uint16_t command;
+
+            info = xf86PciVideoInfo[i];
+            pci_device_cfg_read_u16(info, &command, 4);
+
+            if ((command & PCI_CMD_MEM_ENABLE)
+                && ((num == 1) || IS_VGA(info->device_class))) {
+                if (primaryBus.type == BUS_NONE) {
+                    primaryBus.type = BUS_PCI;
+                    primaryBus.id.pci = info;
+                }
+                else {
+                    xf86Msg(X_NOTICE,
+                            "More than one possible primary device found\n");
+                    primaryBus.type ^= (BusType) (-1);
+                }
+            }
+        }
+    }
+
+    /* Print a summary of the video devices found */
+    for (k = 0; k < num; k++) {
+        const char *prim = " ";
+        Bool memdone = FALSE, iodone = FALSE;
+
+        info = xf86PciVideoInfo[k];
+
+        if (!PCIALWAYSPRINTCLASSES(info->device_class))
+            continue;
+
+        if (xf86IsPrimaryPci(info))
+            prim = "*";
+
+        xf86Msg(X_PROBED, "PCI:%s(%u@%u:%u:%u) %04x:%04x:%04x:%04x ", prim,
+                info->bus, info->domain, info->dev, info->func,
+                info->vendor_id, info->device_id,
+                info->subvendor_id, info->subdevice_id);
+
+        xf86ErrorF("rev %d", info->revision);
+
+        for (i = 0; i < 6; i++) {
+            struct pci_mem_region *r = &info->regions[i];
+
+            if (r->size && !r->is_IO) {
+                if (!memdone) {
+                    xf86ErrorF(", Mem @ ");
+                    memdone = TRUE;
+                }
+                else
+                    xf86ErrorF(", ");
+                xf86ErrorF("0x%08lx/%ld", (long) r->base_addr, (long) r->size);
+            }
+        }
+
+        for (i = 0; i < 6; i++) {
+            struct pci_mem_region *r = &info->regions[i];
+
+            if (r->size && r->is_IO) {
+                if (!iodone) {
+                    xf86ErrorF(", I/O @ ");
+                    iodone = TRUE;
+                }
+                else
+                    xf86ErrorF(", ");
+                xf86ErrorF("0x%08lx/%ld", (long) r->base_addr, (long) r->size);
+            }
+        }
+
+        if (info->rom_size) {
+            xf86ErrorF(", BIOS @ 0x\?\?\?\?\?\?\?\?/%ld",
+                       (long) info->rom_size);
+        }
+
+        xf86ErrorF("\n");
+    }
+    free(xf86PciVideoInfo);
+}
+
+/*
+ * If the slot requested is already in use, return -1.
+ * Otherwise, claim the slot for the screen requesting it.
+ */
+
+int
+xf86ClaimPciSlot(struct pci_device *d, DriverPtr drvp,
+                 int chipset, GDevPtr dev, Bool active)
+{
+    EntityPtr p = NULL;
+    int num;
+
+    if (xf86CheckPciSlot(d)) {
+        num = xf86AllocateEntity();
+        p = xf86Entities[num];
+        p->driver = drvp;
+        p->chipset = chipset;
+        p->bus.type = BUS_PCI;
+        p->bus.id.pci = d;
+        p->active = active;
+        p->inUse = FALSE;
+        if (dev)
+            xf86AddDevToEntity(num, dev);
+        pciSlotClaimed++;
+
+        return num;
+    }
+    else
+        return -1;
+}
+
+/*
+ * Unclaim PCI slot, e.g. if probing failed, so that a different driver can claim.
+ */
+void
+xf86UnclaimPciSlot(struct pci_device *d, GDevPtr dev)
+{
+    int i;
+
+    for (i = 0; i < xf86NumEntities; i++) {
+        const EntityPtr p = xf86Entities[i];
+
+        if ((p->bus.type == BUS_PCI) && (p->bus.id.pci == d)) {
+            /* Probably the slot should be deallocated? */
+            xf86RemoveDevFromEntity(i, dev);
+            pciSlotClaimed--;
+            p->bus.type = BUS_NONE;
+            return;
+        }
+    }
+}
+
+/*
+ * Parse a BUS ID string, and return the PCI bus parameters if it was
+ * in the correct format for a PCI bus id.
+ */
+
+Bool
+xf86ParsePciBusString(const char *busID, int *bus, int *device, int *func)
+{
+    /*
+     * The format is assumed to be "bus[@domain]:device[:func]", where domain,
+     * bus, device and func are decimal integers.  domain and func may be
+     * omitted and assumed to be zero, although doing this isn't encouraged.
+     */
+
+    char *p, *s, *d;
+    const char *id;
+    int i;
+
+    if (StringToBusType(busID, &id) != BUS_PCI)
+        return FALSE;
+
+    s = xstrdup(id);
+    p = strtok(s, ":");
+    if (p == NULL || *p == 0) {
+        free(s);
+        return FALSE;
+    }
+    d = strpbrk(p, "@");
+    if (d != NULL) {
+        *(d++) = 0;
+        for (i = 0; d[i] != 0; i++) {
+            if (!isdigit(d[i])) {
+                free(s);
+                return FALSE;
+            }
+        }
+    }
+    for (i = 0; p[i] != 0; i++) {
+        if (!isdigit(p[i])) {
+            free(s);
+            return FALSE;
+        }
+    }
+    *bus = atoi(p);
+    if (d != NULL && *d != 0)
+        *bus += atoi(d) << 8;
+    p = strtok(NULL, ":");
+    if (p == NULL || *p == 0) {
+        free(s);
+        return FALSE;
+    }
+    for (i = 0; p[i] != 0; i++) {
+        if (!isdigit(p[i])) {
+            free(s);
+            return FALSE;
+        }
+    }
+    *device = atoi(p);
+    *func = 0;
+    p = strtok(NULL, ":");
+    if (p == NULL || *p == 0) {
+        free(s);
+        return TRUE;
+    }
+    for (i = 0; p[i] != 0; i++) {
+        if (!isdigit(p[i])) {
+            free(s);
+            return FALSE;
+        }
+    }
+    *func = atoi(p);
+    free(s);
+    return TRUE;
+}
+
+/*
+ * Compare a BUS ID string with a PCI bus id.  Return TRUE if they match.
+ */
+
+Bool
+xf86ComparePciBusString(const char *busID, int bus, int device, int func)
+{
+    int ibus, idevice, ifunc;
+
+    if (xf86ParsePciBusString(busID, &ibus, &idevice, &ifunc)) {
+        return bus == ibus && device == idevice && func == ifunc;
+    }
+    else {
+        return FALSE;
+    }
+}
+
+/*
+ * xf86IsPrimaryPci() -- return TRUE if primary device
+ * is PCI and bus, dev and func numbers match.
+ */
+
+Bool
+xf86IsPrimaryPci(struct pci_device *pPci)
+{
+    /* Add max. 1 screen for the IgnorePrimary fallback path */
+    if (xf86ProbeIgnorePrimary && xf86NumScreens == 0)
+        return TRUE;
+
+    if (primaryBus.type == BUS_PCI)
+        return pPci == primaryBus.id.pci;
+#ifdef XSERVER_PLATFORM_BUS
+    if (primaryBus.type == BUS_PLATFORM)
+        if (primaryBus.id.plat->pdev)
+            if (MATCH_PCI_DEVICES(primaryBus.id.plat->pdev, pPci))
+                return TRUE;
+#endif
+    return FALSE;
+}
+
+/*
+ * xf86GetPciInfoForEntity() -- Get the pciVideoRec of entity.
+ */
+struct pci_device *
+xf86GetPciInfoForEntity(int entityIndex)
+{
+    EntityPtr p;
+
+    if (entityIndex >= xf86NumEntities)
+        return NULL;
+
+    p = xf86Entities[entityIndex];
+    switch (p->bus.type) {
+    case BUS_PCI:
+        return p->bus.id.pci;
+    case BUS_PLATFORM:
+        return p->bus.id.plat->pdev;
+    default:
+        break;
+    }
+    return NULL;
+}
+
+/*
+ * xf86CheckPciMemBase() checks that the memory base value matches one of the
+ * PCI base address register values for the given PCI device.
+ */
+Bool
+xf86CheckPciMemBase(struct pci_device *pPci, memType base)
+{
+    int i;
+
+    for (i = 0; i < 6; i++)
+        if (base == pPci->regions[i].base_addr)
+            return TRUE;
+    return FALSE;
+}
+
+/*
+ * Check if the slot requested is free.  If it is already in use, return FALSE.
+ */
+
+Bool
+xf86CheckPciSlot(const struct pci_device *d)
+{
+    int i;
+
+    for (i = 0; i < xf86NumEntities; i++) {
+        const EntityPtr p = xf86Entities[i];
+
+        if ((p->bus.type == BUS_PCI) && (p->bus.id.pci == d)) {
+            return FALSE;
+        }
+#ifdef XSERVER_PLATFORM_BUS
+        if ((p->bus.type == BUS_PLATFORM) && (p->bus.id.plat->pdev)) {
+            struct pci_device *ud = p->bus.id.plat->pdev;
+            if (MATCH_PCI_DEVICES(ud, d))
+                return FALSE;
+        }
+#endif
+    }
+    return TRUE;
+}
+
+#define END_OF_MATCHES(m) \
+    (((m).vendor_id == 0) && ((m).device_id == 0) && ((m).subvendor_id == 0))
+
+Bool
+xf86PciAddMatchingDev(DriverPtr drvp)
+{
+    const struct pci_id_match *const devices = drvp->supported_devices;
+    int j;
+    struct pci_device *pPci;
+    struct pci_device_iterator *iter;
+    int numFound = 0;
+
+    iter = pci_id_match_iterator_create(NULL);
+    while ((pPci = pci_device_next(iter)) != NULL) {
+        /* Determine if this device is supported by the driver.  If it is,
+         * add it to the list of devices to configure.
+         */
+        for (j = 0; !END_OF_MATCHES(devices[j]); j++) {
+            if (PCI_ID_COMPARE(devices[j].vendor_id, pPci->vendor_id)
+                && PCI_ID_COMPARE(devices[j].device_id, pPci->device_id)
+                && ((devices[j].device_class_mask & pPci->device_class)
+                    == devices[j].device_class)) {
+                if (xf86CheckPciSlot(pPci)) {
+                    GDevPtr pGDev =
+                        xf86AddBusDeviceToConfigure(drvp->driverName, BUS_PCI,
+                                                    pPci, -1);
+                    if (pGDev != NULL) {
+                        /* After configure pass 1, chipID and chipRev are
+                         * treated as over-rides, so clobber them here.
+                         */
+                        pGDev->chipID = -1;
+                        pGDev->chipRev = -1;
+                    }
+
+                    numFound++;
+                }
+
+                break;
+            }
+        }
+    }
+
+    pci_iterator_destroy(iter);
+
+    return numFound != 0;
+}
+
+Bool
+xf86PciProbeDev(DriverPtr drvp)
+{
+    int i, j;
+    struct pci_device *pPci;
+    Bool foundScreen = FALSE;
+    const struct pci_id_match *const devices = drvp->supported_devices;
+    GDevPtr *devList;
+    const unsigned numDevs = xf86MatchDevice(drvp->driverName, &devList);
+
+    for (i = 0; i < numDevs; i++) {
+        struct pci_device_iterator *iter;
+        unsigned device_id;
+
+        /* Find the pciVideoRec associated with this device section.
+         */
+        iter = pci_id_match_iterator_create(NULL);
+        while ((pPci = pci_device_next(iter)) != NULL) {
+            if (devList[i]->busID && *devList[i]->busID) {
+                if (xf86ComparePciBusString(devList[i]->busID,
+                                            ((pPci->domain << 8)
+                                             | pPci->bus),
+                                            pPci->dev, pPci->func)) {
+                    break;
+                }
+            }
+            else if (xf86IsPrimaryPci(pPci)) {
+                break;
+            }
+        }
+
+        pci_iterator_destroy(iter);
+
+        if (pPci == NULL) {
+            continue;
+        }
+        device_id = (devList[i]->chipID > 0)
+            ? devList[i]->chipID : pPci->device_id;
+
+        /* Once the pciVideoRec is found, determine if the device is supported
+         * by the driver.  If it is, probe it!
+         */
+        for (j = 0; !END_OF_MATCHES(devices[j]); j++) {
+            if (PCI_ID_COMPARE(devices[j].vendor_id, pPci->vendor_id)
+                && PCI_ID_COMPARE(devices[j].device_id, device_id)
+                && ((devices[j].device_class_mask & pPci->device_class)
+                    == devices[j].device_class)) {
+                int entry;
+
+                /* Allow the same entity to be used more than once for
+                 * devices with multiple screens per entity.  This assumes
+                 * implicitly that there will be a screen == 0 instance.
+                 *
+                 * FIXME Need to make sure that two different drivers don't
+                 * FIXME claim the same screen > 0 instance.
+                 */
+                if ((devList[i]->screen == 0) && !xf86CheckPciSlot(pPci))
+                    continue;
+
+                DebugF("%s: card at %d:%d:%d is claimed by a Device section\n",
+                       drvp->driverName, pPci->bus, pPci->dev, pPci->func);
+
+                /* Allocate an entry in the lists to be returned */
+                entry = xf86ClaimPciSlot(pPci, drvp, device_id,
+                                         devList[i], devList[i]->active);
+
+                if ((entry == -1) && (devList[i]->screen > 0)) {
+                    unsigned k;
+
+                    for (k = 0; k < xf86NumEntities; k++) {
+                        EntityPtr pEnt = xf86Entities[k];
+
+                        if (pEnt->bus.type != BUS_PCI)
+                            continue;
+                        if (pEnt->bus.id.pci == pPci) {
+                            entry = k;
+                            xf86AddDevToEntity(k, devList[i]);
+                            break;
+                        }
+                    }
+                }
+
+                if (entry != -1) {
+                    if ((*drvp->PciProbe) (drvp, entry, pPci,
+                                           devices[j].match_data)) {
+                        foundScreen = TRUE;
+                    }
+                    else
+                        xf86UnclaimPciSlot(pPci, devList[i]);
+                }
+
+                break;
+            }
+        }
+    }
+    free(devList);
+
+    return foundScreen;
+}
+
+void
+xf86PciIsolateDevice(const char *argument)
+{
+    int bus, device, func;
+
+    if (sscanf(argument, "PCI:%d:%d:%d", &bus, &device, &func) == 3) {
+        xf86IsolateDevice.domain = PCI_DOM_FROM_BUS(bus);
+        xf86IsolateDevice.bus = PCI_BUS_NO_DOMAIN(bus);
+        xf86IsolateDevice.dev = device;
+        xf86IsolateDevice.func = func;
+    }
+    else
+        FatalError("Invalid isolated device specification\n");
+}
+
+static Bool
+pciDeviceHasBars(struct pci_device *pci)
+{
+    int i;
+
+    for (i = 0; i < 6; i++)
+        if (pci->regions[i].size)
+            return TRUE;
+
+    if (pci->rom_size)
+        return TRUE;
+
+    return FALSE;
+}
+
+struct Inst {
+    struct pci_device *pci;
+    GDevPtr dev;
+    Bool foundHW;               /* PCIid in list of supported chipsets */
+    Bool claimed;               /* BusID matches with a device section */
+    int chip;
+    int screen;
+};
+
+/**
+ * Find set of unclaimed devices matching a given vendor ID.
+ *
+ * Used by drivers to find as yet unclaimed devices matching the specified
+ * vendor ID.
+ *
+ * \param driverName     Name of the driver.  This is used to find Device
+ *                       sections in the config file.
+ * \param vendorID       PCI vendor ID of associated devices.  If zero, then
+ *                       the true vendor ID must be encoded in the \c PCIid
+ *                       fields of the \c PCIchipsets entries.
+ * \param chipsets       Symbol table used to associate chipset names with
+ *                       PCI IDs.
+ * \param devList        List of Device sections parsed from the config file.
+ * \param numDevs        Number of entries in \c devList.
+ * \param drvp           Pointer the driver's control structure.
+ * \param foundEntities  Returned list of entity indices associated with the
+ *                       driver.
+ *
+ * \returns
+ * The number of elements in returned in \c foundEntities on success or zero
+ * on failure.
+ *
+ * \todo
+ * This function does a bit more than short description says.  Fill in some
+ * more of the details of its operation.
+ *
+ * \todo
+ * The \c driverName parameter is redundant.  It is the same as
+ * \c DriverRec::driverName.  In a future version of this function, remove
+ * that parameter.
+ */
+int
+xf86MatchPciInstances(const char *driverName, int vendorID,
+                      SymTabPtr chipsets, PciChipsets * PCIchipsets,
+                      GDevPtr * devList, int numDevs, DriverPtr drvp,
+                      int **foundEntities)
+{
+    int i, j;
+    struct pci_device *pPci;
+    struct pci_device_iterator *iter;
+    struct Inst *instances = NULL;
+    int numClaimedInstances = 0;
+    int allocatedInstances = 0;
+    int numFound = 0;
+    SymTabRec *c;
+    PciChipsets *id;
+    int *retEntities = NULL;
+
+    *foundEntities = NULL;
+
+    /* Each PCI device will contribute at least one entry.  Each device
+     * section can contribute at most one entry.  The sum of the two is
+     * guaranteed to be larger than the maximum possible number of entries.
+     * Do this calculation and memory allocation once now to eliminate the
+     * need for realloc calls inside the loop.
+     */
+    if (!(xf86DoConfigure && xf86DoConfigurePass1)) {
+        unsigned max_entries = numDevs;
+
+        iter = pci_slot_match_iterator_create(NULL);
+        while ((pPci = pci_device_next(iter)) != NULL) {
+            max_entries++;
+        }
+
+        pci_iterator_destroy(iter);
+        instances = xnfallocarray(max_entries, sizeof(struct Inst));
+    }
+
+    iter = pci_slot_match_iterator_create(NULL);
+    while ((pPci = pci_device_next(iter)) != NULL) {
+        unsigned device_class = pPci->device_class;
+        Bool foundVendor = FALSE;
+
+        /* Convert the pre-PCI 2.0 device class for a VGA adapter to the
+         * 2.0 version of the same class.
+         */
+        if (device_class == 0x00000101) {
+            device_class = 0x00030000;
+        }
+
+        /* Find PCI devices that match the given vendor ID.  The vendor ID is
+         * either specified explicitly as a parameter to the function or
+         * implicitly encoded in the high bits of id->PCIid.
+         *
+         * The first device with a matching vendor is recorded, even if the
+         * device ID doesn't match.  This is done because the Device section
+         * in the xorg.conf file can over-ride the device ID.  A matching PCI
+         * ID might not be found now, but after the device ID over-ride is
+         * applied there /might/ be a match.
+         */
+        for (id = PCIchipsets; id->PCIid != -1; id++) {
+            const unsigned vendor_id = ((id->PCIid & 0xFFFF0000) >> 16)
+                | vendorID;
+            const unsigned device_id = (id->PCIid & 0x0000FFFF);
+            const unsigned match_class = 0x00030000 | id->PCIid;
+
+            if ((vendor_id == pPci->vendor_id)
+                || ((vendorID == PCI_VENDOR_GENERIC) &&
+                    (match_class == device_class))) {
+                if (!foundVendor && (instances != NULL)) {
+                    ++allocatedInstances;
+                    instances[allocatedInstances - 1].pci = pPci;
+                    instances[allocatedInstances - 1].dev = NULL;
+                    instances[allocatedInstances - 1].claimed = FALSE;
+                    instances[allocatedInstances - 1].foundHW = FALSE;
+                    instances[allocatedInstances - 1].screen = 0;
+                }
+
+                foundVendor = TRUE;
+
+                if ((device_id == pPci->device_id)
+                    || ((vendorID == PCI_VENDOR_GENERIC)
+                        && (match_class == device_class))) {
+                    if (instances != NULL) {
+                        instances[allocatedInstances - 1].foundHW = TRUE;
+                        instances[allocatedInstances - 1].chip = id->numChipset;
+                    }
+
+                    if (xf86DoConfigure && xf86DoConfigurePass1) {
+                        if (xf86CheckPciSlot(pPci)) {
+                            GDevPtr pGDev =
+                                xf86AddBusDeviceToConfigure(drvp->driverName,
+                                                            BUS_PCI, pPci, -1);
+
+                            if (pGDev) {
+                                /* After configure pass 1, chipID and chipRev
+                                 * are treated as over-rides, so clobber them
+                                 * here.
+                                 */
+                                pGDev->chipID = -1;
+                                pGDev->chipRev = -1;
+                            }
+
+                            numFound++;
+                        }
+                    }
+                    else {
+                        numFound++;
+                    }
+
+                    break;
+                }
+            }
+        }
+    }
+
+    pci_iterator_destroy(iter);
+
+    /* In "probe only" or "configure" mode (signaled by instances being NULL),
+     * our work is done.  Return the number of detected devices.
+     */
+    if (instances == NULL) {
+        return numFound;
+    }
+
+    /*
+     * This may be debatable, but if no PCI devices with a matching vendor
+     * type is found, return zero now.  It is probably not desirable to
+     * allow the config file to override this.
+     */
+    if (allocatedInstances <= 0) {
+        free(instances);
+        return 0;
+    }
+
+    DebugF("%s instances found: %d\n", driverName, allocatedInstances);
+
+    /*
+     * Check for devices that need duplicated instances.  This is required
+     * when there is more than one screen per entity.
+     *
+     * XXX This currently doesn't work for cases where the BusID isn't
+     * specified explicitly in the config file.
+     */
+
+    for (j = 0; j < numDevs; j++) {
+        if (devList[j]->screen > 0 && devList[j]->busID && *devList[j]->busID) {
+            for (i = 0; i < allocatedInstances; i++) {
+                pPci = instances[i].pci;
+                if (xf86ComparePciBusString(devList[j]->busID,
+                                            PCI_MAKE_BUS(pPci->domain,
+                                                         pPci->bus), pPci->dev,
+                                            pPci->func)) {
+                    allocatedInstances++;
+                    instances[allocatedInstances - 1] = instances[i];
+                    instances[allocatedInstances - 1].screen =
+                        devList[j]->screen;
+                    numFound++;
+                    break;
+                }
+            }
+        }
+    }
+
+    for (i = 0; i < allocatedInstances; i++) {
+        GDevPtr dev = NULL;
+        GDevPtr devBus = NULL;
+
+        pPci = instances[i].pci;
+        for (j = 0; j < numDevs; j++) {
+            if (devList[j]->busID && *devList[j]->busID) {
+                if (xf86ComparePciBusString(devList[j]->busID,
+                                            PCI_MAKE_BUS(pPci->domain,
+                                                         pPci->bus), pPci->dev,
+                                            pPci->func) &&
+                    devList[j]->screen == instances[i].screen) {
+
+                    if (devBus)
+                        xf86MsgVerb(X_WARNING, 0,
+                                    "%s: More than one matching Device section for "
+                                    "instances\n\t(BusID: %s) found: %s\n",
+                                    driverName, devList[j]->busID,
+                                    devList[j]->identifier);
+                    else
+                        devBus = devList[j];
+                }
+            }
+            else {
+                /*
+                 * if device section without BusID is found
+                 * only assign to it to the primary device.
+                 */
+                if (xf86IsPrimaryPci(pPci)) {
+                    xf86Msg(X_PROBED, "Assigning device section with no busID"
+                            " to primary device\n");
+                    if (dev || devBus)
+                        xf86MsgVerb(X_WARNING, 0,
+                                    "%s: More than one matching Device section "
+                                    "found: %s\n", driverName,
+                                    devList[j]->identifier);
+                    else
+                        dev = devList[j];
+                }
+            }
+        }
+        if (devBus)
+            dev = devBus;       /* busID preferred */
+        if (!dev) {
+            if (xf86CheckPciSlot(pPci) && pciDeviceHasBars(pPci)) {
+                xf86MsgVerb(X_WARNING, 0, "%s: No matching Device section "
+                            "for instance (BusID PCI:%u@%u:%u:%u) found\n",
+                            driverName, pPci->bus, pPci->domain, pPci->dev,
+                            pPci->func);
+            }
+        }
+        else {
+            numClaimedInstances++;
+            instances[i].claimed = TRUE;
+            instances[i].dev = dev;
+        }
+    }
+    DebugF("%s instances found: %d\n", driverName, numClaimedInstances);
+    /*
+     * Now check that a chipset or chipID override in the device section
+     * is valid.  Chipset has precedence over chipID.
+     * If chipset is not valid ignore BusSlot completely.
+     */
+    for (i = 0; i < allocatedInstances && numClaimedInstances > 0; i++) {
+        MessageType from = X_PROBED;
+
+        if (!instances[i].claimed) {
+            continue;
+        }
+        if (instances[i].dev->chipset) {
+            for (c = chipsets; c->token >= 0; c++) {
+                if (xf86NameCmp(c->name, instances[i].dev->chipset) == 0)
+                    break;
+            }
+            if (c->token == -1) {
+                instances[i].claimed = FALSE;
+                numClaimedInstances--;
+                xf86MsgVerb(X_WARNING, 0, "%s: Chipset \"%s\" in Device "
+                            "section \"%s\" isn't valid for this driver\n",
+                            driverName, instances[i].dev->chipset,
+                            instances[i].dev->identifier);
+            }
+            else {
+                instances[i].chip = c->token;
+
+                for (id = PCIchipsets; id->numChipset >= 0; id++) {
+                    if (id->numChipset == instances[i].chip)
+                        break;
+                }
+                if (id->numChipset >= 0) {
+                    xf86Msg(X_CONFIG, "Chipset override: %s\n",
+                            instances[i].dev->chipset);
+                    from = X_CONFIG;
+                }
+                else {
+                    instances[i].claimed = FALSE;
+                    numClaimedInstances--;
+                    xf86MsgVerb(X_WARNING, 0, "%s: Chipset \"%s\" in Device "
+                                "section \"%s\" isn't a valid PCI chipset\n",
+                                driverName, instances[i].dev->chipset,
+                                instances[i].dev->identifier);
+                }
+            }
+        }
+        else if (instances[i].dev->chipID > 0) {
+            for (id = PCIchipsets; id->numChipset >= 0; id++) {
+                if (id->PCIid == instances[i].dev->chipID)
+                    break;
+            }
+            if (id->numChipset == -1) {
+                instances[i].claimed = FALSE;
+                numClaimedInstances--;
+                xf86MsgVerb(X_WARNING, 0, "%s: ChipID 0x%04X in Device "
+                            "section \"%s\" isn't valid for this driver\n",
+                            driverName, instances[i].dev->chipID,
+                            instances[i].dev->identifier);
+            }
+            else {
+                instances[i].chip = id->numChipset;
+
+                xf86Msg(X_CONFIG, "ChipID override: 0x%04X\n",
+                        instances[i].dev->chipID);
+                from = X_CONFIG;
+            }
+        }
+        else if (!instances[i].foundHW) {
+            /*
+             * This means that there was no override and the PCI chipType
+             * doesn't match one that is supported
+             */
+            instances[i].claimed = FALSE;
+            numClaimedInstances--;
+        }
+        if (instances[i].claimed == TRUE) {
+            for (c = chipsets; c->token >= 0; c++) {
+                if (c->token == instances[i].chip)
+                    break;
+            }
+            xf86Msg(from, "Chipset %s found\n", c->name);
+        }
+    }
+
+    /*
+     * Of the claimed instances, check that another driver hasn't already
+     * claimed its slot.
+     */
+    numFound = 0;
+    for (i = 0; i < allocatedInstances && numClaimedInstances > 0; i++) {
+        if (!instances[i].claimed)
+            continue;
+        pPci = instances[i].pci;
+
+        /*
+         * Allow the same entity to be used more than once for devices with
+         * multiple screens per entity.  This assumes implicitly that there
+         * will be a screen == 0 instance.
+         *
+         * XXX Need to make sure that two different drivers don't claim
+         * the same screen > 0 instance.
+         */
+        if (instances[i].screen == 0 && !xf86CheckPciSlot(pPci))
+            continue;
+
+        DebugF("%s: card at %d:%d:%d is claimed by a Device section\n",
+               driverName, pPci->bus, pPci->dev, pPci->func);
+
+        /* Allocate an entry in the lists to be returned */
+        numFound++;
+        retEntities = xnfreallocarray(retEntities, numFound, sizeof(int));
+        retEntities[numFound - 1] = xf86ClaimPciSlot(pPci, drvp,
+                                                     instances[i].chip,
+                                                     instances[i].dev,
+                                                     instances[i].dev->active);
+        if (retEntities[numFound - 1] == -1 && instances[i].screen > 0) {
+            for (j = 0; j < xf86NumEntities; j++) {
+                EntityPtr pEnt = xf86Entities[j];
+
+                if (pEnt->bus.type != BUS_PCI)
+                    continue;
+                if (pEnt->bus.id.pci == pPci) {
+                    retEntities[numFound - 1] = j;
+                    xf86AddDevToEntity(j, instances[i].dev);
+                    break;
+                }
+            }
+        }
+    }
+    free(instances);
+    if (numFound > 0) {
+        *foundEntities = retEntities;
+    }
+
+    return numFound;
+}
+
+/*
+ * xf86ConfigPciEntityInactive() -- This function can be used
+ * to configure an inactive entity as well as to reconfigure an
+ * previously active entity inactive. If the entity has been
+ * assigned to a screen before it will be removed. If p_chip is
+ * non-NULL all static resources listed there will be registered.
+ */
+static void
+xf86ConfigPciEntityInactive(EntityInfoPtr pEnt, PciChipsets * p_chip,
+                            EntityProc init, EntityProc enter,
+                            EntityProc leave, void *private)
+{
+    ScrnInfoPtr pScrn;
+
+    if ((pScrn = xf86FindScreenForEntity(pEnt->index)))
+        xf86RemoveEntityFromScreen(pScrn, pEnt->index);
+}
+
+ScrnInfoPtr
+xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
+                    PciChipsets * p_chip, void *dummy, EntityProc init,
+                    EntityProc enter, EntityProc leave, void *private)
+{
+    EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
+
+    if (dummy || init || enter || leave)
+        FatalError("Legacy entity access functions are unsupported\n");
+
+    if (!pEnt)
+        return pScrn;
+
+    if (!(pEnt->location.type == BUS_PCI)
+        || !xf86GetPciInfoForEntity(entityIndex)) {
+        free(pEnt);
+        return pScrn;
+    }
+    if (!pEnt->active) {
+        xf86ConfigPciEntityInactive(pEnt, p_chip, init, enter, leave, private);
+        free(pEnt);
+        return pScrn;
+    }
+
+    if (!pScrn)
+        pScrn = xf86AllocateScreen(pEnt->driver, scrnFlag);
+    if (xf86IsEntitySharable(entityIndex)) {
+        xf86SetEntityShared(entityIndex);
+    }
+    xf86AddEntityToScreen(pScrn, entityIndex);
+    if (xf86IsEntityShared(entityIndex)) {
+        return pScrn;
+    }
+    free(pEnt);
+
+    return pScrn;
+}
+
+void
+xf86VideoPtrToDriverList(struct pci_device *dev, XF86MatchedDrivers *md)
+{
+    int i;
+
+    /* Add more entries here if we ever return more than 4 drivers for
+       any device */
+    const char *driverList[5] = { NULL, NULL, NULL, NULL, NULL };
+
+    switch (dev->vendor_id) {
+        /* AMD Geode LX */
+    case 0x1022:
+        if (dev->device_id == 0x2081)
+            driverList[0] = "geode";
+        break;
+        /* older Geode products acquired by AMD still carry an NSC vendor_id */
+    case 0x100b:
+        if (dev->device_id == 0x0030) {
+            /* NSC Geode GX2 specifically */
+            driverList[0] = "geode";
+            /* GX2 support started its life in the NSC tree and was later
+               forked by AMD for GEODE so we keep it as a backup */
+            driverList[1] = "nsc";
+        }
+        else
+            /* other NSC variant e.g. 0x0104 (SC1400), 0x0504 (SCx200) */
+            driverList[0] = "nsc";
+        break;
+        /* Cyrix Geode GX1 */
+    case 0x1078:
+        if (dev->device_id == 0x0104)
+            driverList[0] = "cyrix";
+        break;
+    case 0x1142:
+        driverList[0] = "apm";
+        break;
+    case 0xedd8:
+        driverList[0] = "ark";
+        break;
+    case 0x1a03:
+        driverList[0] = "ast";
+        break;
+    case 0x1002:
+        driverList[0] = "ati";
+        break;
+    case 0x102c:
+        driverList[0] = "chips";
+        break;
+    case 0x1013:
+        driverList[0] = "cirrus";
+        break;
+    case 0x3d3d:
+        driverList[0] = "glint";
+        break;
+    case 0x105d:
+        driverList[0] = "i128";
+        break;
+    case 0x8086:
+	switch (dev->device_id)
+	{
+		/* Intel i740 */
+		case 0x00d1:
+		case 0x7800:
+			driverList[0] = "i740";
+			break;
+		/* GMA500/Poulsbo */
+		case 0x8108:
+		case 0x8109:
+			/* Try psb driver on Poulsbo - if available */
+			driverList[0] = "psb";
+			driverList[1] = "psb_drv";
+			break;
+		/* GMA600/Oaktrail */
+		case 0x4100:
+		case 0x4101:
+		case 0x4102:
+		case 0x4103:
+		case 0x4104:
+		case 0x4105:
+		case 0x4106:
+		case 0x4107:
+		/* Atom E620/Oaktrail */
+		case 0x4108:
+		/* Medfield */
+		case 0x0130:
+		case 0x0131:
+		case 0x0132:
+		case 0x0133:
+		case 0x0134:
+		case 0x0135:
+		case 0x0136:
+		case 0x0137:
+		/* GMA 3600/CDV */
+		case 0x0be0:
+		case 0x0be1:
+		case 0x0be2:
+		case 0x0be3:
+		case 0x0be4:
+		case 0x0be5:
+		case 0x0be6:
+		case 0x0be7:
+		case 0x0be8:
+		case 0x0be9:
+		case 0x0bea:
+		case 0x0beb:
+		case 0x0bec:
+		case 0x0bed:
+		case 0x0bee:
+		case 0x0bef:
+			/* Use fbdev/vesa driver on Oaktrail, Medfield, CDV */
+			break;
+		default:
+			driverList[0] = "intel";
+			break;
+        }
+        break;
+    case 0x102b:
+        driverList[0] = "mga";
+        break;
+    case 0x10c8:
+        driverList[0] = "neomagic";
+        break;
+    case 0x10de:
+    case 0x12d2:
+    {
+        int idx = 0;
+
+#if defined(__linux__) || defined(__NetBSD__)
+        char busid[32];
+        int fd;
+
+        snprintf(busid, sizeof(busid), "pci:%04x:%02x:%02x.%d",
+                 dev->domain, dev->bus, dev->dev, dev->func);
+
+       /* 'modesetting' is preferred for GeForce 8 and newer GPUs */
+        fd = drmOpenWithType("nouveau", busid, DRM_NODE_RENDER);
+        if (fd >= 0) {
+            uint64_t args[] = { 11 /* NOUVEAU_GETPARAM_CHIPSET_ID */, 0 };
+            int ret = drmCommandWriteRead(fd, 0 /* DRM_NOUVEAU_GETPARAM */,
+                                          &args, sizeof(args));
+            drmClose(fd);
+            if (ret == 0) {
+                if (args[1] == 0x050 || args[1] >= 0x80)
+                    break;
+            }
+        }
+
+        driverList[idx++] = "nouveau";
+#endif
+        driverList[idx++] = "nv";
+        break;
+    }
+    case 0x1106:
+        driverList[0] = "openchrome";
+        break;
+    case 0x1b36:
+        driverList[0] = "qxl";
+        break;
+    case 0x1163:
+        driverList[0] = "rendition";
+        break;
+    case 0x5333:
+        switch (dev->device_id) {
+        case 0x88d0:
+        case 0x88d1:
+        case 0x88f0:
+        case 0x8811:
+        case 0x8812:
+        case 0x8814:
+        case 0x8901:
+            driverList[0] = "s3";
+            break;
+        case 0x5631:
+        case 0x883d:
+        case 0x8a01:
+        case 0x8a10:
+        case 0x8c01:
+        case 0x8c03:
+        case 0x8904:
+        case 0x8a13:
+            driverList[0] = "s3virge";
+            break;
+        default:
+            driverList[0] = "savage";
+            break;
+        }
+        break;
+    case 0x1039:
+        driverList[0] = "sis";
+        break;
+    case 0x126f:
+        driverList[0] = "siliconmotion";
+        break;
+    case 0x121a:
+        if (dev->device_id < 0x0003)
+            driverList[0] = "voodoo";
+        else
+            driverList[0] = "tdfx";
+        break;
+    case 0x1011:
+        driverList[0] = "tga";
+        break;
+    case 0x1023:
+        driverList[0] = "trident";
+        break;
+    case 0x100c:
+        driverList[0] = "tseng";
+        break;
+    case 0x80ee:
+        driverList[0] = "vboxvideo";
+        break;
+    case 0x15ad:
+        driverList[0] = "vmware";
+        break;
+    case 0x18ca:
+        if (dev->device_id == 0x47)
+            driverList[0] = "xgixp";
+        else
+            driverList[0] = "xgi";
+        break;
+    default:
+        break;
+    }
+    for (i = 0; driverList[i] != NULL; i++) {
+        xf86AddMatchedDriver(md, driverList[i]);
+    }
+}
+
+#ifdef __linux__
+static int
+xchomp(char *line)
+{
+    size_t len = 0;
+
+    if (!line) {
+        return 1;
+    }
+
+    len = strlen(line);
+    if (line[len - 1] == '\n' && len > 0) {
+        line[len - 1] = '\0';
+    }
+    return 0;
+}
+
+/* This function is used to provide a workaround for binary drivers that
+ * don't export their PCI ID's properly. If distros don't end up using this
+ * feature it can and should be removed because the symbol-based resolution
+ * scheme should be the primary one */
+void
+xf86MatchDriverFromFiles(uint16_t match_vendor, uint16_t match_chip,
+                         XF86MatchedDrivers *md)
+{
+    DIR *idsdir;
+    FILE *fp;
+    struct dirent *direntry;
+    char *line = NULL, *tmpMatch;
+    size_t len;
+    ssize_t read;
+    char path_name[512], vendor_str[5], chip_str[5];
+    uint16_t vendor, chip;
+    int j;
+
+    idsdir = opendir(PCI_TXT_IDS_PATH);
+    if (!idsdir)
+        return;
+
+    xf86Msg(X_INFO,
+            "Scanning %s directory for additional PCI ID's supported by the drivers\n",
+            PCI_TXT_IDS_PATH);
+    direntry = readdir(idsdir);
+    /* Read the directory */
+    while (direntry) {
+        if (direntry->d_name[0] == '.') {
+            direntry = readdir(idsdir);
+            continue;
+        }
+        len = strlen(direntry->d_name);
+        /* A tiny bit of sanity checking. We should probably do better */
+        if (strncmp(&(direntry->d_name[len - 4]), ".ids", 4) == 0) {
+            /* We need the full path name to open the file */
+            snprintf(path_name, sizeof(path_name), "%s/%s",
+                     PCI_TXT_IDS_PATH, direntry->d_name);
+            fp = fopen(path_name, "r");
+            if (fp == NULL) {
+                xf86Msg(X_ERROR, "Could not open %s for reading. Exiting.\n",
+                        path_name);
+                goto end;
+            }
+            /* Read the file */
+#ifdef __GLIBC__
+            while ((read = getline(&line, &len, fp)) != -1) {
+#else
+            while ((line = fgetln(fp, &len)) != (char *) NULL) {
+#endif                          /* __GLIBC __ */
+                xchomp(line);
+                if (isdigit(line[0])) {
+                    strlcpy(vendor_str, line, sizeof(vendor_str));
+                    vendor = (int) strtol(vendor_str, NULL, 16);
+                    if ((strlen(&line[4])) == 0) {
+                        chip_str[0] = '\0';
+                        chip = -1;
+                    }
+                    else {
+                        /* Handle trailing whitespace */
+                        if (isspace(line[4])) {
+                            chip_str[0] = '\0';
+                            chip = -1;
+                        }
+                        else {
+                            /* Ok, it's a real ID */
+                            strlcpy(chip_str, &line[4], sizeof(chip_str));
+                            chip = (int) strtol(chip_str, NULL, 16);
+                        }
+                    }
+                    if (vendor == match_vendor && chip == match_chip) {
+                        tmpMatch =
+                            (char *) malloc(sizeof(char) *
+                                            strlen(direntry->d_name) - 3);
+                        if (!tmpMatch) {
+                            xf86Msg(X_ERROR,
+                                    "Could not allocate space for the module name. Exiting.\n");
+                            goto end;
+                        }
+                        /* hack off the .ids suffix. This should guard
+                         * against other problems, but it will end up
+                         * taking off anything after the first '.' */
+                        for (j = 0; j < (strlen(direntry->d_name) - 3); j++) {
+                            if (direntry->d_name[j] == '.') {
+                                tmpMatch[j] = '\0';
+                                break;
+                            }
+                            else {
+                                tmpMatch[j] = direntry->d_name[j];
+                            }
+                        }
+                        xf86AddMatchedDriver(md, tmpMatch);
+                        xf86Msg(X_INFO, "Matched %s from file name %s\n",
+                                tmpMatch, direntry->d_name);
+                        free(tmpMatch);
+                    }
+                }
+                else {
+                    /* TODO Handle driver overrides here */
+                }
+            }
+            fclose(fp);
+        }
+        direntry = readdir(idsdir);
+    }
+ end:
+    free(line);
+    closedir(idsdir);
+}
+#endif                          /* __linux__ */
+
+void
+xf86PciMatchDriver(XF86MatchedDrivers *md)
+{
+    struct pci_device *info = NULL;
+    struct pci_device_iterator *iter;
+
+    /* Find the primary device, and get some information about it. */
+    iter = pci_slot_match_iterator_create(NULL);
+    while ((info = pci_device_next(iter)) != NULL) {
+        if (xf86IsPrimaryPci(info)) {
+            break;
+        }
+    }
+
+    pci_iterator_destroy(iter);
+#ifdef __linux__
+    if (info)
+        xf86MatchDriverFromFiles(info->vendor_id, info->device_id, md);
+#endif
+
+    if (info != NULL) {
+        xf86VideoPtrToDriverList(info, md);
+    }
+}
+
+Bool
+xf86PciConfigure(void *busData, struct pci_device *pDev)
+{
+    struct pci_device *pVideo = NULL;
+
+    pVideo = (struct pci_device *) busData;
+    if (pDev &&
+        (pDev->domain == pVideo->domain) &&
+        (pDev->bus == pVideo->bus) &&
+        (pDev->dev == pVideo->dev) && (pDev->func == pVideo->func))
+        return 0;
+
+    return 1;
+}
+
+void
+xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo,
+                       GDevRec * GDev, int *chipset)
+{
+    char busnum[8];
+    char *tmp;
+
+    pVideo = (struct pci_device *) busData;
+
+    snprintf(busnum, sizeof(busnum), "%d", pVideo->bus);
+
+    XNFasprintf(&tmp, "PCI:%s:%d:%d",
+                busnum, pVideo->dev, pVideo->func);
+    GDev->busID = tmp;
+
+    GDev->chipID = pVideo->device_id;
+    GDev->chipRev = pVideo->revision;
+
+    if (*chipset < 0)
+        *chipset = (pVideo->vendor_id << 16) | pVideo->device_id;
+}
+
+char *
+DRICreatePCIBusID(const struct pci_device *dev)
+{
+    char *busID;
+
+    if (asprintf(&busID, "pci:%04x:%02x:%02x.%d",
+                 dev->domain, dev->bus, dev->dev, dev->func) == -1)
+        return NULL;
+
+    return busID;
+}
Index: xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/xorg-server-21.1.7-new/hw/xfree86/common
===================================================================
--- xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/xorg-server-21.1.7-new/hw/xfree86/common	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/xorg-server-21.1.7-new/hw/xfree86/common	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/xorg-server-21.1.7-new/hw/xfree86/common
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/xorg-server-21.1.7-new/hw/xfree86
===================================================================
--- xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/xorg-server-21.1.7-new/hw/xfree86	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/xorg-server-21.1.7-new/hw/xfree86	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/xorg-server-21.1.7-new/hw/xfree86
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/xorg-server-21.1.7-new/hw
===================================================================
--- xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/xorg-server-21.1.7-new/hw	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/xorg-server-21.1.7-new/hw	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/xorg-server-21.1.7-new/hw
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/xorg-server-21.1.7-new
===================================================================
--- xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/xorg-server-21.1.7-new	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/xorg-server-21.1.7-new	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch/xorg-server-21.1.7-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch
===================================================================
--- xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-modesetting-on-GeForce-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/create.patch.sh
===================================================================
--- xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/create.patch.sh	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=21.1.7
+
+tar --files-from=file.list -xJvf ../xorg-server-$VERSION.tar.xz
+mv xorg-server-$VERSION xorg-server-$VERSION-orig
+
+cp -rf ./xorg-server-$VERSION-new ./xorg-server-$VERSION
+
+diff --unified -Nr  xorg-server-$VERSION-orig  xorg-server-$VERSION > xorg-server-$VERSION-mouse-kbd-layout.patch
+
+mv xorg-server-$VERSION-mouse-kbd-layout.patch ../patches
+
+rm -rf ./xorg-server-$VERSION
+rm -rf ./xorg-server-$VERSION-orig

Property changes on: xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/file.list
===================================================================
--- xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/file.list	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/file.list	(revision 5)
@@ -0,0 +1,3 @@
+xorg-server-21.1.7/Xi/exevents.c
+xorg-server-21.1.7/dix/getevents.c
+xorg-server-21.1.7/include/inputstr.h
Index: xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new/Xi/exevents.c
===================================================================
--- xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new/Xi/exevents.c	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new/Xi/exevents.c	(revision 5)
@@ -0,0 +1,3351 @@
+/************************************************************
+
+Copyright 1989, 1998  The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+			All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+
+/*
+ * Copyright © 2010 Collabora Ltd.
+ * Copyright © 2011 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Daniel Stone <daniel@fooishbar.org>
+ */
+
+/********************************************************************
+ *
+ *  Routines to register and initialize extension input devices.
+ *  This also contains ProcessOtherEvent, the routine called from DDX
+ *  to route extension events.
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "inputstr.h"
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include <X11/extensions/XI2proto.h>
+#include <X11/extensions/geproto.h>
+#include "windowstr.h"
+#include "miscstruct.h"
+#include "region.h"
+#include "exevents.h"
+#include "extnsionst.h"
+#include "exglobals.h"
+#include "eventstr.h"
+#include "dixevents.h"          /* DeliverFocusedEvent */
+#include "dixgrabs.h"           /* CreateGrab() */
+#include "scrnintstr.h"
+#include "listdev.h"            /* for CopySwapXXXClass */
+#include "xace.h"
+#include "xiquerydevice.h"      /* For List*Info */
+#include "eventconvert.h"
+#include "eventstr.h"
+#include "inpututils.h"
+#include "mi.h"
+
+#include <X11/extensions/XKBproto.h>
+#include "xkbsrv.h"
+
+#define WID(w) ((w) ? ((w)->drawable.id) : 0)
+#define AllModifiersMask ( \
+	ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \
+	Mod3Mask | Mod4Mask | Mod5Mask )
+#define AllButtonsMask ( \
+	Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask )
+
+Bool ShouldFreeInputMasks(WindowPtr /* pWin */ ,
+                          Bool  /* ignoreSelectedEvents */
+    );
+static Bool MakeInputMasks(WindowPtr    /* pWin */
+    );
+
+/*
+ * Only let the given client know of core events which will affect its
+ * interpretation of input events, if the client's ClientPointer (or the
+ * paired keyboard) is the current device.
+ */
+int
+XIShouldNotify(ClientPtr client, DeviceIntPtr dev)
+{
+    DeviceIntPtr current_ptr = PickPointer(client);
+    DeviceIntPtr current_kbd = GetMaster(current_ptr, KEYBOARD_OR_FLOAT);
+
+    if (dev == current_kbd || dev == current_ptr)
+        return 1;
+
+    return 0;
+}
+
+Bool
+IsPointerEvent(InternalEvent *event)
+{
+    switch (event->any.type) {
+    case ET_ButtonPress:
+    case ET_ButtonRelease:
+    case ET_Motion:
+        /* XXX: enter/leave ?? */
+        return TRUE;
+    default:
+        break;
+    }
+    return FALSE;
+}
+
+Bool
+IsTouchEvent(InternalEvent *event)
+{
+    switch (event->any.type) {
+    case ET_TouchBegin:
+    case ET_TouchUpdate:
+    case ET_TouchEnd:
+        return TRUE;
+    default:
+        break;
+    }
+    return FALSE;
+}
+
+Bool
+IsGestureEvent(InternalEvent *event)
+{
+    switch (event->any.type) {
+    case ET_GesturePinchBegin:
+    case ET_GesturePinchUpdate:
+    case ET_GesturePinchEnd:
+    case ET_GestureSwipeBegin:
+    case ET_GestureSwipeUpdate:
+    case ET_GestureSwipeEnd:
+        return TRUE;
+    default:
+        break;
+    }
+    return FALSE;
+}
+
+Bool
+IsGestureBeginEvent(InternalEvent *event)
+{
+    switch (event->any.type) {
+    case ET_GesturePinchBegin:
+    case ET_GestureSwipeBegin:
+        return TRUE;
+    default:
+        break;
+    }
+    return FALSE;
+}
+
+Bool
+IsGestureEndEvent(InternalEvent *event)
+{
+    switch (event->any.type) {
+    case ET_GesturePinchEnd:
+    case ET_GestureSwipeEnd:
+        return TRUE;
+    default:
+        break;
+    }
+    return FALSE;
+}
+
+/**
+ * @return the device matching the deviceid of the device set in the event, or
+ * NULL if the event is not an XInput event.
+ */
+DeviceIntPtr
+XIGetDevice(xEvent *xE)
+{
+    DeviceIntPtr pDev = NULL;
+
+    if (xE->u.u.type == DeviceButtonPress ||
+        xE->u.u.type == DeviceButtonRelease ||
+        xE->u.u.type == DeviceMotionNotify ||
+        xE->u.u.type == ProximityIn ||
+        xE->u.u.type == ProximityOut || xE->u.u.type == DevicePropertyNotify) {
+        int rc;
+        int id;
+
+        id = ((deviceKeyButtonPointer *) xE)->deviceid & ~MORE_EVENTS;
+
+        rc = dixLookupDevice(&pDev, id, serverClient, DixUnknownAccess);
+        if (rc != Success)
+            ErrorF("[dix] XIGetDevice failed on XACE restrictions (%d)\n", rc);
+    }
+    return pDev;
+}
+
+/**
+ * Copy the device->key into master->key and send a mapping notify to the
+ * clients if appropriate.
+ * master->key needs to be allocated by the caller.
+ *
+ * Device is the slave device. If it is attached to a master device, we may
+ * need to send a mapping notify to the client because it causes the MD
+ * to change state.
+ *
+ * Mapping notify needs to be sent in the following cases:
+ *      - different slave device on same master
+ *      - different master
+ *
+ * XXX: They way how the code is we also send a map notify if the slave device
+ * stays the same, but the master changes. This isn't really necessary though.
+ *
+ * XXX: this gives you funny behaviour with the ClientPointer. When a
+ * MappingNotify is sent to the client, the client usually responds with a
+ * GetKeyboardMapping. This will retrieve the ClientPointer's keyboard
+ * mapping, regardless of which keyboard sent the last mapping notify request.
+ * So depending on the CP setting, your keyboard may change layout in each
+ * app...
+ *
+ * This code is basically the old SwitchCoreKeyboard.
+ */
+
+void
+CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master)
+{
+    KeyClassPtr mk = master->key;
+
+    if (device == master)
+        return;
+
+    mk->sourceid = device->id;
+
+    if (!XkbDeviceApplyKeymap(master, device->key->xkbInfo->desc))
+        FatalError("Couldn't pivot keymap from device to core!\n");
+}
+
+/**
+ * Copies the feedback classes from device "from" into device "to". Classes
+ * are duplicated (not just flipping the pointers). All feedback classes are
+ * linked lists, the full list is duplicated.
+ */
+static void
+DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to)
+{
+    ClassesPtr classes;
+
+    if (from->intfeed) {
+        IntegerFeedbackPtr *i, it;
+
+        if (!to->intfeed) {
+            classes = to->unused_classes;
+            to->intfeed = classes->intfeed;
+            classes->intfeed = NULL;
+        }
+
+        i = &to->intfeed;
+        for (it = from->intfeed; it; it = it->next) {
+            if (!(*i)) {
+                *i = calloc(1, sizeof(IntegerFeedbackClassRec));
+                if (!(*i)) {
+                    ErrorF("[Xi] Cannot alloc memory for class copy.");
+                    return;
+                }
+            }
+            (*i)->CtrlProc = it->CtrlProc;
+            (*i)->ctrl = it->ctrl;
+
+            i = &(*i)->next;
+        }
+    }
+    else if (to->intfeed && !from->intfeed) {
+        classes = to->unused_classes;
+        classes->intfeed = to->intfeed;
+        to->intfeed = NULL;
+    }
+
+    if (from->stringfeed) {
+        StringFeedbackPtr *s, it;
+
+        if (!to->stringfeed) {
+            classes = to->unused_classes;
+            to->stringfeed = classes->stringfeed;
+            classes->stringfeed = NULL;
+        }
+
+        s = &to->stringfeed;
+        for (it = from->stringfeed; it; it = it->next) {
+            if (!(*s)) {
+                *s = calloc(1, sizeof(StringFeedbackClassRec));
+                if (!(*s)) {
+                    ErrorF("[Xi] Cannot alloc memory for class copy.");
+                    return;
+                }
+            }
+            (*s)->CtrlProc = it->CtrlProc;
+            (*s)->ctrl = it->ctrl;
+
+            s = &(*s)->next;
+        }
+    }
+    else if (to->stringfeed && !from->stringfeed) {
+        classes = to->unused_classes;
+        classes->stringfeed = to->stringfeed;
+        to->stringfeed = NULL;
+    }
+
+    if (from->bell) {
+        BellFeedbackPtr *b, it;
+
+        if (!to->bell) {
+            classes = to->unused_classes;
+            to->bell = classes->bell;
+            classes->bell = NULL;
+        }
+
+        b = &to->bell;
+        for (it = from->bell; it; it = it->next) {
+            if (!(*b)) {
+                *b = calloc(1, sizeof(BellFeedbackClassRec));
+                if (!(*b)) {
+                    ErrorF("[Xi] Cannot alloc memory for class copy.");
+                    return;
+                }
+            }
+            (*b)->BellProc = it->BellProc;
+            (*b)->CtrlProc = it->CtrlProc;
+            (*b)->ctrl = it->ctrl;
+
+            b = &(*b)->next;
+        }
+    }
+    else if (to->bell && !from->bell) {
+        classes = to->unused_classes;
+        classes->bell = to->bell;
+        to->bell = NULL;
+    }
+
+    if (from->leds) {
+        LedFeedbackPtr *l, it;
+
+        if (!to->leds) {
+            classes = to->unused_classes;
+            to->leds = classes->leds;
+            classes->leds = NULL;
+        }
+
+        l = &to->leds;
+        for (it = from->leds; it; it = it->next) {
+            if (!(*l)) {
+                *l = calloc(1, sizeof(LedFeedbackClassRec));
+                if (!(*l)) {
+                    ErrorF("[Xi] Cannot alloc memory for class copy.");
+                    return;
+                }
+            }
+            (*l)->CtrlProc = it->CtrlProc;
+            (*l)->ctrl = it->ctrl;
+            if ((*l)->xkb_sli)
+                XkbFreeSrvLedInfo((*l)->xkb_sli);
+            (*l)->xkb_sli = XkbCopySrvLedInfo(from, it->xkb_sli, NULL, *l);
+
+            l = &(*l)->next;
+        }
+    }
+    else if (to->leds && !from->leds) {
+        classes = to->unused_classes;
+        classes->leds = to->leds;
+        to->leds = NULL;
+    }
+}
+
+static void
+DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to)
+{
+    ClassesPtr classes;
+
+    /* XkbInitDevice (->XkbInitIndicatorMap->XkbFindSrvLedInfo) relies on the
+     * kbdfeed to be set up properly, so let's do the feedback classes first.
+     */
+    if (from->kbdfeed) {
+        KbdFeedbackPtr *k, it;
+
+        if (!to->kbdfeed) {
+            classes = to->unused_classes;
+
+            to->kbdfeed = classes->kbdfeed;
+            if (!to->kbdfeed)
+                InitKeyboardDeviceStruct(to, NULL, NULL, NULL);
+            classes->kbdfeed = NULL;
+        }
+
+        k = &to->kbdfeed;
+        for (it = from->kbdfeed; it; it = it->next) {
+            if (!(*k)) {
+                *k = calloc(1, sizeof(KbdFeedbackClassRec));
+                if (!*k) {
+                    ErrorF("[Xi] Cannot alloc memory for class copy.");
+                    return;
+                }
+            }
+            (*k)->BellProc = it->BellProc;
+            (*k)->CtrlProc = it->CtrlProc;
+            (*k)->ctrl = it->ctrl;
+            if ((*k)->xkb_sli)
+                XkbFreeSrvLedInfo((*k)->xkb_sli);
+            (*k)->xkb_sli = XkbCopySrvLedInfo(from, it->xkb_sli, *k, NULL);
+
+            k = &(*k)->next;
+        }
+    }
+    else if (to->kbdfeed && !from->kbdfeed) {
+        classes = to->unused_classes;
+        classes->kbdfeed = to->kbdfeed;
+        to->kbdfeed = NULL;
+    }
+
+    if (from->key) {
+        if (!to->key) {
+            classes = to->unused_classes;
+            to->key = classes->key;
+            if (!to->key)
+                InitKeyboardDeviceStruct(to, NULL, NULL, NULL);
+            else
+                classes->key = NULL;
+        }
+
+        CopyKeyClass(from, to);
+    }
+    else if (to->key && !from->key) {
+        classes = to->unused_classes;
+        classes->key = to->key;
+        to->key = NULL;
+    }
+
+    /* If a SrvLedInfoPtr's flags are XkbSLI_IsDefault, the names and maps
+     * pointer point into the xkbInfo->desc struct.  XkbCopySrvLedInfo
+     * didn't update the pointers so we need to do it manually here.
+     */
+    if (to->kbdfeed) {
+        KbdFeedbackPtr k;
+
+        for (k = to->kbdfeed; k; k = k->next) {
+            if (!k->xkb_sli)
+                continue;
+            if (k->xkb_sli->flags & XkbSLI_IsDefault) {
+                k->xkb_sli->names = to->key->xkbInfo->desc->names->indicators;
+                k->xkb_sli->maps = to->key->xkbInfo->desc->indicators->maps;
+            }
+        }
+    }
+
+    /* We can't just copy over the focus class. When an app sets the focus,
+     * it'll do so on the master device. Copying the SDs focus means losing
+     * the focus.
+     * So we only copy the focus class if the device didn't have one,
+     * otherwise we leave it as it is.
+     */
+    if (from->focus) {
+        if (!to->focus) {
+            WindowPtr *oldTrace;
+
+            classes = to->unused_classes;
+            to->focus = classes->focus;
+            if (!to->focus) {
+                to->focus = calloc(1, sizeof(FocusClassRec));
+                if (!to->focus)
+                    FatalError("[Xi] no memory for class shift.\n");
+            }
+            else
+                classes->focus = NULL;
+
+            oldTrace = to->focus->trace;
+            memcpy(to->focus, from->focus, sizeof(FocusClassRec));
+            to->focus->trace = reallocarray(oldTrace,
+                                            to->focus->traceSize,
+                                            sizeof(WindowPtr));
+            if (!to->focus->trace && to->focus->traceSize)
+                FatalError("[Xi] no memory for trace.\n");
+            memcpy(to->focus->trace, from->focus->trace,
+                   from->focus->traceSize * sizeof(WindowPtr));
+            to->focus->sourceid = from->id;
+        }
+    }
+    else if (to->focus) {
+        classes = to->unused_classes;
+        classes->focus = to->focus;
+        to->focus = NULL;
+    }
+
+}
+
+/* FIXME: this should really be shared with the InitValuatorAxisClassRec and
+ * similar */
+static void
+DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
+{
+    ClassesPtr classes;
+
+    /* Feedback classes must be copied first */
+    if (from->ptrfeed) {
+        PtrFeedbackPtr *p, it;
+
+        if (!to->ptrfeed) {
+            classes = to->unused_classes;
+            to->ptrfeed = classes->ptrfeed;
+            classes->ptrfeed = NULL;
+        }
+
+        p = &to->ptrfeed;
+        for (it = from->ptrfeed; it; it = it->next) {
+            if (!(*p)) {
+                *p = calloc(1, sizeof(PtrFeedbackClassRec));
+                if (!*p) {
+                    ErrorF("[Xi] Cannot alloc memory for class copy.");
+                    return;
+                }
+            }
+            (*p)->CtrlProc = it->CtrlProc;
+            (*p)->ctrl = it->ctrl;
+
+            p = &(*p)->next;
+        }
+    }
+    else if (to->ptrfeed && !from->ptrfeed) {
+        classes = to->unused_classes;
+        classes->ptrfeed = to->ptrfeed;
+        to->ptrfeed = NULL;
+    }
+
+    if (from->valuator) {
+        ValuatorClassPtr v;
+
+        if (!to->valuator) {
+            classes = to->unused_classes;
+            to->valuator = classes->valuator;
+            if (to->valuator)
+                classes->valuator = NULL;
+        }
+
+        v = AllocValuatorClass(to->valuator, from->valuator->numAxes);
+
+        if (!v)
+            FatalError("[Xi] no memory for class shift.\n");
+
+        to->valuator = v;
+        memcpy(v->axes, from->valuator->axes, v->numAxes * sizeof(AxisInfo));
+
+        v->sourceid = from->id;
+    }
+    else if (to->valuator && !from->valuator) {
+        classes = to->unused_classes;
+        classes->valuator = to->valuator;
+        to->valuator = NULL;
+    }
+
+    if (from->button) {
+        if (!to->button) {
+            classes = to->unused_classes;
+            to->button = classes->button;
+            if (!to->button) {
+                to->button = calloc(1, sizeof(ButtonClassRec));
+                if (!to->button)
+                    FatalError("[Xi] no memory for class shift.\n");
+            }
+            else
+                classes->button = NULL;
+        }
+
+        if (from->button->xkb_acts) {
+            if (!to->button->xkb_acts) {
+                to->button->xkb_acts = calloc(1, sizeof(XkbAction));
+                if (!to->button->xkb_acts)
+                    FatalError("[Xi] not enough memory for xkb_acts.\n");
+            }
+            memcpy(to->button->xkb_acts, from->button->xkb_acts,
+                   sizeof(XkbAction));
+        }
+        else {
+            free(to->button->xkb_acts);
+            to->button->xkb_acts = NULL;
+        }
+
+        memcpy(to->button->labels, from->button->labels,
+               from->button->numButtons * sizeof(Atom));
+        to->button->sourceid = from->id;
+    }
+    else if (to->button && !from->button) {
+        classes = to->unused_classes;
+        classes->button = to->button;
+        to->button = NULL;
+    }
+
+    if (from->proximity) {
+        if (!to->proximity) {
+            classes = to->unused_classes;
+            to->proximity = classes->proximity;
+            if (!to->proximity) {
+                to->proximity = calloc(1, sizeof(ProximityClassRec));
+                if (!to->proximity)
+                    FatalError("[Xi] no memory for class shift.\n");
+            }
+            else
+                classes->proximity = NULL;
+        }
+        memcpy(to->proximity, from->proximity, sizeof(ProximityClassRec));
+        to->proximity->sourceid = from->id;
+    }
+    else if (to->proximity) {
+        classes = to->unused_classes;
+        classes->proximity = to->proximity;
+        to->proximity = NULL;
+    }
+
+    if (from->touch) {
+        TouchClassPtr t, f;
+
+        if (!to->touch) {
+            classes = to->unused_classes;
+            to->touch = classes->touch;
+            if (!to->touch) {
+                int i;
+
+                to->touch = calloc(1, sizeof(TouchClassRec));
+                if (!to->touch)
+                    FatalError("[Xi] no memory for class shift.\n");
+                to->touch->num_touches = from->touch->num_touches;
+                to->touch->touches = calloc(to->touch->num_touches,
+                                            sizeof(TouchPointInfoRec));
+                for (i = 0; i < to->touch->num_touches; i++)
+                    TouchInitTouchPoint(to->touch, to->valuator, i);
+                if (!to->touch)
+                    FatalError("[Xi] no memory for class shift.\n");
+            }
+            else
+                classes->touch = NULL;
+        }
+
+        t = to->touch;
+        f = from->touch;
+        t->sourceid = f->sourceid;
+        t->max_touches = f->max_touches;
+        t->mode = f->mode;
+        t->buttonsDown = f->buttonsDown;
+        t->state = f->state;
+        t->motionMask = f->motionMask;
+        /* to->touches and to->num_touches are separate on the master,
+         * don't copy */
+    }
+    /* Don't remove touch class if from->touch is non-existent. The to device
+     * may have an active touch grab, so we need to keep the touch class record
+     * around. */
+
+    if (from->gesture) {
+        if (!to->gesture) {
+            classes = to->unused_classes;
+            to->gesture = classes->gesture;
+            if (!to->gesture) {
+                if (!InitGestureClassDeviceStruct(to, from->gesture->max_touches))
+                    FatalError("[Xi] no memory for class shift.\n");
+            }
+            else
+                classes->gesture = NULL;
+        }
+
+        to->gesture->sourceid = from->gesture->sourceid;
+        /* to->gesture->gesture is separate on the master,  don't copy */
+    }
+    /* Don't remove gesture class if from->gesture is non-existent. The to device
+     * may have an active gesture grab, so we need to keep the gesture class record
+     * around. */
+}
+
+/**
+ * Copies the CONTENT of the classes of device from into the classes in device
+ * to. From and to are identical after finishing.
+ *
+ * If to does not have classes from currently has, the classes are stored in
+ * to's devPrivates system. Later, we recover it again from there if needed.
+ * Saves a few memory allocations.
+ */
+void
+DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to,
+                      DeviceChangedEvent *dce)
+{
+    input_lock();
+
+    /* generic feedback classes, not tied to pointer and/or keyboard */
+    DeepCopyFeedbackClasses(from, to);
+
+    if ((dce->flags & DEVCHANGE_KEYBOARD_EVENT))
+        /* We need to copy to MASTER_KEYBOARD. Didn't worked with 'to'. */
+        DeepCopyKeyboardClasses(from, GetMaster(from, MASTER_KEYBOARD));
+    if ((dce->flags & DEVCHANGE_POINTER_EVENT))
+        DeepCopyPointerClasses(from, to);
+
+    input_unlock();
+}
+
+/**
+ * Send an XI2 DeviceChangedEvent to all interested clients.
+ */
+void
+XISendDeviceChangedEvent(DeviceIntPtr device, DeviceChangedEvent *dce)
+{
+    xXIDeviceChangedEvent *dcce;
+    int rc;
+
+    rc = EventToXI2((InternalEvent *) dce, (xEvent **) &dcce);
+    if (rc != Success) {
+        ErrorF("[Xi] event conversion from DCE failed with code %d\n", rc);
+        return;
+    }
+
+    /* we don't actually swap if there's a NullClient, swapping is done
+     * later when event is delivered. */
+    SendEventToAllWindows(device, XI_DeviceChangedMask, (xEvent *) dcce, 1);
+    free(dcce);
+}
+
+static void
+ChangeMasterDeviceClasses(DeviceIntPtr device, DeviceChangedEvent *dce)
+{
+    DeviceIntPtr slave;
+    int rc;
+
+    /* For now, we don't have devices that change physically. */
+    if (!IsMaster(device))
+        return;
+
+    rc = dixLookupDevice(&slave, dce->sourceid, serverClient, DixReadAccess);
+
+    if (rc != Success)
+        return;                 /* Device has disappeared */
+
+    if (IsMaster(slave))
+        return;
+
+    if (IsFloating(slave))
+        return;                 /* set floating since the event */
+
+    if (GetMaster(slave, MASTER_ATTACHED)->id != dce->masterid)
+        return;                 /* not our slave anymore, don't care */
+
+    /* FIXME: we probably need to send a DCE for the new slave now */
+
+    device->public.devicePrivate = slave->public.devicePrivate;
+
+    /* FIXME: the classes may have changed since we generated the event. */
+    DeepCopyDeviceClasses(slave, device, dce);
+    dce->deviceid = device->id;
+    XISendDeviceChangedEvent(device, dce);
+}
+
+/**
+ * Add state and motionMask to the filter for this event. The protocol
+ * supports some extra masks for motion when a button is down:
+ * ButtonXMotionMask and the DeviceButtonMotionMask to trigger only when at
+ * least one button (or that specific button is down). These masks need to
+ * be added to the filters for core/XI motion events.
+ *
+ * @param device The device to update the mask for
+ * @param state The current button state mask
+ * @param motion_mask The motion mask (DeviceButtonMotionMask or 0)
+ */
+static void
+UpdateDeviceMotionMask(DeviceIntPtr device, unsigned short state,
+                       Mask motion_mask)
+{
+    Mask mask;
+
+    mask = PointerMotionMask | state | motion_mask;
+    SetMaskForEvent(device->id, mask, DeviceMotionNotify);
+    SetMaskForEvent(device->id, mask, MotionNotify);
+}
+
+static void
+IncreaseButtonCount(DeviceIntPtr dev, int key, CARD8 *buttons_down,
+                    Mask *motion_mask, unsigned short *state)
+{
+    if (dev->valuator)
+        dev->valuator->motionHintWindow = NullWindow;
+
+    (*buttons_down)++;
+    *motion_mask = DeviceButtonMotionMask;
+    if (dev->button->map[key] <= 5)
+        *state |= (Button1Mask >> 1) << dev->button->map[key];
+}
+
+static void
+DecreaseButtonCount(DeviceIntPtr dev, int key, CARD8 *buttons_down,
+                    Mask *motion_mask, unsigned short *state)
+{
+    if (dev->valuator)
+        dev->valuator->motionHintWindow = NullWindow;
+
+    if (*buttons_down >= 1 && !--(*buttons_down))
+        *motion_mask = 0;
+    if (dev->button->map[key] <= 5)
+        *state &= ~((Button1Mask >> 1) << dev->button->map[key]);
+}
+
+/**
+ * Update the device state according to the data in the event.
+ *
+ * return values are
+ *   DEFAULT ... process as normal
+ *   DONT_PROCESS ... return immediately from caller
+ */
+#define DEFAULT 0
+#define DONT_PROCESS 1
+int
+UpdateDeviceState(DeviceIntPtr device, DeviceEvent *event)
+{
+    int i;
+    int key = 0, last_valuator;
+
+    KeyClassPtr k = NULL;
+    ButtonClassPtr b = NULL;
+    ValuatorClassPtr v = NULL;
+    TouchClassPtr t = NULL;
+
+    /* This event is always the first we get, before the actual events with
+     * the data. However, the way how the DDX is set up, "device" will
+     * actually be the slave device that caused the event.
+     */
+    switch (event->type) {
+    case ET_DeviceChanged:
+        ChangeMasterDeviceClasses(device, (DeviceChangedEvent *) event);
+        return DONT_PROCESS;    /* event has been sent already */
+    case ET_Motion:
+    case ET_ButtonPress:
+    case ET_ButtonRelease:
+    case ET_KeyPress:
+    case ET_KeyRelease:
+    case ET_ProximityIn:
+    case ET_ProximityOut:
+    case ET_TouchBegin:
+    case ET_TouchUpdate:
+    case ET_TouchEnd:
+        break;
+    default:
+        /* other events don't update the device */
+        return DEFAULT;
+    }
+
+    k = device->key;
+    v = device->valuator;
+    b = device->button;
+    t = device->touch;
+
+    key = event->detail.key;
+
+    /* Update device axis */
+    /* Check valuators first */
+    last_valuator = -1;
+    for (i = 0; i < MAX_VALUATORS; i++) {
+        if (BitIsOn(&event->valuators.mask, i)) {
+            if (!v) {
+                ErrorF("[Xi] Valuators reported for non-valuator device '%s'. "
+                       "Ignoring event.\n", device->name);
+                return DONT_PROCESS;
+            }
+            else if (v->numAxes < i) {
+                ErrorF("[Xi] Too many valuators reported for device '%s'. "
+                       "Ignoring event.\n", device->name);
+                return DONT_PROCESS;
+            }
+            last_valuator = i;
+        }
+    }
+
+    for (i = 0; i <= last_valuator && i < v->numAxes; i++) {
+        /* XXX: Relative/Absolute mode */
+        if (BitIsOn(&event->valuators.mask, i))
+            v->axisVal[i] = event->valuators.data[i];
+    }
+
+    if (event->type == ET_KeyPress) {
+        if (!k)
+            return DONT_PROCESS;
+
+        /* don't allow ddx to generate multiple downs, but repeats are okay */
+        if (key_is_down(device, key, KEY_PROCESSED) && !event->key_repeat)
+            return DONT_PROCESS;
+
+        if (device->valuator)
+            device->valuator->motionHintWindow = NullWindow;
+        set_key_down(device, key, KEY_PROCESSED);
+    }
+    else if (event->type == ET_KeyRelease) {
+        if (!k)
+            return DONT_PROCESS;
+
+        if (!key_is_down(device, key, KEY_PROCESSED))   /* guard against duplicates */
+            return DONT_PROCESS;
+        if (device->valuator)
+            device->valuator->motionHintWindow = NullWindow;
+        set_key_up(device, key, KEY_PROCESSED);
+    }
+    else if (event->type == ET_ButtonPress) {
+        if (!b)
+            return DONT_PROCESS;
+
+        if (button_is_down(device, key, BUTTON_PROCESSED))
+            return DONT_PROCESS;
+
+        set_button_down(device, key, BUTTON_PROCESSED);
+
+        if (!b->map[key])
+            return DONT_PROCESS;
+
+        IncreaseButtonCount(device, key, &b->buttonsDown, &b->motionMask,
+                            &b->state);
+        UpdateDeviceMotionMask(device, b->state, b->motionMask);
+    }
+    else if (event->type == ET_ButtonRelease) {
+        if (!b)
+            return DONT_PROCESS;
+
+        if (!button_is_down(device, key, BUTTON_PROCESSED))
+            return DONT_PROCESS;
+        if (IsMaster(device)) {
+            DeviceIntPtr sd;
+
+            /*
+             * Leave the button down if any slave has the
+             * button still down. Note that this depends on the
+             * event being delivered through the slave first
+             */
+            for (sd = inputInfo.devices; sd; sd = sd->next) {
+                if (IsMaster(sd) || GetMaster(sd, MASTER_POINTER) != device)
+                    continue;
+                if (!sd->button)
+                    continue;
+                for (i = 1; i <= sd->button->numButtons; i++)
+                    if (sd->button->map[i] == key &&
+                        button_is_down(sd, i, BUTTON_PROCESSED))
+                        return DONT_PROCESS;
+            }
+        }
+        set_button_up(device, key, BUTTON_PROCESSED);
+        if (!b->map[key])
+            return DONT_PROCESS;
+
+        DecreaseButtonCount(device, key, &b->buttonsDown, &b->motionMask,
+                            &b->state);
+        UpdateDeviceMotionMask(device, b->state, b->motionMask);
+    }
+    else if (event->type == ET_ProximityIn)
+        device->proximity->in_proximity = TRUE;
+    else if (event->type == ET_ProximityOut)
+        device->proximity->in_proximity = FALSE;
+    else if (event->type == ET_TouchBegin) {
+        BUG_RETURN_VAL(!b || !v, DONT_PROCESS);
+        BUG_RETURN_VAL(!t, DONT_PROCESS);
+
+        if (!b->map[key])
+            return DONT_PROCESS;
+
+        if (!(event->flags & TOUCH_POINTER_EMULATED) ||
+            (event->flags & TOUCH_REPLAYING))
+            return DONT_PROCESS;
+
+        IncreaseButtonCount(device, key, &t->buttonsDown, &t->motionMask,
+                            &t->state);
+        UpdateDeviceMotionMask(device, t->state, DeviceButtonMotionMask);
+    }
+    else if (event->type == ET_TouchEnd) {
+        BUG_RETURN_VAL(!b || !v, DONT_PROCESS);
+        BUG_RETURN_VAL(!t, DONT_PROCESS);
+
+        if (t->buttonsDown <= 0 || !b->map[key])
+            return DONT_PROCESS;
+
+        if (!(event->flags & TOUCH_POINTER_EMULATED))
+            return DONT_PROCESS;
+
+        DecreaseButtonCount(device, key, &t->buttonsDown, &t->motionMask,
+                            &t->state);
+        UpdateDeviceMotionMask(device, t->state, DeviceButtonMotionMask);
+    }
+
+    return DEFAULT;
+}
+
+/**
+ * A client that does not have the TouchOwnership mask set may not receive a
+ * TouchBegin event if there is at least one grab active.
+ *
+ * @return TRUE if the client selected for ownership events on the given
+ * window for this device, FALSE otherwise
+ */
+static inline Bool
+TouchClientWantsOwnershipEvents(ClientPtr client, DeviceIntPtr dev,
+                                WindowPtr win)
+{
+    InputClients *iclient;
+
+    nt_list_for_each_entry(iclient, wOtherInputMasks(win)->inputClients, next) {
+        if (rClient(iclient) != client)
+            continue;
+
+        return xi2mask_isset(iclient->xi2mask, dev, XI_TouchOwnership);
+    }
+
+    return FALSE;
+}
+
+static void
+TouchSendOwnershipEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, int reason,
+                        XID resource)
+{
+    int nev, i;
+    InternalEvent *tel = InitEventList(GetMaximumEventsNum());
+
+    nev = GetTouchOwnershipEvents(tel, dev, ti, reason, resource, 0);
+    for (i = 0; i < nev; i++)
+        mieqProcessDeviceEvent(dev, tel + i, NULL);
+
+    FreeEventList(tel, GetMaximumEventsNum());
+}
+
+/**
+ * Attempts to deliver a touch event to the given client.
+ */
+static Bool
+DeliverOneTouchEvent(ClientPtr client, DeviceIntPtr dev, TouchPointInfoPtr ti,
+                     GrabPtr grab, WindowPtr win, InternalEvent *ev)
+{
+    int err;
+    xEvent *xi2;
+    Mask filter;
+    Window child = DeepestSpriteWin(&ti->sprite)->drawable.id;
+
+    /* FIXME: owner event handling */
+
+    /* If the client does not have the ownership mask set and is not
+     * the current owner of the touch, only pretend we delivered */
+    if (!grab && ti->num_grabs != 0 &&
+        !TouchClientWantsOwnershipEvents(client, dev, win))
+        return TRUE;
+
+    /* If we fail here, we're going to leave a client hanging. */
+    err = EventToXI2(ev, &xi2);
+    if (err != Success)
+        FatalError("[Xi] %s: XI2 conversion failed in %s"
+                   " (%d)\n", dev->name, __func__, err);
+
+    FixUpEventFromWindow(&ti->sprite, xi2, win, child, FALSE);
+    filter = GetEventFilter(dev, xi2);
+    if (XaceHook(XACE_RECEIVE_ACCESS, client, win, xi2, 1) != Success)
+        return FALSE;
+    err = TryClientEvents(client, dev, xi2, 1, filter, filter, NullGrab);
+    free(xi2);
+
+    /* Returning the value from TryClientEvents isn't useful, since all our
+     * resource-gone cleanups will update the delivery list anyway. */
+    return TRUE;
+}
+
+static void
+ActivateEarlyAccept(DeviceIntPtr dev, TouchPointInfoPtr ti)
+{
+    ClientPtr client;
+    XID error;
+    GrabPtr grab = ti->listeners[0].grab;
+
+    BUG_RETURN(ti->listeners[0].type != TOUCH_LISTENER_GRAB &&
+               ti->listeners[0].type != TOUCH_LISTENER_POINTER_GRAB);
+    BUG_RETURN(!grab);
+
+    client = rClient(grab);
+
+    if (TouchAcceptReject(client, dev, XIAcceptTouch, ti->client_id,
+                          ti->listeners[0].window->drawable.id, &error) != Success)
+        ErrorF("[Xi] Failed to accept touch grab after early acceptance.\n");
+}
+
+/**
+ * Find the oldest touch that still has a pointer emulation client.
+ *
+ * Pointer emulation can only be performed for the oldest touch. Otherwise, the
+ * order of events seen by the client will be wrong. This function helps us find
+ * the next touch to be emulated.
+ *
+ * @param dev The device to find touches for.
+ */
+static TouchPointInfoPtr
+FindOldestPointerEmulatedTouch(DeviceIntPtr dev)
+{
+    TouchPointInfoPtr oldest = NULL;
+    int i;
+
+    for (i = 0; i < dev->touch->num_touches; i++) {
+        TouchPointInfoPtr ti = dev->touch->touches + i;
+        int j;
+
+        if (!ti->active || !ti->emulate_pointer)
+            continue;
+
+        for (j = 0; j < ti->num_listeners; j++) {
+            if (ti->listeners[j].type == TOUCH_LISTENER_POINTER_GRAB ||
+                ti->listeners[j].type == TOUCH_LISTENER_POINTER_REGULAR)
+                break;
+        }
+        if (j == ti->num_listeners)
+            continue;
+
+        if (!oldest) {
+            oldest = ti;
+            continue;
+        }
+
+        if (oldest->client_id - ti->client_id < UINT_MAX / 2)
+            oldest = ti;
+    }
+
+    return oldest;
+}
+
+/**
+ * If the current owner has rejected the event, deliver the
+ * TouchOwnership/TouchBegin to the next item in the sprite stack.
+ */
+static void
+TouchPuntToNextOwner(DeviceIntPtr dev, TouchPointInfoPtr ti,
+                     TouchOwnershipEvent *ev)
+{
+    TouchListener *listener = &ti->listeners[0]; /* new owner */
+    int accepted_early = listener->state == TOUCH_LISTENER_EARLY_ACCEPT;
+
+    /* Deliver the ownership */
+    if (listener->state == TOUCH_LISTENER_AWAITING_OWNER || accepted_early)
+        DeliverTouchEvents(dev, ti, (InternalEvent *) ev,
+                           listener->listener);
+    else if (listener->state == TOUCH_LISTENER_AWAITING_BEGIN) {
+        /* We can't punt to a pointer listener unless all older pointer
+         * emulated touches have been seen already. */
+        if ((listener->type == TOUCH_LISTENER_POINTER_GRAB ||
+             listener->type == TOUCH_LISTENER_POINTER_REGULAR) &&
+            ti != FindOldestPointerEmulatedTouch(dev))
+            return;
+
+        TouchEventHistoryReplay(ti, dev, listener->listener);
+    }
+
+    /* New owner has Begin/Update but not end. If touch is pending_finish,
+     * emulate the TouchEnd now */
+    if (ti->pending_finish) {
+        TouchEmitTouchEnd(dev, ti, 0, 0);
+
+        /* If the last owner is not a touch grab, finalise the touch, we
+           won't get more correspondence on this.
+         */
+        if (ti->num_listeners == 1 &&
+            (ti->num_grabs == 0 ||
+             listener->grab->grabtype != XI2 ||
+             !xi2mask_isset(listener->grab->xi2mask, dev, XI_TouchBegin))) {
+            TouchEndTouch(dev, ti);
+            return;
+        }
+    }
+
+    if (accepted_early)
+        ActivateEarlyAccept(dev, ti);
+}
+
+/**
+ * Check the oldest touch to see if it needs to be replayed to its pointer
+ * owner.
+ *
+ * Touch event propagation is paused if it hits a pointer listener while an
+ * older touch with a pointer listener is waiting on accept or reject. This
+ * function will restart propagation of a paused touch if needed.
+ *
+ * @param dev The device to check touches for.
+ */
+static void
+CheckOldestTouch(DeviceIntPtr dev)
+{
+    TouchPointInfoPtr oldest = FindOldestPointerEmulatedTouch(dev);
+
+    if (oldest && oldest->listeners[0].state == TOUCH_LISTENER_AWAITING_BEGIN)
+        TouchPuntToNextOwner(dev, oldest, NULL);
+}
+
+/**
+ * Process a touch rejection.
+ *
+ * @param sourcedev The source device of the touch sequence.
+ * @param ti The touchpoint info record.
+ * @param resource The resource of the client rejecting the touch.
+ * @param ev TouchOwnership event to send. Set to NULL if no event should be
+ *        sent.
+ */
+void
+TouchRejected(DeviceIntPtr sourcedev, TouchPointInfoPtr ti, XID resource,
+              TouchOwnershipEvent *ev)
+{
+    Bool was_owner = (resource == ti->listeners[0].listener);
+    int i;
+
+    /* Send a TouchEnd event to the resource being removed, but only if they
+     * haven't received one yet already */
+    for (i = 0; i < ti->num_listeners; i++) {
+        if (ti->listeners[i].listener == resource) {
+            if (ti->listeners[i].state != TOUCH_LISTENER_HAS_END)
+                TouchEmitTouchEnd(sourcedev, ti, TOUCH_REJECT, resource);
+            break;
+        }
+    }
+
+    /* Remove the resource from the listener list, updating
+     * ti->num_listeners, as well as ti->num_grabs if it was a grab. */
+    TouchRemoveListener(ti, resource);
+
+    /* If the current owner was removed and there are further listeners, deliver
+     * the TouchOwnership or TouchBegin event to the new owner. */
+    if (ev && ti->num_listeners > 0 && was_owner)
+        TouchPuntToNextOwner(sourcedev, ti, ev);
+    else if (ti->num_listeners == 0)
+        TouchEndTouch(sourcedev, ti);
+
+    CheckOldestTouch(sourcedev);
+}
+
+/**
+ * Processes a TouchOwnership event, indicating a grab has accepted the touch
+ * it currently owns, or a grab or selection has been removed.  Will generate
+ * and send TouchEnd events to all clients removed from the delivery list, as
+ * well as possibly sending the new TouchOwnership event.  May end the
+ * touchpoint if it is pending finish.
+ */
+static void
+ProcessTouchOwnershipEvent(TouchOwnershipEvent *ev,
+                           DeviceIntPtr dev)
+{
+    TouchPointInfoPtr ti = TouchFindByClientID(dev, ev->touchid);
+
+    if (!ti) {
+        DebugF("[Xi] %s: Failed to get event %d for touchpoint %d\n",
+               dev->name, ev->type, ev->touchid);
+        return;
+    }
+
+    if (ev->reason == XIRejectTouch)
+        TouchRejected(dev, ti, ev->resource, ev);
+    else if (ev->reason == XIAcceptTouch) {
+        int i;
+
+
+        /* For pointer-emulated listeners that ungrabbed the active grab,
+         * the state was forced to TOUCH_LISTENER_HAS_END. Still go
+         * through the motions of ending the touch if the listener has
+         * already seen the end. This ensures that the touch record is ended in
+         * the server.
+         */
+        if (ti->listeners[0].state == TOUCH_LISTENER_HAS_END)
+            TouchEmitTouchEnd(dev, ti, TOUCH_ACCEPT, ti->listeners[0].listener);
+
+        /* The touch owner has accepted the touch.  Send TouchEnd events to
+         * everyone else, and truncate the list of listeners. */
+        for (i = 1; i < ti->num_listeners; i++)
+            TouchEmitTouchEnd(dev, ti, TOUCH_ACCEPT, ti->listeners[i].listener);
+
+        while (ti->num_listeners > 1)
+            TouchRemoveListener(ti, ti->listeners[1].listener);
+        /* Owner accepted after receiving end */
+        if (ti->listeners[0].state == TOUCH_LISTENER_HAS_END)
+            TouchEndTouch(dev, ti);
+        else
+            ti->listeners[0].state = TOUCH_LISTENER_HAS_ACCEPTED;
+    }
+    else {  /* this is the very first ownership event for a grab */
+        DeliverTouchEvents(dev, ti, (InternalEvent *) ev, ev->resource);
+    }
+}
+
+/**
+ * Copy the event's valuator information into the touchpoint, we may need
+ * this for emulated TouchEnd events.
+ */
+static void
+TouchCopyValuatorData(DeviceEvent *ev, TouchPointInfoPtr ti)
+{
+    int i;
+
+    for (i = 0; i < ARRAY_SIZE(ev->valuators.data); i++)
+        if (BitIsOn(ev->valuators.mask, i))
+            valuator_mask_set_double(ti->valuators, i, ev->valuators.data[i]);
+}
+
+/**
+ * Given a touch event and a potential listener, retrieve info needed for
+ * processing the event.
+ *
+ * @param dev The device generating the touch event.
+ * @param ti The touch point info record for the touch event.
+ * @param ev The touch event to process.
+ * @param listener The touch event listener that may receive the touch event.
+ * @param[out] client The client that should receive the touch event.
+ * @param[out] win The window to deliver the event on.
+ * @param[out] grab The grab to deliver the event through, if any.
+ * @param[out] mask The XI 2.x event mask of the grab or selection, if any.
+ * @return TRUE if an event should be delivered to the listener, FALSE
+ *         otherwise.
+ */
+static Bool
+RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
+                          InternalEvent *ev, TouchListener * listener,
+                          ClientPtr *client, WindowPtr *win, GrabPtr *grab,
+                          XI2Mask **mask)
+{
+    int rc;
+    InputClients *iclients = NULL;
+    *mask = NULL;
+
+    if (listener->type == TOUCH_LISTENER_GRAB ||
+        listener->type == TOUCH_LISTENER_POINTER_GRAB) {
+        *grab = listener->grab;
+
+        BUG_RETURN_VAL(!*grab, FALSE);
+
+        *client = rClient(*grab);
+        *win = (*grab)->window;
+        *mask = (*grab)->xi2mask;
+    }
+    else {
+        rc = dixLookupResourceByType((void **) win, listener->listener,
+                                     listener->resource_type,
+                                     serverClient, DixSendAccess);
+        if (rc != Success)
+            return FALSE;
+
+        if (listener->level == XI2) {
+            int evtype;
+
+            if (ti->emulate_pointer &&
+                listener->type == TOUCH_LISTENER_POINTER_REGULAR)
+                evtype = GetXI2Type(TouchGetPointerEventType(ev));
+            else
+                evtype = GetXI2Type(ev->any.type);
+
+            nt_list_for_each_entry(iclients,
+                                   wOtherInputMasks(*win)->inputClients, next)
+                if (xi2mask_isset(iclients->xi2mask, dev, evtype))
+                break;
+
+            BUG_RETURN_VAL(!iclients, FALSE);
+
+            *mask = iclients->xi2mask;
+            *client = rClient(iclients);
+        }
+        else if (listener->level == XI) {
+            int xi_type = GetXIType(TouchGetPointerEventType(ev));
+            Mask xi_filter = event_get_filter_from_type(dev, xi_type);
+
+            nt_list_for_each_entry(iclients,
+                                   wOtherInputMasks(*win)->inputClients, next)
+                if (iclients->mask[dev->id] & xi_filter)
+                break;
+            BUG_RETURN_VAL(!iclients, FALSE);
+
+            *client = rClient(iclients);
+        }
+        else {
+            int coretype = GetCoreType(TouchGetPointerEventType(ev));
+            Mask core_filter = event_get_filter_from_type(dev, coretype);
+            OtherClients *oclients;
+
+            /* all others */
+            nt_list_for_each_entry(oclients,
+                                   (OtherClients *) wOtherClients(*win), next)
+                if (oclients->mask & core_filter)
+                    break;
+
+            /* if owner selected, oclients is NULL */
+            *client = oclients ? rClient(oclients) : wClient(*win);
+        }
+
+        *grab = NULL;
+    }
+
+    return TRUE;
+}
+
+static int
+DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
+                          InternalEvent *ev, TouchListener * listener,
+                          ClientPtr client, WindowPtr win, GrabPtr grab,
+                          XI2Mask *xi2mask)
+{
+    InternalEvent motion, button;
+    InternalEvent *ptrev = &motion;
+    int nevents;
+    DeviceIntPtr kbd;
+
+    /* There may be a pointer grab on the device */
+    if (!grab) {
+        grab = dev->deviceGrab.grab;
+        if (grab) {
+            win = grab->window;
+            xi2mask = grab->xi2mask;
+            client = rClient(grab);
+        }
+    }
+
+    /* We don't deliver pointer events to non-owners */
+    if (!TouchResourceIsOwner(ti, listener->listener))
+        return !Success;
+
+    if (!ti->emulate_pointer)
+        return !Success;
+
+    nevents = TouchConvertToPointerEvent(ev, &motion, &button);
+    BUG_RETURN_VAL(nevents == 0, BadValue);
+
+    /* Note that here we deliver only part of the events that are generated by the touch event:
+     *
+     * TouchBegin results in ButtonPress (motion is handled in DeliverEmulatedMotionEvent)
+     * TouchUpdate results in Motion
+     * TouchEnd results in ButtonRelease (motion is handled in DeliverEmulatedMotionEvent)
+     */
+    if (nevents > 1)
+        ptrev = &button;
+
+    kbd = GetMaster(dev, KEYBOARD_OR_FLOAT);
+    event_set_state(dev, kbd, &ptrev->device_event);
+    ptrev->device_event.corestate = event_get_corestate(dev, kbd);
+
+    if (grab) {
+        /* this side-steps the usual activation mechanisms, but... */
+        if (ev->any.type == ET_TouchBegin && !dev->deviceGrab.grab)
+            ActivatePassiveGrab(dev, grab, ptrev, ev);  /* also delivers the event */
+        else {
+            int deliveries = 0;
+
+            /* 'grab' is the passive grab, but if the grab isn't active,
+             * don't deliver */
+            if (!dev->deviceGrab.grab)
+                return !Success;
+
+            if (grab->ownerEvents) {
+                WindowPtr focus = NullWindow;
+                WindowPtr sprite_win = DeepestSpriteWin(dev->spriteInfo->sprite);
+
+                deliveries = DeliverDeviceEvents(sprite_win, ptrev, grab, focus, dev);
+            }
+
+            if (!deliveries)
+                deliveries = DeliverOneGrabbedEvent(ptrev, dev, grab->grabtype);
+
+            /* We must accept the touch sequence once a pointer listener has
+             * received one event past ButtonPress. */
+            if (deliveries && ev->any.type != ET_TouchBegin &&
+                !(ev->device_event.flags & TOUCH_CLIENT_ID))
+                TouchListenerAcceptReject(dev, ti, 0, XIAcceptTouch);
+
+            if (ev->any.type == ET_TouchEnd &&
+                ti->num_listeners == 1 &&
+                !dev->button->buttonsDown &&
+                dev->deviceGrab.fromPassiveGrab && GrabIsPointerGrab(grab)) {
+                (*dev->deviceGrab.DeactivateGrab) (dev);
+                CheckOldestTouch(dev);
+                return Success;
+            }
+        }
+    }
+    else {
+        GrabPtr devgrab = dev->deviceGrab.grab;
+        WindowPtr sprite_win = DeepestSpriteWin(dev->spriteInfo->sprite);
+
+        DeliverDeviceEvents(sprite_win, ptrev, grab, win, dev);
+        /* FIXME: bad hack
+         * Implicit passive grab activated in response to this event. Store
+         * the event.
+         */
+        if (!devgrab && dev->deviceGrab.grab && dev->deviceGrab.implicitGrab) {
+            TouchListener *l;
+            GrabPtr g;
+
+            devgrab = dev->deviceGrab.grab;
+            g = AllocGrab(devgrab);
+            BUG_WARN(!g);
+
+            CopyPartialInternalEvent(dev->deviceGrab.sync.event, ev);
+
+            /* The listener array has a sequence of grabs and then one event
+             * selection. Implicit grab activation occurs through delivering an
+             * event selection. Thus, we update the last listener in the array.
+             */
+            l = &ti->listeners[ti->num_listeners - 1];
+            l->listener = g->resource;
+            l->grab = g;
+            //l->resource_type = RT_NONE;
+
+            if (devgrab->grabtype != XI2 || devgrab->type != XI_TouchBegin)
+                l->type = TOUCH_LISTENER_POINTER_GRAB;
+            else
+                l->type = TOUCH_LISTENER_GRAB;
+        }
+
+    }
+    if (ev->any.type == ET_TouchBegin)
+        listener->state = TOUCH_LISTENER_IS_OWNER;
+    else if (ev->any.type == ET_TouchEnd)
+        listener->state = TOUCH_LISTENER_HAS_END;
+
+    return Success;
+}
+
+static void
+DeliverEmulatedMotionEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
+                           InternalEvent *ev)
+{
+    DeviceEvent motion;
+
+    if (ti->num_listeners) {
+        ClientPtr client;
+        WindowPtr win;
+        GrabPtr grab;
+        XI2Mask *mask;
+
+        if (ti->listeners[0].type != TOUCH_LISTENER_POINTER_REGULAR &&
+            ti->listeners[0].type != TOUCH_LISTENER_POINTER_GRAB)
+            return;
+
+        motion = ev->device_event;
+        motion.type = ET_TouchUpdate;
+        motion.detail.button = 0;
+
+        if (!RetrieveTouchDeliveryData(dev, ti, (InternalEvent*)&motion,
+                                       &ti->listeners[0], &client, &win, &grab,
+                                       &mask))
+            return;
+
+        DeliverTouchEmulatedEvent(dev, ti, (InternalEvent*)&motion, &ti->listeners[0], client,
+                                  win, grab, mask);
+    }
+    else {
+        InternalEvent button;
+        int converted;
+
+        converted = TouchConvertToPointerEvent(ev, (InternalEvent*)&motion, &button);
+
+        BUG_WARN(converted == 0);
+        if (converted)
+            ProcessOtherEvent((InternalEvent*)&motion, dev);
+    }
+}
+
+/**
+ * Processes and delivers a TouchBegin, TouchUpdate, or a
+ * TouchEnd event.
+ *
+ * Due to having rather different delivery semantics (see the Xi 2.2 protocol
+ * spec for more information), this implements its own grab and event-selection
+ * delivery logic.
+ */
+static void
+ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
+{
+    TouchClassPtr t = dev->touch;
+    TouchPointInfoPtr ti;
+    uint32_t touchid;
+    int type = ev->any.type;
+    int emulate_pointer = ! !(ev->device_event.flags & TOUCH_POINTER_EMULATED);
+    DeviceIntPtr kbd;
+
+    if (!t)
+        return;
+
+    touchid = ev->device_event.touchid;
+
+    if (type == ET_TouchBegin && !(ev->device_event.flags & TOUCH_REPLAYING)) {
+        ti = TouchBeginTouch(dev, ev->device_event.sourceid, touchid,
+                             emulate_pointer);
+    }
+    else
+        ti = TouchFindByClientID(dev, touchid);
+
+    /* Active pointer grab */
+    if (emulate_pointer && dev->deviceGrab.grab && !dev->deviceGrab.fromPassiveGrab &&
+        (dev->deviceGrab.grab->grabtype == CORE ||
+         dev->deviceGrab.grab->grabtype == XI ||
+         !xi2mask_isset(dev->deviceGrab.grab->xi2mask, dev, XI_TouchBegin)))
+    {
+        /* Active pointer grab on touch point and we get a TouchEnd - claim this
+         * touchpoint accepted, otherwise clients waiting for ownership will
+         * wait on this touchpoint until this client ungrabs, or the cows come
+         * home, whichever is earlier */
+        if (ti && type == ET_TouchEnd)
+            TouchListenerAcceptReject(dev, ti, 0, XIAcceptTouch);
+        else if (!ti && type != ET_TouchBegin) {
+            /* Under the following circumstances we create a new touch record for an
+             * existing touch:
+             *
+             * - The touch may be pointer emulated
+             * - An explicit grab is active on the device
+             * - The grab is a pointer grab
+             *
+             * This allows for an explicit grab to receive pointer events for an already
+             * active touch.
+             */
+            ti = TouchBeginTouch(dev, ev->device_event.sourceid, touchid,
+                                 emulate_pointer);
+            if (!ti) {
+                DebugF("[Xi] %s: Failed to create new dix record for explicitly "
+                       "grabbed touchpoint %d\n",
+                       dev->name, touchid);
+                return;
+            }
+
+            TouchBuildSprite(dev, ti, ev);
+            TouchSetupListeners(dev, ti, ev);
+        }
+    }
+
+    if (!ti) {
+        DebugF("[Xi] %s: Failed to get event %d for touchpoint %d\n",
+               dev->name, type, touchid);
+        goto out;
+    }
+
+    /* if emulate_pointer is set, emulate the motion event right
+     * here, so we can ignore it for button event emulation. TouchUpdate
+     * events which _only_ emulate motion just work normally */
+    if (emulate_pointer && (ev->any.type == ET_TouchBegin ||
+                           (ev->any.type == ET_TouchEnd && ti->num_listeners > 0)))
+        DeliverEmulatedMotionEvent(dev, ti, ev);
+
+    if (emulate_pointer && IsMaster(dev))
+        CheckMotion(&ev->device_event, dev);
+
+    kbd = GetMaster(dev, KEYBOARD_OR_FLOAT);
+    event_set_state(NULL, kbd, &ev->device_event);
+    ev->device_event.corestate = event_get_corestate(NULL, kbd);
+
+    /* Make sure we have a valid window trace for event delivery; must be
+     * called after event type mutation. Touch end events are always processed
+     * in order to end touch records. */
+    /* FIXME: check this */
+    if ((type == ET_TouchBegin &&
+         !(ev->device_event.flags & TOUCH_REPLAYING) &&
+         !TouchBuildSprite(dev, ti, ev)) ||
+        (type != ET_TouchEnd && ti->sprite.spriteTraceGood == 0))
+        return;
+
+    TouchCopyValuatorData(&ev->device_event, ti);
+    /* WARNING: the event type may change to TouchUpdate in
+     * DeliverTouchEvents if a TouchEnd was delivered to a grabbing
+     * owner */
+    DeliverTouchEvents(dev, ti, ev, ev->device_event.resource);
+    if (ev->any.type == ET_TouchEnd)
+        TouchEndTouch(dev, ti);
+
+ out:
+    if (emulate_pointer)
+        UpdateDeviceState(dev, &ev->device_event);
+}
+
+static void
+ProcessBarrierEvent(InternalEvent *e, DeviceIntPtr dev)
+{
+    Mask filter;
+    WindowPtr pWin;
+    BarrierEvent *be = &e->barrier_event;
+    xEvent *ev;
+    int rc;
+    GrabPtr grab = dev->deviceGrab.grab;
+
+    if (!IsMaster(dev))
+        return;
+
+    if (dixLookupWindow(&pWin, be->window, serverClient, DixReadAccess) != Success)
+        return;
+
+    if (grab)
+        be->flags |= XIBarrierDeviceIsGrabbed;
+
+    rc = EventToXI2(e, &ev);
+    if (rc != Success) {
+        ErrorF("[Xi] event conversion from %s failed with code %d\n", __func__, rc);
+        return;
+    }
+
+    /* A client has a grab, deliver to this client if the grab_window is the
+       barrier window.
+
+       Otherwise, deliver normally to the client.
+     */
+    if (grab &&
+        CLIENT_ID(be->barrierid) == CLIENT_ID(grab->resource) &&
+        grab->window->drawable.id == be->window) {
+        DeliverGrabbedEvent(e, dev, FALSE);
+    } else {
+        filter = GetEventFilter(dev, ev);
+
+        DeliverEventsToWindow(dev, pWin, ev, 1,
+                              filter, NullGrab);
+    }
+    free(ev);
+}
+
+static BOOL
+IsAnotherGestureActiveOnMaster(DeviceIntPtr dev, InternalEvent* ev)
+{
+    GestureClassPtr g = dev->gesture;
+    if (g->gesture.active && g->gesture.sourceid != ev->gesture_event.sourceid) {
+        return TRUE;
+    }
+    return FALSE;
+}
+
+/**
+ * Processes and delivers a Gesture{Pinch,Swipe}{Begin,Update,End}.
+ *
+ * Due to having rather different delivery semantics (see the Xi 2.4 protocol
+ * spec for more information), this implements its own grab and event-selection
+ * delivery logic.
+ */
+void
+ProcessGestureEvent(InternalEvent *ev, DeviceIntPtr dev)
+{
+    GestureInfoPtr gi;
+    DeviceIntPtr kbd;
+    Bool deactivateGestureGrab = FALSE;
+    Bool delivered = FALSE;
+
+    if (!dev->gesture)
+        return;
+
+    if (IsMaster(dev) && IsAnotherGestureActiveOnMaster(dev, ev))
+        return;
+
+    if (IsGestureBeginEvent(ev))
+        gi = GestureBeginGesture(dev, ev);
+    else
+        gi = GestureFindActiveByEventType(dev, ev->any.type);
+
+    if (!gi) {
+        /* This may happen if gesture is no longer active or was never started. */
+        return;
+    }
+
+    kbd = GetMaster(dev, KEYBOARD_OR_FLOAT);
+    event_set_state_gesture(kbd, &ev->gesture_event);
+
+    if (IsGestureBeginEvent(ev))
+        GestureSetupListener(dev, gi, ev);
+
+    if (IsGestureEndEvent(ev) &&
+            dev->deviceGrab.grab &&
+            dev->deviceGrab.fromPassiveGrab &&
+            GrabIsGestureGrab(dev->deviceGrab.grab))
+        deactivateGestureGrab = TRUE;
+
+    delivered = DeliverGestureEventToOwner(dev, gi, ev);
+
+    if (delivered && !deactivateGestureGrab &&
+            (IsGestureBeginEvent(ev) || IsGestureEndEvent(ev)))
+        FreezeThisEventIfNeededForSyncGrab(dev, ev);
+
+    if (IsGestureEndEvent(ev))
+        GestureEndGesture(gi);
+
+    if (deactivateGestureGrab)
+        (*dev->deviceGrab.DeactivateGrab) (dev);
+}
+
+/**
+ * Process DeviceEvents and DeviceChangedEvents.
+ */
+static void
+ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
+{
+    GrabPtr grab;
+    Bool deactivateDeviceGrab = FALSE;
+    int key = 0, rootX, rootY;
+    ButtonClassPtr b;
+    int ret = 0;
+    int corestate;
+    DeviceIntPtr mouse = NULL, kbd = NULL;
+    DeviceEvent *event = &ev->device_event;
+
+    if (IsPointerDevice(device)) {
+        kbd = GetMaster(device, KEYBOARD_OR_FLOAT);
+        mouse = device;
+        if (!kbd->key)          /* can happen with floating SDs */
+            kbd = NULL;
+    }
+    else {
+        mouse = GetMaster(device, POINTER_OR_FLOAT);
+        kbd = device;
+        if (!mouse->valuator || !mouse->button) /* may be float. SDs */
+            mouse = NULL;
+    }
+
+    corestate = event_get_corestate(mouse, kbd);
+    event_set_state(mouse, kbd, event);
+
+    ret = UpdateDeviceState(device, event);
+    if (ret == DONT_PROCESS)
+        return;
+
+    b = device->button;
+
+    if (IsMaster(device) || IsFloating(device))
+        CheckMotion(event, device);
+
+    switch (event->type) {
+    case ET_Motion:
+    case ET_ButtonPress:
+    case ET_ButtonRelease:
+    case ET_KeyPress:
+    case ET_KeyRelease:
+    case ET_ProximityIn:
+    case ET_ProximityOut:
+        GetSpritePosition(device, &rootX, &rootY);
+        event->root_x = rootX;
+        event->root_y = rootY;
+        NoticeEventTime((InternalEvent *) event, device);
+        event->corestate = corestate;
+        key = event->detail.key;
+        break;
+    default:
+        break;
+    }
+
+    /* send KeyPress and KeyRelease events to XACE plugins */
+    if (XaceHookIsSet(XACE_KEY_AVAIL) &&
+            (event->type == ET_KeyPress || event->type == ET_KeyRelease)) {
+        xEvent *core;
+        int count;
+
+        if (EventToCore(ev, &core, &count) == Success && count > 0) {
+            XaceHook(XACE_KEY_AVAIL, core, device, 0);
+            free(core);
+        }
+    }
+
+    if (DeviceEventCallback && !syncEvents.playingEvents) {
+        DeviceEventInfoRec eventinfo;
+        SpritePtr pSprite = device->spriteInfo->sprite;
+
+        /* see comment in EnqueueEvents regarding the next three lines */
+        if (ev->any.type == ET_Motion)
+            ev->device_event.root = pSprite->hotPhys.pScreen->root->drawable.id;
+
+        eventinfo.device = device;
+        eventinfo.event = ev;
+        CallCallbacks(&DeviceEventCallback, (void *) &eventinfo);
+    }
+
+    grab = device->deviceGrab.grab;
+
+    switch (event->type) {
+    case ET_KeyPress:
+        /* Don't deliver focus events (e.g. from KeymapNotify when running
+         * nested) to clients. */
+        if (event->source_type == EVENT_SOURCE_FOCUS)
+            return;
+        if (!grab && CheckDeviceGrabs(device, ev, 0))
+            return;
+        break;
+    case ET_KeyRelease:
+        if (grab && device->deviceGrab.fromPassiveGrab &&
+            (key == device->deviceGrab.activatingKey) &&
+            GrabIsKeyboardGrab(device->deviceGrab.grab))
+            deactivateDeviceGrab = TRUE;
+        break;
+    case ET_ButtonPress:
+        if (b->map[key] == 0)   /* there's no button 0 */
+            return;
+        event->detail.button = b->map[key];
+        if (!grab && CheckDeviceGrabs(device, ev, 0)) {
+            /* if a passive grab was activated, the event has been sent
+             * already */
+            return;
+        }
+        break;
+    case ET_ButtonRelease:
+        if (b->map[key] == 0)   /* there's no button 0 */
+            return;
+        event->detail.button = b->map[key];
+        if (grab && !b->buttonsDown &&
+            device->deviceGrab.fromPassiveGrab &&
+            GrabIsPointerGrab(device->deviceGrab.grab))
+            deactivateDeviceGrab = TRUE;
+    default:
+        break;
+    }
+
+    /* Don't deliver focus events (e.g. from KeymapNotify when running
+     * nested) to clients. */
+    if (event->source_type != EVENT_SOURCE_FOCUS) {
+        if (grab)
+            DeliverGrabbedEvent((InternalEvent *) event, device,
+                                deactivateDeviceGrab);
+        else if (device->focus && !IsPointerEvent(ev))
+            DeliverFocusedEvent(device, (InternalEvent *) event,
+                                GetSpriteWindow(device));
+        else
+            DeliverDeviceEvents(GetSpriteWindow(device), (InternalEvent *) event,
+                                NullGrab, NullWindow, device);
+    }
+
+    if (deactivateDeviceGrab == TRUE) {
+        (*device->deviceGrab.DeactivateGrab) (device);
+
+        if (!IsMaster (device) && !IsFloating (device)) {
+            int flags, num_events = 0;
+            InternalEvent dce;
+
+            flags = (IsPointerDevice (device)) ?
+                DEVCHANGE_POINTER_EVENT : DEVCHANGE_KEYBOARD_EVENT;
+            UpdateFromMaster (&dce, device, flags, &num_events);
+            BUG_WARN(num_events > 1);
+
+            if (num_events == 1)
+                ChangeMasterDeviceClasses(GetMaster (device, MASTER_ATTACHED),
+                                          &dce.changed_event);
+        }
+
+    }
+
+    event->detail.key = key;
+}
+
+/**
+ * Main device event processing function.
+ * Called from when processing the events from the event queue.
+ *
+ */
+void
+ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
+{
+    verify_internal_event(ev);
+
+    switch (ev->any.type) {
+    case ET_RawKeyPress:
+    case ET_RawKeyRelease:
+    case ET_RawButtonPress:
+    case ET_RawButtonRelease:
+    case ET_RawMotion:
+    case ET_RawTouchBegin:
+    case ET_RawTouchUpdate:
+    case ET_RawTouchEnd:
+        DeliverRawEvent(&ev->raw_event, device);
+        break;
+    case ET_TouchBegin:
+    case ET_TouchUpdate:
+    case ET_TouchEnd:
+        ProcessTouchEvent(ev, device);
+        break;
+    case ET_TouchOwnership:
+        /* TouchOwnership events are handled separately from the rest, as they
+         * have more complex semantics. */
+        ProcessTouchOwnershipEvent(&ev->touch_ownership_event, device);
+        break;
+    case ET_BarrierHit:
+    case ET_BarrierLeave:
+        ProcessBarrierEvent(ev, device);
+        break;
+    case ET_GesturePinchBegin:
+    case ET_GesturePinchUpdate:
+    case ET_GesturePinchEnd:
+    case ET_GestureSwipeBegin:
+    case ET_GestureSwipeUpdate:
+    case ET_GestureSwipeEnd:
+        ProcessGestureEvent(ev, device);
+        break;
+    default:
+        ProcessDeviceEvent(ev, device);
+        break;
+    }
+}
+
+static int
+DeliverTouchBeginEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
+                       InternalEvent *ev, TouchListener * listener,
+                       ClientPtr client, WindowPtr win, GrabPtr grab,
+                       XI2Mask *xi2mask)
+{
+    enum TouchListenerState state;
+    int rc = Success;
+    Bool has_ownershipmask;
+
+    if (listener->type == TOUCH_LISTENER_POINTER_REGULAR ||
+        listener->type == TOUCH_LISTENER_POINTER_GRAB) {
+        rc = DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win,
+                                       grab, xi2mask);
+        if (rc == Success) {
+            listener->state = TOUCH_LISTENER_IS_OWNER;
+            /* async grabs cannot replay, so automatically accept this touch */
+            if (listener->type == TOUCH_LISTENER_POINTER_GRAB &&
+                dev->deviceGrab.grab &&
+                dev->deviceGrab.fromPassiveGrab &&
+                dev->deviceGrab.grab->pointerMode == GrabModeAsync)
+                ActivateEarlyAccept(dev, ti);
+        }
+        goto out;
+    }
+
+    has_ownershipmask = xi2mask_isset(xi2mask, dev, XI_TouchOwnership);
+
+    if (TouchResourceIsOwner(ti, listener->listener) || has_ownershipmask)
+        rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
+    if (!TouchResourceIsOwner(ti, listener->listener)) {
+        if (has_ownershipmask)
+            state = TOUCH_LISTENER_AWAITING_OWNER;
+        else
+            state = TOUCH_LISTENER_AWAITING_BEGIN;
+    }
+    else {
+        if (has_ownershipmask)
+            TouchSendOwnershipEvent(dev, ti, 0, listener->listener);
+
+        if (listener->type == TOUCH_LISTENER_REGULAR)
+            state = TOUCH_LISTENER_HAS_ACCEPTED;
+        else
+            state = TOUCH_LISTENER_IS_OWNER;
+    }
+    listener->state = state;
+
+ out:
+    return rc;
+}
+
+static int
+DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
+                     TouchListener * listener, ClientPtr client,
+                     WindowPtr win, GrabPtr grab, XI2Mask *xi2mask)
+{
+    int rc = Success;
+
+    if (listener->type == TOUCH_LISTENER_POINTER_REGULAR ||
+        listener->type == TOUCH_LISTENER_POINTER_GRAB) {
+        /* Note: If the active grab was ungrabbed, we already changed the
+         * state to TOUCH_LISTENER_HAS_END but still get here. So we mustn't
+         * actually send the event.
+         * This is part two of the hack in DeactivatePointerGrab
+         */
+        if (listener->state != TOUCH_LISTENER_HAS_END) {
+            rc = DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win,
+                                           grab, xi2mask);
+
+             /* Once we send a TouchEnd to a legacy listener, we're already well
+              * past the accepting/rejecting stage (can only happen on
+              * GrabModeSync + replay. This listener now gets the end event,
+              * and we can continue.
+              */
+            if (rc == Success)
+                listener->state = TOUCH_LISTENER_HAS_END;
+        }
+        goto out;
+    }
+
+    /* A client is waiting for the begin, don't give it a TouchEnd */
+    if (listener->state == TOUCH_LISTENER_AWAITING_BEGIN) {
+        listener->state = TOUCH_LISTENER_HAS_END;
+        goto out;
+    }
+
+    /* Event in response to reject */
+    if (ev->device_event.flags & TOUCH_REJECT ||
+        (ev->device_event.flags & TOUCH_ACCEPT && !TouchResourceIsOwner(ti, listener->listener))) {
+        /* Touch has been rejected, or accepted by its owner which is not this listener */
+        if (listener->state != TOUCH_LISTENER_HAS_END)
+            rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
+        listener->state = TOUCH_LISTENER_HAS_END;
+    }
+    else if (TouchResourceIsOwner(ti, listener->listener)) {
+        Bool normal_end = !(ev->device_event.flags & TOUCH_ACCEPT);
+
+        /* FIXME: what about early acceptance */
+        if (normal_end && listener->state != TOUCH_LISTENER_HAS_END)
+            rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
+
+        if ((ti->num_listeners > 1 ||
+             (ti->num_grabs > 0 && listener->state != TOUCH_LISTENER_HAS_ACCEPTED)) &&
+            (ev->device_event.flags & (TOUCH_ACCEPT | TOUCH_REJECT)) == 0) {
+            ev->any.type = ET_TouchUpdate;
+            ev->device_event.flags |= TOUCH_PENDING_END;
+            ti->pending_finish = TRUE;
+        }
+
+        if (normal_end)
+            listener->state = TOUCH_LISTENER_HAS_END;
+    }
+
+ out:
+    return rc;
+}
+
+static int
+DeliverTouchEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
+                  TouchListener * listener, ClientPtr client,
+                  WindowPtr win, GrabPtr grab, XI2Mask *xi2mask)
+{
+    Bool has_ownershipmask = FALSE;
+    int rc = Success;
+
+    if (xi2mask)
+        has_ownershipmask = xi2mask_isset(xi2mask, dev, XI_TouchOwnership);
+
+    if (ev->any.type == ET_TouchOwnership) {
+        ev->touch_ownership_event.deviceid = dev->id;
+        if (!TouchResourceIsOwner(ti, listener->listener))
+            goto out;
+        rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
+        listener->state = TOUCH_LISTENER_IS_OWNER;
+    }
+    else
+        ev->device_event.deviceid = dev->id;
+
+    if (ev->any.type == ET_TouchBegin) {
+        rc = DeliverTouchBeginEvent(dev, ti, ev, listener, client, win, grab,
+                                    xi2mask);
+    }
+    else if (ev->any.type == ET_TouchUpdate) {
+        if (listener->type == TOUCH_LISTENER_POINTER_REGULAR ||
+            listener->type == TOUCH_LISTENER_POINTER_GRAB)
+            DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win, grab,
+                                      xi2mask);
+        else if (TouchResourceIsOwner(ti, listener->listener) ||
+                 has_ownershipmask)
+            rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
+    }
+    else if (ev->any.type == ET_TouchEnd)
+        rc = DeliverTouchEndEvent(dev, ti, ev, listener, client, win, grab,
+                                  xi2mask);
+
+ out:
+    return rc;
+}
+
+/**
+ * Delivers a touch events to all interested clients.  For TouchBegin events,
+ * will update ti->listeners, ti->num_listeners, and ti->num_grabs.
+ * May also mutate ev (type and flags) upon successful delivery.  If
+ * @resource is non-zero, will only attempt delivery to the owner of that
+ * resource.
+ *
+ * @return TRUE if the event was delivered at least once, FALSE otherwise
+ */
+void
+DeliverTouchEvents(DeviceIntPtr dev, TouchPointInfoPtr ti,
+                   InternalEvent *ev, XID resource)
+{
+    int i;
+
+    if (ev->any.type == ET_TouchBegin &&
+        !(ev->device_event.flags & (TOUCH_CLIENT_ID | TOUCH_REPLAYING)))
+        TouchSetupListeners(dev, ti, ev);
+
+    TouchEventHistoryPush(ti, &ev->device_event);
+
+    for (i = 0; i < ti->num_listeners; i++) {
+        GrabPtr grab = NULL;
+        ClientPtr client;
+        WindowPtr win;
+        XI2Mask *mask;
+        TouchListener *listener = &ti->listeners[i];
+
+        if (resource && listener->listener != resource)
+            continue;
+
+        if (!RetrieveTouchDeliveryData(dev, ti, ev, listener, &client, &win,
+                                       &grab, &mask))
+            continue;
+
+        DeliverTouchEvent(dev, ti, ev, listener, client, win, grab, mask);
+    }
+}
+
+/**
+ * Attempts to deliver a gesture event to the given client.
+ */
+static Bool
+DeliverOneGestureEvent(ClientPtr client, DeviceIntPtr dev, GestureInfoPtr gi,
+                       GrabPtr grab, WindowPtr win, InternalEvent *ev)
+{
+    int err;
+    xEvent *xi2;
+    Mask filter;
+    Window child = DeepestSpriteWin(&gi->sprite)->drawable.id;
+
+    /* If we fail here, we're going to leave a client hanging. */
+    err = EventToXI2(ev, &xi2);
+    if (err != Success)
+        FatalError("[Xi] %s: XI2 conversion failed in %s"
+                   " (%d)\n", dev->name, __func__, err);
+
+    FixUpEventFromWindow(&gi->sprite, xi2, win, child, FALSE);
+    filter = GetEventFilter(dev, xi2);
+    if (XaceHook(XACE_RECEIVE_ACCESS, client, win, xi2, 1) != Success)
+        return FALSE;
+    err = TryClientEvents(client, dev, xi2, 1, filter, filter, NullGrab);
+    free(xi2);
+
+    /* Returning the value from TryClientEvents isn't useful, since all our
+     * resource-gone cleanups will update the delivery list anyway. */
+    return TRUE;
+}
+
+/**
+ * Given a gesture event and a potential listener, retrieve info needed for processing the event.
+ *
+ * @param dev The device generating the gesture event.
+ * @param ev The gesture event to process.
+ * @param listener The gesture event listener that may receive the gesture event.
+ * @param[out] client The client that should receive the gesture event.
+ * @param[out] win The window to deliver the event on.
+ * @param[out] grab The grab to deliver the event through, if any.
+ * @return TRUE if an event should be delivered to the listener, FALSE
+ *         otherwise.
+ */
+static Bool
+RetrieveGestureDeliveryData(DeviceIntPtr dev, InternalEvent *ev, GestureListener* listener,
+                            ClientPtr *client, WindowPtr *win, GrabPtr *grab)
+{
+    int rc;
+    int evtype;
+    InputClients *iclients = NULL;
+    *grab = NULL;
+
+    if (listener->type == GESTURE_LISTENER_GRAB ||
+        listener->type == GESTURE_LISTENER_NONGESTURE_GRAB) {
+        *grab = listener->grab;
+
+        BUG_RETURN_VAL(!*grab, FALSE);
+
+        *client = rClient(*grab);
+        *win = (*grab)->window;
+    }
+    else {
+        rc = dixLookupResourceByType((void **) win, listener->listener, listener->resource_type,
+                                     serverClient, DixSendAccess);
+        if (rc != Success)
+            return FALSE;
+
+        /* note that we only will have XI2 listeners as
+           listener->type == GESTURE_LISTENER_REGULAR */
+        evtype = GetXI2Type(ev->any.type);
+
+        nt_list_for_each_entry(iclients, wOtherInputMasks(*win)->inputClients, next)
+            if (xi2mask_isset(iclients->xi2mask, dev, evtype))
+                break;
+
+        BUG_RETURN_VAL(!iclients, FALSE);
+
+        *client = rClient(iclients);
+    }
+
+    return TRUE;
+}
+
+/**
+ * Delivers a gesture to the owner, if possible and needed. Returns whether
+ * an event was delivered.
+ */
+Bool
+DeliverGestureEventToOwner(DeviceIntPtr dev, GestureInfoPtr gi, InternalEvent *ev)
+{
+    GrabPtr grab = NULL;
+    ClientPtr client;
+    WindowPtr win;
+
+    if (!gi->has_listener || gi->listener.type == GESTURE_LISTENER_NONGESTURE_GRAB) {
+        return 0;
+    }
+
+    if (!RetrieveGestureDeliveryData(dev, ev, &gi->listener, &client, &win, &grab))
+        return 0;
+
+    ev->gesture_event.deviceid = dev->id;
+
+    return DeliverOneGestureEvent(client, dev, gi, grab, win, ev);
+}
+
+int
+InitProximityClassDeviceStruct(DeviceIntPtr dev)
+{
+    ProximityClassPtr proxc;
+
+    BUG_RETURN_VAL(dev == NULL, FALSE);
+    BUG_RETURN_VAL(dev->proximity != NULL, FALSE);
+
+    proxc = (ProximityClassPtr) malloc(sizeof(ProximityClassRec));
+    if (!proxc)
+        return FALSE;
+    proxc->sourceid = dev->id;
+    proxc->in_proximity = TRUE;
+    dev->proximity = proxc;
+    return TRUE;
+}
+
+/**
+ * Initialise the device's valuators. The memory must already be allocated,
+ * this function merely inits the matching axis (specified through axnum) to
+ * sane values.
+ *
+ * It is a condition that (minval < maxval).
+ *
+ * @see InitValuatorClassDeviceStruct
+ */
+Bool
+InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval,
+                       int maxval, int resolution, int min_res, int max_res,
+                       int mode)
+{
+    AxisInfoPtr ax;
+
+    BUG_RETURN_VAL(dev == NULL, FALSE);
+    BUG_RETURN_VAL(dev->valuator == NULL, FALSE);
+    BUG_RETURN_VAL(axnum >= dev->valuator->numAxes, FALSE);
+    BUG_RETURN_VAL(minval > maxval && mode == Absolute, FALSE);
+
+    ax = dev->valuator->axes + axnum;
+
+    ax->min_value = minval;
+    ax->max_value = maxval;
+    ax->resolution = resolution;
+    ax->min_resolution = min_res;
+    ax->max_resolution = max_res;
+    ax->label = label;
+    ax->mode = mode;
+
+    if (mode & OutOfProximity)
+        dev->proximity->in_proximity = FALSE;
+
+    return SetScrollValuator(dev, axnum, SCROLL_TYPE_NONE, 0, SCROLL_FLAG_NONE);
+}
+
+/**
+ * Set the given axis number as a scrolling valuator.
+ */
+Bool
+SetScrollValuator(DeviceIntPtr dev, int axnum, enum ScrollType type,
+                  double increment, int flags)
+{
+    AxisInfoPtr ax;
+    int *current_ax;
+    InternalEvent dce;
+    DeviceIntPtr master;
+
+    BUG_RETURN_VAL(dev == NULL, FALSE);
+    BUG_RETURN_VAL(dev->valuator == NULL, FALSE);
+    BUG_RETURN_VAL(axnum >= dev->valuator->numAxes, FALSE);
+
+    switch (type) {
+    case SCROLL_TYPE_VERTICAL:
+        current_ax = &dev->valuator->v_scroll_axis;
+        break;
+    case SCROLL_TYPE_HORIZONTAL:
+        current_ax = &dev->valuator->h_scroll_axis;
+        break;
+    case SCROLL_TYPE_NONE:
+        ax = &dev->valuator->axes[axnum];
+        ax->scroll.type = type;
+        return TRUE;
+    default:
+        return FALSE;
+    }
+
+    if (increment == 0.0)
+        return FALSE;
+
+    if (*current_ax != -1 && axnum != *current_ax) {
+        ax = &dev->valuator->axes[*current_ax];
+        if (ax->scroll.type == type &&
+            (flags & SCROLL_FLAG_PREFERRED) &&
+            (ax->scroll.flags & SCROLL_FLAG_PREFERRED))
+            return FALSE;
+    }
+    *current_ax = axnum;
+
+    ax = &dev->valuator->axes[axnum];
+    ax->scroll.type = type;
+    ax->scroll.increment = increment;
+    ax->scroll.flags = flags;
+
+    master = GetMaster(dev, MASTER_ATTACHED);
+    CreateClassesChangedEvent(&dce, master, dev,
+                              DEVCHANGE_POINTER_EVENT |
+                              DEVCHANGE_DEVICE_CHANGE);
+    XISendDeviceChangedEvent(dev, &dce.changed_event);
+
+    /* if the current slave is us, update the master. If not, we'll update
+     * whenever the next slave switch happens anyway. CMDC sends the event
+     * for us */
+    if (master && master->lastSlave == dev)
+        ChangeMasterDeviceClasses(master, &dce.changed_event);
+
+    return TRUE;
+}
+
+int
+CheckGrabValues(ClientPtr client, GrabParameters *param)
+{
+    if (param->grabtype != CORE &&
+        param->grabtype != XI && param->grabtype != XI2) {
+        ErrorF("[Xi] grabtype is invalid. This is a bug.\n");
+        return BadImplementation;
+    }
+
+    if ((param->this_device_mode != GrabModeSync) &&
+        (param->this_device_mode != GrabModeAsync) &&
+        (param->this_device_mode != XIGrabModeTouch)) {
+        client->errorValue = param->this_device_mode;
+        return BadValue;
+    }
+    if ((param->other_devices_mode != GrabModeSync) &&
+        (param->other_devices_mode != GrabModeAsync) &&
+        (param->other_devices_mode != XIGrabModeTouch)) {
+        client->errorValue = param->other_devices_mode;
+        return BadValue;
+    }
+
+    if (param->modifiers != AnyModifier &&
+        param->modifiers != XIAnyModifier &&
+        (param->modifiers & ~AllModifiersMask)) {
+        client->errorValue = param->modifiers;
+        return BadValue;
+    }
+
+    if ((param->ownerEvents != xFalse) && (param->ownerEvents != xTrue)) {
+        client->errorValue = param->ownerEvents;
+        return BadValue;
+    }
+    return Success;
+}
+
+int
+GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device,
+           int button, GrabParameters *param, enum InputLevel grabtype,
+           GrabMask *mask)
+{
+    WindowPtr pWin, confineTo;
+    CursorPtr cursor;
+    GrabPtr grab;
+    int rc, type = -1;
+    Mask access_mode = DixGrabAccess;
+
+    rc = CheckGrabValues(client, param);
+    if (rc != Success)
+        return rc;
+    if (param->confineTo == None)
+        confineTo = NullWindow;
+    else {
+        rc = dixLookupWindow(&confineTo, param->confineTo, client,
+                             DixSetAttrAccess);
+        if (rc != Success)
+            return rc;
+    }
+    if (param->cursor == None)
+        cursor = NullCursor;
+    else {
+        rc = dixLookupResourceByType((void **) &cursor, param->cursor,
+                                     RT_CURSOR, client, DixUseAccess);
+        if (rc != Success) {
+            client->errorValue = param->cursor;
+            return rc;
+        }
+        access_mode |= DixForceAccess;
+    }
+    if (param->this_device_mode == GrabModeSync ||
+        param->other_devices_mode == GrabModeSync)
+        access_mode |= DixFreezeAccess;
+    rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode);
+    if (rc != Success)
+        return rc;
+    rc = dixLookupWindow(&pWin, param->grabWindow, client, DixSetAttrAccess);
+    if (rc != Success)
+        return rc;
+
+    if (grabtype == XI)
+        type = DeviceButtonPress;
+    else if (grabtype == XI2)
+        type = XI_ButtonPress;
+
+    grab = CreateGrab(client->index, dev, modifier_device, pWin, grabtype,
+                      mask, param, type, button, confineTo, cursor);
+    if (!grab)
+        return BadAlloc;
+    return AddPassiveGrabToList(client, grab);
+}
+
+/**
+ * Grab the given key.
+ */
+int
+GrabKey(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device,
+        int key, GrabParameters *param, enum InputLevel grabtype,
+        GrabMask *mask)
+{
+    WindowPtr pWin;
+    GrabPtr grab;
+    KeyClassPtr k = dev->key;
+    Mask access_mode = DixGrabAccess;
+    int rc, type = -1;
+
+    rc = CheckGrabValues(client, param);
+    if (rc != Success)
+        return rc;
+    if ((dev->id != XIAllDevices && dev->id != XIAllMasterDevices) && k == NULL)
+        return BadMatch;
+    if (grabtype == XI) {
+        if ((key > k->xkbInfo->desc->max_key_code ||
+             key < k->xkbInfo->desc->min_key_code)
+            && (key != AnyKey)) {
+            client->errorValue = key;
+            return BadValue;
+        }
+        type = DeviceKeyPress;
+    }
+    else if (grabtype == XI2)
+        type = XI_KeyPress;
+
+    rc = dixLookupWindow(&pWin, param->grabWindow, client, DixSetAttrAccess);
+    if (rc != Success)
+        return rc;
+    if (param->this_device_mode == GrabModeSync ||
+        param->other_devices_mode == GrabModeSync)
+        access_mode |= DixFreezeAccess;
+    rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode);
+    if (rc != Success)
+        return rc;
+
+    grab = CreateGrab(client->index, dev, modifier_device, pWin, grabtype,
+                      mask, param, type, key, NULL, NULL);
+    if (!grab)
+        return BadAlloc;
+    return AddPassiveGrabToList(client, grab);
+}
+
+/* Enter/FocusIn grab */
+int
+GrabWindow(ClientPtr client, DeviceIntPtr dev, int type,
+           GrabParameters *param, GrabMask *mask)
+{
+    WindowPtr pWin;
+    CursorPtr cursor;
+    GrabPtr grab;
+    Mask access_mode = DixGrabAccess;
+    int rc;
+
+    rc = CheckGrabValues(client, param);
+    if (rc != Success)
+        return rc;
+
+    rc = dixLookupWindow(&pWin, param->grabWindow, client, DixSetAttrAccess);
+    if (rc != Success)
+        return rc;
+    if (param->cursor == None)
+        cursor = NullCursor;
+    else {
+        rc = dixLookupResourceByType((void **) &cursor, param->cursor,
+                                     RT_CURSOR, client, DixUseAccess);
+        if (rc != Success) {
+            client->errorValue = param->cursor;
+            return rc;
+        }
+        access_mode |= DixForceAccess;
+    }
+    if (param->this_device_mode == GrabModeSync ||
+        param->other_devices_mode == GrabModeSync)
+        access_mode |= DixFreezeAccess;
+    rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode);
+    if (rc != Success)
+        return rc;
+
+    grab = CreateGrab(client->index, dev, dev, pWin, XI2,
+                      mask, param,
+                      (type == XIGrabtypeEnter) ? XI_Enter : XI_FocusIn, 0,
+                      NULL, cursor);
+
+    if (!grab)
+        return BadAlloc;
+
+    return AddPassiveGrabToList(client, grab);
+}
+
+/* Touch grab */
+int
+GrabTouchOrGesture(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr mod_dev,
+                   int type, GrabParameters *param, GrabMask *mask)
+{
+    WindowPtr pWin;
+    GrabPtr grab;
+    int rc;
+
+    rc = CheckGrabValues(client, param);
+    if (rc != Success)
+        return rc;
+
+    rc = dixLookupWindow(&pWin, param->grabWindow, client, DixSetAttrAccess);
+    if (rc != Success)
+        return rc;
+    rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixGrabAccess);
+    if (rc != Success)
+        return rc;
+
+    grab = CreateGrab(client->index, dev, mod_dev, pWin, XI2,
+                      mask, param, type, 0, NullWindow, NullCursor);
+    if (!grab)
+        return BadAlloc;
+
+    return AddPassiveGrabToList(client, grab);
+}
+
+int
+SelectForWindow(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client,
+                Mask mask, Mask exclusivemasks)
+{
+    int mskidx = dev->id;
+    int i, ret;
+    Mask check;
+    InputClientsPtr others;
+
+    check = (mask & exclusivemasks);
+    if (wOtherInputMasks(pWin)) {
+        if (check & wOtherInputMasks(pWin)->inputEvents[mskidx]) {
+            /* It is illegal for two different clients to select on any of
+             * the events for maskcheck. However, it is OK, for some client
+             * to continue selecting on one of those events.
+             */
+            for (others = wOtherInputMasks(pWin)->inputClients; others;
+                 others = others->next) {
+                if (!SameClient(others, client) && (check &
+                                                    others->mask[mskidx]))
+                    return BadAccess;
+            }
+        }
+        for (others = wOtherInputMasks(pWin)->inputClients; others;
+             others = others->next) {
+            if (SameClient(others, client)) {
+                check = others->mask[mskidx];
+                others->mask[mskidx] = mask;
+                if (mask == 0) {
+                    for (i = 0; i < EMASKSIZE; i++)
+                        if (i != mskidx && others->mask[i] != 0)
+                            break;
+                    if (i == EMASKSIZE) {
+                        RecalculateDeviceDeliverableEvents(pWin);
+                        if (ShouldFreeInputMasks(pWin, FALSE))
+                            FreeResource(others->resource, RT_NONE);
+                        return Success;
+                    }
+                }
+                goto maskSet;
+            }
+        }
+    }
+    check = 0;
+    if ((ret = AddExtensionClient(pWin, client, mask, mskidx)) != Success)
+        return ret;
+ maskSet:
+    if (dev->valuator)
+        if ((dev->valuator->motionHintWindow == pWin) &&
+            (mask & DevicePointerMotionHintMask) &&
+            !(check & DevicePointerMotionHintMask) && !dev->deviceGrab.grab)
+            dev->valuator->motionHintWindow = NullWindow;
+    RecalculateDeviceDeliverableEvents(pWin);
+    return Success;
+}
+
+static void
+FreeInputClient(InputClientsPtr * other)
+{
+    xi2mask_free(&(*other)->xi2mask);
+    free(*other);
+    *other = NULL;
+}
+
+static InputClientsPtr
+AllocInputClient(void)
+{
+    return calloc(1, sizeof(InputClients));
+}
+
+int
+AddExtensionClient(WindowPtr pWin, ClientPtr client, Mask mask, int mskidx)
+{
+    InputClientsPtr others;
+
+    if (!pWin->optional && !MakeWindowOptional(pWin))
+        return BadAlloc;
+    others = AllocInputClient();
+    if (!others)
+        return BadAlloc;
+    if (!pWin->optional->inputMasks && !MakeInputMasks(pWin))
+        goto bail;
+    others->xi2mask = xi2mask_new();
+    if (!others->xi2mask)
+        goto bail;
+    others->mask[mskidx] = mask;
+    others->resource = FakeClientID(client->index);
+    others->next = pWin->optional->inputMasks->inputClients;
+    pWin->optional->inputMasks->inputClients = others;
+    if (!AddResource(others->resource, RT_INPUTCLIENT, (void *) pWin))
+        goto bail;
+    return Success;
+
+ bail:
+    FreeInputClient(&others);
+    return BadAlloc;
+}
+
+static Bool
+MakeInputMasks(WindowPtr pWin)
+{
+    struct _OtherInputMasks *imasks;
+
+    imasks = calloc(1, sizeof(struct _OtherInputMasks));
+    if (!imasks)
+        return FALSE;
+    imasks->xi2mask = xi2mask_new();
+    if (!imasks->xi2mask) {
+        free(imasks);
+        return FALSE;
+    }
+    pWin->optional->inputMasks = imasks;
+    return TRUE;
+}
+
+static void
+FreeInputMask(OtherInputMasks ** imask)
+{
+    xi2mask_free(&(*imask)->xi2mask);
+    free(*imask);
+    *imask = NULL;
+}
+
+#define XIPropagateMask (KeyPressMask | \
+                         KeyReleaseMask | \
+                         ButtonPressMask | \
+                         ButtonReleaseMask | \
+                         PointerMotionMask)
+
+void
+RecalculateDeviceDeliverableEvents(WindowPtr pWin)
+{
+    InputClientsPtr others;
+    struct _OtherInputMasks *inputMasks;        /* default: NULL */
+    WindowPtr pChild, tmp;
+    int i;
+
+    pChild = pWin;
+    while (1) {
+        if ((inputMasks = wOtherInputMasks(pChild)) != 0) {
+            xi2mask_zero(inputMasks->xi2mask, -1);
+            for (others = inputMasks->inputClients; others;
+                 others = others->next) {
+                for (i = 0; i < EMASKSIZE; i++)
+                    inputMasks->inputEvents[i] |= others->mask[i];
+                xi2mask_merge(inputMasks->xi2mask, others->xi2mask);
+            }
+            for (i = 0; i < EMASKSIZE; i++)
+                inputMasks->deliverableEvents[i] = inputMasks->inputEvents[i];
+            for (tmp = pChild->parent; tmp; tmp = tmp->parent)
+                if (wOtherInputMasks(tmp))
+                    for (i = 0; i < EMASKSIZE; i++)
+                        inputMasks->deliverableEvents[i] |=
+                            (wOtherInputMasks(tmp)->deliverableEvents[i]
+                             & ~inputMasks->dontPropagateMask[i] &
+                             XIPropagateMask);
+        }
+        if (pChild->firstChild) {
+            pChild = pChild->firstChild;
+            continue;
+        }
+        while (!pChild->nextSib && (pChild != pWin))
+            pChild = pChild->parent;
+        if (pChild == pWin)
+            break;
+        pChild = pChild->nextSib;
+    }
+}
+
+int
+InputClientGone(WindowPtr pWin, XID id)
+{
+    InputClientsPtr other, prev;
+
+    if (!wOtherInputMasks(pWin))
+        return Success;
+    prev = 0;
+    for (other = wOtherInputMasks(pWin)->inputClients; other;
+         other = other->next) {
+        if (other->resource == id) {
+            if (prev) {
+                prev->next = other->next;
+                FreeInputClient(&other);
+            }
+            else if (!(other->next)) {
+                if (ShouldFreeInputMasks(pWin, TRUE)) {
+                    OtherInputMasks *mask = wOtherInputMasks(pWin);
+
+                    mask->inputClients = other->next;
+                    FreeInputMask(&mask);
+                    pWin->optional->inputMasks = (OtherInputMasks *) NULL;
+                    CheckWindowOptionalNeed(pWin);
+                    FreeInputClient(&other);
+                }
+                else {
+                    other->resource = FakeClientID(0);
+                    if (!AddResource(other->resource, RT_INPUTCLIENT,
+                                     (void *) pWin))
+                        return BadAlloc;
+                }
+            }
+            else {
+                wOtherInputMasks(pWin)->inputClients = other->next;
+                FreeInputClient(&other);
+            }
+            RecalculateDeviceDeliverableEvents(pWin);
+            return Success;
+        }
+        prev = other;
+    }
+    FatalError("client not on device event list");
+}
+
+/**
+ * Search for window in each touch trace for each device. Remove the window
+ * and all its subwindows from the trace when found. The initial window
+ * order is preserved.
+ */
+void
+WindowGone(WindowPtr win)
+{
+    DeviceIntPtr dev;
+
+    for (dev = inputInfo.devices; dev; dev = dev->next) {
+        TouchClassPtr t = dev->touch;
+        int i;
+
+        if (!t)
+            continue;
+
+        for (i = 0; i < t->num_touches; i++) {
+            SpritePtr sprite = &t->touches[i].sprite;
+            int j;
+
+            for (j = 0; j < sprite->spriteTraceGood; j++) {
+                if (sprite->spriteTrace[j] == win) {
+                    sprite->spriteTraceGood = j;
+                    break;
+                }
+            }
+        }
+    }
+}
+
+int
+SendEvent(ClientPtr client, DeviceIntPtr d, Window dest, Bool propagate,
+          xEvent *ev, Mask mask, int count)
+{
+    WindowPtr pWin;
+    WindowPtr effectiveFocus = NullWindow;      /* only set if dest==InputFocus */
+    WindowPtr spriteWin = GetSpriteWindow(d);
+
+    if (dest == PointerWindow)
+        pWin = spriteWin;
+    else if (dest == InputFocus) {
+        WindowPtr inputFocus;
+
+        if (!d->focus)
+            inputFocus = spriteWin;
+        else
+            inputFocus = d->focus->win;
+
+        if (inputFocus == FollowKeyboardWin)
+            inputFocus = inputInfo.keyboard->focus->win;
+
+        if (inputFocus == NoneWin)
+            return Success;
+
+        /* If the input focus is PointerRootWin, send the event to where
+         * the pointer is if possible, then perhaps propagate up to root. */
+        if (inputFocus == PointerRootWin)
+            inputFocus = GetCurrentRootWindow(d);
+
+        if (IsParent(inputFocus, spriteWin)) {
+            effectiveFocus = inputFocus;
+            pWin = spriteWin;
+        }
+        else
+            effectiveFocus = pWin = inputFocus;
+    }
+    else
+        dixLookupWindow(&pWin, dest, client, DixSendAccess);
+    if (!pWin)
+        return BadWindow;
+    if ((propagate != xFalse) && (propagate != xTrue)) {
+        client->errorValue = propagate;
+        return BadValue;
+    }
+    ev->u.u.type |= 0x80;
+    if (propagate) {
+        for (; pWin; pWin = pWin->parent) {
+            if (DeliverEventsToWindow(d, pWin, ev, count, mask, NullGrab))
+                return Success;
+            if (pWin == effectiveFocus)
+                return Success;
+            if (wOtherInputMasks(pWin))
+                mask &= ~wOtherInputMasks(pWin)->dontPropagateMask[d->id];
+            if (!mask)
+                break;
+        }
+    }
+    else if (!XaceHook(XACE_SEND_ACCESS, client, NULL, pWin, ev, count))
+        DeliverEventsToWindow(d, pWin, ev, count, mask, NullGrab);
+    return Success;
+}
+
+int
+SetButtonMapping(ClientPtr client, DeviceIntPtr dev, int nElts, BYTE * map)
+{
+    int i;
+    ButtonClassPtr b = dev->button;
+
+    if (b == NULL)
+        return BadMatch;
+
+    if (nElts != b->numButtons) {
+        client->errorValue = nElts;
+        return BadValue;
+    }
+    if (BadDeviceMap(&map[0], nElts, 1, 255, &client->errorValue))
+        return BadValue;
+    for (i = 0; i < nElts; i++)
+        if ((b->map[i + 1] != map[i]) && BitIsOn(b->down, i + 1))
+            return MappingBusy;
+    for (i = 0; i < nElts; i++)
+        b->map[i + 1] = map[i];
+    return Success;
+}
+
+int
+ChangeKeyMapping(ClientPtr client,
+                 DeviceIntPtr dev,
+                 unsigned len,
+                 int type,
+                 KeyCode firstKeyCode,
+                 CARD8 keyCodes, CARD8 keySymsPerKeyCode, KeySym * map)
+{
+    KeySymsRec keysyms;
+    KeyClassPtr k = dev->key;
+
+    if (k == NULL)
+        return BadMatch;
+
+    if (len != (keyCodes * keySymsPerKeyCode))
+        return BadLength;
+
+    if ((firstKeyCode < k->xkbInfo->desc->min_key_code) ||
+        (firstKeyCode + keyCodes - 1 > k->xkbInfo->desc->max_key_code)) {
+        client->errorValue = firstKeyCode;
+        return BadValue;
+    }
+    if (keySymsPerKeyCode == 0) {
+        client->errorValue = 0;
+        return BadValue;
+    }
+    keysyms.minKeyCode = firstKeyCode;
+    keysyms.maxKeyCode = firstKeyCode + keyCodes - 1;
+    keysyms.mapWidth = keySymsPerKeyCode;
+    keysyms.map = map;
+
+    XkbApplyMappingChange(dev, &keysyms, firstKeyCode, keyCodes, NULL,
+                          serverClient);
+
+    return Success;
+}
+
+static void
+DeleteDeviceFromAnyExtEvents(WindowPtr pWin, DeviceIntPtr dev)
+{
+    WindowPtr parent;
+
+    /* Deactivate any grabs performed on this window, before making
+     * any input focus changes.
+     * Deactivating a device grab should cause focus events. */
+
+    if (dev->deviceGrab.grab && (dev->deviceGrab.grab->window == pWin))
+        (*dev->deviceGrab.DeactivateGrab) (dev);
+
+    /* If the focus window is a root window (ie. has no parent)
+     * then don't delete the focus from it. */
+
+    if (dev->focus && (pWin == dev->focus->win) && (pWin->parent != NullWindow)) {
+        int focusEventMode = NotifyNormal;
+
+        /* If a grab is in progress, then alter the mode of focus events. */
+
+        if (dev->deviceGrab.grab)
+            focusEventMode = NotifyWhileGrabbed;
+
+        switch (dev->focus->revert) {
+        case RevertToNone:
+            if (!ActivateFocusInGrab(dev, pWin, NoneWin))
+                DoFocusEvents(dev, pWin, NoneWin, focusEventMode);
+            dev->focus->win = NoneWin;
+            dev->focus->traceGood = 0;
+            break;
+        case RevertToParent:
+            parent = pWin;
+            do {
+                parent = parent->parent;
+                dev->focus->traceGood--;
+            }
+            while (!parent->realized);
+            if (!ActivateFocusInGrab(dev, pWin, parent))
+                DoFocusEvents(dev, pWin, parent, focusEventMode);
+            dev->focus->win = parent;
+            dev->focus->revert = RevertToNone;
+            break;
+        case RevertToPointerRoot:
+            if (!ActivateFocusInGrab(dev, pWin, PointerRootWin))
+                DoFocusEvents(dev, pWin, PointerRootWin, focusEventMode);
+            dev->focus->win = PointerRootWin;
+            dev->focus->traceGood = 0;
+            break;
+        case RevertToFollowKeyboard:
+        {
+            DeviceIntPtr kbd = GetMaster(dev, MASTER_KEYBOARD);
+
+            if (!kbd || (kbd == dev && kbd != inputInfo.keyboard))
+                kbd = inputInfo.keyboard;
+            if (kbd->focus->win) {
+                if (!ActivateFocusInGrab(dev, pWin, kbd->focus->win))
+                    DoFocusEvents(dev, pWin, kbd->focus->win, focusEventMode);
+                dev->focus->win = FollowKeyboardWin;
+                dev->focus->traceGood = 0;
+            }
+            else {
+                if (!ActivateFocusInGrab(dev, pWin, NoneWin))
+                    DoFocusEvents(dev, pWin, NoneWin, focusEventMode);
+                dev->focus->win = NoneWin;
+                dev->focus->traceGood = 0;
+            }
+        }
+            break;
+        }
+    }
+
+    if (dev->valuator)
+        if (dev->valuator->motionHintWindow == pWin)
+            dev->valuator->motionHintWindow = NullWindow;
+}
+
+void
+DeleteWindowFromAnyExtEvents(WindowPtr pWin, Bool freeResources)
+{
+    int i;
+    DeviceIntPtr dev;
+    InputClientsPtr ic;
+    struct _OtherInputMasks *inputMasks;
+
+    for (dev = inputInfo.devices; dev; dev = dev->next) {
+        DeleteDeviceFromAnyExtEvents(pWin, dev);
+    }
+
+    for (dev = inputInfo.off_devices; dev; dev = dev->next)
+        DeleteDeviceFromAnyExtEvents(pWin, dev);
+
+    if (freeResources)
+        while ((inputMasks = wOtherInputMasks(pWin)) != 0) {
+            ic = inputMasks->inputClients;
+            for (i = 0; i < EMASKSIZE; i++)
+                inputMasks->dontPropagateMask[i] = 0;
+            FreeResource(ic->resource, RT_NONE);
+        }
+}
+
+int
+MaybeSendDeviceMotionNotifyHint(deviceKeyButtonPointer *pEvents, Mask mask)
+{
+    DeviceIntPtr dev;
+
+    dixLookupDevice(&dev, pEvents->deviceid & DEVICE_BITS, serverClient,
+                    DixReadAccess);
+    if (!dev)
+        return 0;
+
+    if (pEvents->type == DeviceMotionNotify) {
+        if (mask & DevicePointerMotionHintMask) {
+            if (WID(dev->valuator->motionHintWindow) == pEvents->event) {
+                return 1;       /* don't send, but pretend we did */
+            }
+            pEvents->detail = NotifyHint;
+        }
+        else {
+            pEvents->detail = NotifyNormal;
+        }
+    }
+    return 0;
+}
+
+void
+CheckDeviceGrabAndHintWindow(WindowPtr pWin, int type,
+                             deviceKeyButtonPointer *xE, GrabPtr grab,
+                             ClientPtr client, Mask deliveryMask)
+{
+    DeviceIntPtr dev;
+
+    dixLookupDevice(&dev, xE->deviceid & DEVICE_BITS, serverClient,
+                    DixGrabAccess);
+    if (!dev)
+        return;
+
+    if (type == DeviceMotionNotify)
+        dev->valuator->motionHintWindow = pWin;
+    else if ((type == DeviceButtonPress) && (!grab) &&
+             (deliveryMask & DeviceButtonGrabMask)) {
+        GrabPtr tempGrab;
+
+        tempGrab = AllocGrab(NULL);
+        if (!tempGrab)
+            return;
+
+        tempGrab->device = dev;
+        tempGrab->resource = client->clientAsMask;
+        tempGrab->window = pWin;
+        tempGrab->ownerEvents =
+            (deliveryMask & DeviceOwnerGrabButtonMask) ? TRUE : FALSE;
+        tempGrab->eventMask = deliveryMask;
+        tempGrab->keyboardMode = GrabModeAsync;
+        tempGrab->pointerMode = GrabModeAsync;
+        tempGrab->confineTo = NullWindow;
+        tempGrab->cursor = NullCursor;
+        tempGrab->next = NULL;
+        (*dev->deviceGrab.ActivateGrab) (dev, tempGrab, currentTime, TRUE);
+        FreeGrab(tempGrab);
+    }
+}
+
+static Mask
+DeviceEventMaskForClient(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
+{
+    InputClientsPtr other;
+
+    if (!wOtherInputMasks(pWin))
+        return 0;
+    for (other = wOtherInputMasks(pWin)->inputClients; other;
+         other = other->next) {
+        if (SameClient(other, client))
+            return other->mask[dev->id];
+    }
+    return 0;
+}
+
+void
+MaybeStopDeviceHint(DeviceIntPtr dev, ClientPtr client)
+{
+    WindowPtr pWin;
+    GrabPtr grab = dev->deviceGrab.grab;
+
+    pWin = dev->valuator->motionHintWindow;
+
+    if ((grab && SameClient(grab, client) &&
+         ((grab->eventMask & DevicePointerMotionHintMask) ||
+          (grab->ownerEvents &&
+           (DeviceEventMaskForClient(dev, pWin, client) &
+            DevicePointerMotionHintMask)))) ||
+        (!grab &&
+         (DeviceEventMaskForClient(dev, pWin, client) &
+          DevicePointerMotionHintMask)))
+        dev->valuator->motionHintWindow = NullWindow;
+}
+
+int
+DeviceEventSuppressForWindow(WindowPtr pWin, ClientPtr client, Mask mask,
+                             int maskndx)
+{
+    struct _OtherInputMasks *inputMasks = wOtherInputMasks(pWin);
+
+    if (mask & ~XIPropagateMask) {
+        client->errorValue = mask;
+        return BadValue;
+    }
+
+    if (mask == 0) {
+        if (inputMasks)
+            inputMasks->dontPropagateMask[maskndx] = mask;
+    }
+    else {
+        if (!inputMasks)
+            AddExtensionClient(pWin, client, 0, 0);
+        inputMasks = wOtherInputMasks(pWin);
+        inputMasks->dontPropagateMask[maskndx] = mask;
+    }
+    RecalculateDeviceDeliverableEvents(pWin);
+    if (ShouldFreeInputMasks(pWin, FALSE))
+        FreeResource(inputMasks->inputClients->resource, RT_NONE);
+    return Success;
+}
+
+Bool
+ShouldFreeInputMasks(WindowPtr pWin, Bool ignoreSelectedEvents)
+{
+    int i;
+    Mask allInputEventMasks = 0;
+    struct _OtherInputMasks *inputMasks = wOtherInputMasks(pWin);
+
+    for (i = 0; i < EMASKSIZE; i++)
+        allInputEventMasks |= inputMasks->dontPropagateMask[i];
+    if (!ignoreSelectedEvents)
+        for (i = 0; i < EMASKSIZE; i++)
+            allInputEventMasks |= inputMasks->inputEvents[i];
+    if (allInputEventMasks == 0)
+        return TRUE;
+    else
+        return FALSE;
+}
+
+/***********************************************************************
+ *
+ * Walk through the window tree, finding all clients that want to know
+ * about the Event.
+ *
+ */
+
+static void
+FindInterestedChildren(DeviceIntPtr dev, WindowPtr p1, Mask mask,
+                       xEvent *ev, int count)
+{
+    WindowPtr p2;
+
+    while (p1) {
+        p2 = p1->firstChild;
+        DeliverEventsToWindow(dev, p1, ev, count, mask, NullGrab);
+        FindInterestedChildren(dev, p2, mask, ev, count);
+        p1 = p1->nextSib;
+    }
+}
+
+/***********************************************************************
+ *
+ * Send an event to interested clients in all windows on all screens.
+ *
+ */
+
+void
+SendEventToAllWindows(DeviceIntPtr dev, Mask mask, xEvent *ev, int count)
+{
+    int i;
+    WindowPtr pWin, p1;
+
+    for (i = 0; i < screenInfo.numScreens; i++) {
+        pWin = screenInfo.screens[i]->root;
+        if (!pWin)
+            continue;
+        DeliverEventsToWindow(dev, pWin, ev, count, mask, NullGrab);
+        p1 = pWin->firstChild;
+        FindInterestedChildren(dev, p1, mask, ev, count);
+    }
+}
+
+/**
+ * Set the XI2 mask for the given client on the given window.
+ * @param dev The device to set the mask for.
+ * @param win The window to set the mask on.
+ * @param client The client setting the mask.
+ * @param len Number of bytes in mask.
+ * @param mask Event mask in the form of (1 << eventtype)
+ */
+int
+XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client,
+               unsigned int len, unsigned char *mask)
+{
+    OtherInputMasks *masks;
+    InputClientsPtr others = NULL;
+
+    masks = wOtherInputMasks(win);
+    if (masks) {
+        for (others = wOtherInputMasks(win)->inputClients; others;
+             others = others->next) {
+            if (SameClient(others, client)) {
+                xi2mask_zero(others->xi2mask, dev->id);
+                break;
+            }
+        }
+    }
+
+    if (len && !others) {
+        if (AddExtensionClient(win, client, 0, 0) != Success)
+            return BadAlloc;
+        others = wOtherInputMasks(win)->inputClients;
+    }
+
+    if (others) {
+        xi2mask_zero(others->xi2mask, dev->id);
+        len = min(len, xi2mask_mask_size(others->xi2mask));
+    }
+
+    if (len) {
+        xi2mask_set_one_mask(others->xi2mask, dev->id, mask, len);
+    }
+
+    RecalculateDeviceDeliverableEvents(win);
+
+    return Success;
+}
Index: xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new/Xi
===================================================================
--- xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new/Xi	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new/Xi	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new/Xi
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new/dix/getevents.c
===================================================================
--- xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new/dix/getevents.c	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new/dix/getevents.c	(revision 5)
@@ -0,0 +1,2246 @@
+/*
+ * Copyright © 2006 Nokia Corporation
+ * Copyright © 2006-2007 Daniel Stone
+ * Copyright © 2008 Red Hat, Inc.
+ * Copyright © 2011 The Chromium Authors
+ *
+ * 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: Daniel Stone <daniel@fooishbar.org>
+ *          Peter Hutterer <peter.hutterer@who-t.net>
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/X.h>
+#include <X11/keysym.h>
+#include <X11/Xproto.h>
+#include <math.h>
+#include <limits.h>
+
+#include "misc.h"
+#include "resource.h"
+#include "inputstr.h"
+#include "scrnintstr.h"
+#include "cursorstr.h"
+#include "dixstruct.h"
+#include "globals.h"
+#include "dixevents.h"
+#include "mipointer.h"
+#include "eventstr.h"
+#include "eventconvert.h"
+#include "inpututils.h"
+#include "mi.h"
+#include "windowstr.h"
+
+#include <X11/extensions/XKBproto.h>
+#include "xkbsrv.h"
+
+#ifdef PANORAMIX
+#include "panoramiX.h"
+#include "panoramiXsrv.h"
+#endif
+
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XI2.h>
+#include <X11/extensions/XIproto.h>
+#include <pixman.h>
+#include "exglobals.h"
+#include "exevents.h"
+#include "extnsionst.h"
+#include "listdev.h"            /* for sizing up DeviceClassesChangedEvent */
+#include "probes.h"
+
+/* Number of motion history events to store. */
+#define MOTION_HISTORY_SIZE 256
+
+/**
+ * InputEventList is the storage for input events generated by
+ * QueuePointerEvents, QueueKeyboardEvents, and QueueProximityEvents.
+ * This list is allocated on startup by the DIX.
+ */
+InternalEvent *InputEventList = NULL;
+
+/**
+ * Pick some arbitrary size for Xi motion history.
+ */
+int
+GetMotionHistorySize(void)
+{
+    return MOTION_HISTORY_SIZE;
+}
+
+void
+set_button_down(DeviceIntPtr pDev, int button, int type)
+{
+    if (type == BUTTON_PROCESSED)
+        SetBit(pDev->button->down, button);
+    else
+        SetBit(pDev->button->postdown, button);
+}
+
+void
+set_button_up(DeviceIntPtr pDev, int button, int type)
+{
+    if (type == BUTTON_PROCESSED)
+        ClearBit(pDev->button->down, button);
+    else
+        ClearBit(pDev->button->postdown, button);
+}
+
+Bool
+button_is_down(DeviceIntPtr pDev, int button, int type)
+{
+    Bool ret = FALSE;
+
+    if (type & BUTTON_PROCESSED)
+        ret = ret || BitIsOn(pDev->button->down, button);
+    if (type & BUTTON_POSTED)
+        ret = ret || BitIsOn(pDev->button->postdown, button);
+
+    return ret;
+}
+
+void
+set_key_down(DeviceIntPtr pDev, int key_code, int type)
+{
+    if (type == KEY_PROCESSED)
+        SetBit(pDev->key->down, key_code);
+    else
+        SetBit(pDev->key->postdown, key_code);
+}
+
+void
+set_key_up(DeviceIntPtr pDev, int key_code, int type)
+{
+    if (type == KEY_PROCESSED)
+        ClearBit(pDev->key->down, key_code);
+    else
+        ClearBit(pDev->key->postdown, key_code);
+}
+
+Bool
+key_is_down(DeviceIntPtr pDev, int key_code, int type)
+{
+    Bool ret = FALSE;
+
+    if (type & KEY_PROCESSED)
+        ret = ret || BitIsOn(pDev->key->down, key_code);
+    if (type & KEY_POSTED)
+        ret = ret || BitIsOn(pDev->key->postdown, key_code);
+
+    return ret;
+}
+
+static Bool
+key_autorepeats(DeviceIntPtr pDev, int key_code)
+{
+    return ! !(pDev->kbdfeed->ctrl.autoRepeats[key_code >> 3] &
+               (1 << (key_code & 7)));
+}
+
+static void
+init_touch_ownership(DeviceIntPtr dev, TouchOwnershipEvent *event, Time ms)
+{
+    memset(event, 0, sizeof(TouchOwnershipEvent));
+    event->header = ET_Internal;
+    event->type = ET_TouchOwnership;
+    event->length = sizeof(TouchOwnershipEvent);
+    event->time = ms;
+    event->deviceid = dev->id;
+}
+
+static void
+init_raw(DeviceIntPtr dev, RawDeviceEvent *event, Time ms, int type, int detail)
+{
+    memset(event, 0, sizeof(RawDeviceEvent));
+    event->header = ET_Internal;
+    event->length = sizeof(RawDeviceEvent);
+    switch (type) {
+    case MotionNotify:
+        event->type = ET_RawMotion;
+        break;
+    case ButtonPress:
+        event->type = ET_RawButtonPress;
+        break;
+    case ButtonRelease:
+        event->type = ET_RawButtonRelease;
+        break;
+    case KeyPress:
+        event->type = ET_RawKeyPress;
+        break;
+    case KeyRelease:
+        event->type = ET_RawKeyRelease;
+        break;
+    case XI_TouchBegin:
+        event->type = ET_RawTouchBegin;
+        break;
+    case XI_TouchUpdate:
+        event->type = ET_RawTouchUpdate;
+        break;
+    case XI_TouchEnd:
+        event->type = ET_RawTouchEnd;
+        break;
+    }
+    event->time = ms;
+    event->deviceid = dev->id;
+    event->sourceid = dev->id;
+    event->detail.button = detail;
+}
+
+static void
+set_raw_valuators(RawDeviceEvent *event, ValuatorMask *mask,
+                  BOOL use_unaccel, double *data)
+{
+    int i;
+
+    use_unaccel = use_unaccel && valuator_mask_has_unaccelerated(mask);
+
+    for (i = 0; i < valuator_mask_size(mask); i++) {
+        if (valuator_mask_isset(mask, i)) {
+            double v;
+
+            SetBit(event->valuators.mask, i);
+
+            if (use_unaccel)
+                v = valuator_mask_get_unaccelerated(mask, i);
+            else
+                v = valuator_mask_get_double(mask, i);
+
+            data[i] = v;
+        }
+    }
+}
+
+static void
+set_valuators(DeviceIntPtr dev, DeviceEvent *event, ValuatorMask *mask)
+{
+    int i;
+
+    /* Set the data to the previous value for unset absolute axes. The values
+     * may be used when sent as part of an XI 1.x valuator event. */
+    for (i = 0; i < valuator_mask_size(mask); i++) {
+        if (valuator_mask_isset(mask, i)) {
+            SetBit(event->valuators.mask, i);
+            if (valuator_get_mode(dev, i) == Absolute)
+                SetBit(event->valuators.mode, i);
+            event->valuators.data[i] = valuator_mask_get_double(mask, i);
+        }
+        else
+            event->valuators.data[i] = dev->valuator->axisVal[i];
+    }
+}
+
+void
+CreateClassesChangedEvent(InternalEvent *event,
+                          DeviceIntPtr master, DeviceIntPtr slave, int flags)
+{
+    int i;
+    DeviceChangedEvent *dce;
+    CARD32 ms = GetTimeInMillis();
+
+    dce = &event->changed_event;
+    memset(dce, 0, sizeof(DeviceChangedEvent));
+    dce->deviceid = slave->id;
+    dce->masterid = master ? master->id : 0;
+    dce->header = ET_Internal;
+    dce->length = sizeof(DeviceChangedEvent);
+    dce->type = ET_DeviceChanged;
+    dce->time = ms;
+    dce->flags = flags;
+    dce->sourceid = slave->id;
+
+    if (slave->button) {
+        dce->buttons.num_buttons = slave->button->numButtons;
+        for (i = 0; i < dce->buttons.num_buttons; i++)
+            dce->buttons.names[i] = slave->button->labels[i];
+    }
+    if (slave->valuator) {
+        dce->num_valuators = slave->valuator->numAxes;
+        for (i = 0; i < dce->num_valuators; i++) {
+            dce->valuators[i].min = slave->valuator->axes[i].min_value;
+            dce->valuators[i].max = slave->valuator->axes[i].max_value;
+            dce->valuators[i].resolution = slave->valuator->axes[i].resolution;
+            dce->valuators[i].mode = slave->valuator->axes[i].mode;
+            dce->valuators[i].name = slave->valuator->axes[i].label;
+            dce->valuators[i].scroll = slave->valuator->axes[i].scroll;
+            dce->valuators[i].value = slave->valuator->axisVal[i];
+        }
+    }
+    if (slave->key) {
+        dce->keys.min_keycode = slave->key->xkbInfo->desc->min_key_code;
+        dce->keys.max_keycode = slave->key->xkbInfo->desc->max_key_code;
+    }
+}
+
+/**
+ * Rescale the coord between the two axis ranges.
+ */
+static double
+rescaleValuatorAxis(double coord, AxisInfoPtr from, AxisInfoPtr to,
+                    double defmin, double defmax)
+{
+    double fmin = defmin, fmax = defmax;
+    double tmin = defmin, tmax = defmax;
+
+    if (from && from->min_value < from->max_value) {
+        fmin = from->min_value;
+        fmax = from->max_value + 1;
+    }
+    if (to && to->min_value < to->max_value) {
+        tmin = to->min_value;
+        tmax = to->max_value + 1;
+    }
+
+    if (fmin == tmin && fmax == tmax)
+        return coord;
+
+    if (fmax == fmin)           /* avoid division by 0 */
+        return 0.0;
+
+    return (coord - fmin) * (tmax - tmin) / (fmax - fmin) + tmin;
+}
+
+/**
+ * Update all coordinates when changing to a different SD
+ * to ensure that relative reporting will work as expected
+ * without loss of precision.
+ *
+ * pDev->last.valuators will be in absolute device coordinates after this
+ * function.
+ */
+static void
+updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev)
+{
+    /* master->last.valuators[0]/[1] is in desktop-wide coords and the actual
+     * position of the pointer */
+    pDev->last.valuators[0] = master->last.valuators[0];
+    pDev->last.valuators[1] = master->last.valuators[1];
+
+    if (!pDev->valuator)
+        return;
+
+    /* scale back to device coordinates */
+    if (pDev->valuator->numAxes > 0) {
+        pDev->last.valuators[0] = rescaleValuatorAxis(pDev->last.valuators[0],
+                                                      NULL,
+                                                      pDev->valuator->axes + 0,
+                                                      screenInfo.x,
+                                                      screenInfo.width);
+    }
+    if (pDev->valuator->numAxes > 1) {
+        pDev->last.valuators[1] = rescaleValuatorAxis(pDev->last.valuators[1],
+                                                      NULL,
+                                                      pDev->valuator->axes + 1,
+                                                      screenInfo.y,
+                                                      screenInfo.height);
+    }
+
+    /* other axes are left as-is */
+}
+
+/**
+ * Allocate the motion history buffer.
+ */
+void
+AllocateMotionHistory(DeviceIntPtr pDev)
+{
+    int size;
+
+    free(pDev->valuator->motion);
+
+    if (pDev->valuator->numMotionEvents < 1)
+        return;
+
+    /* An MD must have a motion history size large enough to keep all
+     * potential valuators, plus the respective range of the valuators.
+     * 3 * INT32 for (min_val, max_val, curr_val))
+     */
+    if (IsMaster(pDev))
+        size = sizeof(INT32) * 3 * MAX_VALUATORS;
+    else {
+        ValuatorClassPtr v = pDev->valuator;
+        int numAxes;
+
+        /* XI1 doesn't understand mixed mode devices */
+        for (numAxes = 0; numAxes < v->numAxes; numAxes++)
+            if (valuator_get_mode(pDev, numAxes) != valuator_get_mode(pDev, 0))
+                break;
+        size = sizeof(INT32) * numAxes;
+    }
+
+    size += sizeof(Time);
+
+    pDev->valuator->motion = calloc(pDev->valuator->numMotionEvents, size);
+    pDev->valuator->first_motion = 0;
+    pDev->valuator->last_motion = 0;
+    if (!pDev->valuator->motion)
+        ErrorF("[dix] %s: Failed to alloc motion history (%d bytes).\n",
+               pDev->name, size * pDev->valuator->numMotionEvents);
+}
+
+/**
+ * Dump the motion history between start and stop into the supplied buffer.
+ * Only records the event for a given screen in theory, but in practice, we
+ * sort of ignore this.
+ *
+ * If core is set, we only generate x/y, in INT16, scaled to screen coords.
+ */
+int
+GetMotionHistory(DeviceIntPtr pDev, xTimecoord ** buff, unsigned long start,
+                 unsigned long stop, ScreenPtr pScreen, BOOL core)
+{
+    char *ibuff = NULL, *obuff;
+    int i = 0, ret = 0;
+    int j, coord;
+    Time current;
+
+    /* The size of a single motion event. */
+    int size;
+    AxisInfo from, *to;         /* for scaling */
+    INT32 *ocbuf, *icbuf;       /* pointer to coordinates for copying */
+    INT16 *corebuf;
+    AxisInfo core_axis = { 0 };
+
+    if (!pDev->valuator || !pDev->valuator->numMotionEvents)
+        return 0;
+
+    if (core && !pScreen)
+        return 0;
+
+    if (IsMaster(pDev))
+        size = (sizeof(INT32) * 3 * MAX_VALUATORS) + sizeof(Time);
+    else
+        size = (sizeof(INT32) * pDev->valuator->numAxes) + sizeof(Time);
+
+    *buff = malloc(size * pDev->valuator->numMotionEvents);
+    if (!(*buff))
+        return 0;
+    obuff = (char *) *buff;
+
+    for (i = pDev->valuator->first_motion;
+         i != pDev->valuator->last_motion;
+         i = (i + 1) % pDev->valuator->numMotionEvents) {
+        /* We index the input buffer by which element we're accessing, which
+         * is not monotonic, and the output buffer by how many events we've
+         * written so far. */
+        ibuff = (char *) pDev->valuator->motion + (i * size);
+        memcpy(&current, ibuff, sizeof(Time));
+
+        if (current > stop) {
+            return ret;
+        }
+        else if (current >= start) {
+            if (core) {
+                memcpy(obuff, ibuff, sizeof(Time));     /* copy timestamp */
+
+                icbuf = (INT32 *) (ibuff + sizeof(Time));
+                corebuf = (INT16 *) (obuff + sizeof(Time));
+
+                /* fetch x coordinate + range */
+                memcpy(&from.min_value, icbuf++, sizeof(INT32));
+                memcpy(&from.max_value, icbuf++, sizeof(INT32));
+                memcpy(&coord, icbuf++, sizeof(INT32));
+
+                /* scale to screen coords */
+                to = &core_axis;
+                to->max_value = pScreen->width;
+                coord =
+                    rescaleValuatorAxis(coord, &from, to, 0, pScreen->width);
+
+                memcpy(corebuf, &coord, sizeof(INT16));
+                corebuf++;
+
+                /* fetch y coordinate + range */
+                memcpy(&from.min_value, icbuf++, sizeof(INT32));
+                memcpy(&from.max_value, icbuf++, sizeof(INT32));
+                memcpy(&coord, icbuf++, sizeof(INT32));
+
+                to->max_value = pScreen->height;
+                coord =
+                    rescaleValuatorAxis(coord, &from, to, 0, pScreen->height);
+                memcpy(corebuf, &coord, sizeof(INT16));
+
+            }
+            else if (IsMaster(pDev)) {
+                memcpy(obuff, ibuff, sizeof(Time));     /* copy timestamp */
+
+                ocbuf = (INT32 *) (obuff + sizeof(Time));
+                icbuf = (INT32 *) (ibuff + sizeof(Time));
+                for (j = 0; j < MAX_VALUATORS; j++) {
+                    if (j >= pDev->valuator->numAxes)
+                        break;
+
+                    /* fetch min/max/coordinate */
+                    memcpy(&from.min_value, icbuf++, sizeof(INT32));
+                    memcpy(&from.max_value, icbuf++, sizeof(INT32));
+                    memcpy(&coord, icbuf++, sizeof(INT32));
+
+                    to = (j <
+                          pDev->valuator->numAxes) ? &pDev->valuator->
+                        axes[j] : NULL;
+
+                    /* x/y scaled to screen if no range is present */
+                    if (j == 0 && (from.max_value < from.min_value))
+                        from.max_value = pScreen->width;
+                    else if (j == 1 && (from.max_value < from.min_value))
+                        from.max_value = pScreen->height;
+
+                    /* scale from stored range into current range */
+                    coord = rescaleValuatorAxis(coord, &from, to, 0, 0);
+                    memcpy(ocbuf, &coord, sizeof(INT32));
+                    ocbuf++;
+                }
+            }
+            else
+                memcpy(obuff, ibuff, size);
+
+            /* don't advance by size here. size may be different to the
+             * actually written size if the MD has less valuators than MAX */
+            if (core)
+                obuff += sizeof(INT32) + sizeof(Time);
+            else
+                obuff +=
+                    (sizeof(INT32) * pDev->valuator->numAxes) + sizeof(Time);
+            ret++;
+        }
+    }
+
+    return ret;
+}
+
+/**
+ * Update the motion history for a specific device, with the list of
+ * valuators.
+ *
+ * Layout of the history buffer:
+ *   for SDs: [time] [val0] [val1] ... [valn]
+ *   for MDs: [time] [min_val0] [max_val0] [val0] [min_val1] ... [valn]
+ *
+ * For events that have some valuators unset:
+ *      min_val == max_val == val == 0.
+ */
+static void
+updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, ValuatorMask *mask,
+                    double *valuators)
+{
+    char *buff = (char *) pDev->valuator->motion;
+    ValuatorClassPtr v;
+    int i;
+
+    if (!pDev->valuator->numMotionEvents)
+        return;
+
+    v = pDev->valuator;
+    if (IsMaster(pDev)) {
+        buff += ((sizeof(INT32) * 3 * MAX_VALUATORS) + sizeof(CARD32)) *
+            v->last_motion;
+
+        memcpy(buff, &ms, sizeof(Time));
+        buff += sizeof(Time);
+
+        memset(buff, 0, sizeof(INT32) * 3 * MAX_VALUATORS);
+
+        for (i = 0; i < v->numAxes; i++) {
+            int val;
+
+            /* XI1 doesn't support mixed mode devices */
+            if (valuator_get_mode(pDev, i) != valuator_get_mode(pDev, 0))
+                break;
+            if (valuator_mask_size(mask) <= i || !valuator_mask_isset(mask, i)) {
+                buff += 3 * sizeof(INT32);
+                continue;
+            }
+            memcpy(buff, &v->axes[i].min_value, sizeof(INT32));
+            buff += sizeof(INT32);
+            memcpy(buff, &v->axes[i].max_value, sizeof(INT32));
+            buff += sizeof(INT32);
+            val = valuators[i];
+            memcpy(buff, &val, sizeof(INT32));
+            buff += sizeof(INT32);
+        }
+    }
+    else {
+
+        buff += ((sizeof(INT32) * pDev->valuator->numAxes) + sizeof(CARD32)) *
+            pDev->valuator->last_motion;
+
+        memcpy(buff, &ms, sizeof(Time));
+        buff += sizeof(Time);
+
+        memset(buff, 0, sizeof(INT32) * pDev->valuator->numAxes);
+
+        for (i = 0; i < MAX_VALUATORS; i++) {
+            int val;
+
+            if (valuator_mask_size(mask) <= i || !valuator_mask_isset(mask, i)) {
+                buff += sizeof(INT32);
+                continue;
+            }
+            val = valuators[i];
+            memcpy(buff, &val, sizeof(INT32));
+            buff += sizeof(INT32);
+        }
+    }
+
+    pDev->valuator->last_motion = (pDev->valuator->last_motion + 1) %
+        pDev->valuator->numMotionEvents;
+    /* If we're wrapping around, just keep the circular buffer going. */
+    if (pDev->valuator->first_motion == pDev->valuator->last_motion)
+        pDev->valuator->first_motion = (pDev->valuator->first_motion + 1) %
+            pDev->valuator->numMotionEvents;
+
+    return;
+}
+
+/**
+ * Returns the maximum number of events GetKeyboardEvents
+ * and GetPointerEvents will ever return.
+ *
+ * This MUST be absolutely constant, from init until exit.
+ */
+int
+GetMaximumEventsNum(void)
+{
+    /* One raw event
+     * One device event
+     * One possible device changed event
+     * Lots of possible separate button scroll events (horiz + vert)
+     * Lots of possible separate raw button scroll events (horiz + vert)
+     */
+    return 100;
+}
+
+/**
+ * Clip an axis to its bounds, which are declared in the call to
+ * InitValuatorAxisClassStruct.
+ */
+static void
+clipAxis(DeviceIntPtr pDev, int axisNum, double *val)
+{
+    AxisInfoPtr axis;
+
+    if (axisNum >= pDev->valuator->numAxes)
+        return;
+
+    axis = pDev->valuator->axes + axisNum;
+
+    /* If a value range is defined, clip. If not, do nothing */
+    if (axis->max_value <= axis->min_value)
+        return;
+
+    if (*val < axis->min_value)
+        *val = axis->min_value;
+    if (*val > axis->max_value)
+        *val = axis->max_value;
+}
+
+/**
+ * Clip every axis in the list of valuators to its bounds.
+ */
+static void
+clipValuators(DeviceIntPtr pDev, ValuatorMask *mask)
+{
+    int i;
+
+    for (i = 0; i < valuator_mask_size(mask); i++)
+        if (valuator_mask_isset(mask, i)) {
+            double val = valuator_mask_get_double(mask, i);
+
+            clipAxis(pDev, i, &val);
+            valuator_mask_set_double(mask, i, val);
+        }
+}
+
+/**
+ * Create the DCCE event (does not update the master's device state yet, this
+ * is done in the event processing).
+ * Pull in the coordinates from the MD if necessary.
+ *
+ * @param events Pointer to a pre-allocated event array.
+ * @param dev The slave device that generated an event.
+ * @param type Either DEVCHANGE_POINTER_EVENT and/or DEVCHANGE_KEYBOARD_EVENT
+ * @param num_events The current number of events, returns the number of
+ *        events if a DCCE was generated.
+ * @return The updated @events pointer.
+ */
+InternalEvent *
+UpdateFromMaster(InternalEvent *events, DeviceIntPtr dev, int type,
+                 int *num_events)
+{
+    DeviceIntPtr master;
+
+    /* Don't guess the master upon the event type. Use MASTER_ATTACHED,
+     * otherwise we'll never get a DeviceChangedEvent(reason:SlaveSwith). */
+    master = GetMaster(dev, MASTER_ATTACHED);
+    /* Need to track the slave event type. Other we'le never get a
+     * DeviceChangedEvent(reason:SlaveSwith) for the 'keyboard' if the
+     * 'pointer' has been touched before. */
+    int slave_type = (type & DEVCHANGE_KEYBOARD_EVENT) |
+                     (type & DEVCHANGE_POINTER_EVENT);
+
+    if (master &&
+        ((master->last.slave != dev) ||
+         (master->last.slave == dev && master->last.slave_type != slave_type))) {
+        master->last.slave_type = slave_type;
+        CreateClassesChangedEvent(events, master, dev,
+                                  type | DEVCHANGE_SLAVE_SWITCH);
+        if (IsPointerDevice(master)) {
+            updateSlaveDeviceCoords(master, dev);
+            master->last.numValuators = dev->last.numValuators;
+        }
+        master->last.slave = dev;
+        (*num_events)++;
+        events++;
+    }
+    return events;
+}
+
+/**
+ * Move the device's pointer to the position given in the valuators.
+ *
+ * @param dev The device whose pointer is to be moved.
+ * @param mask Valuator data for this event.
+ */
+static void
+clipAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
+{
+    int i;
+
+    for (i = 0; i < valuator_mask_size(mask); i++) {
+        double val;
+
+        if (!valuator_mask_isset(mask, i))
+            continue;
+        val = valuator_mask_get_double(mask, i);
+        clipAxis(dev, i, &val);
+        valuator_mask_set_double(mask, i, val);
+    }
+}
+
+static void
+add_to_scroll_valuator(DeviceIntPtr dev, ValuatorMask *mask, int valuator, double value)
+{
+    double v;
+
+    if (!valuator_mask_fetch_double(mask, valuator, &v))
+        return;
+
+    /* protect against scrolling overflow. INT_MAX for double, because
+     * we'll eventually write this as 32.32 fixed point */
+    if ((value > 0 && v > INT_MAX - value) || (value < 0 && v < INT_MIN - value)) {
+        v = 0;
+
+        /* reset last.scroll to avoid a button storm */
+        valuator_mask_set_double(dev->last.scroll, valuator, 0);
+    }
+    else
+        v += value;
+
+    valuator_mask_set_double(mask, valuator, v);
+}
+
+
+static void
+scale_for_device_resolution(DeviceIntPtr dev, ValuatorMask *mask)
+{
+    double y;
+    ValuatorClassPtr v = dev->valuator;
+    int xrange = v->axes[0].max_value - v->axes[0].min_value + 1;
+    int yrange = v->axes[1].max_value - v->axes[1].min_value + 1;
+
+    double screen_ratio = 1.0 * screenInfo.width/screenInfo.height;
+    double device_ratio = 1.0 * xrange/yrange;
+    double resolution_ratio = 1.0;
+    double ratio;
+
+    if (!valuator_mask_fetch_double(mask, 1, &y))
+        return;
+
+    if (v->axes[0].resolution != 0 && v->axes[1].resolution != 0)
+        resolution_ratio = 1.0 * v->axes[0].resolution/v->axes[1].resolution;
+
+    ratio = device_ratio/resolution_ratio/screen_ratio;
+    valuator_mask_set_double(mask, 1, y / ratio);
+}
+
+/**
+ * Move the device's pointer by the values given in @valuators.
+ *
+ * @param dev The device whose pointer is to be moved.
+ * @param[in,out] mask Valuator data for this event, modified in-place.
+ */
+static void
+moveRelative(DeviceIntPtr dev, int flags, ValuatorMask *mask)
+{
+    int i;
+    Bool clip_xy = IsMaster(dev) || !IsFloating(dev);
+    ValuatorClassPtr v = dev->valuator;
+
+    /* for abs devices in relative mode, we've just scaled wrong, since we
+       mapped the device's shape into the screen shape. Undo this. */
+    if ((flags & POINTER_ABSOLUTE) == 0 && v && v->numAxes > 1 &&
+        v->axes[0].min_value < v->axes[0].max_value &&
+        v->axes[1].min_value < v->axes[1].max_value) {
+        scale_for_device_resolution(dev, mask);
+    }
+
+    /* calc other axes, clip, drop back into valuators */
+    for (i = 0; i < valuator_mask_size(mask); i++) {
+        double val = dev->last.valuators[i];
+
+        if (!valuator_mask_isset(mask, i))
+            continue;
+
+        add_to_scroll_valuator(dev, mask, i, val);
+
+        /* x & y need to go over the limits to cross screens if the SD
+         * isn't currently attached; otherwise, clip to screen bounds. */
+        if (valuator_get_mode(dev, i) == Absolute &&
+            ((i != 0 && i != 1) || clip_xy)) {
+            val = valuator_mask_get_double(mask, i);
+            clipAxis(dev, i, &val);
+            valuator_mask_set_double(mask, i, val);
+        }
+    }
+}
+
+/**
+ * Accelerate the data in valuators based on the device's acceleration scheme.
+ *
+ * @param dev The device which's pointer is to be moved.
+ * @param valuators Valuator mask
+ * @param ms Current time.
+ */
+static void
+accelPointer(DeviceIntPtr dev, ValuatorMask *valuators, CARD32 ms)
+{
+    if (dev->valuator->accelScheme.AccelSchemeProc)
+        dev->valuator->accelScheme.AccelSchemeProc(dev, valuators, ms);
+}
+
+/**
+ * Scale from absolute screen coordinates to absolute coordinates in the
+ * device's coordinate range.
+ *
+ * @param dev The device to scale for.
+ * @param[in, out] mask The mask in desktop/screen coordinates, modified in place
+ * to contain device coordinate range.
+ * @param flags If POINTER_SCREEN is set, mask is in per-screen coordinates.
+ *              Otherwise, mask is in desktop coords.
+ */
+static void
+scale_from_screen(DeviceIntPtr dev, ValuatorMask *mask, int flags)
+{
+    double scaled;
+    ScreenPtr scr = miPointerGetScreen(dev);
+
+    if (valuator_mask_isset(mask, 0)) {
+        scaled = valuator_mask_get_double(mask, 0);
+        if (flags & POINTER_SCREEN)
+            scaled += scr->x;
+        scaled = rescaleValuatorAxis(scaled,
+                                     NULL, dev->valuator->axes + 0,
+                                     screenInfo.x, screenInfo.width);
+        valuator_mask_set_double(mask, 0, scaled);
+    }
+    if (valuator_mask_isset(mask, 1)) {
+        scaled = valuator_mask_get_double(mask, 1);
+        if (flags & POINTER_SCREEN)
+            scaled += scr->y;
+        scaled = rescaleValuatorAxis(scaled,
+                                     NULL, dev->valuator->axes + 1,
+                                     screenInfo.y, screenInfo.height);
+        valuator_mask_set_double(mask, 1, scaled);
+    }
+}
+
+/**
+ * Scale from (absolute) device to screen coordinates here,
+ *
+ * The coordinates provided are always absolute. see fill_pointer_events for
+ * information on coordinate systems.
+ *
+ * @param dev The device to be moved.
+ * @param mask Mask of axis values for this event
+ * @param[out] devx x desktop-wide coordinate in device coordinate system
+ * @param[out] devy y desktop-wide coordinate in device coordinate system
+ * @param[out] screenx x coordinate in desktop coordinate system
+ * @param[out] screeny y coordinate in desktop coordinate system
+ */
+static ScreenPtr
+scale_to_desktop(DeviceIntPtr dev, ValuatorMask *mask,
+                 double *devx, double *devy, double *screenx, double *screeny)
+{
+    ScreenPtr scr = miPointerGetScreen(dev);
+    double x, y;
+
+    BUG_WARN(dev->valuator && dev->valuator->numAxes < 2);
+    if (!dev->valuator || dev->valuator->numAxes < 2) {
+        /* if we have no axes, last.valuators must be in screen coords
+         * anyway */
+        *devx = *screenx = dev->last.valuators[0];
+        *devy = *screeny = dev->last.valuators[1];
+        return scr;
+    }
+
+    if (valuator_mask_isset(mask, 0))
+        x = valuator_mask_get_double(mask, 0);
+    else
+        x = dev->last.valuators[0];
+    if (valuator_mask_isset(mask, 1))
+        y = valuator_mask_get_double(mask, 1);
+    else
+        y = dev->last.valuators[1];
+
+    /* scale x&y to desktop coordinates */
+    *screenx = rescaleValuatorAxis(x, dev->valuator->axes + 0, NULL,
+                                   screenInfo.x, screenInfo.width);
+    *screeny = rescaleValuatorAxis(y, dev->valuator->axes + 1, NULL,
+                                   screenInfo.y, screenInfo.height);
+
+    *devx = x;
+    *devy = y;
+
+    return scr;
+}
+
+/**
+ * If we have HW cursors, this actually moves the visible sprite. If not, we
+ * just do all the screen crossing, etc.
+ *
+ * We use the screen coordinates here, call miPointerSetPosition() and then
+ * scale back into device coordinates (if needed). miPSP will change x/y if
+ * the screen was crossed.
+ *
+ * The coordinates provided are always absolute. The parameter mode
+ * specifies whether it was relative or absolute movement that landed us at
+ * those coordinates. see fill_pointer_events for information on coordinate
+ * systems.
+ *
+ * @param dev The device to be moved.
+ * @param mode Movement mode (Absolute or Relative)
+ * @param[out] mask Mask of axis values for this event, returns the
+ * per-screen device coordinates after confinement
+ * @param[in,out] devx x desktop-wide coordinate in device coordinate system
+ * @param[in,out] devy y desktop-wide coordinate in device coordinate system
+ * @param[in,out] screenx x coordinate in desktop coordinate system
+ * @param[in,out] screeny y coordinate in desktop coordinate system
+ * @param[out] nevents Number of barrier events added to events
+ * @param[in,out] events List of events barrier events are added to
+ */
+static ScreenPtr
+positionSprite(DeviceIntPtr dev, int mode, ValuatorMask *mask,
+               double *devx, double *devy, double *screenx, double *screeny,
+               int *nevents, InternalEvent* events)
+{
+    ScreenPtr scr = miPointerGetScreen(dev);
+    double tmpx, tmpy;
+
+    if (!dev->valuator || dev->valuator->numAxes < 2)
+        return scr;
+
+    tmpx = *screenx;
+    tmpy = *screeny;
+
+    /* miPointerSetPosition takes care of crossing screens for us, as well as
+     * clipping to the current screen. Coordinates returned are in desktop
+     * coord system */
+    scr = miPointerSetPosition(dev, mode, screenx, screeny, nevents, events);
+
+    /* If we were constrained, rescale x/y from the screen coordinates so
+     * the device valuators reflect the correct position. For screen
+     * crossing this doesn't matter much, the coords would be 0 or max.
+     */
+    if (tmpx != *screenx)
+        *devx = rescaleValuatorAxis(*screenx, NULL, dev->valuator->axes + 0,
+                                    screenInfo.x, screenInfo.width);
+
+    if (tmpy != *screeny)
+        *devy = rescaleValuatorAxis(*screeny, NULL, dev->valuator->axes + 1,
+                                    screenInfo.y, screenInfo.height);
+
+    /* Recalculate the per-screen device coordinates */
+    if (valuator_mask_isset(mask, 0)) {
+        double x;
+
+        x = rescaleValuatorAxis(*screenx - scr->x, NULL,
+                                dev->valuator->axes + 0, 0, scr->width);
+        valuator_mask_set_double(mask, 0, x);
+    }
+    if (valuator_mask_isset(mask, 1)) {
+        double y;
+
+        y = rescaleValuatorAxis(*screeny - scr->y, NULL,
+                                dev->valuator->axes + 1, 0, scr->height);
+        valuator_mask_set_double(mask, 1, y);
+    }
+
+    return scr;
+}
+
+/**
+ * Update the motion history for the device and (if appropriate) for its
+ * master device.
+ * @param dev Slave device to update.
+ * @param mask Bit mask of valid valuators to append to history.
+ * @param num Total number of valuators to append to history.
+ * @param ms Current time
+ */
+static void
+updateHistory(DeviceIntPtr dev, ValuatorMask *mask, CARD32 ms)
+{
+    if (!dev->valuator)
+        return;
+
+    updateMotionHistory(dev, ms, mask, dev->last.valuators);
+    if (!IsMaster(dev) && !IsFloating(dev)) {
+        DeviceIntPtr master = GetMaster(dev, MASTER_POINTER);
+
+        updateMotionHistory(master, ms, mask, dev->last.valuators);
+    }
+}
+
+static void
+queueEventList(DeviceIntPtr device, InternalEvent *events, int nevents)
+{
+    int i;
+
+    for (i = 0; i < nevents; i++)
+        mieqEnqueue(device, &events[i]);
+}
+
+static void
+event_set_root_coordinates(DeviceEvent *event, double x, double y)
+{
+    event->root_x = trunc(x);
+    event->root_y = trunc(y);
+    event->root_x_frac = x - trunc(x);
+    event->root_y_frac = y - trunc(y);
+}
+
+/**
+ * Generate internal events representing this keyboard event and enqueue
+ * them on the event queue.
+ *
+ * This function is not reentrant. Disable signals before calling.
+ *
+ * @param device The device to generate the event for
+ * @param type Event type, one of KeyPress or KeyRelease
+ * @param keycode Key code of the pressed/released key
+ *
+ */
+void
+QueueKeyboardEvents(DeviceIntPtr device, int type,
+                    int keycode)
+{
+    int nevents;
+
+    nevents = GetKeyboardEvents(InputEventList, device, type, keycode);
+    queueEventList(device, InputEventList, nevents);
+}
+
+/**
+ * Returns a set of InternalEvents for KeyPress/KeyRelease, optionally
+ * also with valuator events.
+ *
+ * The DDX is responsible for allocating the event list in the first
+ * place via InitEventList(), and for freeing it.
+ *
+ * @return the number of events written into events.
+ */
+int
+GetKeyboardEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
+                  int key_code)
+{
+    int num_events = 0;
+    CARD32 ms = 0;
+    DeviceEvent *event;
+    RawDeviceEvent *raw;
+    enum DeviceEventSource source_type = EVENT_SOURCE_NORMAL;
+
+#ifdef XSERVER_DTRACE
+    if (XSERVER_INPUT_EVENT_ENABLED()) {
+        XSERVER_INPUT_EVENT(pDev->id, type, key_code, 0, 0,
+                            NULL, NULL);
+    }
+#endif
+
+    if (type == EnterNotify) {
+        source_type = EVENT_SOURCE_FOCUS;
+        type = KeyPress;
+    } else if (type == LeaveNotify) {
+        source_type = EVENT_SOURCE_FOCUS;
+        type = KeyRelease;
+    }
+
+    /* refuse events from disabled devices */
+    if (!pDev->enabled)
+        return 0;
+
+    if (!events || !pDev->key || !pDev->focus || !pDev->kbdfeed ||
+        (type != KeyPress && type != KeyRelease) ||
+        (key_code < 8 || key_code > 255))
+        return 0;
+
+    num_events = 1;
+
+    events =
+        UpdateFromMaster(events, pDev, DEVCHANGE_KEYBOARD_EVENT, &num_events);
+
+    /* Handle core repeating, via press/release/press/release. */
+    if (type == KeyPress && key_is_down(pDev, key_code, KEY_POSTED)) {
+        /* If autorepeating is disabled either globally or just for that key,
+         * or we have a modifier, don't generate a repeat event. */
+        if (!pDev->kbdfeed->ctrl.autoRepeat ||
+            !key_autorepeats(pDev, key_code) ||
+            pDev->key->xkbInfo->desc->map->modmap[key_code])
+            return 0;
+    }
+
+    ms = GetTimeInMillis();
+
+    if (source_type == EVENT_SOURCE_NORMAL) {
+        raw = &events->raw_event;
+        init_raw(pDev, raw, ms, type, key_code);
+        events++;
+        num_events++;
+    }
+
+    event = &events->device_event;
+    init_device_event(event, pDev, ms, source_type);
+    event->detail.key = key_code;
+
+    if (type == KeyPress) {
+        event->type = ET_KeyPress;
+        set_key_down(pDev, key_code, KEY_POSTED);
+    }
+    else if (type == KeyRelease) {
+        event->type = ET_KeyRelease;
+        set_key_up(pDev, key_code, KEY_POSTED);
+    }
+
+    return num_events;
+}
+
+/**
+ * Initialize an event array large enough for num_events arrays.
+ * This event list is to be passed into GetPointerEvents() and
+ * GetKeyboardEvents().
+ *
+ * @param num_events Number of elements in list.
+ */
+InternalEvent *
+InitEventList(int num_events)
+{
+    InternalEvent *events = calloc(num_events, sizeof(InternalEvent));
+
+    return events;
+}
+
+/**
+ * Free an event list.
+ *
+ * @param list The list to be freed.
+ * @param num_events Number of elements in list.
+ */
+void
+FreeEventList(InternalEvent *list, int num_events)
+{
+    free(list);
+}
+
+/**
+ * Transform vector x/y according to matrix m and drop the rounded coords
+ * back into x/y.
+ */
+static void
+transform(struct pixman_f_transform *m, double *x, double *y)
+{
+    struct pixman_f_vector p = {.v = {*x, *y, 1} };
+    pixman_f_transform_point(m, &p);
+
+    *x = p.v[0];
+    *y = p.v[1];
+}
+
+static void
+transformRelative(DeviceIntPtr dev, ValuatorMask *mask)
+{
+    double x = 0, y = 0;
+
+    valuator_mask_fetch_double(mask, 0, &x);
+    valuator_mask_fetch_double(mask, 1, &y);
+
+    transform(&dev->relative_transform, &x, &y);
+
+    if (x)
+        valuator_mask_set_double(mask, 0, x);
+    else
+        valuator_mask_unset(mask, 0);
+
+    if (y)
+        valuator_mask_set_double(mask, 1, y);
+    else
+        valuator_mask_unset(mask, 1);
+}
+
+/**
+ * Apply the device's transformation matrix to the valuator mask and replace
+ * the scaled values in mask. This transformation only applies to valuators
+ * 0 and 1, others will be untouched.
+ *
+ * @param dev The device the valuators came from
+ * @param[in,out] mask The valuator mask.
+ */
+static void
+transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
+{
+    double x, y, ox = 0.0, oy = 0.0;
+    int has_x, has_y;
+
+    has_x = valuator_mask_isset(mask, 0);
+    has_y = valuator_mask_isset(mask, 1);
+
+    if (!has_x && !has_y)
+        return;
+
+    if (!has_x || !has_y) {
+        struct pixman_f_transform invert;
+
+        /* undo transformation from last event */
+        ox = dev->last.valuators[0];
+        oy = dev->last.valuators[1];
+
+        pixman_f_transform_invert(&invert, &dev->scale_and_transform);
+        transform(&invert, &ox, &oy);
+    }
+
+    if (has_x)
+        ox = valuator_mask_get_double(mask, 0);
+
+    if (has_y)
+        oy = valuator_mask_get_double(mask, 1);
+
+    x = ox;
+    y = oy;
+
+    transform(&dev->scale_and_transform, &x, &y);
+
+    if (has_x || ox != x)
+        valuator_mask_set_double(mask, 0, x);
+
+    if (has_y || oy != y)
+        valuator_mask_set_double(mask, 1, y);
+}
+
+static void
+storeLastValuators(DeviceIntPtr dev, ValuatorMask *mask,
+                   int xaxis, int yaxis, double devx, double devy)
+{
+    int i;
+
+    /* store desktop-wide in last.valuators */
+    if (valuator_mask_isset(mask, xaxis))
+        dev->last.valuators[0] = devx;
+    if (valuator_mask_isset(mask, yaxis))
+        dev->last.valuators[1] = devy;
+
+    for (i = 0; i < valuator_mask_size(mask); i++) {
+        if (i == xaxis || i == yaxis)
+            continue;
+
+        if (valuator_mask_isset(mask, i))
+            dev->last.valuators[i] = valuator_mask_get_double(mask, i);
+    }
+
+}
+
+/**
+ * Generate internal events representing this pointer event and enqueue them
+ * on the event queue.
+ *
+ * This function is not reentrant. Disable signals before calling.
+ *
+ * @param device The device to generate the event for
+ * @param type Event type, one of ButtonPress, ButtonRelease, MotionNotify
+ * @param buttons Button number of the buttons modified. Must be 0 for
+ * MotionNotify
+ * @param flags Event modification flags
+ * @param mask Valuator mask for valuators present for this event.
+ */
+void
+QueuePointerEvents(DeviceIntPtr device, int type,
+                   int buttons, int flags, const ValuatorMask *mask)
+{
+    int nevents;
+
+    nevents =
+        GetPointerEvents(InputEventList, device, type, buttons, flags, mask);
+    queueEventList(device, InputEventList, nevents);
+}
+
+/**
+ * Helper function for GetPointerEvents, which only generates motion and
+ * raw motion events for the slave device: does not update the master device.
+ *
+ * Should not be called by anyone other than GetPointerEvents.
+ *
+ * We use several different coordinate systems and need to switch between
+ * the three in fill_pointer_events, positionSprite and
+ * miPointerSetPosition. "desktop" refers to the width/height of all
+ * screenInfo.screens[n]->width/height added up. "screen" is ScreenRec, not
+ * output.
+ *
+ * Coordinate systems:
+ * - relative events have a mask_in in relative coordinates, mapped to
+ *   pixels. These events are mapped to the current position±delta.
+ * - absolute events have a mask_in in absolute device coordinates in
+ *   device-specific range. This range is mapped to the desktop.
+ * - POINTER_SCREEN absolute events (x86WarpCursor) are in screen-relative
+ *   screen coordinate range.
+ * - rootx/rooty in events must be be relative to the current screen's
+ *   origin (screen coordinate system)
+ * - XI2 valuators must be relative to the current screen's origin. On
+ *   the protocol the device min/max range maps to the current screen.
+ *
+ * For screen switching we need to get the desktop coordinates for each
+ * event, then map that to the respective position on each screen and
+ * position the cursor there.
+ * The device's last.valuator[] stores the last position in desktop-wide
+ * coordinates (in device range for slave devices, desktop range for master
+ * devices).
+ *
+ * screen-relative device coordinates requires scaling: A device coordinate
+ * x/y of range [n..m] that maps to positions Sx/Sy on Screen S must be
+ * rescaled to match Sx/Sy for [n..m]. In the simplest example, x of (m/2-1)
+ * is the last coordinate on the first screen and must be rescaled for the
+ * event to be m. XI2 clients that do their own coordinate mapping would
+ * otherwise interpret the position of the device elsewhere to the cursor.
+ * However, this scaling leads to losses:
+ * if we have two ScreenRecs we scale from e.g. [0..44704]  (Wacom I4) to
+ * [0..2048[. that gives us 2047.954 as desktop coord, or the per-screen
+ * coordinate 1023.954. Scaling that back into the device coordinate range
+ * gives us 44703. So off by one device unit. It's a bug, but we'll have to
+ * live with it because with all this scaling, we just cannot win.
+ *
+ * @return the number of events written into events.
+ */
+static int
+fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type,
+                    int buttons, CARD32 ms, int flags,
+                    const ValuatorMask *mask_in)
+{
+    int num_events = 0;
+    DeviceEvent *event;
+    RawDeviceEvent *raw = NULL;
+    double screenx = 0.0, screeny = 0.0;        /* desktop coordinate system */
+    double devx = 0.0, devy = 0.0;      /* desktop-wide in device coords */
+    int sx = 0, sy = 0;                 /* for POINTER_SCREEN */
+    ValuatorMask mask;
+    ScreenPtr scr;
+    int num_barrier_events = 0;
+
+    switch (type) {
+    case MotionNotify:
+        if (!pDev->valuator) {
+            ErrorF("[dix] motion events from device %d without valuators\n",
+                   pDev->id);
+            return 0;
+        }
+        if (!mask_in || valuator_mask_num_valuators(mask_in) <= 0)
+            return 0;
+        break;
+    case ButtonPress:
+    case ButtonRelease:
+        if (!pDev->button || !buttons)
+            return 0;
+        if (mask_in && valuator_mask_size(mask_in) > 0 && !pDev->valuator) {
+            ErrorF
+                ("[dix] button event with valuator from device %d without valuators\n",
+                 pDev->id);
+            return 0;
+        }
+        break;
+    default:
+        return 0;
+    }
+
+    valuator_mask_copy(&mask, mask_in);
+
+    if ((flags & POINTER_NORAW) == 0) {
+        raw = &events->raw_event;
+        events++;
+        num_events++;
+
+        init_raw(pDev, raw, ms, type, buttons);
+
+        if (flags & POINTER_EMULATED)
+            raw->flags = XIPointerEmulated;
+
+        set_raw_valuators(raw, &mask, TRUE, raw->valuators.data_raw);
+    }
+
+    valuator_mask_drop_unaccelerated(&mask);
+
+    /* valuators are in driver-native format (rel or abs) */
+
+    if (flags & POINTER_ABSOLUTE) {
+        if (flags & (POINTER_SCREEN | POINTER_DESKTOP)) {    /* valuators are in screen/desktop coords */
+            sx = valuator_mask_get(&mask, 0);
+            sy = valuator_mask_get(&mask, 1);
+            scale_from_screen(pDev, &mask, flags);
+        }
+
+        transformAbsolute(pDev, &mask);
+        clipAbsolute(pDev, &mask);
+        if ((flags & POINTER_NORAW) == 0 && raw)
+            set_raw_valuators(raw, &mask, FALSE, raw->valuators.data);
+    }
+    else {
+        transformRelative(pDev, &mask);
+
+        if (flags & POINTER_ACCELERATE)
+            accelPointer(pDev, &mask, ms);
+        if ((flags & POINTER_NORAW) == 0 && raw)
+            set_raw_valuators(raw, &mask, FALSE, raw->valuators.data);
+
+        moveRelative(pDev, flags, &mask);
+    }
+
+    /* valuators are in device coordinate system in absolute coordinates */
+    scale_to_desktop(pDev, &mask, &devx, &devy, &screenx, &screeny);
+
+    /* #53037 XWarpPointer's scaling back and forth between screen and
+       device may leave us with rounding errors. End result is that the
+       pointer doesn't end up on the pixel it should.
+       Avoid this by forcing screenx/screeny back to what the input
+       coordinates were.
+     */
+    if (flags & POINTER_SCREEN) {
+        scr = miPointerGetScreen(pDev);
+        screenx = sx + scr->x;
+        screeny = sy + scr->y;
+    }
+
+    scr = positionSprite(pDev, (flags & POINTER_ABSOLUTE) ? Absolute : Relative,
+                         &mask, &devx, &devy, &screenx, &screeny,
+                         &num_barrier_events, events);
+    num_events += num_barrier_events;
+    events += num_barrier_events;
+
+    /* screenx, screeny are in desktop coordinates,
+       mask is in device coordinates per-screen (the event data)
+       devx/devy is in device coordinate desktop-wide */
+    updateHistory(pDev, &mask, ms);
+
+    clipValuators(pDev, &mask);
+
+    storeLastValuators(pDev, &mask, 0, 1, devx, devy);
+
+    /* Update the MD's coordinates, which are always in desktop space. */
+    if (!IsMaster(pDev) && !IsFloating(pDev)) {
+        DeviceIntPtr master = GetMaster(pDev, MASTER_POINTER);
+
+        master->last.valuators[0] = screenx;
+        master->last.valuators[1] = screeny;
+    }
+
+    if ((flags & POINTER_RAWONLY) == 0) {
+        num_events++;
+
+        event = &events->device_event;
+        init_device_event(event, pDev, ms, EVENT_SOURCE_NORMAL);
+
+        if (type == MotionNotify) {
+            event->type = ET_Motion;
+            event->detail.button = 0;
+        }
+        else {
+            if (type == ButtonPress) {
+                event->type = ET_ButtonPress;
+                set_button_down(pDev, buttons, BUTTON_POSTED);
+            }
+            else if (type == ButtonRelease) {
+                event->type = ET_ButtonRelease;
+                set_button_up(pDev, buttons, BUTTON_POSTED);
+            }
+            event->detail.button = buttons;
+        }
+
+        /* root_x and root_y must be in per-screen coordinates */
+        event_set_root_coordinates(event, screenx - scr->x, screeny - scr->y);
+
+        if (flags & POINTER_EMULATED)
+            event->flags = XIPointerEmulated;
+
+        set_valuators(pDev, event, &mask);
+    }
+
+    return num_events;
+}
+
+/**
+ * Generate events for each scroll axis that changed between before/after
+ * for the device.
+ *
+ * @param events The pointer to the event list to fill the events
+ * @param dev The device to generate the events for
+ * @param type The real type of the event
+ * @param axis The axis number to generate events for
+ * @param mask State before this event in absolute coords
+ * @param[in,out] last Last scroll state posted in absolute coords (modified
+ * in-place)
+ * @param ms Current time in ms
+ * @param max_events Max number of events to be generated
+ * @return The number of events generated
+ */
+static int
+emulate_scroll_button_events(InternalEvent *events,
+                             DeviceIntPtr dev,
+                             int type,
+                             int axis,
+                             const ValuatorMask *mask,
+                             ValuatorMask *last, CARD32 ms, int max_events)
+{
+    AxisInfoPtr ax;
+    double delta;
+    double incr;
+    int num_events = 0;
+    double total;
+    int b;
+    int flags = 0;
+
+    if (dev->valuator->axes[axis].scroll.type == SCROLL_TYPE_NONE)
+        return 0;
+
+    if (!valuator_mask_isset(mask, axis))
+        return 0;
+
+    ax = &dev->valuator->axes[axis];
+    incr = ax->scroll.increment;
+
+    BUG_WARN_MSG(incr == 0, "for device %s\n", dev->name);
+    if (incr == 0)
+        return 0;
+
+    if (type != ButtonPress && type != ButtonRelease)
+        flags |= POINTER_EMULATED;
+
+    if (!valuator_mask_isset(last, axis))
+        valuator_mask_set_double(last, axis, 0);
+
+    delta =
+        valuator_mask_get_double(mask, axis) - valuator_mask_get_double(last,
+                                                                        axis);
+    total = delta;
+    b = (ax->scroll.type == SCROLL_TYPE_VERTICAL) ? 5 : 7;
+
+    if ((incr > 0 && delta < 0) || (incr < 0 && delta > 0))
+        b--;                    /* we're scrolling up or left → button 4 or 6 */
+
+    while (fabs(delta) >= fabs(incr)) {
+        int nev_tmp;
+
+        if (delta > 0)
+            delta -= fabs(incr);
+        else if (delta < 0)
+            delta += fabs(incr);
+
+        /* fill_pointer_events() generates four events: one normal and one raw
+         * event for button press and button release.
+         * We may get a bigger scroll delta than we can generate events
+         * for. In that case, we keep decreasing delta, but skip events.
+         */
+        if (num_events + 4 < max_events) {
+            if (type != ButtonRelease) {
+                nev_tmp = fill_pointer_events(events, dev, ButtonPress, b, ms,
+                                              flags, NULL);
+                events += nev_tmp;
+                num_events += nev_tmp;
+            }
+            if (type != ButtonPress) {
+                nev_tmp = fill_pointer_events(events, dev, ButtonRelease, b, ms,
+                                              flags, NULL);
+                events += nev_tmp;
+                num_events += nev_tmp;
+            }
+        }
+    }
+
+    /* We emulated, update last.scroll */
+    if (total != delta) {
+        total -= delta;
+        valuator_mask_set_double(last, axis,
+                                 valuator_mask_get_double(last, axis) + total);
+    }
+
+    return num_events;
+}
+
+
+/**
+ * Generate a complete series of InternalEvents (filled into the EventList)
+ * representing pointer motion, or button presses.  If the device is a slave
+ * device, also potentially generate a DeviceClassesChangedEvent to update
+ * the master device.
+ *
+ * events is not NULL-terminated; the return value is the number of events.
+ * The DDX is responsible for allocating the event structure in the first
+ * place via InitEventList() and GetMaximumEventsNum(), and for freeing it.
+ *
+ * In the generated events rootX/Y will be in absolute screen coords and
+ * the valuator information in the absolute or relative device coords.
+ *
+ * last.valuators[x] of the device is always in absolute device coords.
+ * last.valuators[x] of the master device is in absolute screen coords.
+ *
+ * master->last.valuators[x] for x > 2 is undefined.
+ */
+int
+GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
+                 int buttons, int flags, const ValuatorMask *mask_in)
+{
+    CARD32 ms = GetTimeInMillis();
+    int num_events = 0, nev_tmp;
+    ValuatorMask mask;
+    ValuatorMask scroll;
+    int i;
+    int realtype = type;
+
+#ifdef XSERVER_DTRACE
+    if (XSERVER_INPUT_EVENT_ENABLED()) {
+        XSERVER_INPUT_EVENT(pDev->id, type, buttons, flags,
+                            mask_in ? mask_in->last_bit + 1 : 0,
+                            mask_in ? mask_in->mask : NULL,
+                            mask_in ? mask_in->valuators : NULL);
+    }
+#endif
+
+    BUG_RETURN_VAL(buttons >= MAX_BUTTONS, 0);
+
+    /* refuse events from disabled devices */
+    if (!pDev->enabled)
+        return 0;
+
+    if (!miPointerGetScreen(pDev))
+        return 0;
+
+    events = UpdateFromMaster(events, pDev, DEVCHANGE_POINTER_EVENT,
+                              &num_events);
+
+    valuator_mask_copy(&mask, mask_in);
+
+    /* Turn a scroll button press into a smooth-scrolling event if
+     * necessary. This only needs to cater for the XIScrollFlagPreferred
+     * axis (if more than one scrolling axis is present) */
+    if (type == ButtonPress) {
+        double adj;
+        int axis;
+        int h_scroll_axis = -1;
+        int v_scroll_axis = -1;
+
+        if (pDev->valuator) {
+            h_scroll_axis = pDev->valuator->h_scroll_axis;
+            v_scroll_axis = pDev->valuator->v_scroll_axis;
+        }
+
+        /* Up is negative on valuators, down positive */
+        switch (buttons) {
+        case 4:
+            adj = -1.0;
+            axis = v_scroll_axis;
+            break;
+        case 5:
+            adj = 1.0;
+            axis = v_scroll_axis;
+            break;
+        case 6:
+            adj = -1.0;
+            axis = h_scroll_axis;
+            break;
+        case 7:
+            adj = 1.0;
+            axis = h_scroll_axis;
+            break;
+        default:
+            adj = 0.0;
+            axis = -1;
+            break;
+        }
+
+        if (adj != 0.0 && axis != -1) {
+            adj *= pDev->valuator->axes[axis].scroll.increment;
+            if (!valuator_mask_isset(&mask, axis))
+                valuator_mask_set(&mask, axis, 0);
+            add_to_scroll_valuator(pDev, &mask, axis, adj);
+            type = MotionNotify;
+            buttons = 0;
+            flags |= POINTER_EMULATED;
+        }
+    }
+
+    /* First fill out the original event set, with smooth-scrolling axes. */
+    nev_tmp = fill_pointer_events(events, pDev, type, buttons, ms, flags,
+                                  &mask);
+    events += nev_tmp;
+    num_events += nev_tmp;
+
+    valuator_mask_zero(&scroll);
+
+    /* Now turn the smooth-scrolling axes back into emulated button presses
+     * for legacy clients, based on the integer delta between before and now */
+    for (i = 0; i < valuator_mask_size(&mask); i++) {
+        if ( !pDev->valuator || (i >= pDev->valuator->numAxes))
+            break;
+
+        if (!valuator_mask_isset(&mask, i))
+            continue;
+
+        valuator_mask_set_double(&scroll, i, pDev->last.valuators[i]);
+
+        nev_tmp =
+            emulate_scroll_button_events(events, pDev, realtype, i, &scroll,
+                                         pDev->last.scroll, ms,
+                                         GetMaximumEventsNum() - num_events);
+        events += nev_tmp;
+        num_events += nev_tmp;
+    }
+
+    return num_events;
+}
+
+/**
+ * Generate internal events representing this proximity event and enqueue
+ * them on the event queue.
+ *
+ * This function is not reentrant. Disable signals before calling.
+ *
+ * @param device The device to generate the event for
+ * @param type Event type, one of ProximityIn or ProximityOut
+ * @param keycode Key code of the pressed/released key
+ * @param mask Valuator mask for valuators present for this event.
+ *
+ */
+void
+QueueProximityEvents(DeviceIntPtr device, int type, const ValuatorMask *mask)
+{
+    int nevents;
+
+    nevents = GetProximityEvents(InputEventList, device, type, mask);
+    queueEventList(device, InputEventList, nevents);
+}
+
+/**
+ * Generate ProximityIn/ProximityOut InternalEvents, accompanied by
+ * valuators.
+ *
+ * The DDX is responsible for allocating the events in the first place via
+ * InitEventList(), and for freeing it.
+ *
+ * @return the number of events written into events.
+ */
+int
+GetProximityEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
+                   const ValuatorMask *mask_in)
+{
+    int num_events = 1, i;
+    DeviceEvent *event;
+    ValuatorMask mask;
+
+#ifdef XSERVER_DTRACE
+    if (XSERVER_INPUT_EVENT_ENABLED()) {
+        XSERVER_INPUT_EVENT(pDev->id, type, 0, 0,
+                            mask_in ? mask_in->last_bit + 1 : 0,
+                            mask_in ? mask_in->mask : NULL,
+                            mask_in ? mask_in->valuators : NULL);
+    }
+#endif
+
+    /* refuse events from disabled devices */
+    if (!pDev->enabled)
+        return 0;
+
+    /* Sanity checks. */
+    if ((type != ProximityIn && type != ProximityOut) || !mask_in)
+        return 0;
+    if (!pDev->valuator || !pDev->proximity)
+        return 0;
+
+    valuator_mask_copy(&mask, mask_in);
+
+    /* ignore relative axes for proximity. */
+    for (i = 0; i < valuator_mask_size(&mask); i++) {
+        if (valuator_mask_isset(&mask, i) &&
+            valuator_get_mode(pDev, i) == Relative)
+            valuator_mask_unset(&mask, i);
+    }
+
+    /* FIXME: posting proximity events with relative valuators only results
+     * in an empty event, EventToXI() will fail to convert → no event sent
+     * to client. */
+
+    events =
+        UpdateFromMaster(events, pDev, DEVCHANGE_POINTER_EVENT, &num_events);
+
+    event = &events->device_event;
+    init_device_event(event, pDev, GetTimeInMillis(), EVENT_SOURCE_NORMAL);
+    event->type = (type == ProximityIn) ? ET_ProximityIn : ET_ProximityOut;
+
+    clipValuators(pDev, &mask);
+
+    set_valuators(pDev, event, &mask);
+
+    return num_events;
+}
+
+int
+GetTouchOwnershipEvents(InternalEvent *events, DeviceIntPtr pDev,
+                        TouchPointInfoPtr ti, uint8_t reason, XID resource,
+                        uint32_t flags)
+{
+    TouchClassPtr t = pDev->touch;
+    TouchOwnershipEvent *event;
+    CARD32 ms = GetTimeInMillis();
+
+    if (!pDev->enabled || !t || !ti)
+        return 0;
+
+    event = &events->touch_ownership_event;
+    init_touch_ownership(pDev, event, ms);
+
+    event->touchid = ti->client_id;
+    event->sourceid = ti->sourceid;
+    event->resource = resource;
+    event->flags = flags;
+    event->reason = reason;
+
+    return 1;
+}
+
+/**
+ * Generate internal events representing this touch event and enqueue them
+ * on the event queue.
+ *
+ * This function is not reentrant. Disable signals before calling.
+ *
+ * @param device The device to generate the event for
+ * @param type Event type, one of XI_TouchBegin, XI_TouchUpdate, XI_TouchEnd
+ * @param touchid Touch point ID
+ * @param flags Event modification flags
+ * @param mask Valuator mask for valuators present for this event.
+ */
+void
+QueueTouchEvents(DeviceIntPtr device, int type,
+                 uint32_t ddx_touchid, int flags, const ValuatorMask *mask)
+{
+    int nevents;
+
+    nevents =
+        GetTouchEvents(InputEventList, device, ddx_touchid, type, flags, mask);
+    queueEventList(device, InputEventList, nevents);
+}
+
+/**
+ * Get events for a touch. Generates a TouchBegin event if end is not set and
+ * the touch id is not active. Generates a TouchUpdate event if end is not set
+ * and the touch id is active. Generates a TouchEnd event if end is set and the
+ * touch id is active.
+ *
+ * events is not NULL-terminated; the return value is the number of events.
+ * The DDX is responsible for allocating the event structure in the first
+ * place via GetMaximumEventsNum(), and for freeing it.
+ *
+ * @param[out] events The list of events generated
+ * @param dev The device to generate the events for
+ * @param ddx_touchid The touch ID as assigned by the DDX
+ * @param type XI_TouchBegin, XI_TouchUpdate or XI_TouchEnd
+ * @param flags Event flags
+ * @param mask_in Valuator information for this event
+ */
+int
+GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
+               uint16_t type, uint32_t flags, const ValuatorMask *mask_in)
+{
+    ScreenPtr scr;
+    TouchClassPtr t = dev->touch;
+    ValuatorClassPtr v = dev->valuator;
+    DeviceEvent *event;
+    CARD32 ms = GetTimeInMillis();
+    ValuatorMask mask;
+    double screenx = 0.0, screeny = 0.0;        /* desktop coordinate system */
+    double devx = 0.0, devy = 0.0;      /* desktop-wide in device coords */
+    int i;
+    int num_events = 0;
+    RawDeviceEvent *raw;
+    DDXTouchPointInfoPtr ti;
+    int need_rawevent = TRUE;
+    Bool emulate_pointer = FALSE;
+    int client_id = 0;
+
+#ifdef XSERVER_DTRACE
+    if (XSERVER_INPUT_EVENT_ENABLED()) {
+        XSERVER_INPUT_EVENT(dev->id, type, ddx_touchid, flags,
+                            mask_in ? mask_in->last_bit + 1 : 0,
+                            mask_in ? mask_in->mask : NULL,
+                            mask_in ? mask_in->valuators : NULL);
+    }
+#endif
+
+    if (!dev->enabled || !t || !v)
+        return 0;
+
+    /* Find and/or create the DDX touch info */
+
+    ti = TouchFindByDDXID(dev, ddx_touchid, (type == XI_TouchBegin));
+    if (!ti) {
+        ErrorFSigSafe("[dix] %s: unable to %s touch point %u\n", dev->name,
+                      type == XI_TouchBegin ? "begin" : "find", ddx_touchid);
+        return 0;
+    }
+    client_id = ti->client_id;
+
+    emulate_pointer = ti->emulate_pointer;
+
+    if (!IsMaster(dev))
+        events =
+            UpdateFromMaster(events, dev, DEVCHANGE_POINTER_EVENT, &num_events);
+
+    valuator_mask_copy(&mask, mask_in);
+
+    if (need_rawevent) {
+        raw = &events->raw_event;
+        events++;
+        num_events++;
+        init_raw(dev, raw, ms, type, client_id);
+        set_raw_valuators(raw, &mask, TRUE, raw->valuators.data_raw);
+    }
+
+    event = &events->device_event;
+    num_events++;
+
+    init_device_event(event, dev, ms, EVENT_SOURCE_NORMAL);
+
+    switch (type) {
+    case XI_TouchBegin:
+        event->type = ET_TouchBegin;
+        /* If we're starting a touch, we must have x & y coordinates. */
+        if (!mask_in ||
+            !valuator_mask_isset(mask_in, 0) ||
+            !valuator_mask_isset(mask_in, 1)) {
+            ErrorFSigSafe("%s: Attempted to start touch without x/y "
+                          "(driver bug)\n", dev->name);
+            return 0;
+        }
+        break;
+    case XI_TouchUpdate:
+        event->type = ET_TouchUpdate;
+        if (!mask_in || valuator_mask_num_valuators(mask_in) <= 0) {
+            ErrorFSigSafe("%s: TouchUpdate with no valuators? Driver bug\n",
+                          dev->name);
+        }
+        break;
+    case XI_TouchEnd:
+        event->type = ET_TouchEnd;
+        /* We can end the DDX touch here, since we don't use the active
+         * field below */
+        TouchEndDDXTouch(dev, ti);
+        break;
+    default:
+        return 0;
+    }
+
+    /* Get our screen event coordinates (root_x/root_y/event_x/event_y):
+     * these come from the touchpoint in Absolute mode, or the sprite in
+     * Relative. */
+    if (t->mode == XIDirectTouch) {
+        for (i = 0; i < max(valuator_mask_size(&mask), 2); i++) {
+            double val;
+
+            if (valuator_mask_fetch_double(&mask, i, &val))
+                valuator_mask_set_double(ti->valuators, i, val);
+            /* If the device doesn't post new X and Y axis values,
+             * use the last values posted.
+             */
+            else if (i < 2 &&
+                valuator_mask_fetch_double(ti->valuators, i, &val))
+                valuator_mask_set_double(&mask, i, val);
+        }
+
+        transformAbsolute(dev, &mask);
+        clipAbsolute(dev, &mask);
+    }
+    else {
+        screenx = dev->spriteInfo->sprite->hotPhys.x;
+        screeny = dev->spriteInfo->sprite->hotPhys.y;
+    }
+    if (need_rawevent)
+        set_raw_valuators(raw, &mask, FALSE, raw->valuators.data);
+
+    scr = dev->spriteInfo->sprite->hotPhys.pScreen;
+
+    /* Indirect device touch coordinates are not used for cursor positioning.
+     * They are merely informational, and are provided in device coordinates.
+     * The device sprite is used for positioning instead, and it is already
+     * scaled. */
+    if (t->mode == XIDirectTouch)
+        scr = scale_to_desktop(dev, &mask, &devx, &devy, &screenx, &screeny);
+    if (emulate_pointer)
+        scr = positionSprite(dev, Absolute, &mask,
+                             &devx, &devy, &screenx, &screeny, NULL, NULL);
+
+    /* see fill_pointer_events for coordinate systems */
+    if (emulate_pointer)
+        updateHistory(dev, &mask, ms);
+
+    clipValuators(dev, &mask);
+
+    if (emulate_pointer)
+        storeLastValuators(dev, &mask, 0, 1, devx, devy);
+
+    /* Update the MD's coordinates, which are always in desktop space. */
+    if (emulate_pointer && !IsMaster(dev) && !IsFloating(dev)) {
+	    DeviceIntPtr master = GetMaster(dev, MASTER_POINTER);
+
+	    master->last.valuators[0] = screenx;
+	    master->last.valuators[1] = screeny;
+    }
+
+    event->root = scr->root->drawable.id;
+
+    event_set_root_coordinates(event, screenx - scr->x, screeny - scr->y);
+    event->touchid = client_id;
+    event->flags = flags;
+
+    if (emulate_pointer) {
+        event->flags |= TOUCH_POINTER_EMULATED;
+        event->detail.button = 1;
+    }
+
+    set_valuators(dev, event, &mask);
+    for (i = 0; i < v->numAxes; i++) {
+        if (valuator_mask_isset(&mask, i))
+            v->axisVal[i] = valuator_mask_get(&mask, i);
+    }
+
+    return num_events;
+}
+
+void
+GetDixTouchEnd(InternalEvent *ievent, DeviceIntPtr dev, TouchPointInfoPtr ti,
+               uint32_t flags)
+{
+    ScreenPtr scr = dev->spriteInfo->sprite->hotPhys.pScreen;
+    DeviceEvent *event = &ievent->device_event;
+    CARD32 ms = GetTimeInMillis();
+
+    BUG_WARN(!dev->enabled);
+
+    init_device_event(event, dev, ms, EVENT_SOURCE_NORMAL);
+
+    event->sourceid = ti->sourceid;
+    event->type = ET_TouchEnd;
+
+    event->root = scr->root->drawable.id;
+
+    /* Get screen event coordinates from the sprite.  Is this really the best
+     * we can do? */
+    event_set_root_coordinates(event,
+                               dev->last.valuators[0] - scr->x,
+                               dev->last.valuators[1] - scr->y);
+    event->touchid = ti->client_id;
+    event->flags = flags;
+
+    if (flags & TOUCH_POINTER_EMULATED) {
+        event->flags |= TOUCH_POINTER_EMULATED;
+        event->detail.button = 1;
+    }
+}
+
+/**
+ * Synthesize a single motion event for the core pointer.
+ *
+ * Used in cursor functions, e.g. when cursor confinement changes, and we need
+ * to shift the pointer to get it inside the new bounds.
+ */
+void
+PostSyntheticMotion(DeviceIntPtr pDev,
+                    int x, int y, int screen, unsigned long time)
+{
+    DeviceEvent ev;
+
+#ifdef PANORAMIX
+    /* Translate back to the sprite screen since processInputProc
+       will translate from sprite screen to screen 0 upon reentry
+       to the DIX layer. */
+    if (!noPanoramiXExtension) {
+        x += screenInfo.screens[0]->x - screenInfo.screens[screen]->x;
+        y += screenInfo.screens[0]->y - screenInfo.screens[screen]->y;
+    }
+#endif
+
+    memset(&ev, 0, sizeof(DeviceEvent));
+    init_device_event(&ev, pDev, time, EVENT_SOURCE_NORMAL);
+    ev.root_x = x;
+    ev.root_y = y;
+    ev.type = ET_Motion;
+    ev.time = time;
+
+    /* FIXME: MD/SD considerations? */
+    (*pDev->public.processInputProc) ((InternalEvent *) &ev, pDev);
+}
+
+void
+InitGestureEvent(InternalEvent *ievent, DeviceIntPtr dev, CARD32 ms,
+                 int type, uint16_t num_touches, uint32_t flags,
+                 double delta_x, double delta_y,
+                 double delta_unaccel_x, double delta_unaccel_y,
+                 double scale, double delta_angle)
+{
+    ScreenPtr scr = dev->spriteInfo->sprite->hotPhys.pScreen;
+    GestureEvent *event = &ievent->gesture_event;
+    double screenx = 0.0, screeny = 0.0;        /* desktop coordinate system */
+
+    init_gesture_event(event, dev, ms);
+
+    screenx = dev->spriteInfo->sprite->hotPhys.x;
+    screeny = dev->spriteInfo->sprite->hotPhys.y;
+
+    event->type = type;
+    event->root = scr->root->drawable.id;
+    event->root_x = screenx - scr->x;
+    event->root_y = screeny - scr->y;
+    event->num_touches = num_touches;
+    event->flags = flags;
+
+    event->delta_x = delta_x;
+    event->delta_y = delta_y;
+    event->delta_unaccel_x = delta_unaccel_x;
+    event->delta_unaccel_y = delta_unaccel_y;
+    event->scale = scale;
+    event->delta_angle = delta_angle;
+}
+
+/**
+ * Get events for a pinch or swipe gesture.
+ *
+ * events is not NULL-terminated; the return value is the number of events.
+ * The DDX is responsible for allocating the event structure in the first
+ * place via GetMaximumEventsNum(), and for freeing it.
+ *
+ * @param[out] events The list of events generated
+ * @param dev The device to generate the events for
+ * @param type XI_Gesture{Pinch,Swipe}{Begin,Update,End}
+ * @prama num_touches The number of touches in the gesture
+ * @param flags Event flags
+ * @param delta_x,delta_y accelerated relative motion delta
+ * @param delta_unaccel_x,delta_unaccel_y unaccelerated relative motion delta
+ * @param scale (valid only to pinch events) absolute scale of a pinch gesture
+ * @param delta_angle (valid only to pinch events) the ange delta in degrees between the last and
+ *        the current pinch event.
+ */
+int
+GetGestureEvents(InternalEvent *events, DeviceIntPtr dev,
+                 uint16_t type, uint16_t num_touches, uint32_t flags,
+                 double delta_x, double delta_y,
+                 double delta_unaccel_x, double delta_unaccel_y,
+                 double scale, double delta_angle)
+
+{
+    GestureClassPtr g = dev->gesture;
+    CARD32 ms = GetTimeInMillis();
+    enum EventType evtype;
+    int num_events = 0;
+    uint32_t evflags = 0;
+
+    if (!dev->enabled || !g)
+        return 0;
+
+    if (!IsMaster(dev))
+        events = UpdateFromMaster(events, dev, DEVCHANGE_POINTER_EVENT,
+                                  &num_events);
+
+    switch (type) {
+    case XI_GesturePinchBegin:
+        evtype = ET_GesturePinchBegin;
+        break;
+    case XI_GesturePinchUpdate:
+        evtype = ET_GesturePinchUpdate;
+        break;
+    case XI_GesturePinchEnd:
+        evtype = ET_GesturePinchEnd;
+        if (flags & XIGesturePinchEventCancelled)
+            evflags |= GESTURE_CANCELLED;
+        break;
+    case XI_GestureSwipeBegin:
+        evtype = ET_GestureSwipeBegin;
+        break;
+    case XI_GestureSwipeUpdate:
+        evtype = ET_GestureSwipeUpdate;
+        break;
+    case XI_GestureSwipeEnd:
+        evtype = ET_GestureSwipeEnd;
+        if (flags & XIGestureSwipeEventCancelled)
+            evflags |= GESTURE_CANCELLED;
+        break;
+    default:
+        return 0;
+    }
+
+    InitGestureEvent(events, dev, ms, evtype, num_touches, evflags,
+                     delta_x, delta_y, delta_unaccel_x, delta_unaccel_y,
+                     scale, delta_angle);
+    num_events++;
+
+    return num_events;
+}
+
+void
+QueueGesturePinchEvents(DeviceIntPtr dev, uint16_t type,
+                        uint16_t num_touches, uint32_t flags,
+                        double delta_x, double delta_y,
+                        double delta_unaccel_x,
+                        double delta_unaccel_y,
+                        double scale, double delta_angle)
+{
+    int nevents;
+    nevents = GetGestureEvents(InputEventList, dev, type, num_touches, flags,
+                               delta_x, delta_y,
+                               delta_unaccel_x, delta_unaccel_y,
+                               scale, delta_angle);
+    queueEventList(dev, InputEventList, nevents);
+}
+
+void
+QueueGestureSwipeEvents(DeviceIntPtr dev, uint16_t type,
+                        uint16_t num_touches, uint32_t flags,
+                        double delta_x, double delta_y,
+                        double delta_unaccel_x,
+                        double delta_unaccel_y)
+{
+    int nevents;
+    nevents = GetGestureEvents(InputEventList, dev, type, num_touches, flags,
+                               delta_x, delta_y,
+                               delta_unaccel_x, delta_unaccel_y,
+                               0.0, 0.0);
+    queueEventList(dev, InputEventList, nevents);
+}
Index: xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new/dix
===================================================================
--- xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new/dix	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new/dix	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new/dix
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new/include/inputstr.h
===================================================================
--- xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new/include/inputstr.h	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new/include/inputstr.h	(revision 5)
@@ -0,0 +1,705 @@
+/************************************************************
+
+Copyright 1987, 1998  The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+
+#ifndef INPUTSTRUCT_H
+#define INPUTSTRUCT_H
+
+#include <X11/extensions/XI2proto.h>
+
+#include <pixman.h>
+#include "input.h"
+#include "window.h"
+#include "dixstruct.h"
+#include "cursorstr.h"
+#include "geext.h"
+#include "privates.h"
+
+extern _X_EXPORT void AssignTypeAndName(DeviceIntPtr dev,
+                                        Atom type,
+                                        const char *name);
+
+#define BitIsOn(ptr, bit) (!!(((const BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7))))
+#define SetBit(ptr, bit)  (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7)))
+#define ClearBit(ptr, bit) (((BYTE *)(ptr))[(bit)>>3] &= ~(1 << ((bit) & 7)))
+extern _X_EXPORT int CountBits(const uint8_t * mask, int len);
+
+#define SameClient(obj,client) \
+	(CLIENT_BITS((obj)->resource) == (client)->clientAsMask)
+
+#define EMASKSIZE	(MAXDEVICES + 2)
+
+/* This is the last XI2 event supported by the server. If you add
+ * events to the protocol, the server will not support these events until
+ * this number here is bumped.
+ */
+#define XI2LASTEVENT    XI_GestureSwipeEnd
+#define XI2MASKSIZE     ((XI2LASTEVENT >> 3) + 1)       /* no of bytes for masks */
+
+/**
+ * Scroll types for ::SetScrollValuator and the scroll type in the
+ * ::ScrollInfoPtr.
+ */
+enum ScrollType {
+    SCROLL_TYPE_NONE = 0,           /**< Not a scrolling valuator */
+    SCROLL_TYPE_VERTICAL = 8,
+    SCROLL_TYPE_HORIZONTAL = 9,
+};
+
+/**
+ * This struct stores the core event mask for each client except the client
+ * that created the window.
+ *
+ * Each window that has events selected from other clients has at least one of
+ * these masks. If multiple clients selected for events on the same window,
+ * these masks are in a linked list.
+ *
+ * The event mask for the client that created the window is stored in
+ * win->eventMask instead.
+ *
+ * The resource id is simply a fake client ID to associate this mask with a
+ * client.
+ *
+ * Kludge: OtherClients and InputClients must be compatible, see code.
+ */
+typedef struct _OtherClients {
+    OtherClientsPtr next;     /**< Pointer to the next mask */
+    XID resource;                 /**< id for putting into resource manager */
+    Mask mask;                /**< Core event mask */
+} OtherClients;
+
+/**
+ * This struct stores the XI event mask for each client.
+ *
+ * Each window that has events selected has at least one of these masks. If
+ * multiple client selected for events on the same window, these masks are in
+ * a linked list.
+ */
+typedef struct _InputClients {
+    InputClientsPtr next;     /**< Pointer to the next mask */
+    XID resource;                 /**< id for putting into resource manager */
+    Mask mask[EMASKSIZE];                /**< Actual XI event mask, deviceid is index */
+    /** XI2 event masks. One per device, each bit is a mask of (1 << type) */
+    struct _XI2Mask *xi2mask;
+} InputClients;
+
+/**
+ * Combined XI event masks from all devices.
+ *
+ * This is the XI equivalent of the deliverableEvents, eventMask and
+ * dontPropagate mask of the WindowRec (or WindowOptRec).
+ *
+ * A window that has an XI client selecting for events has exactly one
+ * OtherInputMasks struct and exactly one InputClients struct hanging off
+ * inputClients. Each further client appends to the inputClients list.
+ * Each Mask field is per-device, with the device id as the index.
+ * Exception: for non-device events (Presence events), the MAXDEVICES
+ * deviceid is used.
+ */
+typedef struct _OtherInputMasks {
+    /**
+     * Bitwise OR of all masks by all clients and the window's parent's masks.
+     */
+    Mask deliverableEvents[EMASKSIZE];
+    /**
+     * Bitwise OR of all masks by all clients on this window.
+     */
+    Mask inputEvents[EMASKSIZE];
+    /** The do-not-propagate masks for each device. */
+    Mask dontPropagateMask[EMASKSIZE];
+    /** The clients that selected for events */
+    InputClientsPtr inputClients;
+    /* XI2 event masks. One per device, each bit is a mask of (1 << type) */
+    struct _XI2Mask *xi2mask;
+} OtherInputMasks;
+
+/*
+ * The following structure gets used for both active and passive grabs. For
+ * active grabs some of the fields (e.g. modifiers) are not used. However,
+ * that is not much waste since there aren't many active grabs (one per
+ * keyboard/pointer device) going at once in the server.
+ */
+
+#define MasksPerDetailMask 8    /* 256 keycodes and 256 possible
+                                   modifier combinations, but only
+                                   3 buttons. */
+
+typedef struct _DetailRec {     /* Grab details may be bit masks */
+    unsigned int exact;
+    Mask *pMask;
+} DetailRec;
+
+union _GrabMask {
+    Mask core;
+    Mask xi;
+    struct _XI2Mask *xi2mask;
+};
+
+/**
+ * Central struct for device grabs.
+ * The same struct is used for both core grabs and device grabs, with
+ * different fields being set.
+ * If the grab is a core grab (GrabPointer/GrabKeyboard), then the eventMask
+ * is a combination of standard event masks (i.e. PointerMotionMask |
+ * ButtonPressMask).
+ * If the grab is a device grab (GrabDevice), then the eventMask is a
+ * combination of event masks for a given XI event type (see SetEventInfo).
+ *
+ * If the grab is a result of a ButtonPress, then eventMask is the core mask
+ * and deviceMask is set to the XI event mask for the grab.
+ */
+typedef struct _GrabRec {
+    GrabPtr next;               /* for chain of passive grabs */
+    XID resource;
+    DeviceIntPtr device;
+    WindowPtr window;
+    unsigned ownerEvents:1;
+    unsigned keyboardMode:1;
+    unsigned pointerMode:1;
+    enum InputLevel grabtype;
+    CARD8 type;                 /* event type for passive grabs, 0 for active grabs */
+    DetailRec modifiersDetail;
+    DeviceIntPtr modifierDevice;
+    DetailRec detail;           /* key or button */
+    WindowPtr confineTo;        /* always NULL for keyboards */
+    CursorPtr cursor;           /* always NULL for keyboards */
+    Mask eventMask;
+    Mask deviceMask;
+    /* XI2 event masks. One per device, each bit is a mask of (1 << type) */
+    struct _XI2Mask *xi2mask;
+} GrabRec;
+
+/**
+ * Sprite information for a device.
+ */
+typedef struct _SpriteRec {
+    CursorPtr current;
+    BoxRec hotLimits;           /* logical constraints of hot spot */
+    Bool confined;              /* confined to screen */
+    RegionPtr hotShape;         /* additional logical shape constraint */
+    BoxRec physLimits;          /* physical constraints of hot spot */
+    WindowPtr win;              /* window of logical position */
+    HotSpot hot;                /* logical pointer position */
+    HotSpot hotPhys;            /* physical pointer position */
+#ifdef PANORAMIX
+    ScreenPtr screen;           /* all others are in Screen 0 coordinates */
+    RegionRec Reg1;             /* Region 1 for confining motion */
+    RegionRec Reg2;             /* Region 2 for confining virtual motion */
+    WindowPtr windows[MAXSCREENS];
+    WindowPtr confineWin;       /* confine window */
+#endif
+    /* The window trace information is used at dix/events.c to avoid having
+     * to compute all the windows between the root and the current pointer
+     * window each time a button or key goes down. The grabs on each of those
+     * windows must be checked.
+     * spriteTraces should only be used at dix/events.c! */
+    WindowPtr *spriteTrace;
+    int spriteTraceSize;
+    int spriteTraceGood;
+
+    /* Due to delays between event generation and event processing, it is
+     * possible that the pointer has crossed screen boundaries between the
+     * time in which it begins generating events and the time when
+     * those events are processed.
+     *
+     * pEnqueueScreen: screen the pointer was on when the event was generated
+     * pDequeueScreen: screen the pointer was on when the event is processed
+     */
+    ScreenPtr pEnqueueScreen;
+    ScreenPtr pDequeueScreen;
+
+} SpriteRec;
+
+typedef struct _KeyClassRec {
+    int sourceid;
+    CARD8 down[DOWN_LENGTH];
+    CARD8 postdown[DOWN_LENGTH];
+    int modifierKeyCount[8];
+    struct _XkbSrvInfo *xkbInfo;
+} KeyClassRec, *KeyClassPtr;
+
+typedef struct _ScrollInfo {
+    enum ScrollType type;
+    double increment;
+    int flags;
+} ScrollInfo, *ScrollInfoPtr;
+
+typedef struct _AxisInfo {
+    int resolution;
+    int min_resolution;
+    int max_resolution;
+    int min_value;
+    int max_value;
+    Atom label;
+    CARD8 mode;
+    ScrollInfo scroll;
+} AxisInfo, *AxisInfoPtr;
+
+typedef struct _ValuatorAccelerationRec {
+    int number;
+    PointerAccelSchemeProc AccelSchemeProc;
+    void *accelData;            /* at disposal of AccelScheme */
+    PointerAccelSchemeInitProc AccelInitProc;
+    DeviceCallbackProc AccelCleanupProc;
+} ValuatorAccelerationRec, *ValuatorAccelerationPtr;
+
+typedef struct _ValuatorClassRec {
+    int sourceid;
+    int numMotionEvents;
+    int first_motion;
+    int last_motion;
+    void *motion;               /* motion history buffer. Different layout
+                                   for MDs and SDs! */
+    WindowPtr motionHintWindow;
+
+    AxisInfoPtr axes;
+    unsigned short numAxes;
+    double *axisVal;            /* always absolute, but device-coord system */
+    ValuatorAccelerationRec accelScheme;
+    int h_scroll_axis;          /* horiz smooth-scrolling axis */
+    int v_scroll_axis;          /* vert smooth-scrolling axis */
+} ValuatorClassRec;
+
+typedef struct _TouchListener {
+    XID listener;           /* grabs/event selection IDs receiving
+                             * events for this touch */
+    int resource_type;      /* listener's resource type */
+    enum TouchListenerType type;
+    enum TouchListenerState state;
+    enum InputLevel level;  /* matters only for emulating touches */
+    WindowPtr window;
+    GrabPtr grab;
+} TouchListener;
+
+typedef struct _TouchPointInfo {
+    uint32_t client_id;         /* touch ID as seen in client events */
+    int sourceid;               /* Source device's ID for this touchpoint */
+    Bool active;                /* whether or not the touch is active */
+    Bool pending_finish;        /* true if the touch is physically inactive
+                                 * but still owned by a grab */
+    SpriteRec sprite;           /* window trace for delivery */
+    ValuatorMask *valuators;    /* last recorded axis values */
+    TouchListener *listeners;   /* set of listeners */
+    int num_listeners;
+    int num_grabs;              /* number of open grabs on this touch
+                                 * which have not accepted or rejected */
+    Bool emulate_pointer;
+    DeviceEvent *history;       /* History of events on this touchpoint */
+    size_t history_elements;    /* Number of current elements in history */
+    size_t history_size;        /* Size of history in elements */
+} TouchPointInfoRec;
+
+typedef struct _DDXTouchPointInfo {
+    uint32_t client_id;         /* touch ID as seen in client events */
+    Bool active;                /* whether or not the touch is active */
+    uint32_t ddx_id;            /* touch ID given by the DDX */
+    Bool emulate_pointer;
+
+    ValuatorMask *valuators;    /* last axis values as posted, pre-transform */
+} DDXTouchPointInfoRec;
+
+typedef struct _TouchClassRec {
+    int sourceid;
+    TouchPointInfoPtr touches;
+    unsigned short num_touches; /* number of allocated touches */
+    unsigned short max_touches; /* maximum number of touches, may be 0 */
+    CARD8 mode;                 /* ::XIDirectTouch, XIDependentTouch */
+    /* for pointer-emulation */
+    CARD8 buttonsDown;          /* number of buttons down */
+    unsigned short state;       /* logical button state */
+    Mask motionMask;
+} TouchClassRec;
+
+typedef struct _GestureListener {
+    XID listener;           /* grabs/event selection IDs receiving
+                             * events for this gesture */
+    int resource_type;      /* listener's resource type */
+    enum GestureListenerType type;
+    WindowPtr window;
+    GrabPtr grab;
+} GestureListener;
+
+typedef struct _GestureInfo {
+    int sourceid;               /* Source device's ID for this gesture */
+    Bool active;                /* whether or not the gesture is active */
+    uint8_t type;               /* Gesture type: either ET_GesturePinchBegin or
+                                   ET_GestureSwipeBegin. Valid if active == TRUE */
+    int num_touches;            /* The number of touches in the gesture */
+    SpriteRec sprite;           /* window trace for delivery */
+    GestureListener listener;   /* the listener that will receive events */
+    Bool has_listener;          /* true if listener has been setup already */
+} GestureInfoRec;
+
+typedef struct _GestureClassRec {
+    int sourceid;
+    GestureInfoRec gesture;
+    unsigned short max_touches; /* maximum number of touches, may be 0 */
+} GestureClassRec;
+
+typedef struct _ButtonClassRec {
+    int sourceid;
+    CARD8 numButtons;
+    CARD8 buttonsDown;          /* number of buttons currently down
+                                   This counts logical buttons, not
+                                   physical ones, i.e if some buttons
+                                   are mapped to 0, they're not counted
+                                   here */
+    unsigned short state;
+    Mask motionMask;
+    CARD8 down[DOWN_LENGTH];
+    CARD8 postdown[DOWN_LENGTH];
+    CARD8 map[MAP_LENGTH];
+    union _XkbAction *xkb_acts;
+    Atom labels[MAX_BUTTONS];
+} ButtonClassRec, *ButtonClassPtr;
+
+typedef struct _FocusClassRec {
+    int sourceid;
+    WindowPtr win;              /* May be set to a int constant (e.g. PointerRootWin)! */
+    int revert;
+    TimeStamp time;
+    WindowPtr *trace;
+    int traceSize;
+    int traceGood;
+} FocusClassRec, *FocusClassPtr;
+
+typedef struct _ProximityClassRec {
+    int sourceid;
+    char in_proximity;
+} ProximityClassRec, *ProximityClassPtr;
+
+typedef struct _KbdFeedbackClassRec *KbdFeedbackPtr;
+typedef struct _PtrFeedbackClassRec *PtrFeedbackPtr;
+typedef struct _IntegerFeedbackClassRec *IntegerFeedbackPtr;
+typedef struct _StringFeedbackClassRec *StringFeedbackPtr;
+typedef struct _BellFeedbackClassRec *BellFeedbackPtr;
+typedef struct _LedFeedbackClassRec *LedFeedbackPtr;
+
+typedef struct _KbdFeedbackClassRec {
+    BellProcPtr BellProc;
+    KbdCtrlProcPtr CtrlProc;
+    KeybdCtrl ctrl;
+    KbdFeedbackPtr next;
+    struct _XkbSrvLedInfo *xkb_sli;
+} KbdFeedbackClassRec;
+
+typedef struct _PtrFeedbackClassRec {
+    PtrCtrlProcPtr CtrlProc;
+    PtrCtrl ctrl;
+    PtrFeedbackPtr next;
+} PtrFeedbackClassRec;
+
+typedef struct _IntegerFeedbackClassRec {
+    IntegerCtrlProcPtr CtrlProc;
+    IntegerCtrl ctrl;
+    IntegerFeedbackPtr next;
+} IntegerFeedbackClassRec;
+
+typedef struct _StringFeedbackClassRec {
+    StringCtrlProcPtr CtrlProc;
+    StringCtrl ctrl;
+    StringFeedbackPtr next;
+} StringFeedbackClassRec;
+
+typedef struct _BellFeedbackClassRec {
+    BellProcPtr BellProc;
+    BellCtrlProcPtr CtrlProc;
+    BellCtrl ctrl;
+    BellFeedbackPtr next;
+} BellFeedbackClassRec;
+
+typedef struct _LedFeedbackClassRec {
+    LedCtrlProcPtr CtrlProc;
+    LedCtrl ctrl;
+    LedFeedbackPtr next;
+    struct _XkbSrvLedInfo *xkb_sli;
+} LedFeedbackClassRec;
+
+typedef struct _ClassesRec {
+    KeyClassPtr key;
+    ValuatorClassPtr valuator;
+    TouchClassPtr touch;
+    GestureClassPtr gesture;
+    ButtonClassPtr button;
+    FocusClassPtr focus;
+    ProximityClassPtr proximity;
+    KbdFeedbackPtr kbdfeed;
+    PtrFeedbackPtr ptrfeed;
+    IntegerFeedbackPtr intfeed;
+    StringFeedbackPtr stringfeed;
+    BellFeedbackPtr bell;
+    LedFeedbackPtr leds;
+} ClassesRec;
+
+/* Device properties */
+typedef struct _XIPropertyValue {
+    Atom type;                  /* ignored by server */
+    short format;               /* format of data for swapping - 8,16,32 */
+    long size;                  /* size of data in (format/8) bytes */
+    void *data;                 /* private to client */
+} XIPropertyValueRec;
+
+typedef struct _XIProperty {
+    struct _XIProperty *next;
+    Atom propertyName;
+    BOOL deletable;             /* clients can delete this prop? */
+    XIPropertyValueRec value;
+} XIPropertyRec;
+
+typedef XIPropertyRec *XIPropertyPtr;
+typedef XIPropertyValueRec *XIPropertyValuePtr;
+
+typedef struct _XIPropertyHandler {
+    struct _XIPropertyHandler *next;
+    long id;
+    int (*SetProperty) (DeviceIntPtr dev,
+                        Atom property, XIPropertyValuePtr prop, BOOL checkonly);
+    int (*GetProperty) (DeviceIntPtr dev, Atom property);
+    int (*DeleteProperty) (DeviceIntPtr dev, Atom property);
+} XIPropertyHandler, *XIPropertyHandlerPtr;
+
+/* states for devices */
+
+#define NOT_GRABBED		0
+#define THAWED			1
+#define THAWED_BOTH		2       /* not a real state */
+#define FREEZE_NEXT_EVENT	3
+#define FREEZE_BOTH_NEXT_EVENT	4
+#define FROZEN			5       /* any state >= has device frozen */
+#define FROZEN_NO_EVENT		5
+#define FROZEN_WITH_EVENT	6
+#define THAW_OTHERS		7
+
+typedef struct _GrabInfoRec {
+    TimeStamp grabTime;
+    Bool fromPassiveGrab;       /* true if from passive grab */
+    Bool implicitGrab;          /* implicit from ButtonPress */
+    GrabPtr unused;             /* Kept for ABI stability, remove soon */
+    GrabPtr grab;
+    CARD8 activatingKey;
+    void (*ActivateGrab) (DeviceIntPtr /*device */ ,
+                          GrabPtr /*grab */ ,
+                          TimeStamp /*time */ ,
+                          Bool /*autoGrab */ );
+    void (*DeactivateGrab) (DeviceIntPtr /*device */ );
+    struct {
+        Bool frozen;
+        int state;
+        GrabPtr other;          /* if other grab has this frozen */
+        InternalEvent *event;   /* saved to be replayed */
+    } sync;
+} GrabInfoRec, *GrabInfoPtr;
+
+typedef struct _SpriteInfoRec {
+    /* sprite must always point to a valid sprite. For devices sharing the
+     * sprite, let sprite point to a paired spriteOwner's sprite. */
+    SpritePtr sprite;           /* sprite information */
+    Bool spriteOwner;           /* True if device owns the sprite */
+    DeviceIntPtr paired;        /* The paired device. Keyboard if
+                                   spriteOwner is TRUE, otherwise the
+                                   pointer that owns the sprite. */
+
+    /* keep states for animated cursor */
+    struct {
+        CursorPtr pCursor;
+        ScreenPtr pScreen;
+        int elt;
+    } anim;
+} SpriteInfoRec, *SpriteInfoPtr;
+
+/* device types */
+#define MASTER_POINTER          1
+#define MASTER_KEYBOARD         2
+#define SLAVE                   3
+/* special types for GetMaster */
+#define MASTER_ATTACHED         4       /* Master for this device */
+#define KEYBOARD_OR_FLOAT       5       /* Keyboard master for this device or this device if floating */
+#define POINTER_OR_FLOAT        6       /* Pointer master for this device or this device if floating */
+
+typedef struct _DeviceIntRec {
+    DeviceRec public;
+    DeviceIntPtr next;
+    Bool startup;               /* true if needs to be turned on at
+                                   server initialization time */
+    DeviceProc deviceProc;      /* proc(DevicePtr, DEVICE_xx). It is
+                                   used to initialize, turn on, or
+                                   turn off the device */
+    Bool inited;                /* TRUE if INIT returns Success */
+    Bool enabled;               /* TRUE if ON returns Success */
+    Bool coreEvents;            /* TRUE if device also sends core */
+    GrabInfoRec deviceGrab;     /* grab on the device */
+    int type;                   /* MASTER_POINTER, MASTER_KEYBOARD, SLAVE */
+    Atom xinput_type;
+    char *name;
+    int id;
+    KeyClassPtr key;
+    ValuatorClassPtr valuator;
+    TouchClassPtr touch;
+    GestureClassPtr gesture;
+    ButtonClassPtr button;
+    FocusClassPtr focus;
+    ProximityClassPtr proximity;
+    KbdFeedbackPtr kbdfeed;
+    PtrFeedbackPtr ptrfeed;
+    IntegerFeedbackPtr intfeed;
+    StringFeedbackPtr stringfeed;
+    BellFeedbackPtr bell;
+    LedFeedbackPtr leds;
+    struct _XkbInterest *xkb_interest;
+    char *config_info;          /* used by the hotplug layer */
+    ClassesPtr unused_classes;  /* for master devices */
+    int saved_master_id;        /* for slaves while grabbed */
+    PrivateRec *devPrivates;
+    DeviceUnwrapProc unwrapProc;
+    SpriteInfoPtr spriteInfo;
+    DeviceIntPtr master;        /* master device */
+    DeviceIntPtr lastSlave;     /* last slave device used */
+
+    /* last valuator values recorded, not posted to client;
+     * for slave devices, valuators is in device coordinates, mapped to the
+     * desktop
+     * for master devices, valuators is in desktop coordinates.
+     * see dix/getevents.c
+     * remainder supports acceleration
+     */
+    struct {
+        double valuators[MAX_VALUATORS];
+        int numValuators;
+        DeviceIntPtr slave;
+        int slave_type;
+        ValuatorMask *scroll;
+        int num_touches;        /* size of the touches array */
+        DDXTouchPointInfoPtr touches;
+    } last;
+
+    /* Input device property handling. */
+    struct {
+        XIPropertyPtr properties;
+        XIPropertyHandlerPtr handlers;  /* NULL-terminated */
+    } properties;
+
+    /* coordinate transformation matrix for relative movement. Matrix with
+     * the translation component dropped */
+    struct pixman_f_transform relative_transform;
+    /* scale matrix for absolute devices, this is the combined matrix of
+       [1/scale] . [transform] . [scale]. See DeviceSetTransform */
+    struct pixman_f_transform scale_and_transform;
+
+    /* XTest related master device id */
+    int xtest_master_id;
+
+    struct _SyncCounter *idle_counter;
+} DeviceIntRec;
+
+typedef struct {
+    int numDevices;             /* total number of devices */
+    DeviceIntPtr devices;       /* all devices turned on */
+    DeviceIntPtr off_devices;   /* all devices turned off */
+    DeviceIntPtr keyboard;      /* the main one for the server */
+    DeviceIntPtr pointer;
+    DeviceIntPtr all_devices;
+    DeviceIntPtr all_master_devices;
+} InputInfo;
+
+extern _X_EXPORT InputInfo inputInfo;
+
+/* for keeping the events for devices grabbed synchronously */
+typedef struct _QdEvent *QdEventPtr;
+typedef struct _QdEvent {
+    struct xorg_list next;
+    DeviceIntPtr device;
+    ScreenPtr pScreen;          /* what screen the pointer was on */
+    unsigned long months;       /* milliseconds is in the event */
+    InternalEvent *event;
+} QdEventRec;
+
+/**
+ * syncEvents is the global structure for queued events.
+ *
+ * Devices can be frozen through GrabModeSync pointer grabs. If this is the
+ * case, events from these devices are added to "pending" instead of being
+ * processed normally. When the device is unfrozen, events in "pending" are
+ * replayed and processed as if they would come from the device directly.
+ */
+typedef struct _EventSyncInfo {
+    struct xorg_list pending;
+
+    /** The device to replay events for. Only set in AllowEvents(), in which
+     * case it is set to the device specified in the request. */
+    DeviceIntPtr replayDev;     /* kludgy rock to put flag for */
+
+    /**
+     * The window the events are supposed to be replayed on.
+     * This window may be set to the grab's window (but only when
+     * Replay{Pointer|Keyboard} is given in the XAllowEvents()
+     * request. */
+    WindowPtr replayWin;        /*   ComputeFreezes            */
+    /**
+     * Flag to indicate whether we're in the process of
+     * replaying events. Only set in ComputeFreezes(). */
+    Bool playingEvents;
+    TimeStamp time;
+} EventSyncInfoRec, *EventSyncInfoPtr;
+
+extern EventSyncInfoRec syncEvents;
+
+/**
+ * Given a sprite, returns the window at the bottom of the trace (i.e. the
+ * furthest window from the root).
+ */
+static inline WindowPtr
+DeepestSpriteWin(SpritePtr sprite)
+{
+    assert(sprite->spriteTraceGood > 0);
+    return sprite->spriteTrace[sprite->spriteTraceGood - 1];
+}
+
+struct _XI2Mask {
+    unsigned char **masks;      /* event mask in masks[deviceid][event type byte] */
+    size_t nmasks;              /* number of masks */
+    size_t mask_size;           /* size of each mask in bytes */
+};
+
+#endif                          /* INPUTSTRUCT_H */
Index: xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new/include
===================================================================
--- xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new/include	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new/include	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new/include
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new
===================================================================
--- xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch/xorg-server-21.1.7-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch
===================================================================
--- xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-mouse-kbd-layout-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-nouveau-segfault-patch/create.patch.sh
===================================================================
--- xserver/xorg-server/create-21.1.7-nouveau-segfault-patch/create.patch.sh	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-nouveau-segfault-patch/create.patch.sh	(revision 5)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=21.1.7
+
+tar --files-from=file.list -xJvf ../xorg-server-$VERSION.tar.xz
+mv xorg-server-$VERSION xorg-server-$VERSION-orig
+
+cp -rf ./xorg-server-$VERSION-new ./xorg-server-$VERSION
+
+diff --unified -Nr  xorg-server-$VERSION-orig  xorg-server-$VERSION > xorg-server-$VERSION-nouveau-segfault.patch
+
+mv xorg-server-$VERSION-nouveau-segfault.patch ../patches
+
+rm -rf ./xorg-server-$VERSION
+rm -rf ./xorg-server-$VERSION-orig

Property changes on: xserver/xorg-server/create-21.1.7-nouveau-segfault-patch/create.patch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: xserver/xorg-server/create-21.1.7-nouveau-segfault-patch/file.list
===================================================================
--- xserver/xorg-server/create-21.1.7-nouveau-segfault-patch/file.list	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-nouveau-segfault-patch/file.list	(revision 5)
@@ -0,0 +1 @@
+xorg-server-21.1.7/render/mipict.c
Index: xserver/xorg-server/create-21.1.7-nouveau-segfault-patch/xorg-server-21.1.7-new/render/mipict.c
===================================================================
--- xserver/xorg-server/create-21.1.7-nouveau-segfault-patch/xorg-server-21.1.7-new/render/mipict.c	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-nouveau-segfault-patch/xorg-server-21.1.7-new/render/mipict.c	(revision 5)
@@ -0,0 +1,590 @@
+/*
+ *
+ * Copyright © 1999 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission.  Keith Packard makes no
+ * representations about the suitability of this software for any purpose.  It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "scrnintstr.h"
+#include "gcstruct.h"
+#include "pixmapstr.h"
+#include "windowstr.h"
+#include "mi.h"
+#include "picturestr.h"
+#include "mipict.h"
+
+int
+miCreatePicture(PicturePtr pPicture)
+{
+    return Success;
+}
+
+void
+miDestroyPicture(PicturePtr pPicture)
+{
+    if (pPicture->freeCompClip)
+        RegionDestroy(pPicture->pCompositeClip);
+}
+
+static void
+miDestroyPictureClip(PicturePtr pPicture)
+{
+    if (pPicture->clientClip)
+        RegionDestroy(pPicture->clientClip);
+    pPicture->clientClip = NULL;
+}
+
+static int
+miChangePictureClip(PicturePtr pPicture, int type, void *value, int n)
+{
+    ScreenPtr pScreen = pPicture->pDrawable->pScreen;
+    PictureScreenPtr ps = GetPictureScreen(pScreen);
+    RegionPtr clientClip;
+
+    switch (type) {
+    case CT_PIXMAP:
+        /* convert the pixmap to a region */
+        clientClip = BitmapToRegion(pScreen, (PixmapPtr) value);
+        if (!clientClip)
+            return BadAlloc;
+        (*pScreen->DestroyPixmap) ((PixmapPtr) value);
+        break;
+    case CT_REGION:
+        clientClip = value;
+        break;
+    case CT_NONE:
+        clientClip = 0;
+        break;
+    default:
+        clientClip = RegionFromRects(n, (xRectangle *) value, type);
+        if (!clientClip)
+            return BadAlloc;
+        free(value);
+        break;
+    }
+    (*ps->DestroyPictureClip) (pPicture);
+    pPicture->clientClip = clientClip;
+    pPicture->stateChanges |= CPClipMask;
+    return Success;
+}
+
+static void
+miChangePicture(PicturePtr pPicture, Mask mask)
+{
+    return;
+}
+
+static void
+miValidatePicture(PicturePtr pPicture, Mask mask)
+{
+    DrawablePtr pDrawable = pPicture->pDrawable;
+
+    if ((mask & (CPClipXOrigin | CPClipYOrigin | CPClipMask | CPSubwindowMode))
+        || (pDrawable->serialNumber !=
+            (pPicture->serialNumber & DRAWABLE_SERIAL_BITS))) {
+        if (pDrawable->type == DRAWABLE_WINDOW) {
+            WindowPtr pWin = (WindowPtr) pDrawable;
+            RegionPtr pregWin;
+            Bool freeTmpClip, freeCompClip;
+
+            if (pPicture->subWindowMode == IncludeInferiors) {
+                pregWin = NotClippedByChildren(pWin);
+                freeTmpClip = TRUE;
+            }
+            else {
+                pregWin = &pWin->clipList;
+                freeTmpClip = FALSE;
+            }
+            freeCompClip = pPicture->freeCompClip;
+
+            /*
+             * if there is no client clip, we can get by with just keeping the
+             * pointer we got, and remembering whether or not should destroy
+             * (or maybe re-use) it later.  this way, we avoid unnecessary
+             * copying of regions.  (this wins especially if many clients clip
+             * by children and have no client clip.)
+             */
+            if (!pPicture->clientClip) {
+                if (freeCompClip)
+                    RegionDestroy(pPicture->pCompositeClip);
+                pPicture->pCompositeClip = pregWin;
+                pPicture->freeCompClip = freeTmpClip;
+            }
+            else {
+                /*
+                 * we need one 'real' region to put into the composite clip. if
+                 * pregWin the current composite clip are real, we can get rid of
+                 * one. if pregWin is real and the current composite clip isn't,
+                 * use pregWin for the composite clip. if the current composite
+                 * clip is real and pregWin isn't, use the current composite
+                 * clip. if neither is real, create a new region.
+                 */
+
+                RegionTranslate(pPicture->clientClip,
+                                pDrawable->x + pPicture->clipOrigin.x,
+                                pDrawable->y + pPicture->clipOrigin.y);
+
+                if (freeCompClip) {
+                    RegionIntersect(pPicture->pCompositeClip,
+                                    pregWin, pPicture->clientClip);
+                    if (freeTmpClip)
+                        RegionDestroy(pregWin);
+                }
+                else if (freeTmpClip) {
+                    RegionIntersect(pregWin, pregWin, pPicture->clientClip);
+                    pPicture->pCompositeClip = pregWin;
+                }
+                else {
+                    pPicture->pCompositeClip = RegionCreate(NullBox, 0);
+                    RegionIntersect(pPicture->pCompositeClip,
+                                    pregWin, pPicture->clientClip);
+                }
+                pPicture->freeCompClip = TRUE;
+                RegionTranslate(pPicture->clientClip,
+                                -(pDrawable->x + pPicture->clipOrigin.x),
+                                -(pDrawable->y + pPicture->clipOrigin.y));
+            }
+        }                       /* end of composite clip for a window */
+        else {
+            BoxRec pixbounds;
+
+            /* XXX should we translate by drawable.x/y here ? */
+            /* If you want pixmaps in offscreen memory, yes */
+            pixbounds.x1 = pDrawable->x;
+            pixbounds.y1 = pDrawable->y;
+            pixbounds.x2 = pDrawable->x + pDrawable->width;
+            pixbounds.y2 = pDrawable->y + pDrawable->height;
+
+            if (pPicture->freeCompClip) {
+                RegionReset(pPicture->pCompositeClip, &pixbounds);
+            }
+            else {
+                pPicture->freeCompClip = TRUE;
+                pPicture->pCompositeClip = RegionCreate(&pixbounds, 1);
+            }
+
+            if (pPicture->clientClip) {
+                if (pDrawable->x || pDrawable->y) {
+                    RegionTranslate(pPicture->clientClip,
+                                    pDrawable->x + pPicture->clipOrigin.x,
+                                    pDrawable->y + pPicture->clipOrigin.y);
+                    RegionIntersect(pPicture->pCompositeClip,
+                                    pPicture->pCompositeClip,
+                                    pPicture->clientClip);
+                    RegionTranslate(pPicture->clientClip,
+                                    -(pDrawable->x + pPicture->clipOrigin.x),
+                                    -(pDrawable->y + pPicture->clipOrigin.y));
+                }
+                else {
+                    RegionTranslate(pPicture->pCompositeClip,
+                                    -pPicture->clipOrigin.x,
+                                    -pPicture->clipOrigin.y);
+                    RegionIntersect(pPicture->pCompositeClip,
+                                    pPicture->pCompositeClip,
+                                    pPicture->clientClip);
+                    RegionTranslate(pPicture->pCompositeClip,
+                                    pPicture->clipOrigin.x,
+                                    pPicture->clipOrigin.y);
+                }
+            }
+        }                       /* end of composite clip for pixmap */
+    }
+}
+
+static int
+miChangePictureTransform(PicturePtr pPicture, PictTransform * transform)
+{
+    return Success;
+}
+
+static int
+miChangePictureFilter(PicturePtr pPicture,
+                      int filter, xFixed * params, int nparams)
+{
+    return Success;
+}
+
+#define BOUND(v)	(INT16) ((v) < MINSHORT ? MINSHORT : (v) > MAXSHORT ? MAXSHORT : (v))
+
+static inline pixman_bool_t
+miClipPictureReg(pixman_region16_t * pRegion,
+                 pixman_region16_t * pClip, int dx, int dy)
+{
+    if (pixman_region_n_rects(pRegion) == 1 &&
+        pixman_region_n_rects(pClip) == 1) {
+        pixman_box16_t *pRbox = pixman_region_rectangles(pRegion, NULL);
+        pixman_box16_t *pCbox = pixman_region_rectangles(pClip, NULL);
+        int v;
+
+        if (pRbox->x1 < (v = pCbox->x1 + dx))
+            pRbox->x1 = BOUND(v);
+        if (pRbox->x2 > (v = pCbox->x2 + dx))
+            pRbox->x2 = BOUND(v);
+        if (pRbox->y1 < (v = pCbox->y1 + dy))
+            pRbox->y1 = BOUND(v);
+        if (pRbox->y2 > (v = pCbox->y2 + dy))
+            pRbox->y2 = BOUND(v);
+        if (pRbox->x1 >= pRbox->x2 || pRbox->y1 >= pRbox->y2) {
+            pixman_region_init(pRegion);
+        }
+    }
+    else if (!pixman_region_not_empty(pClip))
+        return FALSE;
+    else {
+        if (dx || dy)
+            pixman_region_translate(pRegion, -dx, -dy);
+        if (!pixman_region_intersect(pRegion, pRegion, pClip))
+            return FALSE;
+        if (dx || dy)
+            pixman_region_translate(pRegion, dx, dy);
+    }
+    return pixman_region_not_empty(pRegion);
+}
+
+static inline Bool
+miClipPictureSrc(RegionPtr pRegion, PicturePtr pPicture, int dx, int dy)
+{
+    if (pPicture->clientClip) {
+        Bool result;
+
+        pixman_region_translate(pPicture->clientClip,
+                                pPicture->clipOrigin.x + dx,
+                                pPicture->clipOrigin.y + dy);
+
+        result = RegionIntersect(pRegion, pRegion, pPicture->clientClip);
+
+        pixman_region_translate(pPicture->clientClip,
+                                -(pPicture->clipOrigin.x + dx),
+                                -(pPicture->clipOrigin.y + dy));
+
+        if (!result)
+            return FALSE;
+    }
+    return TRUE;
+}
+
+static void
+SourceValidateOnePicture(PicturePtr pPicture)
+{
+    DrawablePtr pDrawable = pPicture->pDrawable;
+    ScreenPtr pScreen;
+
+    if (!pDrawable)
+        return;
+
+    pScreen = pDrawable->pScreen;
+
+    pScreen->SourceValidate(pDrawable, 0, 0, pDrawable->width,
+                            pDrawable->height, pPicture->subWindowMode);
+}
+
+void
+miCompositeSourceValidate(PicturePtr pPicture)
+{
+    SourceValidateOnePicture(pPicture);
+    if (pPicture->alphaMap)
+        SourceValidateOnePicture(pPicture->alphaMap);
+}
+
+/*
+ * returns FALSE if the final region is empty.  Indistinguishable from
+ * an allocation failure, but rendering ignores those anyways.
+ */
+
+Bool
+miComputeCompositeRegion(RegionPtr pRegion,
+                         PicturePtr pSrc,
+                         PicturePtr pMask,
+                         PicturePtr pDst,
+                         INT16 xSrc,
+                         INT16 ySrc,
+                         INT16 xMask,
+                         INT16 yMask,
+                         INT16 xDst, INT16 yDst, CARD16 width, CARD16 height)
+{
+
+    int v;
+
+    pRegion->extents.x1 = xDst;
+    v = xDst + width;
+    pRegion->extents.x2 = BOUND(v);
+    pRegion->extents.y1 = yDst;
+    v = yDst + height;
+    pRegion->extents.y2 = BOUND(v);
+    pRegion->data = 0;
+    /* Check for empty operation */
+    if (pRegion->extents.x1 >= pRegion->extents.x2 ||
+        pRegion->extents.y1 >= pRegion->extents.y2) {
+        pixman_region_init(pRegion);
+        return FALSE;
+    }
+    /* clip against dst */
+    if (!miClipPictureReg(pRegion, pDst->pCompositeClip, 0, 0)) {
+        pixman_region_fini(pRegion);
+        return FALSE;
+    }
+    if (pDst->alphaMap) {
+        if (!miClipPictureReg(pRegion, pDst->alphaMap->pCompositeClip,
+                              -pDst->alphaOrigin.x, -pDst->alphaOrigin.y)) {
+            pixman_region_fini(pRegion);
+            return FALSE;
+        }
+    }
+    /* clip against src */
+    if (!miClipPictureSrc(pRegion, pSrc, xDst - xSrc, yDst - ySrc)) {
+        pixman_region_fini(pRegion);
+        return FALSE;
+    }
+    if (pSrc->alphaMap) {
+        if (!miClipPictureSrc(pRegion, pSrc->alphaMap,
+                              xDst - (xSrc - pSrc->alphaOrigin.x),
+                              yDst - (ySrc - pSrc->alphaOrigin.y))) {
+            pixman_region_fini(pRegion);
+            return FALSE;
+        }
+    }
+    /* clip against mask */
+    if (pMask) {
+        if (!miClipPictureSrc(pRegion, pMask, xDst - xMask, yDst - yMask)) {
+            pixman_region_fini(pRegion);
+            return FALSE;
+        }
+        if (pMask->alphaMap) {
+            if (!miClipPictureSrc(pRegion, pMask->alphaMap,
+                                  xDst - (xMask - pMask->alphaOrigin.x),
+                                  yDst - (yMask - pMask->alphaOrigin.y))) {
+                pixman_region_fini(pRegion);
+                return FALSE;
+            }
+        }
+    }
+
+    miCompositeSourceValidate(pSrc);
+    if (pMask)
+        miCompositeSourceValidate(pMask);
+
+    return TRUE;
+}
+
+void
+miRenderColorToPixel(PictFormatPtr format, xRenderColor * color, CARD32 *pixel)
+{
+    CARD32 r, g, b, a;
+    miIndexedPtr pIndexed;
+
+    if(! format)
+        *pixel = (color->alpha >> 8 << 24) | (color->red >> 8 << 16) | (color->green & 0xff00) | (color->blue >> 8);
+    else
+    switch (format->type) {
+    case PictTypeDirect:
+        r = color->red >> (16 - Ones(format->direct.redMask));
+        g = color->green >> (16 - Ones(format->direct.greenMask));
+        b = color->blue >> (16 - Ones(format->direct.blueMask));
+        a = color->alpha >> (16 - Ones(format->direct.alphaMask));
+        r = r << format->direct.red;
+        g = g << format->direct.green;
+        b = b << format->direct.blue;
+        a = a << format->direct.alpha;
+        *pixel = r | g | b | a;
+        break;
+    case PictTypeIndexed:
+        pIndexed = (miIndexedPtr) (format->index.devPrivate);
+        if (pIndexed->color) {
+            r = color->red >> 11;
+            g = color->green >> 11;
+            b = color->blue >> 11;
+            *pixel = miIndexToEnt15(pIndexed, (r << 10) | (g << 5) | b);
+        }
+        else {
+            r = color->red >> 8;
+            g = color->green >> 8;
+            b = color->blue >> 8;
+            *pixel = miIndexToEntY24(pIndexed, (r << 16) | (g << 8) | b);
+        }
+        break;
+    }
+}
+
+static CARD16
+miFillColor(CARD32 pixel, int bits)
+{
+    while (bits < 16) {
+        pixel |= pixel << bits;
+        bits <<= 1;
+    }
+    return (CARD16) pixel;
+}
+
+Bool
+miIsSolidAlpha(PicturePtr pSrc)
+{
+    ScreenPtr pScreen;
+    char line[1];
+
+    if (!pSrc->pDrawable)
+        return FALSE;
+
+    pScreen = pSrc->pDrawable->pScreen;
+
+    /* Alpha-only */
+    if (PICT_FORMAT_TYPE(pSrc->format) != PICT_TYPE_A)
+        return FALSE;
+    /* repeat */
+    if (!pSrc->repeat)
+        return FALSE;
+    /* 1x1 */
+    if (pSrc->pDrawable->width != 1 || pSrc->pDrawable->height != 1)
+        return FALSE;
+    line[0] = 1;
+    (*pScreen->GetImage) (pSrc->pDrawable, 0, 0, 1, 1, ZPixmap, ~0L, line);
+    switch (pSrc->pDrawable->bitsPerPixel) {
+    case 1:
+        return (CARD8) line[0] == 1 || (CARD8) line[0] == 0x80;
+    case 4:
+        return (CARD8) line[0] == 0xf || (CARD8) line[0] == 0xf0;
+    case 8:
+        return (CARD8) line[0] == 0xff;
+    default:
+        return FALSE;
+    }
+}
+
+void
+miRenderPixelToColor(PictFormatPtr format, CARD32 pixel, xRenderColor * color)
+{
+    CARD32 r, g, b, a;
+    miIndexedPtr pIndexed;
+
+    switch (format->type) {
+    case PictTypeDirect:
+        r = (pixel >> format->direct.red) & format->direct.redMask;
+        g = (pixel >> format->direct.green) & format->direct.greenMask;
+        b = (pixel >> format->direct.blue) & format->direct.blueMask;
+        a = (pixel >> format->direct.alpha) & format->direct.alphaMask;
+        color->red = miFillColor(r, Ones(format->direct.redMask));
+        color->green = miFillColor(g, Ones(format->direct.greenMask));
+        color->blue = miFillColor(b, Ones(format->direct.blueMask));
+        color->alpha = miFillColor(a, Ones(format->direct.alphaMask));
+        break;
+    case PictTypeIndexed:
+        pIndexed = (miIndexedPtr) (format->index.devPrivate);
+        pixel = pIndexed->rgba[pixel & (MI_MAX_INDEXED - 1)];
+        r = (pixel >> 16) & 0xff;
+        g = (pixel >> 8) & 0xff;
+        b = (pixel) & 0xff;
+        color->red = miFillColor(r, 8);
+        color->green = miFillColor(g, 8);
+        color->blue = miFillColor(b, 8);
+        color->alpha = 0xffff;
+        break;
+    }
+}
+
+static void
+miTriStrip(CARD8 op,
+           PicturePtr pSrc,
+           PicturePtr pDst,
+           PictFormatPtr maskFormat,
+           INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points)
+{
+    xTriangle *tris, *tri;
+    int ntri;
+
+    ntri = npoints - 2;
+    tris = xallocarray(ntri, sizeof(xTriangle));
+    if (!tris)
+        return;
+
+    for (tri = tris; npoints >= 3; npoints--, points++, tri++) {
+        tri->p1 = points[0];
+        tri->p2 = points[1];
+        tri->p3 = points[2];
+    }
+    CompositeTriangles(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
+    free(tris);
+}
+
+static void
+miTriFan(CARD8 op,
+         PicturePtr pSrc,
+         PicturePtr pDst,
+         PictFormatPtr maskFormat,
+         INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points)
+{
+    xTriangle *tris, *tri;
+    xPointFixed *first;
+    int ntri;
+
+    ntri = npoints - 2;
+    tris = xallocarray(ntri, sizeof(xTriangle));
+    if (!tris)
+        return;
+
+    first = points++;
+    for (tri = tris; npoints >= 3; npoints--, points++, tri++) {
+        tri->p1 = *first;
+        tri->p2 = points[0];
+        tri->p3 = points[1];
+    }
+    CompositeTriangles(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
+    free(tris);
+}
+
+Bool
+miPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
+{
+    PictureScreenPtr ps;
+
+    if (!PictureInit(pScreen, formats, nformats))
+        return FALSE;
+    ps = GetPictureScreen(pScreen);
+    ps->CreatePicture = miCreatePicture;
+    ps->DestroyPicture = miDestroyPicture;
+    ps->ChangePictureClip = miChangePictureClip;
+    ps->DestroyPictureClip = miDestroyPictureClip;
+    ps->ChangePicture = miChangePicture;
+    ps->ValidatePicture = miValidatePicture;
+    ps->InitIndexed = miInitIndexed;
+    ps->CloseIndexed = miCloseIndexed;
+    ps->UpdateIndexed = miUpdateIndexed;
+    ps->ChangePictureTransform = miChangePictureTransform;
+    ps->ChangePictureFilter = miChangePictureFilter;
+    ps->RealizeGlyph = miRealizeGlyph;
+    ps->UnrealizeGlyph = miUnrealizeGlyph;
+
+    /* MI rendering routines */
+    ps->Composite = 0;          /* requires DDX support */
+    ps->Glyphs = miGlyphs;
+    ps->CompositeRects = miCompositeRects;
+    ps->Trapezoids = 0;
+    ps->Triangles = 0;
+
+    ps->RasterizeTrapezoid = 0; /* requires DDX support */
+    ps->AddTraps = 0;           /* requires DDX support */
+    ps->AddTriangles = 0;       /* requires DDX support */
+
+    ps->TriStrip = miTriStrip;  /* converts call to CompositeTriangles */
+    ps->TriFan = miTriFan;
+
+    return TRUE;
+}
Index: xserver/xorg-server/create-21.1.7-nouveau-segfault-patch/xorg-server-21.1.7-new/render
===================================================================
--- xserver/xorg-server/create-21.1.7-nouveau-segfault-patch/xorg-server-21.1.7-new/render	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-nouveau-segfault-patch/xorg-server-21.1.7-new/render	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-nouveau-segfault-patch/xorg-server-21.1.7-new/render
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-nouveau-segfault-patch/xorg-server-21.1.7-new
===================================================================
--- xserver/xorg-server/create-21.1.7-nouveau-segfault-patch/xorg-server-21.1.7-new	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-nouveau-segfault-patch/xorg-server-21.1.7-new	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-nouveau-segfault-patch/xorg-server-21.1.7-new
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/create-21.1.7-nouveau-segfault-patch
===================================================================
--- xserver/xorg-server/create-21.1.7-nouveau-segfault-patch	(nonexistent)
+++ xserver/xorg-server/create-21.1.7-nouveau-segfault-patch	(revision 5)

Property changes on: xserver/xorg-server/create-21.1.7-nouveau-segfault-patch
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server/patches/README
===================================================================
--- xserver/xorg-server/patches/README	(nonexistent)
+++ xserver/xorg-server/patches/README	(revision 5)
@@ -0,0 +1,22 @@
+
+/* begin *
+
+   xorg-server-21.1.7-black.patch                       - Start X with black screen
+   xorg-server-21.1.7-dont-check-SeatId.patch           - xephyr: Don't check for SeatId anymore
+   xorg-server-21.1.7-mouse-kbd-layout.patch            - Combo mouse keyboard layout patch
+   xorg-server-21.1.7-modesetting-on-GeForce.patch      - xfree86: use modesetting driver by default on GeForce 8 and newer
+   xorg-server-21.1.7-intel-ddx-only-on-pre-gen4.patch  - Use intel ddx only on pre-gen4 hw, newer ones will fall back to modesetting
+   xorg-server-21.1.7-nouveau-segfault.patch            - Fix segfault
+
+
+   Applying Order:
+   --------------
+
+   xorg-server-21.1.7-black.patch
+   xorg-server-21.1.7-dont-check-SeatId.patch
+   xorg-server-21.1.7-mouse-kbd-layout.patch
+   xorg-server-21.1.7-modesetting-on-GeForce.patch
+   xorg-server-21.1.7-intel-ddx-only-on-pre-gen4.patch
+   xorg-server-21.1.7-nouveau-segfault.patch
+
+ * end */
Index: xserver/xorg-server/patches
===================================================================
--- xserver/xorg-server/patches	(nonexistent)
+++ xserver/xorg-server/patches	(revision 5)

Property changes on: xserver/xorg-server/patches
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xorg-server
===================================================================
--- xserver/xorg-server	(nonexistent)
+++ xserver/xorg-server	(revision 5)

Property changes on: xserver/xorg-server
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver/xwayland/Makefile
===================================================================
--- xserver/xwayland/Makefile	(nonexistent)
+++ xserver/xwayland/Makefile	(revision 5)
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/X.org/xserver/xwayland
+
+versions    = 22.1.8
+pkgname     = xwayland
+suffix      = tar.xz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) - & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)
Index: xserver/xwayland
===================================================================
--- xserver/xwayland	(nonexistent)
+++ xserver/xwayland	(revision 5)

Property changes on: xserver/xwayland
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: xserver
===================================================================
--- xserver	(nonexistent)
+++ xserver	(revision 5)

Property changes on: xserver
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: .
===================================================================
--- .	(nonexistent)
+++ .	(revision 5)

Property changes on: .
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~